Patched DICOM will not open as Image Sequence

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\ - 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\”, 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/”, 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/”, line 231, in loadImageData
f"Could not read image {} 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\ - Could not load: 4001: MR MPRAGE as a Image sequence

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.

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

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.

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.

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.

If this helps, here MRPAGE series in Nrrd format. Slicer (5.3.0-2023-04-11) doesn’t see all series in the folder.

1 Like

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

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

1 Like

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.

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.

Nice detective work @issakomi :clap:

@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.

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.