MRtrix tutorial available on OSF


#1

Hi to all MRtrix3 users!

I just wanted to share some resources with you: At this year’s MICCAI conference, there was a contest on the best tutorial. For that, I wrote a step-by-step tutorial on MRtrix3, which explains how you analyze raw multi-shell DWI data. In there, you’ll learn how to:

  1. preprocess the data, and get some idea of what the purpose of each of the analysis steps is,
  2. create a whole-brain tractogram and filter out specific tracts of interest,
  3. create a structural connectivity matrix,
  4. use the connectome visualization tool.

Additionally, I’m providing tutorial data – both the raw dicom data as well as any files which are to be created throughout the tutorial. Throughout the tutorial, I’m providing example code which can be directly used on that test data.

If you want to find out more, just visit the OSF tutorial website: https://osf.io/fkyht/

Thanks and enjoy,

Marlene.


#2

It’s really cool. very helpful, thanks!


#3

Thank you for your feedback, @zonglei, glad you can make use of it :+1:


#4

Hi @martahedl
MRtrix3 doc tell us to run mrgibbs first, and then run dwidenoise because the former may change the noise structure(https://mrtrix.readthedocs.io/en/latest/reference/commands/mrdegibbs.html). But I noticed you reverse their order in your tutorial. Do you think which order is better?
Best,
Zonglei


#5

@Zonglei The wording of the description in mrdegibbs can be misleading. “This command” in the following refers to mrdegibbs: “Similarly, if you intend running dwidenoise, you should run this command afterwards, since it has the potential to alter the noise structure, which would impact on dwidenoise’s performance.” So denoising should be performed before mrdegibbs.


#6

Thanks @maxpietsch for clarifying this :slight_smile:
@zonglei: Thanks for paying attention. If anything else seems unclear, don’t hesitate to bring it up!


#7

First of all, awesome tutorial. I really appreciate the amount of effort that your team is investing into this tutorial.

I am a medical student without any background in computing, trying to learn MRtrix with this tutorial.

I am current facing an issue with page 6 of the BATMAN_tutorial, step 2.2

I tried following with the details as follow:

Arthurs-MacBook-Pro:DWI arthur$ dwidenoise dwi_raw.mif dwi_den.mif –noise noise.mif

dwidenoise: [ERROR] Expected exactly 2 arguments (4 supplied)

dwidenoise: [ERROR] Usage: dwidenoise dwi out

dwidenoise: [ERROR] Yours: dwidenoise dwi_raw.mif dwi_den.mif –noise noise.mif

May I know if I have missed out on anything?

Thank you

Regards,
Arthur


#8

If you copy and pasted the code into a terminal there is a chance that the ‘-’ before ‘noise’ is a dash instead of a minus sign. Try typing this character into the terminal instead.


#10

Awesome. Thanks for the help! :slight_smile:


#11

Really helpful!


#12

Hi everybody.

First of all thanks to Marta for this nice tutorial! :slight_smile:

However, I have tried it with her data, and came to the part where dwipreproc needs to be done and I keep getting this error which I cannot surely identify.

The command is:

dwipreproc dwi_den_unr.mif dwi_den_unr_preproc.mif -pe_dir AP -rpe_pair -se_epi b0_pair.mif -eddy_options " --slm=linear"

The error is:

dwipreproc: [ERROR] Command failed: fsl5.0-topup --imain=topup_in.nii --datain=topup_datain.txt --out=field --fout=field_map.nii.gz --config=/usr/share/fsl/5.0/etc/flirtsch/b02b0.cnf (dwipreproc:743)
dwipreproc: Output of failed command:
dwipreproc: 
dwipreproc: Changing back to original directory (/home/david/Pictures/Human_Connectome/DWI)
dwipreproc: Script failed while executing the command: fsl5.0-topup --imain=topup_in.nii --datain=topup_datain.txt --out=field --fout=field_map.nii.gz --config=/usr/share/fsl/5.0/etc/flirtsch/b02b0.cnf
dwipreproc: For debugging, inspect contents of temporary directory: /home/david/Pictures/Human_Connectome/DWI/dwipreproc-tmp-FF4JJ6/

Any thoughts?

P.S.
Command

dwipreproc dwi_den_unr.mif dwi_den_unr_preproc.mif -rpe_none -pe_dir AP

Works fine, so I guess its not FSL problem

P.P.S.
I got the same problem when I try the command from Marta’s pre-derived files (located in Suplemmentary materials)

So I think I found the problem. On my other machine when I do the preproc script mrtrix calls topup (and not fsl5.0-topup) and everything works fine. Does anyone have the idea of what could have gone wrong?
Both machines are on linux mint 19.


#13

First off, calling dwipreproc with the -rpe_none effectively bypasses the topup step, so this doesn’t mean that FSL works fine… But given the lack of output from the topup invocation, I’d agree there’s a chance that it’s not finding the fsl5.0-topup command. Have you tried running that command in the terminal directly? If you type fsl5.0-topup in the terminal, do you get a
command not found error?

Also, can you post the output the successful dwipreproc call? Looking at how eddy is invoked might give us a clue as to why the topup call is failing.


#14

Thank you for your answer!

When I type both fsl5.0-topup or just topup I get the description of the command in terminal. I tried unlinking fsl5.0-topup from topup located in the /bin, and then mrtrix calls topup command but still gives the same error. Everything else on fsl works perfectly fine.

Eventually (since it was brand new workstation) I installed newest ubuntu, and run the FSL 6.0 python script for the installation, and now everything works fine.


#15

In case it’s relevant, linking to a recent external contribution to MRtrix3 that will alter the invocation of FSL commands from MRtrix3 scripts following the next tag update. Based on the description there, I would suggest that FSL commands prefixed with “fsl5.0-*” should ideally not appear in your PATH at all; these should reside in some unlinked location, and the FSL configuration script should be responsible for providing soft-links to these that do not include the prefix.

But given the lack of output from the topup invocation, I’d agree there’s a chance that it’s not finding the fsl5.0-topup command.

No, there’d be a different error if the executable couldn’t be found.

topup has been observed to fail silently (i.e. no text on stdout or stderr) if it is unable to allocate sufficient memory; it’s conceivable that it could do similar in other circumstances, but that is beyond my knowledge and control. But given my description above, it’s possible that topup is crashing out due to FSL not being configured correctly, even if the commands are discoverable within PATH.


#16

A post was split to a new topic: Processing of volumes prior to dwipreproc