# Segmentation Storage: 1.2.840.10008.5.1.4.1.1.66.4

**URL:** <https://discourse.slicer.org/t/segmentation-storage-1-2-840-10008-5-1-4-1-1-66-4/4274>\
**Category:** Support\
**Tags:** dicom\
**Created:** [October 3, 2018, 3:54pm UTC](https://discourse.slicer.org/t/segmentation-storage-1-2-840-10008-5-1-4-1-1-66-4/4274 "2018-10-03T15:54:22Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![malaterre](https://avatars.discourse-cdn.com/v4/letter/m/82dd89/32.png) [@malaterre](https://discourse.slicer.org/u/malaterre)\
**Post date:** [October 3, 2018, 3:54pm UTC](https://discourse.slicer.org/t/segmentation-storage-1-2-840-10008-5-1-4-1-1-66-4/4274/1 "2018-10-03T15:54:22Z")

</div>

Hi there,

I am browsing through the paper: DICOM for quantitative imaging biomarker development: a standards based approach to sharing clinical data and structured PET/CT analysis results in head and neck cancer research (@fedorov and al.) and near the end I could find the following section:

> Each of these platforms was capable of successfully importing the SEG objects and displaying the encoded segments. An example of the rendering of the segmentations in 3D Slicer is shown in Fig. 8.

After downloading one participant from the TCIA reference, and trying to load the Segmentation Storage instance in 3D Slicer all I could trigger is the following error message:

![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/c/9/c933ba76b680cc86151601f81180c80aa78ff95f.png)

What do I need to be able to load DICOM/SEG instances (singlebit) ?

Thanks much

---

<div class="post-metadata">

**Author:** ![fedorov](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/fedorov/32/14_2.png) [@fedorov](https://discourse.slicer.org/u/fedorov)\
**Post date:** [October 3, 2018, 4:08pm UTC](https://discourse.slicer.org/t/segmentation-storage-1-2-840-10008-5-1-4-1-1-66-4/4274/2 "2018-10-03T16:08:33Z")

</div>

Mathieu, you need to install [QuantitativeReporting](https://qiicr.gitbooks.io/quantitativereporting-guide/content/) extension from Slicer ExtensionManager first. This issue comes up again and again. I did not realize in the PeerJ paper we do not mention the extension. I will add a note to the paper to clarify this. Please let me know if you have troubles loading the data after you install the extension.

---

<div class="post-metadata">

**Author:** ![fedorov](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/fedorov/32/14_2.png) [@fedorov](https://discourse.slicer.org/u/fedorov)\
**Post date:** [October 3, 2018, 4:14pm UTC](https://discourse.slicer.org/t/segmentation-storage-1-2-840-10008-5-1-4-1-1-66-4/4274/3 "2018-10-03T16:14:34Z")

</div>

Ah, [we did mention](https://peerj.com/articles/2057/#p-133) the Reporting extension:

> The following software was tested:
> 
> - 3D Slicer ( _Reporting_ extension, starting from Nov 22, 2015 nightly build version)

Reporting was superseded by QuantitativeReporting, in an attempt to reduce confusion (but in this case achieving the opposite result!).

---

<div class="post-metadata">

**Author:** ![jcfr](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/jcfr/32/17825_2.png) [@jcfr](https://discourse.slicer.org/u/jcfr)\
**Post date:** [October 3, 2018, 5:39pm UTC](https://discourse.slicer.org/t/segmentation-storage-1-2-840-10008-5-1-4-1-1-66-4/4274/4 "2018-10-03T17:39:09Z")

</div>

@fedorov, is there anything that we could do to avoid the crash and report a more informative message ?

In that particular case, would it change anything to go in `Edit -> Settings -> DICOM` and set the `DICOM Reader Approach` to `DCMTK` ?

---

<div class="post-metadata">

**Author:** ![fedorov](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/fedorov/32/14_2.png) [@fedorov](https://discourse.slicer.org/u/fedorov)\
**Post date:** [October 3, 2018, 5:55pm UTC](https://discourse.slicer.org/t/segmentation-storage-1-2-840-10008-5-1-4-1-1-66-4/4274/5 "2018-10-03T17:55:45Z")

</div>

> [@jcfr](#):
>
> is there anything that we could do to avoid the crash and report a more informative message ?

In the order of my preference:

1. I think the best would be to support reading of DICOM Segmentation in ITK 😉

2. Another alternative, which we discussed in the past, is to add [dcmqi](https://github.com/qiicr/dcmqi) to be a dependency in Slicer core application (it is rather light, since it will reuse ITK and DCMTK from Slicer), and support Segmentation objects without having to install any extensions.

3. If we have no resources for 1, and cannot reach consensus for 2, I would update ScalarVolume plugin to not pass Segmentation down the pipeline to ITK readers. This will resolve the crash, but will not help with easily loading the data.

> [@jcfr](#):
>
> In that particular case, would it change anything to go in `Edit -> Settings -> DICOM` and set the `DICOM Reader Approach` to `DCMTK` ?

I don’t know how it will behave, but it won’t load the dataset properly, I am pretty sure. Interpretation of DICOM Seg requires extra steps that are outside DCMTK/ITK readers, and is implemented in dcmqi.

---

<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:** [October 3, 2018, 9:44pm UTC](https://discourse.slicer.org/t/segmentation-storage-1-2-840-10008-5-1-4-1-1-66-4/4274/6 "2018-10-03T21:44:37Z")

</div>

I think it’s good that most DICOM importers are in extensions, but the current mechanism of detecting and offering relevant DICOM import extensions should be improved. Slicer should offer to install potentially useful extensions by a single click (instead of telling the user what to do, have a yes/no button and if user clicks yes then install the extensions).

---

<div class="post-metadata">

**Author:** ![pieper](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/pieper/32/8_2.png) [@pieper](https://discourse.slicer.org/u/pieper)\
**Post date:** [October 3, 2018, 11:14pm UTC](https://discourse.slicer.org/t/segmentation-storage-1-2-840-10008-5-1-4-1-1-66-4/4274/7 "2018-10-03T23:14:31Z")

</div>

> [@lassoan](#):
>
> Slicer should offer to install potentially useful extensions by a single click (instead of telling the user what to do, have a yes/no button and if user clicks yes then install the extensions).

Agreed. Previously the extension manager logic didn’t expose this functionality, but maybe it does now that the auto-update of extensions was added. If not we would need to go back and add some methods to allow the dicom module to install extensions automatically.

---

<div class="post-metadata">

**Author:** ![malaterre](https://avatars.discourse-cdn.com/v4/letter/m/82dd89/32.png) [@malaterre](https://discourse.slicer.org/u/malaterre)\
**Post date:** [October 4, 2018, 6:21am UTC](https://discourse.slicer.org/t/segmentation-storage-1-2-840-10008-5-1-4-1-1-66-4/4274/8 "2018-10-04T06:21:27Z")

</div>

Thank you @fedorov ! This works now. It is odd I could not find any reference to this issue doing a search on ‘segmentation storage’. Anyway problem solved, onto next one !

---

<div class="post-metadata">

**Author:** ![malaterre](https://avatars.discourse-cdn.com/v4/letter/m/82dd89/32.png) [@malaterre](https://discourse.slicer.org/u/malaterre)\
**Post date:** [October 4, 2018, 6:27am UTC](https://discourse.slicer.org/t/segmentation-storage-1-2-840-10008-5-1-4-1-1-66-4/4274/9 "2018-10-04T06:27:20Z")

</div>

> [@fedorov](#):
>
> 1. I think the best would be to support reading of DICOM Segmentation in ITK 😉

Not sure who is the target of the smiley, so I’ll ask. Does ITK now support bit (0/1) image ? It would seems to be a rather simple fix in itk::GDCMImageIO (unless I am missing the whole point).

---

<div class="post-metadata">

**Author:** ![fedorov](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/fedorov/32/14_2.png) [@fedorov](https://discourse.slicer.org/u/fedorov)\
**Post date:** [October 4, 2018, 2:13pm UTC](https://discourse.slicer.org/t/segmentation-storage-1-2-840-10008-5-1-4-1-1-66-4/4274/10 "2018-10-04T14:13:45Z")

</div>

> [@lassoan](#):
>
> Slicer should offer to install potentially useful extensions by a single click (instead of telling the user what to do, have a yes/no button and if user clicks yes then install the extensions).

Yes, this would be great. Right now it is not “instead of have a yes/no button”. There is not such functionality as far as I know - the only chance user has to learn about the extensions is in a popup notification at the time of import. Is someone planning to work on that feature? If not, or until then, should we add a check for Segmentation image IOD and exit the plugin with warning instead of generating that message in the initial post?

> [@malaterre](#):
>
> Not sure who is the target of the smiley, so I’ll ask. Does ITK now support bit (0/1) image ? It would seems to be a rather simple fix in itk::GDCMImageIO (unless I am missing the whole point).

I should be more careful with my smileys next time! I don’t know the answer to your question, but that would not be the critical part. I don’t think it is critical to have output as a bit image. Is more than just supporting bit images, since those segmentations are multiframes, and there will need to be code to sort and paste them into multiple volumes (since segments can overlap), and propagate the metadata, and support a lot more for writing.

---

<div class="post-metadata">

**Author:** ![pieper](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/pieper/32/8_2.png) [@pieper](https://discourse.slicer.org/u/pieper)\
**Post date:** [October 4, 2018, 2:26pm UTC](https://discourse.slicer.org/t/segmentation-storage-1-2-840-10008-5-1-4-1-1-66-4/4274/11 "2018-10-04T14:26:44Z")

</div>

> [@fedorov](#):
>
> - Another alternative, which we discussed in the past, is to add [dcmqi](https://github.com/qiicr/dcmqi) to be a dependency in Slicer core application (it is rather light, since it will reuse ITK and DCMTK from Slicer), and support Segmentation objects without having to install any extensions.

This looked like the best option to me.

---

<div class="post-metadata">

**Author:** ![fedorov](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/fedorov/32/14_2.png) [@fedorov](https://discourse.slicer.org/u/fedorov)\
**Post date:** [February 7, 2019, 6:23pm UTC](https://discourse.slicer.org/t/segmentation-storage-1-2-840-10008-5-1-4-1-1-66-4/4274/12 "2019-02-07T18:23:47Z")

</div>

I experience again and again that Slicer users cannot figure out that they need to install the QuantitativeReporting extension in order to be able to load DICOM SEG objects. The “hints” mechanism we currently have that suggests installing extensions on data import are far from perfect, and I am afraid most users ignore them. The error message lacks any useful information in the user-facing message, and the console error is equally useless.

![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/a/c/ac75e706d6f36887447f0af6273979740eaf721a.png)

 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/b/f/bf96fd74c38ffbbaa7137d38ea674463ed03017b.png)

In the past we discussed adding dcmqi as a core component (see above), but I am not sure we reached consensus from all participants.

As a less intrusive fix, maybe we could add a specific check in the Scalar volume DICOM plugin to inform the user about the need to install QuantitativeReporting at the time DICOM SEG is attempted to be loaded. Does anyone have concerns about this?

@pieper @jcfr @lassoan can each of you please voice your opinion?

---

<div class="post-metadata">

**Author:** ![pieper](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/pieper/32/8_2.png) [@pieper](https://discourse.slicer.org/u/pieper)\
**Post date:** [February 7, 2019, 9:56pm UTC](https://discourse.slicer.org/t/segmentation-storage-1-2-840-10008-5-1-4-1-1-66-4/4274/13 "2019-02-07T21:56:44Z")

</div>

I vote that dcmqi and Quantitative Reporting be integrated into the core. The whole concept of prompting people to install extensions doesn’t seem to work well (it’s hard to make a clear, concise message in a dialog and then people forget it when the dialog goes away). And we really should be encouraging people to use SEG and SR by supporting them natively.

---

<div class="post-metadata">

**Author:** ![fedorov](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/fedorov/32/14_2.png) [@fedorov](https://discourse.slicer.org/u/fedorov)\
**Post date:** [February 8, 2019, 10:24pm UTC](https://discourse.slicer.org/t/segmentation-storage-1-2-840-10008-5-1-4-1-1-66-4/4274/14 "2019-02-08T22:24:20Z")

</div>

Pending responses from @jcfr and @lassoan, the PR for the simple fix has been submitted: [https://github.com/Slicer/Slicer/pull/1088](https://github.com/Slicer/Slicer/pull/1088)

---

<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:** [February 8, 2019, 11:17pm UTC](https://discourse.slicer.org/t/segmentation-storage-1-2-840-10008-5-1-4-1-1-66-4/4274/15 "2019-02-08T23:17:58Z")

</div>

I agree that the extension could be bundled with Slicer by default (similarly to how it is done for MultiVolumeExplorer).

---

<div class="post-metadata">

**Author:** ![issakomi](https://avatars.discourse-cdn.com/v4/letter/i/b9e5f3/32.png) [@issakomi](https://discourse.slicer.org/u/issakomi)\
**Post date:** [September 16, 2020, 2:47pm UTC](https://discourse.slicer.org/t/segmentation-storage-1-2-840-10008-5-1-4-1-1-66-4/4274/16 "2020-09-16T14:47:50Z")

</div>

FYI

Related issue:

> <https://github.com/InsightSoftwareConsortium/ITK/issues/1969>
>
> Description
> Hello. I am running into an error processing a medical image segmentation DICOM file from The Cancer Imaging Archive. When I...

and PR:

> <https://github.com/InsightSoftwareConsortium/ITK/pull/2004>

---

<div class="post-metadata">

**Author:** ![fedorov](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/fedorov/32/14_2.png) [@fedorov](https://discourse.slicer.org/u/fedorov)\
**Post date:** [September 16, 2020, 3:09pm UTC](https://discourse.slicer.org/t/segmentation-storage-1-2-840-10008-5-1-4-1-1-66-4/4274/17 "2020-09-16T15:09:18Z")

</div>

> [@lassoan](#):
>
> I agree that the extension could be bundled with Slicer by default (similarly to how it is done for MultiVolumeExplorer).

@lassoan it sounds like we are all in agreement, and also this issue of having to install the extension very often brings confusion to the users.

Should I try to make a PR with this change? I have not touched Slicer in quite a while, so hopefully I can pull it off …

---

<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 16, 2020, 3:21pm UTC](https://discourse.slicer.org/t/segmentation-storage-1-2-840-10008-5-1-4-1-1-66-4/4274/18 "2020-09-16T15:21:59Z")

</div>

I guess the only downside of integrating it into the core is that we lose the ability to add fixes/enhancements after a stable version is released, but since the extension is relatively mature, it should be OK.

There also a few dependencies to take care of:

- SlicerDevelopmentToolbox: It is a collection of useful code snippets, but would need to be cleaned up before it could get part of Slicer core. It would be better to remove this dependency by moving all necessary parts into QuantitativeReporting.
- DCMQI: this is a quite nice and stable library, so it should be no problem adding it as a dependency to Slicer core
- PETDICOMExtension: this seems to be a quite specialized tool, so it would be probably better not to bundle it with Slicer core

@jcfr can comment on when this should happen, as he is currently reworking the Slicer build system for VTK9.

---

<div class="post-metadata">

**Author:** ![issakomi](https://avatars.discourse-cdn.com/v4/letter/i/b9e5f3/32.png) [@issakomi](https://discourse.slicer.org/u/issakomi)\
**Post date:** [September 16, 2020, 3:23pm UTC](https://discourse.slicer.org/t/segmentation-storage-1-2-840-10008-5-1-4-1-1-66-4/4274/19 "2020-09-16T15:23:16Z")

</div>

Don’t want to step in into discussion about extension (IMHO, i believe that best extensions were better to be a part of Slicer, not sure), but the issue was related to [MONAI project](https://blog.kitware.com/monai-bootcamp-2020/), they have to use `pydicom` to read single-bit images, AFAIK.

---

<div class="post-metadata">

**Author:** ![fedorov](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/fedorov/32/14_2.png) [@fedorov](https://discourse.slicer.org/u/fedorov)\
**Post date:** [September 16, 2020, 3:29pm UTC](https://discourse.slicer.org/t/segmentation-storage-1-2-840-10008-5-1-4-1-1-66-4/4274/20 "2020-09-16T15:29:51Z")

</div>

> [@issakomi](#):
>
> but the issue was related to [MONAI project](https://blog.kitware.com/monai-bootcamp-2020/), they have to use `pydicom` to read single-bit images, AFAIK

@issakomi at least based on this current thread, the original issue reported by the user is quoted below:

> [@malaterre](#):
>
> After downloading one participant from the TCIA reference, and trying to load the Segmentation Storage instance in 3D Slicer all I could trigger is the following error message

[Next page](https://discourse.slicer.org/t/segmentation-storage-1-2-840-10008-5-1-4-1-1-66-4/4274.md?page=2)
