# Problem with dwiintensitynorm

**URL:** <https://community.mrtrix.org/t/problem-with-dwiintensitynorm/1803>\
**Category:** Uncategorized\
**Created:** [July 31, 2018, 8:17pm UTC](https://community.mrtrix.org/t/problem-with-dwiintensitynorm/1803 "2018-07-31T20:17:10Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![zeydabadi](https://community.mrtrix.org/user_avatar/community.mrtrix.org/zeydabadi/32/1425_2.png) [@zeydabadi](https://community.mrtrix.org/u/zeydabadi)\
**Post date:** [July 31, 2018, 8:17pm UTC](https://community.mrtrix.org/t/problem-with-dwiintensitynorm/1803/1 "2018-07-31T20:17:10Z")

</div>

Hello all,  
I am trying to implement Fibre density and cross-section - Single-tissue CSD pipeline on a Linux based cluster.  
Here is the OS and MRtrix version that I’m using:

`Linux node8.cluster 3.10.0-693.11.6.el7.x86_64 #1 SMP Thu Jan 4 01:06:37 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux`

`MRtrix 3.0_RC2-10-g7b4c28ab dwiintensitynorm bin version: 3.0_RC2-10-g7b4c28ab`

My diffusion data were collected on a Siemens 3T Tim Trio and has 6 b0 volumes followed by 61 diffusion volumes.

I converted the nifiti files to mif format using the mrconvert command.

After running the following command:

`dwiintensitynorm $1/dwiintensitynorm/dwi_input/ $1/dwiintensitynorm/mask_input/ $1/dwiintensitynorm/dwi_output/ $1/dwiintensitynorm/fa_template.nii.gz $1/dwiintensitynorm/fa_template_wm_mask.nii.gz`

I receive this error:

```
dwiintensitynorm:
dwiintensitynorm: [ERROR] Command failed: dwinormalise /home/data/dwiintensitynorm/dwi_input/00039-03-02_CSI20160108.mif wm_mask_warped/00039-03-02_CSI20160108.mif /home/data/dwiintensitynorm/dwi_output/00039-03-02_CSI20160108.mif (dwiintensitynorm:102)
dwiintensitynorm: Output of failed command:
dwinormalise: computing 50th percentile within mask... [==================================================]

dwinormalise: [SYSTEM FATAL CODE: SIGSEGV (11)] Segmentation fault: Invalid memory access
dwiintensitynorm: Changing back to original directory (/home/data)
dwiintensitynorm: Script failed while executing the command: dwinormalise /home/data/dwiintensitynorm/dwi_input/00039-03-02_CSI20160108.mif wm_mask_warped/00039-03-02_CSI20160108.mif /home/data/dwiintensitynorm/dwi_output/00039-03-02_CSI20160108.mif
dwiintensitynorm: For debugging, inspect contents of temporary directory: /home/data/dwiintensitynorm-tmp-KI8710/

```

Any idea what’s going wrong?

PS: I tried to run dwiintensitynorm with - debug - nthread 0 switches but after 3 days of running it was still running and I had to give up.

Thank you,  
Mahmoud

---

<div class="post-metadata">

**Author:** ![zeydabadi](https://community.mrtrix.org/user_avatar/community.mrtrix.org/zeydabadi/32/1425_2.png) [@zeydabadi](https://community.mrtrix.org/u/zeydabadi)\
**Post date:** [August 1, 2018, 6:10pm UTC](https://community.mrtrix.org/t/problem-with-dwiintensitynorm/1803/2 "2018-08-01T18:10:55Z")

</div>

As an update, I could finally get some results out of the dwiintensitnorm by removing some of the subjects but the output FA template does not seem to be right and it’s kinda skewed.

 ![FA_Template](https://community.mrtrix.org/uploads/default/original/2X/b/b9b8c0a02d736447690b09befead933ebca72ce5.PNG)

I appreciate any comments as I stopped at this step for a long time.

Thanks,  
Mahmoud

---

<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, 2018, 6:50pm UTC](https://community.mrtrix.org/t/problem-with-dwiintensitynorm/1803/3 "2018-08-01T18:50:39Z")

</div>

Looks like a registration problem, which is usually caused by a problem with the data. Usual suspects are artefacts in DWI data, bad masks or the absence of masks. Have a look at the FA images in the subfolder `fa` in your temporary directory `dwiintensitynorm-tmp-*` and at the transformed images and masks in the subfolder `population_template`. You can do this while the script is running.

The segfault in `dwinormalise` is a bug that might be related to the poor registration. Have a look at `/home/data/dwiintensitynorm/dwi_input/00039-03-02_CSI20160108.mif` and `wm_mask_warped/00039-03-02_CSI20160108.mif /home/data/dwiintensitynorm/dwi_output/00039-03-02_CSI20160108.mif`

You can count voxels in each mask with `mrstats path_to_dwiintensitynorm-tmp/wm_mask_warped/*.mif -ignorezero -output count` or just use `mrview` to go through them.
