Not able to construct DicomImage from a single file

All other questions regarding DCMTK

Moderator: Moderator Team

Post Reply
Message
Author
artemmikheev
Posts: 32
Joined: Mon, 2018-11-12, 20:01

Not able to construct DicomImage from a single file

#1 Post by artemmikheev »

I have a file (googledrive link below) which fails during the DicomImage construction.

I am able to load the DcmFileFormat if I disable the parsing errors (thank you Alvin for help!)

***********************************************************
// THIS WORKS OK
DcmFileFormat* D = new DcmFileFormat();

dcmIgnoreParsingErrors.set(OFTrue);
OFCondition ofc = D->loadFile( cName );
*************************************************************

But if I try to construct DicomImage - it fails with Status=EIS_MissingAttribute

**********************************************************************

UINT32 flags = CIF_UsePresentationState | /// use presentation state instead of 'built-in' LUTs & overlays
CIF_IgnoreModalityTransformation | /// ignore modality transformation (rescale slope/intercept or LUT) stored in the dataset
CIF_IgnoreModalityLutBitDepth;// | /// ignore third value of the modality LUT descriptor, determine bit depth automatically

DicomImage* img = new (std::nothrow) DicomImage( Name,flags ));
EI_Status st = img->getStatus();
************************************************************************

Here is the link to the file

https://drive.google.com/file/d/11ld1l1 ... sp=sharing


Thank you!

artemmikheev
Posts: 32
Joined: Mon, 2018-11-12, 20:01

Re: Not able to construct DicomImage from a single file

#2 Post by artemmikheev »

Also, file seems to be valid, as some viewers are able to load it.
F.e. Mango software.

J. Riesmeier
DCMTK Developer
Posts: 2498
Joined: Tue, 2011-05-03, 14:38
Location: Oldenburg, Germany
Contact:

Re: Not able to construct DicomImage from a single file

#3 Post by J. Riesmeier »

What does the command line tool dcm2pnm (with option --debug) show? If it cannot read the file either, does it work with dcmj2pnm?

artemmikheev
Posts: 32
Joined: Mon, 2018-11-12, 20:01

Re: Not able to construct DicomImage from a single file

#4 Post by artemmikheev »

Unfortunately both commands {dcm2pnm, dcmj2pnm} are failing in the same
way. I use DCMTK binaries 3.6.5. It is Windows x64 with AMD 3950X processor.
Here is the output (identical for both tools):

D:\Dcmtk365\bin>dcmj2pnm --debug d:\temp\897.dcm
D: $dcmtk: dcmj2pnm v3.6.5 2019-10-28 $
D:
I: reading DICOM file: d:\temp\897.dcm
D: DcmFileFormat::lookForXfer() no MetaInfo found
D: DcmDataset::read() trying to detect transfer syntax of data set (because it is unknown)
D: DcmDataset::read() TransferSyntax="Little Endian Implicit"
D: DcmItem::checkAndUpdateVR() setting undefined VR of SmallestImagePixelValue (0028,0106) to 'SS' because PixelRepresentation (0028,0103) has a value of 1
D: DcmItem::checkAndUpdateVR() setting undefined VR of LargestImagePixelValue (0028,0107) to 'SS' because PixelRepresentation (0028,0103) has a value of 1
D: DcmItem::checkAndUpdateVR() setting undefined VR of SmallestPixelValueInSeries (0028,0108) to 'SS' because PixelRepresentation (0028,0103) has a value of 1
D: DcmItem::checkAndUpdateVR() setting undefined VR of LargestPixelValueInSeries (0028,0109) to 'SS' because PixelRepresentation (0028,0103) has a value of 1
E: DcmItem: Parse error in sequence item, found (fffe,e0dd) instead of item delimiter (fffe,e00d)
D: DcmItem::readSubElement() cannot create Sub Element (fffe,e0dd)
F: Item Delimitation Item missing: reading file: d:\temp\897.dcm

J. Riesmeier
DCMTK Developer
Posts: 2498
Joined: Tue, 2011-05-03, 14:38
Location: Oldenburg, Germany
Contact:

Re: Not able to construct DicomImage from a single file

#5 Post by J. Riesmeier »

Apparently, there are various issues with your file. For example, since there is no file meta information, your file is strictly speaking no DICOM file (but a DICOM dataset stored as a file). Also there seems to be an encoding issue with one or more Sequence of Items (SQ) elements...
Also, file seems to be valid, as some viewers are able to load it.
This conclusion is probably wrong.

artemmikheev
Posts: 32
Joined: Mon, 2018-11-12, 20:01

Re: Not able to construct DicomImage from a single file

#6 Post by artemmikheev »

Thank you so much for your help.

This PET image comes from an established vendor in Japan.
File seems to be valid, Mango software loads and displays it
properly.

Here is the link to the Mango viewer:
http://ric.uthscsa.edu/mango/

Let me know if you want me to resend this problematic file other than Googledrive.

Many thanks,
-Artem

J. Riesmeier
DCMTK Developer
Posts: 2498
Joined: Tue, 2011-05-03, 14:38
Location: Oldenburg, Germany
Contact:

Re: Not able to construct DicomImage from a single file

#7 Post by J. Riesmeier »

Yes, please send the file by email to bugs/at/dcmtk/dot/org so that I can have a look at it.

artemmikheev
Posts: 32
Joined: Mon, 2018-11-12, 20:01

Re: Not able to construct DicomImage from a single file

#8 Post by artemmikheev »

Email was sent to specified address with the problem file attached.
Thank you once again.
-Artem

J. Riesmeier
DCMTK Developer
Posts: 2498
Joined: Tue, 2011-05-03, 14:38
Location: Oldenburg, Germany
Contact:

Re: Not able to construct DicomImage from a single file

#9 Post by J. Riesmeier »

Thank you for the sample file. There is indeed a severe violation of the DICOM encoding rules: "DcmItem: Parse error in sequence item, found (fffe,e0dd) instead of item delimiter (fffe,e00d)".

In order to process the file with dcm(j)2pnm, you should first fix the incorrect encoding by "dcmconv +rd input.dcm output.dcm". Option +rd is explained in the syntax usage of the dcmconv tool:

Code: Select all

  handling of wrong delimitation items:
    -rd  --use-delim-items      use delimitation items from dataset (default)
    +rd  --replace-wrong-delim  replace wrong sequence/item delimitation items
This PET image comes from an established vendor in Japan.
File seems to be valid, Mango software loads and displays it properly.
Both statements do not mean that the file is actually DICOM compliant. As I said, it is not. You should definitely inform the vendor of this particular device about this.

artemmikheev
Posts: 32
Joined: Mon, 2018-11-12, 20:01

Re: Not able to construct DicomImage from a single file

#10 Post by artemmikheev »

Many thanks, Joerg.
I will apply the correction as you suggested and it fixed the problem.
Excellent news - as always great help from DCMTK team.
kind regards,
-Artem

Post Reply

Who is online

Users browsing this forum: Bing [Bot], Google [Bot] and 1 guest