# Patched DICOM will not open as Image Sequence

**URL:** <https://discourse.slicer.org/t/patched-dicom-will-not-open-as-image-sequence/28910>\
**Category:** Support\
**Tags:** dicombrowser, dicom\
**Created:** [April 14, 2023, 11:36am UTC](https://discourse.slicer.org/t/patched-dicom-will-not-open-as-image-sequence/28910 "2023-04-14T11:36:54Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tannadrake](https://avatars.discourse-cdn.com/v4/letter/t/ea5d25/32.png) [@Tannadrake](https://discourse.slicer.org/u/Tannadrake)\
**Post date:** [April 14, 2023, 11:36am UTC](https://discourse.slicer.org/t/patched-dicom-will-not-open-as-image-sequence/28910/1 "2023-04-14T11:36:54Z")

</div>

I am attempting to open a DICOM image that required patching. I used the DICOM Patcher module, then when I attempt to open an imaging sequence it gives me an error saying it cannot open as an Image Sequence.

This is the log file content. Any assistance is appreciated.

[ERROR][Python] 14.04.2023 07:28:50 [Python] (C:\Users\amyta\AppData\Local\NA-MIC\Slicer 5.2.2\lib\Slicer-5.2\qt-scripted-modules\DICOMLib\DICOMUtils.py:794) - DICOM plugin failed to load ‘4001: MR MPRAGE’ as a ‘Image sequence’.  
Traceback (most recent call last):  
File “C:\Users\amyta\AppData\Local\NA-MIC\Slicer 5.2.2\lib\Slicer-5.2\qt-scripted-modules\DICOMLib\DICOMUtils.py”, line 790, in loadLoadables  
loadSuccess = plugin.load(loadable)  
File “C:/Users/amyta/AppData/Local/NA-MIC/Slicer 5.2.2/bin/…/lib/Slicer-5.2/qt-scripted-modules/DICOMImageSequencePlugin.py”, line 354, in load  
imageData, ijkToRas = self.loadImageData(filePath, loadable.grayscale, tempFrameVolume)  
File “C:/Users/amyta/AppData/Local/NA-MIC/Slicer 5.2.2/bin/…/lib/Slicer-5.2/qt-scripted-modules/DICOMImageSequencePlugin.py”, line 231, in loadImageData  
f"Could not read image {loadable.name} from file {filePath}. Error is: {errorString}")  
NameError: name ‘loadable’ is not defined  
[WARNING][Python] 14.04.2023 07:28:50 [Python] (C:\Users\amyta\AppData\Local\NA-MIC\Slicer 5.2.2\bin\Python\slicer\util.py:2736) - Could not load: 4001: MR MPRAGE as a Image sequence

---

<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:** [April 14, 2023, 12:14pm UTC](https://discourse.slicer.org/t/patched-dicom-will-not-open-as-image-sequence/28910/2 "2023-04-14T12:14:31Z")

</div>

The map from dicom to sequences is complex due to the wide variety of acquisition types and the ways vendors choose to encode them. Your best bet is to study the dicom headers in terms of what you know about the images and if needed extend the dicom patcher so that there’s a recognized delimiter between sequence items that will map to Slicer data structures. The delimiter could be time, acquisition parameter, physiological signal, etc. It’s generally straightforward to solve any specific case, but not easy to solve the general problem.

---

<div class="post-metadata">

**Author:** ![Tannadrake](https://avatars.discourse-cdn.com/v4/letter/t/ea5d25/32.png) [@Tannadrake](https://discourse.slicer.org/u/Tannadrake)\
**Post date:** [April 14, 2023, 12:17pm UTC](https://discourse.slicer.org/t/patched-dicom-will-not-open-as-image-sequence/28910/3 "2023-04-14T12:17:22Z")

</div>

I am a clinician and have no programing experience. If I provide my specific image data could you help me further? It is animal data, so not protected health information

---

<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:** [April 14, 2023, 12:21pm UTC](https://discourse.slicer.org/t/patched-dicom-will-not-open-as-image-sequence/28910/4 "2023-04-14T12:21:01Z")

</div>

I can’t promise to solve the problem for you myself, but yes, if you post the data and describe what you are trying to accomplish then I or someone with the right experience might be able to help out. In general yes, we want Slicer to be compatible with as many scenarios as possible and having example data is critical. Often with human data we as developers can never see the real data so things may stall. But with animal data sharing the images and acquisition context can really move things forward.

---

<div class="post-metadata">

**Author:** ![Tannadrake](https://avatars.discourse-cdn.com/v4/letter/t/ea5d25/32.png) [@Tannadrake](https://discourse.slicer.org/u/Tannadrake)\
**Post date:** [April 14, 2023, 1:28pm UTC](https://discourse.slicer.org/t/patched-dicom-will-not-open-as-image-sequence/28910/5 "2023-04-14T13:28:54Z")

</div>

Here is a link to one of the studies.  
I am trying to open the MPRage sequence in slicer so that I can segment the lateral ventricles to assess volume and surface area for a research study.

> **[4502907- March 6 2023](https://onedrive.live.com/redir?resid=6D4A380DBC8A33EB%2125526&authkey=%21AIOyiYMnRrI88RM&ithint=folder&e=0JmUwR)**
>
> Folder

---

<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:** [April 14, 2023, 2:00pm UTC](https://discourse.slicer.org/t/patched-dicom-will-not-open-as-image-sequence/28910/6 "2023-04-14T14:00:18Z")

</div>

Thanks for sharing, that makes it easier to see what is going on. These are not the original scan images, but some kind of post-processed result (secondary capture) and reports (structured reports) that are not compatible with Slicer. Probably you can go back to the scanner and pull out the original images.

---

<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:** [April 14, 2023, 2:43pm UTC](https://discourse.slicer.org/t/patched-dicom-will-not-open-as-image-sequence/28910/7 "2023-04-14T14:43:01Z")

</div>

If this helps, here [MRPAGE](https://drive.google.com/file/d/1peQ5Je5s3Z3TLPy4ut517HA_xPm6jhKA/view?usp=sharing) series in Nrrd format. Slicer (5.3.0-2023-04-11) doesn’t see all series in the folder.

---

<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:** [April 14, 2023, 6:51pm UTC](https://discourse.slicer.org/t/patched-dicom-will-not-open-as-image-sequence/28910/8 "2023-04-14T18:51:24Z")

</div>

> [@issakomi](#):
>
> Slicer (5.3.0-2023-04-11) doesn’t see all series in the folder.

Hi @issakomi - did you use another tool that recognized additional files? Can you describe what’s different?

---

<div class="post-metadata">

**Author:** ![Tannadrake](https://avatars.discourse-cdn.com/v4/letter/t/ea5d25/32.png) [@Tannadrake](https://discourse.slicer.org/u/Tannadrake)\
**Post date:** [April 14, 2023, 11:16pm UTC](https://discourse.slicer.org/t/patched-dicom-will-not-open-as-image-sequence/28910/9 "2023-04-14T23:16:40Z")

</div>

That helped! I was able to segment the images. How did you do that?

---

<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:** [April 14, 2023, 11:17pm UTC](https://discourse.slicer.org/t/patched-dicom-will-not-open-as-image-sequence/28910/10 "2023-04-14T23:17:00Z")

</div>

Probably the images were damaged during compression (?).  
`0x0008,0x2111 "Derivation Description" Compress Pegasus JPEG Lossless`  
PixelData looks strange, there is _Basic Offset Table_ and **2** fragments for single slice. Should be _Basic Offset Table_ and 1 fragment (usually). Maybe duplicated. Many viewers skip these files, not only Slicer. Seems to be possible to recover.

---

<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:** [April 14, 2023, 11:28pm UTC](https://discourse.slicer.org/t/patched-dicom-will-not-open-as-image-sequence/28910/11 "2023-04-14T23:28:58Z")

</div>

_dcmcjpeg_ detected

W: DcmSequenceOfItems: Reached end of stream before the end of sequence PixelData (7fe0,0010)  
F: Sequence Delimitation Item missing: reading file: 34123105

BTW. If you drop single file (not using DICOM database import), it opens in Slicer too. It is not a big help, but FYI. Bare ITK’s GDCM IO seems to work.

---

<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:** [April 15, 2023, 2:54pm UTC](https://discourse.slicer.org/t/patched-dicom-will-not-open-as-image-sequence/28910/12 "2023-04-15T14:54:07Z")

</div>

Nice detective work @issakomi 👏

@Tannadrake the images appear to have come from a Siemens syngo.via system. If you or your colleagues used a standard feature of the machine you should report this non-conformance to Siemens and ask the to fix it.

---

<div class="post-metadata">

**Author:** ![Tannadrake](https://avatars.discourse-cdn.com/v4/letter/t/ea5d25/32.png) [@Tannadrake](https://discourse.slicer.org/u/Tannadrake)\
**Post date:** [April 26, 2023, 2:51pm UTC](https://discourse.slicer.org/t/patched-dicom-will-not-open-as-image-sequence/28910/13 "2023-04-26T14:51:23Z")

</div>

Thank you. Will do. In the end we went back to the scanner and pulled the original images onto a flash drive instead of CD which resolved our issue.
