# Errors when converting DICOM to NRRD with DWIConvert

**URL:** <https://discourse.slicer.org/t/errors-when-converting-dicom-to-nrrd-with-dwiconvert/1756>\
**Category:** Support\
**Created:** [January 2, 2018, 7:59pm UTC](https://discourse.slicer.org/t/errors-when-converting-dicom-to-nrrd-with-dwiconvert/1756 "2018-01-02T19:59:06Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![atbauman](https://avatars.discourse-cdn.com/v4/letter/a/cdc98d/32.png) [@atbauman](https://discourse.slicer.org/u/atbauman)\
**Post date:** [January 2, 2018, 7:59pm UTC](https://discourse.slicer.org/t/errors-when-converting-dicom-to-nrrd-with-dwiconvert/1756/1 "2018-01-02T19:59:06Z")

</div>

I am having difficulty converting DICOM files to nrrd using the DWIConvert module.

The following command gives the output below:

`DWIConvert --inputDicomDirectory /path/to/dicom/files --outputVolume output.nrrd`

```
======= DWI Convert Public Lib Ctest =========
Exception creating converter
itk::ExceptionObject (0x2f769d0)
Location: "unknown"
File: /home/kitware/Dashboards/Nightly/Slicer-0-build/BRAINSTools/DWIConvert/GenericDWIConverter.cxx
Line: 13
Description: itk::ERROR: LoadFromDisk not relevant
```

---

<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:** [January 2, 2018, 8:23pm UTC](https://discourse.slicer.org/t/errors-when-converting-dicom-to-nrrd-with-dwiconvert/1756/2 "2018-01-02T20:23:30Z")

</div>

Please add `--conversionMode DicomToNrrd` to the command line.

(not sure if Andras was helping you, but, x-ref [DWI loading from DICOM](https://discourse.slicer.org/t/dwi-loading-from-dicom/1746/3) which I’m looking at right now)

---

<div class="post-metadata">

**Author:** ![atbauman](https://avatars.discourse-cdn.com/v4/letter/a/cdc98d/32.png) [@atbauman](https://discourse.slicer.org/u/atbauman)\
**Post date:** [January 2, 2018, 8:39pm UTC](https://discourse.slicer.org/t/errors-when-converting-dicom-to-nrrd-with-dwiconvert/1756/3 "2018-01-02T20:39:25Z")

</div>

I have the same error after `--conversionMode DicomToNrrd` was added. I assumed DicomToNrrd was the default so I left it out the first time.

I have also just run DWIConvert through the GUI and receive the same error.

---

<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:** [January 2, 2018, 9:25pm UTC](https://discourse.slicer.org/t/errors-when-converting-dicom-to-nrrd-with-dwiconvert/1756/4 "2018-01-02T21:25:28Z")

</div>

Is the data in [this question](https://discourse.slicer.org/t/dwi-loading-from-dicom/1746/3) yours? I just evaluated the sample data @lassoan shared there, for a similar error. If so, then we should consolidate the threads and figure out next steps. See:

> [@DWI loading from DICOM](https://discourse.slicer.org/t/dwi-loading-from-dicom/1746/5):
>
> Thanks for sharing the data. The DWI sequence is 1866: BWH003265:1861 inorton$ for f in \*; do echo $f; dcmdump $f/$(ls $f | head -n 1) | grep Description; done 1863 (0008,1030) LO [NEURO HEAD^BRAIN] # 16, 1 StudyDescription (0008,103e) LO [localizer] # 10, 1 SeriesDescription 1864 (0008,1030) LO [NEURO HEAD^BRAIN] # 16, 1 StudyDescription (0008,103e) LO [SAG TSE T1] # 10, 1 SeriesDescriptio…

---

<div class="post-metadata">

**Author:** ![atbauman](https://avatars.discourse-cdn.com/v4/letter/a/cdc98d/32.png) [@atbauman](https://discourse.slicer.org/u/atbauman)\
**Post date:** [January 2, 2018, 9:59pm UTC](https://discourse.slicer.org/t/errors-when-converting-dicom-to-nrrd-with-dwiconvert/1756/5 "2018-01-02T21:59:44Z")

</div>

No I am using different data than Andras. I am using data exported from a Bruker scanner (7T biospec). I am getting the same error on all the Bruker data I have tried (Diffusion and non-diffusion data).

Though I wonder if this is the wrong approach for what I am trying to do. I am hoping to automatically convert all DICOM files to Nrrd as data is acquired. What I have been doing is using the DICOM module to import data into slicer and then just saving as nrrd within the GUI. I thought the DWIConvert command line interface might be able to help me automate this.

---

<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:** [January 2, 2018, 10:18pm UTC](https://discourse.slicer.org/t/errors-when-converting-dicom-to-nrrd-with-dwiconvert/1756/6 "2018-01-02T22:18:06Z")

</div>

I haven’t used DWIConvert with Bruker data, diffusion or otherwise, and the error message is not very helpful, unfortunately. But I do know there is currently no support for Bruker diffusion specifically in DWIConvert (this is a small animal magnet, correct?). If the non-diffusion volumes are “relatively sane” it probably could/should work but may require a bug report with sample data.

If the Slicer DICOM module interface works well, most steps should be accessible via a [script in Python](https://www.slicer.org/wiki/Documentation/Nightly/Developers/Python_scripting), as an alternative automation approach.

---

<div class="post-metadata">

**Author:** ![atbauman](https://avatars.discourse-cdn.com/v4/letter/a/cdc98d/32.png) [@atbauman](https://discourse.slicer.org/u/atbauman)\
**Post date:** [January 3, 2018, 12:27am UTC](https://discourse.slicer.org/t/errors-when-converting-dicom-to-nrrd-with-dwiconvert/1756/7 "2018-01-03T00:27:42Z")

</div>

Yes it is a small animal magnet. Just scripting it with python does seem like it is probably the way to go. Thanks!

---

<div class="post-metadata">

**Author:** ![zjx1805](https://avatars.discourse-cdn.com/v4/letter/z/f08c70/32.png) [@zjx1805](https://discourse.slicer.org/u/zjx1805)\
**Post date:** [April 10, 2018, 3:29pm UTC](https://discourse.slicer.org/t/errors-when-converting-dicom-to-nrrd-with-dwiconvert/1756/8 "2018-04-10T15:29:48Z")

</div>

Hi atbauman,

I am having the same issue as you. However, I could not figure out how you solved it from the selected solution. Would you mind elaborate a little bit? Thanks!

---

<div class="post-metadata">

**Author:** ![atbauman](https://avatars.discourse-cdn.com/v4/letter/a/cdc98d/32.png) [@atbauman](https://discourse.slicer.org/u/atbauman)\
**Post date:** [April 11, 2018, 7:20pm UTC](https://discourse.slicer.org/t/errors-when-converting-dicom-to-nrrd-with-dwiconvert/1756/9 "2018-04-11T19:20:16Z")

</div>

Hi @zjx1805 ,

I suppose calling this solved is not entirely accurate. I solved my issue of converting DICOM files to NRRD, though I ended up doing this without using the DWIConvert module. Instead I wrote a python script using Slicer’s python interpreter instead. The script basically uses the DICOM browser module to import dicom files, and then the Save module to convert them to NRRD. I was able to suppress all the graphical windows so the script can be run without actually opening the Slicer GUI.

---

<div class="post-metadata">

**Author:** ![zjx1805](https://avatars.discourse-cdn.com/v4/letter/z/f08c70/32.png) [@zjx1805](https://discourse.slicer.org/u/zjx1805)\
**Post date:** [April 11, 2018, 7:45pm UTC](https://discourse.slicer.org/t/errors-when-converting-dicom-to-nrrd-with-dwiconvert/1756/10 "2018-04-11T19:45:37Z")

</div>

Thank you for the clarification!
