# Segmentation fault: 11 with DWIConvert

**URL:** <https://discourse.slicer.org/t/segmentation-fault-11-with-dwiconvert/3989>\
**Category:** Support\
**Tags:** diffusion\
**Created:** [September 5, 2018, 12:30pm UTC](https://discourse.slicer.org/t/segmentation-fault-11-with-dwiconvert/3989 "2018-09-05T12:30:44Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![alca](https://avatars.discourse-cdn.com/v4/letter/a/7ab992/32.png) [@alca](https://discourse.slicer.org/u/alca)\
**Post date:** [September 5, 2018, 12:30pm UTC](https://discourse.slicer.org/t/segmentation-fault-11-with-dwiconvert/3989/1 "2018-09-05T12:30:44Z")

</div>

Dear Slicer experts,

I am trying to use DTIConvert to convert nrrd to nii (–conversionMode NrrdToFSL) on the data that were previously preprocessed by DTIPrep (before that I successfully converted them from nii to nrrd), but I am receiving the error message “Segmentation fault: 11”. Any idea what went wrong?

Looking forward to your response.

Best

Alena

---

<div class="post-metadata">

**Author:** ![alca](https://avatars.discourse-cdn.com/v4/letter/a/7ab992/32.png) [@alca](https://discourse.slicer.org/u/alca)\
**Post date:** [September 7, 2018, 11:30am UTC](https://discourse.slicer.org/t/segmentation-fault-11-with-dwiconvert/3989/2 "2018-09-07T11:30:13Z")

</div>

Operating system: Mac Os  
Slicer version: 4.8.1

I am trying to use DWIConvert to convert nrrd to nii (–conversionMode NrrdToFSL) on the data that were previously preprocessed by DTIPrep (before that I successfully converted them from nii to nrrd), but I am receiving the error message “Segmentation fault: 11”. Any idea what went wrong?

Best

Alena

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [September 7, 2018, 12:40pm UTC](https://discourse.slicer.org/t/segmentation-fault-11-with-dwiconvert/3989/3 "2018-09-07T12:40:28Z")

</div>

Does DTIConvert in _latest nightly version_ of Slicer work well?

---

<div class="post-metadata">

**Author:** ![alca](https://avatars.discourse-cdn.com/v4/letter/a/7ab992/32.png) [@alca](https://discourse.slicer.org/u/alca)\
**Post date:** [September 10, 2018, 7:50am UTC](https://discourse.slicer.org/t/segmentation-fault-11-with-dwiconvert/3989/4 "2018-09-10T07:50:04Z")

</div>

Haven’t tried that I only used 4.8.1 and when it did not work the version of DWIConvert from GitHub.

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [September 10, 2018, 5:57pm UTC](https://discourse.slicer.org/t/segmentation-fault-11-with-dwiconvert/3989/5 "2018-09-10T17:57:23Z")

</div>

Could you please try if DTIConvert in _latest nightly version_ of Slicer works as expected?

---

<div class="post-metadata">

**Author:** ![ihnorton](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/ihnorton/32/9_2.png) [@ihnorton](https://discourse.slicer.org/u/ihnorton)\
**Post date:** [October 3, 2018, 8:28pm UTC](https://discourse.slicer.org/t/segmentation-fault-11-with-dwiconvert/3989/6 "2018-10-03T20:28:19Z")

</div>

> [@alca](#):
>
> Any idea what went wrong?

You may need to use the `--allowLossyConversion` option (if your data can be converted safely). Aside from that, it is very hard to say without more information – the command line you used, example data, etc.

---

<div class="post-metadata">

**Author:** ![ihnorton](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/ihnorton/32/9_2.png) [@ihnorton](https://discourse.slicer.org/u/ihnorton)\
**Post date:** [October 3, 2018, 8:33pm UTC](https://discourse.slicer.org/t/segmentation-fault-11-with-dwiconvert/3989/7 "2018-10-03T20:33:45Z")

</div>

In case it helps, here is an example command line I wrote in a script earlier:

```auto
DWIConvert --conversionMode NrrdToFSL \
    --inputVolume dwi.nhdr \
    --outputBVectors dwi.bvec \
    --outputBValues dwi.bval \
    --outputNiftiFile dwi.nii

```

---

<div class="post-metadata">

**Author:** ![Drew](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/drew/32/2562_2.png) [@Drew](https://discourse.slicer.org/u/Drew)\
**Post date:** [November 15, 2018, 11:26pm UTC](https://discourse.slicer.org/t/segmentation-fault-11-with-dwiconvert/3989/8 "2018-11-15T23:26:59Z")

</div>

I’m also experiencing this issue, first with the newest stable version, and also with the latest nightly build. I’m simply trying to convert between nifti format and .nrrd to QC in DTIPrep, but DWIConvert is not working to convert from the .nrrd back to .nii. Any suggestions?

---

<div class="post-metadata">

**Author:** ![ljod](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/ljod/32/652_2.png) [@ljod](https://discourse.slicer.org/u/ljod)\
**Post date:** [November 16, 2018, 6:33pm UTC](https://discourse.slicer.org/t/segmentation-fault-11-with-dwiconvert/3989/9 "2018-11-16T18:33:40Z")

</div>

Have you tried the options and suggestions above? Such as the lossy conversion? It is hard to give more advice without more information (see the information Isaiah requests above for a list that can help us). Also please try the example command line, or try using those options in the GUI.

---

<div class="post-metadata">

**Author:** ![Drew](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/drew/32/2562_2.png) [@Drew](https://discourse.slicer.org/u/Drew)\
**Post date:** [November 16, 2018, 9:03pm UTC](https://discourse.slicer.org/t/segmentation-fault-11-with-dwiconvert/3989/10 "2018-11-16T21:03:13Z")

</div>

Thanks for the reply.

I originally had this issue runnnng it from the command line, but it happens in the GUI as well.  
Without the lossy conversion option, it initially generates an error, “Error: ReadVolume: Unsupported source pixel type”  
When I run it with the lossy conversion option, it changes the error to ‘Segmentation fault: 11’  
I’ve tried it with the stable build (4.10), the nightly build (4.11) and older versions (4.8).

One issue that could possibly contribute to this is that I’ve started with a 4D DWI file in .nii format, that includes 2 separate acquisitions. I extract those into two separate files, split out the b-vectors and b-values, and then convert the resultant .nii files into .nrrd files before running DTIPrep on each .nrrd files. Then, when I try to convert back to .nii, I get these errors.

Any ideas? What other information would be helpful for you?

Many thanks,  
-Drew

---

<div class="post-metadata">

**Author:** ![ihnorton](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/ihnorton/32/9_2.png) [@ihnorton](https://discourse.slicer.org/u/ihnorton)\
**Post date:** [November 20, 2018, 6:52pm UTC](https://discourse.slicer.org/t/segmentation-fault-11-with-dwiconvert/3989/11 "2018-11-20T18:52:54Z")

</div>

Unfortunately, DWIConvert has some crash modes which do not produce informative error messages due to exception handling issues. My guess is that something about your files does not correspond to DWIConvert’s expectation, and it crashes. If you can reproduce your workflow on one of these [public datasets](https://discourse.slicer.org/t/not-working-dwi-component/4793/3?u=ihnorton), and then share the resulting nrrd file with me, then I can take a look.
