# DWI loading from DICOM

**URL:** <https://discourse.slicer.org/t/dwi-loading-from-dicom/1746>\
**Category:** Support\
**Tags:** diffusion\
**Created:** [December 30, 2017, 10:33pm UTC](https://discourse.slicer.org/t/dwi-loading-from-dicom/1746 "2017-12-30T22:33:44Z")\
**Posts on this page:** 10\
**Page:** 1

<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:** [December 30, 2017, 10:33pm UTC](https://discourse.slicer.org/t/dwi-loading-from-dicom/1746/1 "2017-12-30T22:33:45Z")

</div>

I’ve tried to load an MRI study from DICOM that contained DWI series (Slicer 4.8.1 on Windows). Although I’ve installed SlierDMRI extension, the series was still loaded using scalar volume importer and appeared garbled.

 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/7/7/77dc61475e9028d2910211d4a53affae0a59ef32.png)

Is this behavior expected? There used to be a DICOM importer plugin for diffusion data but it seems that it is not available in 4.8.1.

---

<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:** [December 31, 2017, 1:05am UTC](https://discourse.slicer.org/t/dwi-loading-from-dicom/1746/2 "2017-12-31T01:05:08Z")

</div>

Can you please try DWIConvert and let me know if there is a problem loading directly?

> [@lassoan](#):
>
> There used to be a DICOM importer plugin for diffusion data but it seems that it is not available in 4.8.1.

I’m not sure where this discussion was (maybe MultiVolumeImporter), but we removed it from Slicer base because there were several complaints about it interfering with other plugins – I think either you or Andrey asked to remove it.

I’ll take another look at putting it into SlicerDMRI. DWIConvert has been refactored quite a bit for library use, so maybe now it is feasible to hook in to the heuristics there to get an accurate response (the existing code did not work very well for Siemens, which requires looking into the private header for a large percent of images).

---

<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:** [December 31, 2017, 1:51am UTC](https://discourse.slicer.org/t/dwi-loading-from-dicom/1746/3 "2017-12-31T01:51:31Z")

</div>

I’ve tried DWIConvert. On the DICOM DVD I had my data in 7 subfolders.

- When I specified the parent folder, the import failed (no files in the parent folder).
- Then I copied all files into a single folder and tried to import that. I got `LoadFromDisk not relevant` error.
- After that I tried each of the 7 directories one by one. Import failed with the same message as above (`LoadFromDisk not relevant`).

```
Diffusion-weighted DICOM Import (DWIConvert) standard error:

Exception creating converter 
itk::ExceptionObject (00000070D358D430)
Location: "unknown" 
File: D:\D\P\Slicer-481-package\BRAINSTools\DWIConvert\GenericDWIConverter.cxx
Line: 13
Description: itk::ERROR: LoadFromDisk not relevant
```

These may be all user errors, I just could not figure out how to use this module.

Fortunately, this data set was anonymized and made available publicly, so you can try to import it, too: [https://1drv.ms/f/s!Arm\_AFxB9yqHsOArBhZiJ2HPqRA9Cg](https://1drv.ms/f/s!Arm_AFxB9yqHsOArBhZiJ2HPqRA9Cg)

---

<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:** [December 31, 2017, 1:58am UTC](https://discourse.slicer.org/t/dwi-loading-from-dicom/1746/4 "2017-12-31T01:58:57Z")

</div>

The DICOM importer plugin is very useful: we could then avoid painful selection of multiple directories or merging of directories; and would give a single interface for loading all kinds of data from DICOM.

It was a good decision to remove it from the core, but it should be added to SlicerDMRI - the same way as special radiation therapy importers are in SlicerRT extension, and 4D cardiac ultrasound importers are in SlicerHeart. There is very little chance that people who are not interested in diffusion imaging will install SlicerDMRI and then try to load non-diffusion data set that SlicerDMRI will recognize; and if it happens then you can tune the SlicerDMRI importer code any time, without modifying Slicer core. The plugin that worked in Slicer core, should work without any modification in SlicerDMRI extension. You can have a look at SlicerRT or SlicerHeart to see how DICOM plugins are registered.

---

<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:23pm UTC](https://discourse.slicer.org/t/dwi-loading-from-dicom/1746/5 "2018-01-02T21:23:04Z")

</div>

> [@lassoan](#):
>
> I’ve tried DWIConvert. On the DICOM DVD I had my data in 7 subfolders.

Thanks for sharing the data. The DWI sequence is 1866:

```auto
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 SeriesDescription
1865
(0008,1030) LO [NEURO HEAD^BRAIN] # 16, 1 StudyDescription
(0008,103e) LO [AX TSE T2 H.R.] # 14, 1 SeriesDescription
1866
(0008,1030) LO [NEURO HEAD^BRAIN] # 16, 1 StudyDescription
(0008,103e) LO [AX DWI] # 6, 1 SeriesDescription
1867
(0008,1030) LO [NEURO HEAD^BRAIN] # 16, 1 StudyDescription
(0008,103e) LO [AX DWI_ADC] # 10, 1 SeriesDescription
1868
(0008,1030) LO [NEURO HEAD^BRAIN] # 16, 1 StudyDescription
(0008,103e) LO [AX SPACE] # 8, 1 SeriesDescription
1869
(0008,1030) LO [NEURO HEAD^BRAIN] # 16, 1 StudyDescription
(0008,103e) LO [COR MPR] # 8, 1 SeriesDescription

```

But the following basic tags are empty: Manufacturer `(0008,0070)` and Siemens SoftwareVersion `(0018, 1020)` so DWIConvert cannot identify the dataset, and falls back to a generic reader implementation, which fails. Certainly the error message could be improved!

However, this data does not have any diffusion-weighting tags, and there are only three volumes total in series 1866 ([1] looks like baseline, [2,3] look like gradient-weighting). So, it could not be used to calculate diffusion tensors or higher-order models.

I tried converting with dcm2nii, which does produce a valid 3-volume NIfTI, but does not extract any diffusion-weighting information (as expected since there are no tags available).

It looks like this data was very aggressively anonymized. If you have more information about the scanner or other details then we could figure out if the raw data would be supported.

---

<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:36pm UTC](https://discourse.slicer.org/t/dwi-loading-from-dicom/1746/6 "2018-01-02T21:36:19Z")

</div>

> [@lassoan](#):
>
> The DICOM importer plugin is very useful: we could then avoid painful selection of multiple directories or merging of directories; and would give a single interface for loading all kinds of data from DICOM.

Ok, we will put it back in. Hopefully I can pass an error message pointing to DWIConvert through the plugin interface, but I’ll ask questions about that if needed.

---

<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:43pm UTC](https://discourse.slicer.org/t/dwi-loading-from-dicom/1746/7 "2018-01-02T21:43:43Z")

</div>

> [@ihnorton](#):
>
> Certainly the error message could be improved!

I opened the following issue to capture this:

> <https://github.com/BRAINSia/BRAINSTools/issues/361>
>
> There is a \[discussion and example data\](https://discourse.slicer.org/t/dwi-load…ing-from-dicom/1746) on the Slicer forum where some data (I think Siemens originally) fails to convert due to missing tags from aggressive anonymization. DWIConvert falls back to the generic reader, which also fails. The error shown could be more informative:
> 
> \`\`\`
> Diffusion-weighted DICOM Import (DWIConvert) standard error:
> 
> Exception creating converter 
> itk::ExceptionObject (00000070D358D430)
> Location: "unknown" 
> File: D:\\D\\P\\Slicer-481-package\\BRAINSTools\\DWIConvert\\GenericDWIConverter.cxx
> Line: 13
> Description: itk::ERROR: LoadFromDisk not relevant
> \`\`\`
> 
> Ideally DWIConvert could give some descriptive information rather than the exception, and maybe hints/suggestions about common causes of errors (missing tags, anonymization, etc.)

---

<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:** [January 3, 2018, 4:05am UTC](https://discourse.slicer.org/t/dwi-loading-from-dicom/1746/8 "2018-01-03T04:05:08Z")

</div>

I’ve anonymized the data set with [CTP](http://mircwiki.rsna.org/index.php?title=The_CTP_DICOM_Anonymizer#Accessing_the_CTP_Anonymizer_Configurator), with default settings. I can access the original data, if needed.

This is a brain CT+MRI data set of the same patient, which has been made available as “CT-MR Brain” data set in sample data module in recent nightly builds. It is also available here: [http://slicer.kitware.com/midas3/folder/4996](http://slicer.kitware.com/midas3/folder/4996). Do you think there can be anything valuable in the diffusion weighted image that would be worth added to the published data set? If yes, then we can continue working on this, re-anonymizing the data set in a way that preserves necessary information.

---

<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 3, 2018, 2:21pm UTC](https://discourse.slicer.org/t/dwi-loading-from-dicom/1746/9 "2018-01-03T14:21:56Z")

</div>

> [@lassoan](#):
>
> I’ve anonymized the data set with CTP, with default settings. I can access the original data, if needed.

[Here](https://gist.github.com/ihnorton/29fd5eec57c317a5796cacb28938e3ad) is the CTP script I used recently for Siemens DWI data. After anonymization, there were some warnings from `dciodvfy`, and one of our vendor collaborators still thought it was too strict – but four independent software were able to read the data as DWI. Note that some of the preserved tag ranges are Siemens private headers. I don’t recall seeing private data in the CSA headers in the past, but I still do a manual audit of all headers before release because I don’t know of any guarantees about whether protected information is stored in the private tags.

> [@lassoan](#):
>
> Do you think there can be anything valuable in the diffusion weighted image that would be worth added to the published data set?

If the data is as I described above (1 b0, 2 gradient) then it is probably not worth extra effort (can’t calculate ADC even – and tensors require minimum 6 directions). But if there is a full acquisition then I’m always grateful for more sample data, especially if the anonymized DICOM can be shared too. I don’t think we have any MR + DWI-MR + CT datasets, so that would be nice to have.

---

<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:** [January 4, 2018, 4:44pm UTC](https://discourse.slicer.org/t/dwi-loading-from-dicom/1746/10 "2018-01-04T16:44:10Z")

</div>

> [@ihnorton](#):
>
> If the data is as I described above (1 b0, 2 gradient) then it is probably not worth extra effort

We only have those series that I shared, so I’ll not upload the DWI series to the data store then.
