Single-Shell (+B0) 3-Tissue CSD

Dear MRtrix experts,

I have an acquisition with one B=0 and 29-off directions with B=1000, I need to find the Structural Connectivity matrix, so I preprocessed the data as shown in the guide and then created the Basis Functions:

dwi2response dhollander sub-01_den_preproc_unbiased.mif wm.txt gm.txt csf.txt -voxels voxels.mif
dwi2fod msmt_csd sub-01_den_preproc_unbiased.mif -mask mask.mif wm.txt wmfod.mif gm.txt gmfod.mif csf.txt csffod.mif
mrconvert -coord 3 0 wmfod.mif - | mrcat csffod.mif gmfod.mif - vf.mif

However when opening with:
mrview vf.mif -odf.load_sh wmfod.mif
I can see no GM, see screenshot

I think this is due to the fact that I have only 2 shells (B=0 and B=1000) to find 3 tissues, is it correct?

Assuming it is true, I installed MRtrix3Tissue and used the ss3t_csd_beta1 command:
ss3t_csd_beta1 sub-01_den_preproc_unbiased.mif wm.txt wmfod.mif gm.txt gmfod.mif csf.txt csffod.mif -mask mask.mif

however I get the following error "
ss3t_csd_beta1: [ERROR] shconv fod_csf_0.mif wresp_csf_bz.txt sh_csf_bz_1.mif -mask mask.mif (ss3t_csd_beta1:163)
ss3t_csd_beta1: [ERROR] Information from failed command:
ss3t_csd_beta1:
shconv: [ERROR] unknown option “-mask”

Even removing the option -mask mask.mif did not fix:
ss3t_csd_beta1: [ERROR] sh2amp sh_csf_bz_1.mif grad_bz.txt sig_csf_bz_1.mif -gradient (ss3t_csd_beta1:166)
ss3t_csd_beta1: [ERROR] Information from failed command:
ss3t_csd_beta1:
sh2amp: [ERROR] unknown option “-gradient”

Can you help me please?

I appreciated!

1 Like

Hello @michefabb ,
I think you can first overlay voxels.mif onto DWI image. You should see three colors of voxels.

Many Thanks,
Suren

@suren thanks for your reply. It looks the voxels.mif shows only the voxels used to create the Basis Functions of each tissue, but apparently does not fix the issue with GM.

Any possible help?

@ThijsDhollander @jdtournier do you have any suggestion?

shconv: [ERROR] unknown option “-mask”
sh2amp: [ERROR] unknown option “-gradient”

ss3t_csd_beta1 should be accessing those executables in your MRtrix3Tissue bin directory, but it appears to be calling different versions of the commands in which those options have been depracated, presumably from your usual MRtrix3 installation (more recent than v3.0_RC3). The python API should handle finding the correct executables, or else defaults to whatever (version matched or not) MRtrix3 commands it can find in the system path, which is my best guess for what’s happening in your case.

Some steps to help figure out what’s wrong:

  1. What steps did you follow to install MRtrix3Tissue? Is it somehow in conflict with an MRtrix3 installation?

  2. To confirm whether this is the problem, run your ss3t_csd_beta1 command again with the -debug option (this will generate a lot of output). Look for something like

    ss3t_csd_beta1: [DEBUG] run.version_match() (from run.py:314): Using non-version-matched executable for shconv: ...
    

    before the error occurs

  3. It would also be useful to know your system path, so the output from echo $PATH (or the Windows equivalent). Also, to find out where the python module is trying (and presumably failing) to find the version matched executables, run

    # Change this to the path of your MRtrix3Tissue installation
    libpath=/full/path/to/MRtrix3Tissue/lib
    python3 -c "import sys; sys.path.insert(0,'''$libpath'''); from mrtrix3 import BIN_PATH; print(BIN_PATH)"
    

Hopefully that should help at least pin point what’s going wrong.

I think this is due to the fact that I have only 2 shells (B=0 and B=1000) to find 3 tissues, is it correct?

Yes, correct. In theory, you can also get only WM and GM ODFs (ditching CSF) by only supplying those two response functions, although I’ve met a fair amount of scepticism for this approach (the WM signal can get overly “suppressed” in partial volume voxels).
I still find the WM+CSF approach useful over pure single-shell single-tissue CSD, as you get some free water signal suppression which reduces some of the noise in WM ODFs. Of course what’s best for you depends on your specific application.
There has been a fair amount of discussion of this on the forum, here are some useful threads on the topic:
Msmt-csd
Single shell vs. "Single tissue"
Fixel-Based Analysis on single shell data

Fiona

2 Likes

Dear Fiona,

thank you for your kind reply! I will reply below to all your questions.

  1. What steps did you follow to install MRtrix3Tissue? Is it somehow in conflict with an MRtrix3 installation?

I had already installed MRtrix3.0.4 using
sudo bash -c “$(curl -fsSL https://raw.githubusercontent.com/MRtrix3/macos-installer/master/install)”
when I installed MRtrix3Tissue; for this latter I followed the instructions shown on the MRtrix3Tissue website

  1. To confirm whether this is the problem, run your ss3t_csd_beta1 command again with the -debug option (this will generate a lot of output). Look for something like […]

Done, it states [DEBUG] run.version_match() (from run.py:562): Command shconv not found in MRtrix3 bin/ directory

  1. It would also be useful to know your system path, so the output from echo $PATH (or the Windows equivalent).

Done, echo $PATH states:
/Users/michelangelo/MRtrix3Tissue/bin:/usr/local/opt/qt@5/bin:/Users/michelangelo/fsl/share/fsl/bin:/Users/michelangelo/fsl/share/fsl/bin:/Users/michelangelo/opt/anaconda3/bin:/Users/michelangelo/opt/anaconda3/condabin:/Library/Frameworks/Python.framework/Versions/3.10/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/Library/Apple/usr/bin:/Users/michelangelo/abin

Also, to find out where the python module is trying (and presumably failing) to find the version matched executables, run […]

Done, it returns:
Traceback (most recent call last):

  • File “”, line 1, in *
    ModuleNotFoundError: No module named ‘mrtrix3’

I still find the WM+CSF approach useful over pure single-shell single-tissue CSD, as you get some free water signal suppression which reduces some of the noise in WM ODFs. Of course what’s best for you depends on your specific application.

I am trying to find the matrix for the connectome weight and mean length starting from a T1w and DWI MRI. Since MRtrix3Tissue was not working I used the multi-tissue approach mentioned by you with WM+CSF only (dwi2response dhollander…then waste gm.txt and dwi2fod msmt_csd with wm.txt and csf.txt only), then after all the other operations I ran tckgen with -maxlength 250 -cutoff 0.06 and 10M streamlines: it worked, however I am unsure about the outcome in cerebellum…I attach a picture of T1w with overlay an extraction with 200k streamlines (of the original 10M)…does it look okay to you, or is it missing fibers? can this be due to the approach above, and could it be fixed using MRtrix3Tissue?

I can send more pics to your personal email if helpful.

Greatly appreciated,

Michelangelo

Hello Michelangelo!

Okay I’d hoped this would work from any location, but in that case you might have to navigate to the python library location first:

cd /Users/michelangelo/MRtrix3Tissue/lib
python3 -c "from mrtrix3 import BIN_PATH, EXE_LIST; print(BIN_PATH); print(EXE_LIST)"

if the value of BIN_PATH doesn’t correspond to /Users/michelangelo/MRtrix3Tissue/bin or the names in EXE_LIST don’t contain shconv etc. then something might be wrong with your MRtrix3Tissue installation.

Be aware that having MRtrix3Tissue at the start of your path may interfere with your use of MRtrix3 v.3.0.4.

Maybe you could clarify what your concern is? Nothing obviously weird about the picture you sent jumps out at me, but I’m no expert when it comes to whole brain tractography, and I’ve never done tractography in the cerebellum, so your question isn’t well placed with me I’m afraid.

Cheers
Fiona