Not able to construct DicomImage from a single file
Moderator: Moderator Team
-
- Posts: 32
- Joined: Mon, 2018-11-12, 20:01
Not able to construct DicomImage from a single file
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!
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!
-
- Posts: 32
- Joined: Mon, 2018-11-12, 20:01
Re: Not able to construct DicomImage from a single file
Also, file seems to be valid, as some viewers are able to load it.
F.e. Mango software.
F.e. Mango software.
-
- DCMTK Developer
- Posts: 2505
- Joined: Tue, 2011-05-03, 14:38
- Location: Oldenburg, Germany
- Contact:
Re: Not able to construct DicomImage from a single file
What does the command line tool dcm2pnm (with option --debug) show? If it cannot read the file either, does it work with dcmj2pnm?
-
- Posts: 32
- Joined: Mon, 2018-11-12, 20:01
Re: Not able to construct DicomImage from a single file
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
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
-
- DCMTK Developer
- Posts: 2505
- Joined: Tue, 2011-05-03, 14:38
- Location: Oldenburg, Germany
- Contact:
Re: Not able to construct DicomImage from a single file
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...
This conclusion is probably wrong.Also, file seems to be valid, as some viewers are able to load it.
-
- Posts: 32
- Joined: Mon, 2018-11-12, 20:01
Re: Not able to construct DicomImage from a single file
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
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
-
- DCMTK Developer
- Posts: 2505
- Joined: Tue, 2011-05-03, 14:38
- Location: Oldenburg, Germany
- Contact:
Re: Not able to construct DicomImage from a single file
Yes, please send the file by email to bugs/at/dcmtk/dot/org so that I can have a look at it.
-
- Posts: 32
- Joined: Mon, 2018-11-12, 20:01
Re: Not able to construct DicomImage from a single file
Email was sent to specified address with the problem file attached.
Thank you once again.
-Artem
Thank you once again.
-Artem
-
- DCMTK Developer
- Posts: 2505
- Joined: Tue, 2011-05-03, 14:38
- Location: Oldenburg, Germany
- Contact:
Re: Not able to construct DicomImage from a single file
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:
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
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.This PET image comes from an established vendor in Japan.
File seems to be valid, Mango software loads and displays it properly.
-
- Posts: 32
- Joined: Mon, 2018-11-12, 20:01
Re: Not able to construct DicomImage from a single file
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
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
Who is online
Users browsing this forum: George and 1 guest