Print

Print


Hi
This all looks sensible and thus it’s hard to know what went wrong without looking more closely at the output. Have you loaded all seed/target masks as well as fdt_paths onto fslview to check that everything is in the same space and that your streamlines indeed go through your target masks?

Cheers
Saad

On 23 May 2018, at 02:56, neuroimage analyst <[log in to unmask]> wrote:

Hi

We are interested in generating connectivity between the thalamus and the rest of cortical hemisphere in each brain. In order to do so, I performed the following steps:

a) Extract thalamus 

mri_extract_label $SUBJECTS_DIR/T1/T1_subject_ID_Baseline/mri/aseg.mgz 10 $SUBJECTS_DIR/subject_ID /labels/lh_thalamus.nii.gz

b) Extract the left hemispheric labels

mri_label2vol --label $label --temp $SUBJECTS_DIR/T1/T1_subject_ID_Baseline/anat/fs.nii.gz --o $vol --identity --fillthresh 0.5 > /dev/null

echo $vol >> target.txt

where fs.nii.gz is the freesurfer space T1 generated as:

mri_convert $SUBJECTS_DIR/subject_ID/mri/orig.mgz anat/fs.nii.gz

c) Create waypoints.txt

mri_binarize --i $SUBJECTS_DIR/subject_ID/mri/aparc+aseg.mgz --match 2 --o anat/wm_lh.nii.gz
mri_binarize --i $SUBJECTS_DIR/subject_ID/mri/aparc+aseg.mgz --match 41 --o anat/wm_rh.nii.gz

This is the content of waypoints.txt
anat/wm_lh.nii.gz
anat/wm_rh.nii.gz

d) Create transformation matrix from FreeSurfer space to DWI space

fs2str=subject_ID.bedpostX/xfms/fs2str.mat
str2fs=subject_ID.bedpostX/xfms/str2fs.mat
fa2fs=subject_ID.bedpostX/xfms/fa2fs.mat
fs2fa=subject_ID.bedpostX/xfms/fs2fa.mat
fa2str=subject_ID.bedpostX/xfms/fa2str.mat
str2fa=subject_ID.bedpostX/xfms/str2fa.mat
# Register FreeSurfer Space T1 to acquired T1
tkregister2 --mov $SUBJECTS_DIR/T1/T1_subject_ID_Baseline/anat/fs.gz --targ $SUBJECTS_DIR/T1/T1_subject_ID_Baseline/anat/str.gz --regheader --reg /tmp/junk --fslregout $SUBJECTS_DIR/$fs2str --noedit

# Invert 
convert_xfm -omat $SUBJECTS_DIR/$str2fs -inverse $SUBJECTS_DIR/$fs2str
# Transform FA to structural
flirt -in $SUBJECTS_DIR/subject_ID/dtifit_FA.gz -ref $SUBJECTS_DIR/T1/T1_subject_ID_Baseline/anat/str.gz -omat $SUBJECTS_DIR/$fa2str -dof 6
# Invert
convert_xfm -omat $SUBJECTS_DIR/$str2fa -inverse $SUBJECTS_DIR/$fa2str

# Concatenate and Inverse
convert_xfm -omat $SUBJECTS_DIR/$fa2fs -concat $SUBJECTS_DIR/$str2fs $SUBJECTS_DIR/$fa2str

convert_xfm -omat $SUBJECTS_DIR/$fs2fa -inverse $SUBJECTS_DIR/$fa2fs

e) Perform tracking

probtrackx2 -x $SUBJECTS_DIR/subject_id/labels/lh_thalamus.nii.gz -s $SUBJECTS_DIR/ subject_id.bedpostX/merged -m $SUBJECTS_DIR/ subject_id.bedpostX/nodif_brain_mask -l --usef --s2tastext --os2t --onewaycondition -c 0.2 -S 2000 --steplength=0.5 -P 5000 --fibthresh=0.01 --distthresh=0.0 --sampvox=0.0 --xfm=$SUBJECTS_DIR/ subject_id.bedpostX/xfms/fs2fa.mat --avoid=$SUBJECTS_DIR/T1/T1_subject_id _Baseline/anat/ventricles.nii.gz --seedref=$SUBJECTS_DIR/T1/T1_subject_id_Baseline/anat/fs.nii.gz --forcedir --opd -V 1 --omatrix1 --dir=$SUBJECTS_DIR/subject_id/lh_thalamus.probtrackx2 --waypoints=$SUBJECTS_DIR/T1/T1_subject_id_Baseline.nii/waypoints.txt --waycond='OR' --targetmasks=$SUBJECTS_DIR/subject_id/target.txt --meshspace=freesurfer

However, the content of matrix_seeds_to_all_targets generated from the above line is all 0 and the waytotal has a value of 218681 with # of seed voxels being 7715.

Can anyone comment what is the mistake and how can I generate left thalamus to left hemisphere connectivity with the seed and the targets in FreeSurfer space?

Thanks