<commit_before>Multi-tissue constrained spherical deconvolution
================================================

Introduction
------------

Multi-tissue constrained spherical deconvolution (CSD) of multi-shell data exploits the unique b-value dependencies of the different macroscopic tissue types (WM/GM/CSF) to estimate a multi-tissue orientation distribution function (ODF) as explained in `Jeurissen et al. (2014) <#references>`__. As it includes separate compartments for each tissue type, it can produce a map of the WM/GM/CSF volume fractions directly from the DW data. In addition, the more complete modelling of the DW signal results in more accurate apparent fiber density (AFD) measures and more precise fibre orientation estimates at the tissue interfaces.

User guide
----------

Multi-tissue CSD can be performed as:

::

  msdwi2fod dwi.mif csf.txt csf.mif gm.txt gm.mif wm.txt wm.mif

where

- ``dwi.mif`` is the dwi data set (input)

- ``<tissue>.txt`` is the tissue-specific response function (input)

- ``<tissue>.mif`` is the tissue-specific ODF (output)

Note that input response functions and their corresponding output ODFs need to be specified in pairs.

Typically, you will also want to use the ``-mask`` to avoid calculations in non-brain voxels:

::

  msdwi2fod -mask mask.mif dwi.mif csf.txt csf.mif gm.txt gm.mif wm.txt wm.mif

RGB tissue volume fraction maps can be obtained as follows:

::

  mrconvert -coord 3 0 wm.mif - | mrcat csf.mif gm.mif - vf.mif

The resulting WM fODFs can be displayed together with the tissue volume fraction map as:

::

  mrview vf.mif -odf.load_sh wm.mif

Per tissue response function estimation
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Input response functions for CSF, GM and single fibre WM can be estimated from the data using prior tissue segmentations, similarly to that described in `Jeurissen et al. (2014) <#references>`__ using the ``dwi2response msmt_5tt`` command: 

::

  dwi2response msmt_5tt dwi.mif 5tt.mif gm.txt wm.txt csf.txt
	
where

- ``dwi.mif`` is the same dwi data set as used above (input)

- ``5tt.mif`` is a tissue type segmentation of a coregistered T1 data set from the same subject (input)
<commit_msg>MSMT-CSD workflow update to reflect WM-GM-CSF ordering of dwi2response<commit_after>Multi-tissue constrained spherical deconvolution
================================================

Introduction
------------

Multi-tissue constrained spherical deconvolution (CSD) of multi-shell data exploits the unique b-value dependencies of the different macroscopic tissue types (WM/GM/CSF) to estimate a multi-tissue orientation distribution function (ODF) as explained in `Jeurissen et al. (2014) <#references>`__. As it includes separate compartments for each tissue type, it can produce a map of the WM/GM/CSF signal contributions directly from the DW data. In addition, the more complete modelling of the DW signal results in more accurate apparent fiber density (AFD) measures and more precise fibre orientation estimates at the tissue interfaces.

User guide
----------

Multi-tissue CSD can be performed as:

::

  msdwi2fod dwi.mif wm.txt wm.mif gm.txt gm.mif csf.txt csf.mif

where

- ``dwi.mif`` is the dwi data set (input)

- ``<tissue>.txt`` is the tissue-specific response function (input)

- ``<tissue>.mif`` is the tissue-specific ODF (output)

Note that input response functions and their corresponding output ODFs need to be specified in pairs.

Typically, you will also want to use the ``-mask`` to avoid calculations in non-brain voxels:

::

  msdwi2fod -mask mask.mif dwi.mif wm.txt wm.mif gm.txt gm.mif csf.txt csf.mif

RGB tissue signal contribution maps can be obtained as follows:

::

  mrconvert -coord 3 0 wm.mif - | mrcat csf.mif gm.mif - vf.mif

The resulting WM fODFs can be displayed together with the tissue signal contribution map as:

::

  mrview vf.mif -odf.load_sh wm.mif

Per tissue response function estimation
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Input response functions for CSF, GM and single fibre WM can be estimated from the data using prior tissue segmentations, similarly to that described in `Jeurissen et al. (2014) <#references>`__ using the ``dwi2response msmt_5tt`` command: 

::

  dwi2response msmt_5tt dwi.mif 5tt.mif wm.txt gm.txt csf.txt
	
where

- ``dwi.mif`` is the same dwi data set as used above (input)

- ``5tt.mif`` is a tissue type segmentation of a coregistered T1 data set from the same subject (input)

{'fraction_non_alphanumeric': 0.11678995740865276, 'fraction_numerical': 0.008742434431741762, 'mean_word_length': 4.164351851851852, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4210173', 'n_tokens_mistral': 1405, 'n_tokens_neox': 1307, 'n_words': 580}