AFQ tract segmentation using MRtrix3 WB tractography

Hello MRtrix3 Community,

I’m wondering if anyone has experience working with MRtrix3 and AFQ. I have data that I preprocessed and conducted whole brain tractography for using MRtrix, and I would like to use AFQ to do tract segmentation. Does anyone have tips for creating the dt6.mat file required for AFQ based on data preprocessed in MRtrix?
Any guidance would be appreciated.

Thank you!
Meaghan

Hi Meaghan,

I’m no expert, but I have successfully used AFQ with MRtrix3 before, so I’ll share what I know.

Creating a dt6.mat file should precede whole brain tractography. To create a dt6 file, you need a T1 image in ACPC and the corresponding diffusion scans, then you register the diffusion scans to the T1 image using dtiInit function in MrVista. This step produces the dt6 file you’re looking for.

After running dtiInit, you can then use the T1-registered diffusion scans with MRtrix to perform whole brain tractography. Once that’s done, the produced .tck file can then be fed into the AFQ pipeline, along with the corresponding dt6 file.

Hope that helped!

Cheers,
Joe

Hi Joe,

Thanks for your response!
To make sure I understand, do I need to create the dt6 files before both preprocessing and whole brain tractography? Once I derive the dt6 file, can I run it through the standard mrtrix preprocessing pipeline, or does dtiInit accomplish some of the preprocessing steps as well?

Many thanks,
Meaghan

Hey,

I’m assuming by “preprocessing” you mean motion, eddy current and susceptibility artifact correction? If that’s the case, then it depends on which program you want to use to preprocess your data.

dtiInit is capable of correcting motion and eddy current artifacts, but not susceptibility artifacts. You can use FSL’s topup function to correct susceptibility artifacts (if your data allows it), and then do the rest in dtiInit. Personally, I prefer to do all preprocessing using FSL and then use dtiInit only for aligning my preprocessed data to the T1 images. Alternatively, you can do your preprocessing using mrtriix if you want, but as far as I know it uses FSL functions anyway, so it really makes no difference.

So, the order I would suggest is: preprocess your data (in FSL directly or through mrtrix), then align your preprocessed data to T1 data using dtiInit, then use the aligned and preprocessed data for whole brain tractography. You definitely don’t want to align uncorrected data!

I would suggest quickly going through the dtiInit and MrDiffussion wikis just to get an idea of what dt6 files are and how they work.

Hope that made sense!

Cheers,
Joe

Hi Joe,

This makes sense and seems to fit with what I’m trying to do. I have the data preprocessed through mrtrix/FSL, so I’ll use the outputs from that for dtiInit, and then go from there with the tractography.

Thanks!
Meaghan

No worries. Glad I could be of help :slight_smile:

One last thing, make sure the bvecs produced by dtiInit are not flipped on any of the axes. For some reason, whenever I tried to align my diffusion data using dtiInit, the bvecs produced would be flipped on the x-axis. Not sure if that’s an issue with dtiInit, or if was a problem specific to my data, but just thought I should give you a heads up. Good luck!

This could be the same bug that affected MRtrix3 until recently. It’s very subtle, and was not fully documented on the FSL wiki until we figured out the problem with Mark Jenkinson and issued the fix – I wouldn’t be surprised if other software packages were also affected by this… If you’re convinced there’s an issue in dtiInit, I think it would be worth reporting this to the MrVista developers.

1 Like

Hi Joe,

I’ve been reading more into the DtiInit processing on the Vistasoft wiki, and it seems that if I run the whole dtiInit process on my data, it will try to conduct preprocessing such as eddy correction, etc., which I have already completed in FSL. Do you just use dtiInitAlign on the data you have already preprocessed in FSL?
What is your motivation for doing this rather than using the dtiMakeDt6FromFsl option?

I appreciate your help as I’m trying to explore my options for this type of processing and analysis.

Thank you!
Meaghan

Hey,

I haven’t used dtiInit in a while, so I don’t remember the exact details. What I do remember is that one of the parameters that you have to set before running dtiInit (named eddyCorrect, I believe) gives you 3 different options for correcting your data: 1 for eddy and motion correction, 0 for correcting only one of them (can’t remember which), and -1 for no correction at all. I set it to -1.

I don’t remember using a separate function for only aligning the data, but then I again maybe I didn’t need to use dtiInit and one of these functions would have sufficed. I really can’t help you there, I was pretty much following a pipeline set up by someone else, so I didn’t really explore that much. There’s a good chance the functions I used are outdated by now, I really can’t tell.

That being said, the general idea is still the same, preprocess data, align to T1, perform whole brain tractography, then run AFQ.

Sorry I couldn’t be of more help. I’m sure there’s some message board for MrVista/AFQ where you could get more help. Good luck!

Cheers,
Joe

Hi Joe,
I have created a dt6.mat file using dtiInit function in MrVista and conducted whole brain tractography for using MRtrix3, I want to know the next step about how to segment the fibers of the whole brain tractography, using ‘‘AFQ_SegmentFiberGroups’’ or other command?
Thanks!
Liang

Hi,

I believe the command you need at this point is AFQ_run, but I could be wrong. I haven’t used AFQ in so long.

Alternatively, you could give brainlife a try. It’s a platform where you can upload your data and run different analyses (including AFQ) with relative ease.

Hope that was helpful.

-Joe

Hi Joe,
thanks for your advice,I will have a try.
Thank you !
Liang

1 Like

Hi Liang,

I’m actually trying to do exactly the same thing. I have the dt6.mat file and wholebrain tractography generated using MRtrix for 2 groups of subjects. I successfully segmented the fiber groups on single subject using the method provide in AFQ_example.m, however I’m not sure how to approach the same thing for two groups of subjects. Would next step be AFQ_run or AFQ_SegmentFiberGroups? (It seems like the AFQ_run would be computing the whole brain tractography again using AFQ program). How did you proceed? Any input or suggestion is greatly appreciated. Thank you so much in advance!

Best,

Luie