# MRtrix 3.0 (release candidate 2)

**URL:** https://community.mrtrix.org/t/mrtrix-3-0-release-candidate-2/1065
**Category:** Announcements
**Tags:** update, release
**Created:** [July 31, 2017, 5:50am UTC](https://community.mrtrix.org/t/mrtrix-3-0-release-candidate-2/1065 "2017-07-31T05:50:46Z")
**Posts on this page:** 11
**Page:** 1

<div class="post-metadata">

### Author: ![ThijsDhollander](https://community.mrtrix.org/user_avatar/community.mrtrix.org/thijsdhollander/32/1617_2.png) [@ThijsDhollander](https://community.mrtrix.org/u/ThijsDhollander)
#### Post date: [July 31, 2017, 5:50am UTC](https://community.mrtrix.org/t/mrtrix-3-0-release-candidate-2/1065/1 "2017-07-31T05:50:46Z")

</div>

The last few months of work have resulted in another batch of updated features. The most important changes motivating this second release candidate relate to the bias field correction and intensity normalisation process previously performed by the `mtbin` command, which affects the fixel-based analysis pipeline in particular. Users who are in the process of performing a fixel-based analysis on their data should pay special attention to the changes this update brings to the bias field and intensity normalisation and other steps (and documentation) of the fixel-based analysis pipeline (see below for details).

This release candidate introduces a number of bug fixes and enhancements, but also other changes that you will need to know about, in particular:

- [the `mtbin` command is now deprecated](https://community.mrtrix.org/t/mrtrix-3-0-release-candidate-2/1065/2); users are urged to use the new `mtnormalise` command instead.
- [`dwipreproc` has been updated](https://community.mrtrix.org/t/mrtrix-3-0-release-candidate-2/1065/3) to better handle acquisitions with repeated DWIs.
- [`mrview` now supports displaying multiple volumes](https://community.mrtrix.org/t/mrtrix-3-0-release-candidate-2/1065/4) in lightbox mode.
- [new `-mask` option to `fixelcfestats`](https://community.mrtrix.org/t/mrtrix-3-0-release-candidate-2/1065/5)
- [`mrdegibbs`: a new command](https://community.mrtrix.org/t/mrtrix-3-0-release-candidate-2/1065/6) to remove Gibbs ringing artefacts.
- changes to [voxel size handling in `population_template`](https://community.mrtrix.org/t/mrtrix-3-0-release-candidate-2/1065/7)
- the [energy term used in `dirgen`](https://community.mrtrix.org/t/mrtrix-3-0-release-candidate-2/1065/8) and associated commands has been corrected.
- [improved DICOM handling](https://community.mrtrix.org/t/mrtrix-3-0-release-candidate-2/1065/9) for series containing multiple image types
- support for [reading TIFF images](https://community.mrtrix.org/t/mrtrix-3-0-release-candidate-2/1065/10)

#### Other more minor enhancements:

- support for exporting tracks to PLY format via `tckconvert` (courtesy of Daniel Blezek)
- improved handling of MGH/NGZ images
- fix handling of large files on Windows
- fix of the `-shell` option for `dwi2fod msmt_csd` (thanks to @isAarya for reporting!)

As always, you can update your install by performing a `git pull` followed by `./build` at the command line (while in your MRtrix installation folder).

---

<div class="post-metadata">

### Author: ![ThijsDhollander](https://community.mrtrix.org/user_avatar/community.mrtrix.org/thijsdhollander/32/1617_2.png) [@ThijsDhollander](https://community.mrtrix.org/u/ThijsDhollander)
#### Post date: [August 1, 2017, 10:26pm UTC](https://community.mrtrix.org/t/mrtrix-3-0-release-candidate-2/1065/2 "2017-08-01T22:26:19Z")

</div>

### Deprecation of `mtbin` command and introduction of new `mtnormalise` command

Problems with the stability and some of the underlying theory of the method implemented by `mtbin` have become apparent, and the method has been radically overhauled to resolve these issues. Some of the issues with the original `mtbin` method could result in the introduction of extreme image intensity values in certain regions of the corrected images, which could in turn cause problems for subsequent steps in a typical fixel-based analysis pipeline (most notably the creation of or registration to a population template). When these issues manifested, the bias field and intensity estimation in the entire brain region was often affected as well.

After updating your MRtrix installation, the changes to take note of in this context are:

- `mtbin` has been deprecated. Running it will by default produce an error message to highlight this. The description lists an option to override this behaviour and allow to consciously run the method anyway. However, we recommend against continuing to use it in any (fixel-based) analysis.
- A new alternative method is available via the `mtnormalise` command. The interface and required inputs are similar to the previous `mtbin` method. The method has undergone thorough testing to perform up to expected standards.
- The documentation of the multi-tissue fixel-based analysis pipeline has been updated to incorporate this new method.

We should also warn you that the previous version of MRtrix had an existing `mtnormalise` command, which implemented another method entirely. You should therefore take extra care to fully update your MRtrix installation before following the new (fixel-based analysis) instructions. The easiest way to check whether you are using the correct new `mtnormalise` command after updating, is to check for the presence of a “`lognorm_scale`” field/property in the header of the output images produced by `mtnormalise`. This can for instance be achieved by:

`mrinfo wmfod_norm.mif -property lognorm_scale`

This should produce a single number, which reflects the global scale detected (and corrected for) by the new `mtnormalise` method, assuming a log-normal distribution of the intensity normalisation factors (across the spatial domain). More information can also be found in the updated documentation of both the `mtnormalise` command and the multi-tissue fixel-based analysis pipeline.

#### Updated documentation for the multi-tissue fixel-based analysis pipeline

The fixel-based analysis pipeline has been updated / changed in a few places. The most notable change is the reintroduction of the `dwibiascorrect` bias field correction preprocessing step. Via experience in several (real) fixel-based analysis studies, we found that performing this correction early on in the pipeline has potentially important benefits for the subsequent `dwi2mask` brain mask computation, as well as the estimation of response functions for constrained spherical deconvolution. The new `mtnormalise` method, which sits further in the pipeline, is still _essential_ for global intensity normalisation, but also accounts for further correction of (residual) intensity inhomogeneities. `mtnormalise` can automatically deal both with datasets that already underwent (partial) correction of bias fields, as well as datasets that are still entirely uncorrected for bias fields (and `mtnormalise` will in this scenario correct for those bias fields).

For `dwibiascorrect`, we still advise to use the ANTS N4 bias field correction algorithm via the `-ants` option, which requires an installation of the ANTS software. More information can be found in the documentation of `dwibiascorrect` and the updated multi-tissue fixel-based analysis pipeline. The default parameters used for the N4 algorithm have changed as well, in order to result in a more robust outcome (mostly beneficial for subsequent `dwi2mask` computation).

---

<div class="post-metadata">

### Author: ![rsmith](https://community.mrtrix.org/user_avatar/community.mrtrix.org/rsmith/32/2672_2.png) [@rsmith](https://community.mrtrix.org/u/rsmith)
#### Post date: [August 1, 2017, 10:27pm UTC](https://community.mrtrix.org/t/mrtrix-3-0-release-candidate-2/1065/3 "2017-08-01T22:27:37Z")

</div>

### Fix to `dwipreproc` & phase encode handling

When _all_ DWI volumes are acquired with reversed phase-encoding (i.e. not just _b_=0 images for estimating the inhomogeneity field), it’s possible to take each pair of DW volumes that have the same diffusion gradient direction, and _combine_ them into a single volume, in a manner that accounts for the differences in information content when the two images are stretched / compressed relative to one another. This is performed when using the `-rpe_all` option, as well as the `-rpe_header` option if the input data are appropriate. However my initial testing of this functionality was not thorough enough, and a couple of users have encountered issues. It _should_ hopefully now be working… 😨

There’s also been corresponding changes to the management of phase encoding information in image headers. Some users may have encountered a warning regarding “invalid phase encoding tables”. While this warning will still occur with existing data, newly-generated images will erase this information when it is no longer relevant such that this warning no longer appears.

---

<div class="post-metadata">

### Author: ![rtabbara](https://community.mrtrix.org/letter_avatar_proxy/v4/letter/r/f1d935/32.png) [@rtabbara](https://community.mrtrix.org/u/rtabbara)
#### Post date: [August 1, 2017, 10:35pm UTC](https://community.mrtrix.org/t/mrtrix-3-0-release-candidate-2/1065/4 "2017-08-01T22:35:55Z")

</div>

### Multi-volume lightbox mode for `mrview`

`mrview`'s lightbox view mode now supports concurrently visualising multiple volumes for a single image across a grid. To enable this feature, switch to lightbox mode (View → Lightbox), then open the View tool (Tool → View) and select the _Cycle through volumes_ tick-box. A user can additionally modify the _Volume increment_ size to control the range of visible volumes.

This should prove useful for quick visual inspections of multi-volume data:

 ![28414007-963ea502-6d41-11e7-9dcd-3d9426acc909](https://community.mrtrix.org/uploads/default/original/1X/0d4edea9419df66ea8d93d68bb4b566ebc3959bd.jpg)

---

<div class="post-metadata">

### Author: ![rsmith](https://community.mrtrix.org/user_avatar/community.mrtrix.org/rsmith/32/2672_2.png) [@rsmith](https://community.mrtrix.org/u/rsmith)
#### Post date: [August 1, 2017, 10:37pm UTC](https://community.mrtrix.org/t/mrtrix-3-0-release-candidate-2/1065/5 "2017-08-01T22:37:12Z")

</div>

### `fixelcfestats` now supports `-mask` option

Due to popular demand (including my own), `fixelcfestats` now has a new option `-mask`. Note that this is a _fixel_ mask, _not_ a 3D voxel mask image.

Additionally, during the process of implementing this, I changed some of the internal fixel stats code such that, for my own test case, I experienced a 75% reduction in execution time 💪 (Note that in some instances, the memory usage of `fixelcfestats` may appear to drop drastically during permutation testing, e.g. from 50% to 4%; this is not cause for concern).

---

<div class="post-metadata">

### Author: ![bjeurissen](https://community.mrtrix.org/user_avatar/community.mrtrix.org/bjeurissen/32/28_2.png) [@bjeurissen](https://community.mrtrix.org/u/bjeurissen)
#### Post date: [August 1, 2017, 10:37pm UTC](https://community.mrtrix.org/t/mrtrix-3-0-release-candidate-2/1065/6 "2017-08-01T22:37:52Z")

</div>

### `mrdegibbs`: a new command to remove Gibbs ringing artefacts

This new command implements the method of local subvoxel shifts recently proposed by Elias Kellner et al. ([Magn Reson Med. 2016; 76:1574-1581](https://www.ncbi.nlm.nih.gov/pubmed/26745823)) to remove Gibbs ringing artefacts. This is likely to become an important part of the DWI preprocessing chain, given how prominent these artefacts can be particularly in the _b_=0 images, and their corresponding impact on the image analysis.

For optimal performance, we recommend you install the [FFTW library](http://www.fftw.org/) (and associated headers), and re-run the `./configure` step to make sure the command makes use of it. While FFTW is not a hard requirement (Eigen provides a decent fallback implementation), it does result in considerably faster execution (approximately half the runtime).

Note that this command has been added very recently, and has therefore not been subjected to any community testing. However, on our data, it provides identical results to the [authors’ original implementation](https://bitbucket.org/reisert/unring), while being substantially faster due to the use of multi-threading. We’re fairly confident in our implementation, but if you do notice any unexpected behaviour, please report it!

---

<div class="post-metadata">

### Author: ![maxpietsch](https://community.mrtrix.org/user_avatar/community.mrtrix.org/maxpietsch/32/25_2.png) [@maxpietsch](https://community.mrtrix.org/u/maxpietsch)
#### Post date: [August 1, 2017, 10:47pm UTC](https://community.mrtrix.org/t/mrtrix-3-0-release-candidate-2/1065/7 "2017-08-01T22:47:54Z")

</div>

### `population_template` voxel size handling

The voxel size of the template produced by `population_template` was previously automatically determined from the input images. However, this resulted in suboptimal outcomes under some circumstances, particularly when large rotations exist between the different input images. Furthermore, it became apparent that different voxel sizes were required in different scenarios. To deal with these issues, a new option has been added to `population_template` to allow the output voxel size to be set manually. We encourage users to set the desired voxel size of their template manually, as is now recommended in the [fixel-based analysis documentation](https://mrtrix.readthedocs.io/en/latest/fixel_based_analysis/st_fibre_density_cross-section.html).

---

<div class="post-metadata">

### Author: ![jdtournier](https://community.mrtrix.org/user_avatar/community.mrtrix.org/jdtournier/32/2594_2.png) [@jdtournier](https://community.mrtrix.org/u/jdtournier)
#### Post date: [August 1, 2017, 10:57pm UTC](https://community.mrtrix.org/t/mrtrix-3-0-release-candidate-2/1065/8 "2017-08-01T22:57:31Z")

</div>

### correction to energy term in `dirgen`

The energy term assumed in the cost function for `dirgen` and other associated commands (e.g. `dirstats`, `dirsplit`, `dirmerge`, …) was incorrect, assuming a 1/r² relationship, when this should be 1/r (corresponding to a 1/r² repulsion force). Thanks to @Kerstin for reporting this.

This has now been rectified, and will change the directions generated by `dirgen` slightly, and also affect the energy values reported by `dirstats`. Thankfully, it seems the differences are minor, and not necessarily anything to worry about (see [full discussion on GitHub](https://github.com/MRtrix3/mrtrix3/pull/1050) for details).

In addition, `dirgen` has been modified to perform multiple random restarts (10 by default) to ensure a more globally optimal solution is found.

---

<div class="post-metadata">

### Author: ![jdtournier](https://community.mrtrix.org/user_avatar/community.mrtrix.org/jdtournier/32/2594_2.png) [@jdtournier](https://community.mrtrix.org/u/jdtournier)
#### Post date: [August 1, 2017, 11:17pm UTC](https://community.mrtrix.org/t/mrtrix-3-0-release-candidate-2/1065/9 "2017-08-01T23:17:44Z")

</div>

### Improved handling of multi-type DICOM series

DICOM series can contain images with different `ImageType` tags, which can have different properties. This may mean that a single series might contain images with different dimensions or different data scaling parameters; in such cases, _MRtrix3_ applications would have failed to read the data, producing an error message indicating the reason. This is a common occurrence on Philips DWI data (which frequently includes a computed mean DWI image at the end), or Siemens reformatted (MPR) data (which typically includes a separate image indicating the orientation of the reformatted slices).

This update now splits these different `ImageType`s out into distinct selections, making it possible to read these data correctly. This does mean that the datasets containing series with multiple `ImageType` data will show up with different numbering in the command-line selection menu than might have been the case to date (see [discussion on GitHub](https://github.com/MRtrix3/mrtrix3/pull/1056) for an example). This will hopefully only affect those users relying on these numbers to [script their data imports](http://mrtrix.readthedocs.io/en/latest/tips_and_tricks/dicom_handling.html#loading-dicom-data-from-scripts) - the numbers used will most likely need to be amended to match.

---

<div class="post-metadata">

### Author: ![jdtournier](https://community.mrtrix.org/user_avatar/community.mrtrix.org/jdtournier/32/2594_2.png) [@jdtournier](https://community.mrtrix.org/u/jdtournier)
#### Post date: [August 3, 2017, 9:38pm UTC](https://community.mrtrix.org/t/mrtrix-3-0-release-candidate-2/1065/10 "2017-08-03T21:38:19Z")

</div>

### support for reading TIFF images

Rudimentary support has now been added to import TIFF images, whether as a series of individual slices, or as a single multi-page TIFF. RGB images will appear as 4D images with 3 volumes, one for each of the red, green & blue channels. Multi-page TIFFs will be loaded with each page assumed to correspond to a different slice.

To be able to use this fully relies on _MRtrix3_’s existing [numbered image support](http://mrtrix.readthedocs.io/en/latest/getting_started/image_data.html#multi-file-numbered-image-support) to load a set of image slices or volumes. It will also most likely require further adjustments to various parameters, notably the voxel size, the orientation of the data, and the ordering of the axes.

#### Examples

To convert a set of single-slice RGB TIFFs as-is:

```auto
$ mrconvert tiff/images-[].tif out.nii

```

This will result in a 5D image, since each TIFF image is concatenated along the last dimension. In other words, the image will look something like this (assuming there were 64 TIFF images):

```auto
$ mrinfo out.nii
************************************************
Image: "b0.nii"
************************************************
  Dimensions: 96 x 96 x 1 x 3 x 64

```

To deal with this, you can use the `-axes` option to permute the data:

```auto
$ mrconvert tiff/images-[].tif out.nii -axes 0,1,4,3

```

giving the expected result:

```auto
$ mrinfo out.nii
************************************************
Image: "b0.nii"
************************************************
  Dimensions: 96 x 96 x 64 x 3

```

You can also use the `-vox` option to set the correct voxel dimensions, and if needed changes the order of the axes to rotate the data as required.

Loading a multi-page tiff is simpler since each page in the file is assumed to correspond to a different slice. Again, an RGB image will be imported as a 4D image. If required, a set of multi-page TIFF images can be imported as a single dataset using _MRtrix3_’s [numbered file support](http://mrtrix.readthedocs.io/en/latest/getting_started/image_data.html#multi-file-numbered-image-support).

In due course, we hope to add support for TIFF export (the issue is [already listed on GitHub](https://github.com/MRtrix3/mrtrix3/issues/1032))

---

<div class="post-metadata">

### Author: ![rsmith](https://community.mrtrix.org/user_avatar/community.mrtrix.org/rsmith/32/2672_2.png) [@rsmith](https://community.mrtrix.org/u/rsmith)
#### Post date: [May 14, 2018, 12:50am UTC](https://community.mrtrix.org/t/mrtrix-3-0-release-candidate-2/1065/15 "2018-05-14T00:50:36Z")

</div>


