Dear experts,
I want to perform tractometry with pyAFQ using whole-brain tractography results obtained using MRtrix. Our dMRI images were preprocessed with FSL TOPUP and EDDY. I fitted the CSD model to the preprocessed dMRI data and generated whole-brain streamlines using MRtrix3.
I read the pyAFQ GitHub and wrote API commands. They worked without error, but I’m not confident with them because I’m not familiar with Python.
Here, I would like to ask three questions.
- Are the following commands sufficient to achieve my goal (= segmenting bundles, calculating tract profiles)? Could you check if anything is missing? If you tell me any other points for improvement, it’s also welcome.
- The
sub-N0001_dir-AP_coordsys_RASMM_trkmethod-probCSD_recogmented-AFQ_desc_profiles_dwi.csv
was obtained as a result ofexport_all()
. This file contains thedti_fa
anddti_md
for each node. Whether these values calculated based on the DTI model or the CSD model? I’m using the .tck file of the reconstructed tractographies using dMRI image fitted on the CSD model. - Is it possible to calculate AD and RD as tract profiles? Is this possible by adding any optional command?
Command used :
The commands I used are below. To make it easy for pyAFQ to recognize, the file names have been simplified. The mask image was generated from an eddy-corrected b0 image using fslroi
.
import os
import os.path as op
from AFQ.api.participant import ParticipantAFQ
from AFQ.definitions.image import ImageFile
bids_path = op.join('/media/brain', 'my_disk', 'my_project')
dwi_path = op.join(bids_path, 'derivatives', 'my_preproc_pipeline', 'sub-N0001', 'dwi', 'sub-N0001_dir-AP_dwi.nii.gz')
bval_path = op.join(bids_path, 'derivatives', 'my_preproc_pipeline', 'sub-N0001', 'dwi', 'sub-N0001_dir-AP_dwi.bval')
bvec_path = op.join(bids_path, 'derivatives', 'my_preproc_pipeline', 'sub-N0001', 'dwi', 'sub-N0001_dir-AP_dwi.bvec')
mask_path = op.join(bids_path, 'derivatives', 'my_preproc_pipeline', 'sub-N0001', 'dwi', 'sub-N0001_mask.nii.gz')
tck_path = op.join(bids_path, 'derivatives', 'my_tractography', 'sub-N0001', 'dwi', 'sub-N0001_CSD_Prob_ACT_5000000_tractography.tck')
out_dir = op.join(bids_path, 'derivatives', 'afq', 'sub-N0001')
brain_mask_definition = ImageFile(
path = mask_path,
suffix = "mask",
filters = {"scope":"my_preproc_pipeline"})
myafq = ParticipantAFQ(
dwi_path, bval_path, bvec_path, out_dir,
import_tract = tck_path,
brain_mask_definition = brain_mask_definition,
mapping_definition = None)
myafq.export_all()
Best,
Printemps