# MRtrix 3.0.4 release

**URL:** https://community.mrtrix.org/t/mrtrix-3-0-4-release/6263
**Category:** Announcements
**Created:** [December 16, 2022, 11:57am UTC](https://community.mrtrix.org/t/mrtrix-3-0-4-release/6263 "2022-12-16T11:57:31Z")
**Posts on this page:** 4
**Page:** 1

<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: [December 16, 2022, 11:57am UTC](https://community.mrtrix.org/t/mrtrix-3-0-4-release/6263/1 "2022-12-16T11:57:31Z")

</div>

We are pleased to announce the immediate release of _MRtrix_ `3.0.4`.

This is a bug fix release – this should not affect ongoing studies, other than in exceptionally rare circumstances. We recommend users upgrade as soon as practical, using the instructions provided on our [downloads pages](https://www.mrtrix.org/download/) (for precompiled packages), or the [usual procedure](https://mrtrix.readthedocs.io/en/3.0.4/installation/build_from_source.html#keeping-mrtrix3-up-to-date) for installations from source.

See the [full changelog below](https://community.mrtrix.org/t/mrtrix-3-0-4-release/6263/2) for details.

All the best from the _MRtrix3_ team!

---

<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: [December 16, 2022, 11:59am UTC](https://community.mrtrix.org/t/mrtrix-3-0-4-release/6263/2 "2022-12-16T11:59:05Z")

</div>

# Full changelog

* * *

## Package setup

- [![](https://github.com/jdtournier.png?size=24)](https://github.com/jdtournier) [`configure`: ignore `CFLAGS` & `LDFLAGS` from `qmake`](https://github.com/MRtrix3/mrtrix3/pull/2445)  
Prevent the LTO options introduced with Qt 5.15 from causing non-trivial conflicts with `clang++`.

- [![](https://github.com/jdtournier.png?size=24)](https://github.com/jdtournier) [Eigen 3.4 compatibility](https://github.com/MRtrix3/mrtrix3/pull/2368)  
Fixes compilation from source on macOS, since homebrew now ships with Eigen 3.4.

- [![](https://github.com/jdtournier.png?size=24)](https://github.com/jdtournier) [Fix MIME & icon handling on linux](https://github.com/MRtrix3/mrtrix3/pull/2478)  
On Linux, the `./install_mime_types.sh` command should now produce a working launcher for `mrview`, with recognised mime types that launch correctly and show up with the MRtrix icon.

- [![](https://github.com/jdtournier.png?size=24)](https://github.com/jdtournier) [`build`: Fix build progress](https://github.com/MRtrix3/mrtrix3/pull/2494)  
Prevents the different lines on the build progress feedback from claiming that there are different numbers of total compilation tasks.

## Containers

- [![](https://github.com/Lestropie.png?size=24)](https://github.com/Lestropie) [Multiple changes](https://github.com/MRtrix3/mrtrix3/pull/2370) ([2](https://github.com/MRtrix3/mrtrix3/pull/2461)):
  - Embed licenses of external neuroimaging software packages in the container.
  - Fix missing FSL command `fslsplit` when running `dwifslpreproc` with `-eddy_options " ... --cnr_maps ..."`
  - Fix direct invocation of Singularity containers as executable
  - Fix `mrview` appearance in Singularity when built based on the Docker container.
  - Various fixes to mitigate warning messages when invoking containerized `mrview`  
(Note that some of these involve revisions to [documentation instructions](https://mrtrix.readthedocs.io/en/3.0.4/installation/using_containers.html))

## Documentation

- [![](https://github.com/Lestropie.png?size=24)](https://github.com/Lestropie) [`CONTRIBUTING.md`: General revisions](https://github.com/MRtrix3/mrtrix3/pull/2358) ([2](https://github.com/MRtrix3/mrtrix3/pull/2402))  
Based on interactions with both internal and external contributors, revise and clarify [documentation page](https://github.com/MRtrix3/mrtrix3/blob/master/CONTRIBUTING.md) that provides guidance for generation of novel _MRtrix3_ contributions.

- [![](https://github.com/fionaEyoung.png?size=24)](https://github.com/fionaEyoung) [Fix link to advanced debugging help page](https://github.com/MRtrix3/mrtrix3/pull/2403)  
Replace dead hyperlink with one to relevant wiki page on community forum.

- [![](https://github.com/fionaEyoung.png?size=24)](https://github.com/fionaEyoung) [Fixels (and Dixels): Double negative typo](https://github.com/MRtrix3/mrtrix3/pull/2398)  
Tiny fix affecting [Fixel docs page](https://mrtrix.readthedocs.io/en/latest/concepts/fixels_dixels.html)

- [![](https://github.com/Lestropie.png?size=24)](https://github.com/Lestropie) [`README.md`: Add Twitter reference](https://github.com/MRtrix3/mrtrix3/pull/2395)  
Thanks to [BIDS Specification](https://github.com/bids-standard/bids-specification/blob/master/README.md) for the idea.

## Specific commands

- `connectomestats`:

- [![](https://github.com/Lestropie.png?size=24)](https://github.com/Lestropie) [`dwicat`: Support 3D images](https://github.com/MRtrix3/mrtrix3/pull/2366)  
Fixes processing when an input image to `dwicat` is a 3D image containing a single _b_=0 volume.

- `dwifslpreproc`:

- [![](https://github.com/bjeurissen.png?size=24)](https://github.com/bjeurissen) [`dwi2response manual`: avoid unnecessary brain mask calculation](https://github.com/MRtrix3/mrtrix3/pull/2373)  
This algorithm is based entirely on manual selection of voxels, and therefore execution of a brain masking algorithm is superfluous. This step is now appropriately skipped.

- [![](https://github.com/Lestropie.png?size=24)](https://github.com/Lestropie) [`mrconvert`: Fix gradient table export](https://github.com/MRtrix3/mrtrix3/pull/2508)  
Export external gradient table files in the specific use case where only a linear transform is applied.

- [![](https://github.com/bjeurissen.png?size=24)](https://github.com/bjeurissen) [`mrclusterstats`: Fix for multiple variance groups](https://github.com/MRtrix3/mrtrix3/pull/2507)  
Where multiple variance groups are used, command was erroneously trying to write the standard deviation map for all variance groups to a single image path.

- [![](https://github.com/Lestropie.png?size=24)](https://github.com/Lestropie) [`mrtransform`: DWI grad export](https://github.com/MRtrix3/mrtrix3/pull/2508)  
Where it is requested that the DWI gradient table be exported to an external file, such export erroneously did not occur if only a linear transform was applied.

- `mrview`:

- [![](https://github.com/bjeurissen.png?size=24)](https://github.com/bjeurissen) [`population_template`: Correct transformation of mask data](https://github.com/MRtrix3/mrtrix3/pull/2503)  
Where initial alignment was explicitly disabled by the user, `mrtransform` was erroneously applied to the last contrast instead of the mask.

- `tckconvert`:

- [![](https://github.com/Lestropie.png?size=24)](https://github.com/Lestropie) [`tcksift2`: Fix fixel masking](https://github.com/MRtrix3/mrtrix3/pull/2447)  
Fixels that are only traversed by a solitary streamline will now be excluded from the optimisation as originally intended.

- [![](https://github.com/bjeurissen.png?size=24)](https://github.com/bjeurissen) [`tensor2metric`: avoid crash when supplying input with wrong size](https://github.com/MRtrix3/mrtrix3/pull/2423)  
Check if the input image consists of 6 volumes, and thus can be interpreted as tensor data.

- [![](https://github.com/bjeurissen.png?size=24)](https://github.com/bjeurissen) [`population_template`: Fix incorrect handling of masks when using `-initial_alignment none`](https://github.com/MRtrix3/mrtrix3/pull/2503)  
When no initial alignment was requested, the last available contrast was transformed as opposed to the mask. This would lead to unwanted behaviour (in case of a scalar contrast) or an exception (in case of an ODF). Only affected outcome of population\_template when initial alignment was explicitly turned off, so most studies are probably not affected.

- [![](https://github.com/bjeurissen.png?size=24)](https://github.com/bjeurissen) [`mrclusterstats`: Fix incorrect writing of standard deviation maps when using multiple variance blocks](https://github.com/MRtrix3/mrtrix3/pull/2507)  
When multiple variance blocks were specified with the `-variance` option, all of the output standard deviation maps were written to the same file instead of a different file per variance block.

## Multiple commands

#### DICOM handling

- [![](https://github.com/jdtournier.png?size=24)](https://github.com/jdtournier) [Various Philips data handling updates](https://github.com/MRtrix3/mrtrix3/pull/2450):

- [![](https://github.com/jdtournier.png?size=24)](https://github.com/jdtournier) [Import additional Siemens enhanced fields](https://github.com/MRtrix3/mrtrix3/pull/2466)  
Fixes absent fields `SliceTiming`, `EchoTime`, `MultibandAccelerationFactor` & `SliceEncodingDirection` for some data.

- [![](https://github.com/jdtournier.png?size=24)](https://github.com/jdtournier) [Fix XA10A data parsing](https://github.com/MRtrix3/mrtrix3/pull/2462)  
Thanks to @neurolabusc for contributions to resolving these issues.

- [![](https://github.com/jdtournier.png?size=24)](https://github.com/jdtournier) [Fix GE data gradient table import](https://github.com/MRtrix3/mrtrix3/pull/2523)  
Thanks to @blezek for reporting, @neurolabusc for assistance in diagnosis and rectification, and [Jaemin Shin](https://github.com/mr-jaemin) for testing, providing test data, and providing insights from GE.

#### PNG handling

- [![](https://github.com/Lestropie.png?size=24)](https://github.com/Lestropie) [Export: Exception on too few axes](https://github.com/MRtrix3/mrtrix3/pull/2535)  
If command-line usage results in too few axes to produce one or more meaningful PNG images, produce a meaningful error message rather than crashing.

#### Streamlines data

- [![](https://github.com/jdtournier.png?size=24)](https://github.com/jdtournier) [Avoid invalid memory access when ROI is malformed in tck header](https://github.com/MRtrix3/mrtrix3/pull/2424)  
If a `.tck` file header contains an entry for the ROI that doesn’t have the expected 2 fields, this leads to a segfault when using e.g. `tckinfo` or `tck2fixel`. The change here consists simply of making sure that if only one token is parsed, a second empty string is added as the second, which then avoids the invalid memory access, and permits these headers to be used (the alternative is simply to ignore them, but I’m not sure that’s the best thing to do here).

## APIs

#### Matlab

- [![](https://github.com/fionaEyoung.png?size=24)](https://github.com/fionaEyoung) [Multiline key-value metadata](https://github.com/MRtrix3/mrtrix3/pull/2455)  
Added handling of struct field with cell array values, which otherwise cause an error as `fprintf` doesn’t take cell array arguments.

#### Python

- [![](https://github.com/Lestropie.png?size=24)](https://github.com/Lestropie) [`mrtrix3.run`: Fix default `MRTRIX_LOGLEVEL`](https://github.com/MRtrix3/mrtrix3/pull/2432)  
Default value for environment variable `MRTRIX_LOGLEVEL` was being erroneously written as an integer type rather than a string. In some environments, the `subprocess` module attempts to check whether environment variables correspond to filesystem paths, and this results in a `TypeError` due to this specific envvar not being a string.

- [![](https://github.com/Lestropie.png?size=24)](https://github.com/Lestropie) [`mrtrix3.utils.RunList`](https://github.com/MRtrix3/mrtrix3/pull/2209)  
Pass kwargs to run.command().

- [![](https://github.com/jdtournier.png?size=24)](https://github.com/jdtournier) [Fix help page generation](https://github.com/MRtrix3/mrtrix3/pull/2425)  
Handle [upstream changes in ArgParse](https://github.com/python/cpython/commit/41b223d29cdfeb1f222c12c3abaccc3bc128f5e7#diff-205ef24c9374465bf35c359abce9211d3aa113e986a1e3d41569eb29d07df479), whereby the name for the default option group has now been changed from ‘optional arguments’ to the (arguably more sensible) ‘options’.

---

<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: [December 16, 2022, 12:00pm UTC](https://community.mrtrix.org/t/mrtrix-3-0-4-release/6263/3 "2022-12-16T12:00:38Z")

</div>



---

<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: [December 16, 2022, 12:01pm UTC](https://community.mrtrix.org/t/mrtrix-3-0-4-release/6263/4 "2022-12-16T12:01:12Z")

</div>


