- I want to get help or discuss issues about MRtrix
- What data do I need to perform constrained spherical deconvolution?
- How do I perform the super-resolved version of CSD?
- I keep getting 'failed to converge' messages with csdeconv
- I want to coregister my anatomical images with the DWI/tracks
- How do I produce an image of the track count through each voxel?
- What are these 'mrtrix-azdj28.mif' files that keep appearing in my folder?

top

### I want to get help or discuss issues about MRtrix

Please subscribe to the MRtrix mailing list and post your questions there. You can also browse through the archives to see if your question has already been addressed. Another advantage of joining the mailing list is that you get notified of any new releases.

top

### What data do I need to perform constrained spherical deconvolution?

The input data for CSD is a high angular resolution diffusion-weighted imaging (HARDI) data set. There are three main aspects of the acquisition that impact on the quality of the CSD results. In general, there will be trade-offs between the parameters concerned, meaning that there is no simple answer to this question. However, we do provide our own recommendations as part of this discussion.

b-value:
  higher b-values produce stronger angular contrast in the DW signal, providing improved discrimination between the different fibre orientations. Note that although the raw DW images will look much noisier at higher b-values, it is the vastly improved constrast to noise ratio in the angular domain that is critical for CSD.
  We would recommend a b-value of approximately 3000s/mm².
number of DW directions:
  a larger number of DW directions will produce a better characterisation of the DW signal. In addition to an overall increase in SNR, it provides a more precise definition of the features of the DW signal in the angular domain, which is critical for CSD. In addition, since the DW signal increases in angular constrast with higher b-values, a larger number of DW directions becomes even more important then. Please note that in the context of this discussion, it is the number of unique directions that is important: a 3 × 12 directions acquisition still only contains 12 directions (although with improved SNR).
  We would recommend a minimum of 60 DW directions.
SNR:
  higher SNR obviously produces better results. Larger voxels will provide higher SNR, but at the expense of spatial localisation. However, CSD will produce poor quality results if the SNR in the b=0 image is too low. We would recommend adjusting the voxel size until the SNR exceeds 20. This should not require a huge sacrifice in terms of imaging resolution: for example, using 2.5mm rather than 2mm isotropic voxels effectively doubles the SNR, at the expense of a relatively small reduction in spatial resolution.

In the same way, there is also no simple answer to what the minimum requirements are. It is possible to get reasonable-looking results using b=1000s/mm² and 30 DW directions, but the quality may then be questionable. In general, we would urge you to follow the recommendations given here if you intend to use CSD.

top

### How do I perform the super-resolved version of CSD?

Super-CSD is actually performed in the same way as 'normal' CSD, but using a higher harmonic order (lmax) than would otherwise be possible given the data. For example, 60 directions provides enough data to perform a spherical harmonic fit up to harmonic order 8 (which requires 45 parameters), but not enough for harmonic order 10 (which requires 66 parameters) – see the table in the response function coefficient section. This means that a 60 direction data set will be analysed using straight CSD if `csdeconv` is performed with lmax=8 or lower, and super-resolved CSD if `csdeconv` is performed with lmax=10 or higher.

top

### I keep getting 'failed to converge' messages with csdeconv

`csdeconv` will produce one such message per voxel where the CSD fails to converge. It is not unusual to get a dozen or so such messages per data set when performing a super-resolved reconstruction (see above). The voxels affected are typically not in white matter, so these failures usually won't affect any subsequent tractography.

However, if you are getting a lot of these messages, you may need to check that the CSD images are suitable. They can be loaded directly into MRview: the voxels that failed to converge will appear black. If these messages do signal a real problem, you should try to perform the CSD using a lower value of lmax. In particular, you will usually not get any such messages when performing non-super-resolved CSD (see above).

top

### I want to coregister my anatomical images with the DWI/tracks

MRtrix now includes support for the NIfTI image format, allowing straightforward interaction with SPM5 and FSL (amongst others). Both of these packages provide robust functionality for coregistration. Some simple instructions for coregistration using these packages are given below.

An important point to bear in mind is that the orientation of the DWI data and any images derived from them (including the CSD results) should not be modified, since this may affect the orientation of the DW gradients with respect to the data, and hence also affect the orientation of the fibres relative to the data, which would obviously invalidate any subsequent tractography results. In practice, this means that the anatomical images should be coregistered to the DWI data, leaving the DWI data unmodified.

The first step in the coregistration procedure is to convert the images of interest to NIfTI format. The FA map appears to provide adequate contrast for coregistration with the anatomical images, so we will convert these data:

    > mrconvert anat.mif anat_coreg.nii
    mrconvert: copying data... 100%
    > mrconvert fa.mif fa_coreg.nii
    mrconvert: copying data... 100%

The subsequent steps depend on the software package to be used.

#### SPM5

The procedure with SPM5 is straightforward: set the FA map as the reference image, the anatomical as the source image, and coregister (estimate only) with the normalised mutual information cost function. Once the processing is done, the `anat_coreg.nii` image will have been re-oriented to match that of the FA map (only the header's orientation field will have been modified). The `anat_coreg.nii` can then be loaded into MRview instead of the original `anat.mif`.

- open SPM5, and click on 'coregister' in the spatial pre-processing box
- select New "Coreg: Estimate"
- double-click on +Coreg: Estimate <- X to expand the parameter list
- click on Reference Image <- X to highlight it
- click on Specify Files to open the file dialog
- select the `fa_coreg.nii` file and press Done
- click on Source Image <- X to highlight it
- click on Specify Files to open the file dialog
- select the `anat_coreg.nii` file and press Done
- double-click on +Estimation options to expand the list
- click on Objective Function to select it
- make sure it is set to Normalised Mutual Information
- press Run to start the coregistration

`anat_coreg.nii` should now be coregistered with the DWI data and any tracks generated from them.

#### FSL

The procedure to use with FSL is slightly more complex. The FLIRT command does not produce good results if the FA map is specified as the reference. The steps required are therefore to coregister the anatomical images to the FA map, producing a 4×4 affine transform matrix. As with SPM5, the normalised mutual information cost function produces the best results. The inverse of this transform can then be applied to the anatomical images using the mrtransform command included as part of MRtrix.

    > flirt -ref anat_coreg.nii -in fa_coreg.nii -cost normmi -searchcost normmi -dof 6 -omat transform.txt
    > mrtransform anat_coreg.nii -transform transform.txt -reference fa_coreg.nii -inverse -flipx anat_coreg.mif
    mrtransform: copying image data... 100%

`anat_coreg.mif` should now be coregistered with the DWI data and any tracks generated from them.

top

### How do I produce an image of the track count through each voxel?

The tracks2prob command can be used to generate an image where each voxel contains the fraction of the total number of tracks generated that pass through that voxel. For example:

    > tracks2prob tracks.tck anat.mif track_image.mif
    tracks2prob: generating track count image...  - ok

This will produce an image of the fraction of tracks through each voxel based on the `anat.mif` template image.

top

### What are these 'mrtrix-azdj28.mif' files that keep appearing in my folder?

MRtrix will produce temporary files when data pipes are used. If one of the programs in the pipeline crashes, these files will not be deleted (see here for details). If you find one or more of these files amongst your data, you can safely delete them – assuming of course that there are no currently running MRtrix programs that may be accessing the file!