ROI-based fixel-based analysis

Hello,
Firstly, I’m sorry for the lengthy questions. I’m new to the FBA, and I have read some ralated previous posts before, still confused. Hope you could guide me to figure out, thank you in advanced!

I have DTI data which is single shell (3 b0 + 30b1000). I uesed the SS3T-CSD algorithms and followed the guideline FBA msmt and completed all these steps. But the guideline is about whole-brain FBA. My goal is to performed ROI-based FBA. Like the Yu et al., I want to compare the FD, FC and FDC from one source ROI (i.e. thamalus) to the rest regions of the BNA246 atlas between two groups (controls and patients). And I also want to compare metrics from thalamus to striatum which is also in the BNA246. My questions are:

  1. I have known that I should co-registered the atlas and the template. But how can I conduct this? The coregistration between the atlas and my FOD template should be completed before tckgen or after?
  2. Since my source ROI and target ROIs are in the same atlas, do I still need to creat a fixel mask for my ROIs?
  3. And I have noticed that in this post seed-based tractography@rsmith clarified that SIFT is fundamentally not applicable to seed-based tractography, only to whole-brain tractography. But in the FAB guideline the SIFT seems to a critical step, so I’m confused that considering to my goal should I run the tcksift?

I hope my description is clear, if there are anywhere puzzled you, feel free to ask me to clarify.

Best wishes,
Yuting.

1 Like

Dear Yuting,

From the description in the paper you referenced, it seems like the authors first perform a fixel-wise analysis (FBA) where they found reduced FD and FDC in the thalamus. They then masked the significant fixels to calculate the mean values for all participants and they performed ANCOVAs to compare groups with age and total intracranial volume as covariates. Subsequently they looked at connectivity between the thalamus sub-divisions and the entire cortex. If you want to achieve something similar, here’s what I would suggest:

They used FLIRT and FNIRT to do the registration, you can calculate the transform from population template to MNI T2 template and then use the inverse transform to move the MNI atlases (cortical and thalamus) to the population template, using nearest neighbor interpolation to retain their label values. You don’t need these files for the tractography, so it doesn’t matter whether you do this before or after tckgen

The mask was only used to extract the mean FD or FDC from the suprathreshold fixels coming from FBA, to export the values to an external statistical software. You don’t have to do this, and you can also include covariates in fixelcfestats to reduce this step.

They do mention whole-brain tractography in their methods, so likely they performed whole-brain tractography on the template, then performed SIFT and then used tckedit with the ROIs, or the combination of tck2connectome and connectome2tck to get the thalamus connectivity profile.

So this would be your general workflow. There are numerous posts on the forum if you need help with any particular steps.

Hope this helps,
Nick

1 Like

Hi,@NicDC

Thank you for your suggestion, this really helped me a lot!! And as you recommended,

I followed this post Warping tracks files to MNI space using FSL warps moved the MNI atlas to the template successfully, but when I overlaid the Atlas2wmfod_template.nii.gz on top of my wmfod_template.mif, it looks weird. Could you please help me check my command lines?

## atlas=BN_Atlas_246_1mm.nii.gz MNI=MNI152_T1_1mm_brain.nii.gz template=wmfod_template.nii.gz

# extract the *I=0* from the wmfod_template.mif
mrconvert wmfod_template.mif wmfod_template_bad_strides.nii.gz
mrconvert wmfod_template_bad_strides.nii.gz wmfod_template.nii.gz -strides -1,2,3,4
mrconvert wmfod_template.nii.gz I0image.nii.gz -coord 3 0

# atlas to MNI152
flirt -ref ../MNI152_T1_1mm_brain.nii.gz -in ../BN_Atlas_246_1mm.nii.gz -omat bna246tomni.mat -interp nearestneighbour -dof 12

# wmfod_template to atlas
flirt -ref bna246tomni.nii.gz -in I0image.nii.gz -omat template2bna246.mat -interp nearestneighbour -dof 12
fnirt --ref=bna246tomni.nii.gz --in=I0image.nii.gz --aff=template2bna246.mat --cout=warps_template2bna246

# inverse the warp to get the atlas to wmfod_template warps
invwarp --ref=I0image.nii.gz --warp=warps_template2bna246 --out=warps_bna246totemplate

# initialise warp
warpinit bna246tomni.nii.gz inv_identity_warp_no.nii

# apply the transformation to identity warp
applywarp --ref=I0image.nii.gz --in=inv_identity_warp_no.nii --warp=warps_bna246totemplate.nii.gz --out=mrtrix_warp_bna246totemplate.nii.gz

# check the transformation
mrtransform bna246tomni.nii.gz -warp mrtrix_warp_bna246totemplate.nii.gz bna246toTemplate.nii.gz -template wmfod_template.mif -interp nearest

And in case that I misunderstand, if the registration of Atlas to wmfod_template goes well, the next step would be use the command tcktransform to transform the tracks file which generated by tckgen from the wmfod_template to the MNI Atlas, do I understand that right?

BW,
Yuting.

Hello,

There’s a few things to consider here:

  1. The BNA is already in MNI152 space as far as I can tell, so you shouldn’t need to register it again
  2. The reference for the wmfod_template to MNI step should be a T2-weighted MNI image, not a T1-weighted or label image as it is now
  3. Don’t use nearest neighbor interpolation while calculating the transform and warp, only when applying it to move the label image (atlas) to the wmfod_template

Generally, to figure out where the registration is failing, overlay the output image with the reference image at each stage.

Depends on what you want to do - I was giving you instructions on how to move the Atlas labels to the wmfod_template so that you could use the labels to build a connectome (using tck2connectome) and then select the tracks assigned to the thalamus nodes (using connectome2tck). I think this is what the authors of that paper did, but you could also approach it by warping the tracks to MNI space and then doing something similar - not sure whether one approach is better than the other.

Cheers,
Nick

1 Like

Hi, @NicDC
Many thank you for your reply. :smiling_face_with_three_hearts:

Follow your suggestion

I have upgraded my code as followed, and it works perfectly!!

flirt -ref ../MNI152_T1_1mm_brain.nii.gz -in I0image.nii.gz -omat template2mni.mat -dof 12

fnirt --ref=../MNI152_T1_1mm_brain.nii.gz --in=I0image.nii.gz --aff=template2mni.mat --cout=warps_template2mni

invwarp --ref=I0image.nii.gz --warp=warps_template2mni --out=warps_mni2template

warpinit ../MNI152_T1_1mm_brain.nii.gz inv_identity_warp_no_mni.nii

applywarp --ref=I0image.nii.gz --in=inv_identity_warp_no_mni.nii --warp=warps_mni2template.nii.gz --out=mrtrix_warp_mni2template.nii.gz

mrtransform ../BN_Atlas_246_1mm.nii.gz -warp mrtrix_warp_mni2template.nii.gz bna246toTemplate_mni.nii.gz -template wmfod_template.mif -interp nearest

mrconvert bna246toTemplate_mni.nii.gz bna246toTemplate_mni.mif

And given the thread you quoted, I’ve tried exactly as what the @maxpietsch suggested, and worked successfully, but the results were even weirder :cry:. After applying the warp to the Atlas, some labels disappeared. I have found that some regions disappeared in the warp_MNI152.mif, but I’m not familiar with ANTs, so I have no idea how to optimize it, would you please guide me?

## warp image use ANTs nonlinear
#transform the template_mask.mif to the ANTs compatible format
mrconvert template_mask.mif template_mask.nii.gz

# register MNI152 to the I0image 
antsRegistration --verbose 1 --dimensionality 3 --float 0 --output [ants,antsWarped.nii.gz,antsInverseWarped.nii.gz] --interpolation Linear --use-histogram-matching 1 --winsorize-image-intensities [0.005,0.995] --transform Rigid[0.1] --metric CC[I0image.nii.gz,../MNI152_T1_1mm_brain.nii.gz,1,4,Regular,0.1] --convergence [1000x500x250x100,1e-6,10] --shrink-factors 8x4x2x1 --smoothing-sigmas 3x2x1x0vox --transform Affine[0.1] --metric CC[I0image.nii.gz,../MNI152_T1_1mm_brain.nii.gz,1,4,Regular,0.2] --convergence [1000x500x250x100,1e-6,10] --shrink-factors 8x4x2x1 --smoothing-sigmas 3x2x1x0vox --transform SyN[0.1,3,0] --metric CC[I0image.nii.gz,../MNI152_T1_1mm_brain.nii.gz,1,4] --convergence [100x70x50x20,1e-6,10] --shrink-factors 4x2x2x1 --smoothing-sigmas 2x2x1x0vox -x [template_mask.nii.gz,../MNI152_T1_1mm_brain_mask.nii.gz]

# Generate an identity (deformation field) warp
warpinit ../MNI152_T1_1mm_brain.nii.gz identity_warp[].nii

# Transform this identity warp
for i in {0..2}; do
    antsApplyTransforms -d 3 -e 0 -i identity_warp${i}.nii -o mrtrix_warp${i}.nii -r I0image.nii.gz -t ants1Warp.nii.gz -t ants0GenericAffine.mat --default-value 2147483647
done

# Correct the warp
warpcorrect mrtrix_warp[].nii mrtrix_warp_corrected.mif -marker 2147483647

# Warp the image
mrtransform ../MNI152_T1_1mm_brain.nii.gz -warp mrtrix_warp_corrected.mif warped_MNI152.mif

# check that the conversion went as expected by comparison with ANTs’ output
mrview warped_MNI152.mif -overlay.load antsWarped.nii.gz -overlay.opacity 0.3

# Apply the warp to Atlas (with regridding)
mrtransform ../BN_Atlas_246_1mm.nii.gz -warp mrtrix_warp_corrected.mif -interp nearest BN_Atlas_246_1mm_to_wmfodtemplate.mif

# Check everything worked
mrview wmfod_template.mif -roi.load BN_Atlas_246_1mm_to_wmfodtemplate.mif -roi.opacity 0.3


Sorry, I got a bit confused. Is there any difference between the registration results reults form the ANTs and the FSL? They seem the same when overlaying the results (i.e. Atlas2wmfod_template.mif) with the wmfod_template, ideally. So I can also using tck2connectome and connectome2tck with the warped results (i.e. Atlas2wmfod_template.mif) which I generated from FSL, right?

Sorry for the lengthy questions, and thank you very much for your patience and kindness.

Best wishes,
Yuting.

1 Like

I’m afraid I haven’t used ANTs for this either, so can’t help sorry!

Yes there will be differences between the two methods and in the literature ANTS typically outperforms FLIRT+FNIRT. However, If you are only using the labels to extract connectivity between regions, a less optimal registration (such as that obtained with FLIRT+FNIRT) might be tolerable.

All the best,
Nick

Thank you very much!! I’ve extracted connectivity between regions according to your suggestion, and it worked perfectly!! :smile:

Best wishes,
Yuting

1 Like