Not able to load a single DICOM file

All other questions regarding DCMTK

Moderator: Moderator Team

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

Not able to load a single DICOM file

#1 Post by artemmikheev » Wed, 2021-01-27, 04:23

I am not able to load a DICOM file. Googledrive link is attached.

I simply used
DcmFileFormat::loadFile( Name ) call.

Am I doing something wrong?

Thank you in advance.


https://drive.google.com/file/d/1m7iqt8 ... sp=sharing

alwittta
Posts: 111
Joined: Wed, 2006-03-15, 08:30

Re: Not able to load a single DICOM file

#2 Post by alwittta » Wed, 2021-01-27, 19:08

Hi

This file looks fine to me, able to dump the dataset using dcmdump utility https://support.dcmtk.org/docs/dcmdump.html.
Also able to load the file using DcmFileFormat class:

Code: Select all

         DcmFileFormat* pDcmFile = new DcmFileFormat;

	OFCondition cond = pDcmFile->loadFile(pszFilePath);
		
	DcmDataset  * dataset = pDcmFile->getDataset();
May be the problem is with loading DCMTK libraries to your project.

Here is the dcmdump response:

Code: Select all

D:\software\dcmtk-3.6.0-win32-i386\bin>dcmdump.exe -v -d e:\Med3D\897.dcm
D: $dcmtk: dcmdump v3.6.0 2011-01-06 $
D:
D: DcmItem::checkTransferSyntax() TransferSyntax="Little Endian Implicit"
D: DcmItem::checkTransferSyntax() TransferSyntax="Little Endian Implicit"
W: DcmItem: Parse error in sequence item, found (fffe,e0dd) instead of an item delimiter

# Dicom-File-Format

# Dicom-Meta-Information-Header
# Used TransferSyntax: Unknown Transfer Syntax

# Dicom-Data-Set
# Used TransferSyntax: Little Endian Implicit
(0008,0008) CS [ORIGINAL\PRIMARY]                       #  16, 2 ImageType
(0008,0016) UI =PositronEmissionTomographyImageStorage  #  28, 1 SOPClassUID
(0008,0018) UI [1.2.392.200036.9110.1681310101.1.1897.20130919121234.1023] #  58, 1 SOPInstanceUID
(0008,0020) DA [20130808]                               #   8, 1 StudyDate
(0008,0021) DA [20130919]                               #   8, 1 SeriesDate
(0008,0022) DA [20130808]                               #   8, 1 AcquisitionDate
(0008,0023) DA [20130919]                               #   8, 1 ContentDate
(0008,0030) TM [145504]                                 #   6, 1 StudyTime
(0008,0031) TM [121234]                                 #   6, 1 SeriesTime
(0008,0032) TM [145504]                                 #   6, 1 AcquisitionTime
(0008,0033) TM [122452]                                 #   6, 1 ContentTime
(0008,0050) SH (no value available)                     #   0, 0 AccessionNumber
(0008,0060) CS [PT]                                     #   2, 1 Modality
(0008,0070) LO [Shimadzu Corp.]                         #  14, 1 Manufacturer
(0008,0080) LO (no value available)                     #   0, 0 InstitutionName
(0008,0090) PN (no value available)                     #   0, 0 ReferringPhysicianName
(0008,1030) LO (no value available)                     #   0, 0 StudyDescription
(0008,103e) LO [SUV,3D gauss(mm): 3.00,3D DRAMA]        #  32, 1 SeriesDescription
(0008,1050) PN (no value available)                     #   0, 0 PerformingPhysicianName
(0008,1060) PN (no value available)                     #   0, 0 NameOfPhysiciansReadingStudy
(0008,1070) PN (no value available)                     #   0, 0 OperatorsName
(0008,1090) LO [EminenceSTARGATE]                       #  16, 1 ManufacturerModelName
(0010,0010) PN (no value available)                     #   0, 0 PatientName
(0010,0020) LO (no value available)                     #   0, 0 PatientID
(0010,0030) DA [00000101]                               #   8, 1 PatientBirthDate
(0010,0040) CS [F]                                      #   2, 1 PatientSex
(0010,1010) AS [000Y]                                   #   4, 1 PatientAge
(0010,1020) DS [1.515000]                               #   8, 1 PatientSize
(0010,1030) DS [54.799999]                              #  10, 1 PatientWeight
(0018,0050) DS [2.600000]                               #   8, 1 SliceThickness
(0018,0071) CS [TIME]                                   #   4, 1 AcquisitionTerminationCondition
(0018,0073) CS [MANU]                                   #   4, 1 AcquisitionStartCondition
(0018,1000) LO [0045]                                   #   4, 1 DeviceSerialNumber
(0018,1020) LO [3.52.21]                                #   8, 1 SoftwareVersions
(0018,1100) DS [256.000000]                             #  10, 1 ReconstructionDiameter
(0018,1120) DS [0.000000]                               #   8, 1 GantryDetectorTilt
(0018,1121) DS [0.000000]                               #   8, 1 GantryDetectorSlew
(0018,1147) CS [CYLINDRICAL RING]                       #  16, 1 FieldOfViewShape
(0018,1149) IS [665\200]                                #   8, 2 FieldOfViewDimensions
(0018,1181) CS [NONE]                                   #   4, 1 CollimatorType
(0018,1242) IS [300000]                                 #   6, 1 ActualFrameDuration
(0020,000d) UI [1.2.392.200036.9110.1181706501.2.1.20130808.150000] #  50, 1 StudyInstanceUID
(0020,000e) UI [1.2.392.200036.9110.1681310101.3.1.20130919121234.1023] #  54, 1 SeriesInstanceUID
(0020,0010) SH [1]                                      #   2, 1 StudyID
(0020,0011) IS [1]                                      #   2, 1 SeriesNumber
(0020,0012) IS (no value available)                     #   0, 0 AcquisitionNumber
(0020,0013) IS [1897]                                   #   4, 1 InstanceNumber
(0020,0020) CS [L\P]                                    #   4, 2 PatientOrientation
(0020,0032) DS [-127.000000\-127.000000\-2.600000]      #  34, 3 ImagePositionPatient
(0020,0037) DS [1.000000\0.000000\0.000000\0.000000\1.000000\0.000000] #  54, 6 ImageOrientationPatient
(0020,0052) UI [1.2.392.200036.9110.1681310101.4.20130919121234.0] #  50, 1 FrameOfReferenceUID
(0020,1002) IS [1975]                                   #   4, 1 ImagesInAcquisition
(0020,1040) LO (no value available)                     #   0, 0 PositionReferenceIndicator
(0028,0002) US 1                                        #   2, 1 SamplesPerPixel
(0028,0004) CS [MONOCHROME2]                            #  12, 1 PhotometricInterpretation
(0028,0010) US 128                                      #   2, 1 Rows
(0028,0011) US 128                                      #   2, 1 Columns
(0028,0030) DS [2.000000\2.000000]                      #  18, 2 PixelSpacing
(0028,0051) CS [NORM\RADL\RAN\DECY\ATTN\SCAT\DTIM\DCAL] #  38, 8 CorrectedImage
(0028,0100) US 16                                       #   2, 1 BitsAllocated
(0028,0101) US 16                                       #   2, 1 BitsStored
(0028,0102) US 15                                       #   2, 1 HighBit
(0028,0103) US 1                                        #   2, 1 PixelRepresentation
(0028,0106) xs 65524                                    #   2, 1 SmallestImagePixelValue
(0028,0107) xs 11140                                    #   2, 1 LargestImagePixelValue
(0028,0108) xs 65524                                    #   2, 1 SmallestPixelValueInSeries
(0028,0109) xs 11140                                    #   2, 1 LargestPixelValueInSeries
(0028,1050) DS [3000.000]                               #   8, 1 WindowCenter
(0028,1051) DS [6000.000]                               #   8, 1 WindowWidth
(0028,1052) DS [0.000000]                               #   8, 1 RescaleIntercept
(0028,1053) DS [1.000000]                               #   8, 1 RescaleSlope
(0054,0016) SQ (Sequence with explicit length #=1)      #  72, 1 RadiopharmaceuticalInformationSequence
  (fffe,e000) na (Item with explicit length #=2)          #  64, 1 Item
    (0018,1074) DS [310800000.000000]                       #  16, 1 RadionuclideTotalDose
    (0054,0300) SQ (Sequence with explicit length #=1)      #  16, 1 RadionuclideCodeSequence
      (fffe,e000) na (Item with explicit length #=0)          #   8, 1 Item
      (fffe,e00d) na (ItemDelimitationItem for re-encoding)   #   0, 0 ItemDelimitationItem
    (fffe,e0dd) na (SequenceDelimitationItem for re-encod.) #   0, 0 SequenceDelimitationItem
  (fffe,e00d) na (ItemDelimitationItem for re-encoding)   #   0, 0 ItemDelimitationItem
(fffe,e0dd) na (SequenceDelimitationItem for re-encod.) #   0, 0 SequenceDelimitationItem

Best Regards,
Alvin

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

Re: Not able to load a single DICOM file

#3 Post by artemmikheev » Wed, 2021-01-27, 19:17

Thank you so much, this is puzzling.
Our code seems to be identical.

I use DCMTK 3.6.3.
Are you using the latest 3.6.6 ?

I am using Windows10-x64 and Intel\AMD processor.

OFCondition cond returns an error value (#38)
and says "Item delimitation item missing"

best regards.

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

Re: Not able to load a single DICOM file

#4 Post by artemmikheev » Wed, 2021-01-27, 19:24

Also, forgive my ignorance, is the DCMDUMP.exe utility is available in compiled form?
Somehow I can not find it....
Thanks again.
-Artem

alwittta
Posts: 111
Joined: Wed, 2006-03-15, 08:30

Re: Not able to load a single DICOM file

#5 Post by alwittta » Wed, 2021-01-27, 19:52

Here is the link to DCMTK 3.6.5 executable binaries, which includes the Windows version also:

https://dicom.offis.de/download/dcmtk/dcmtk365/bin/

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

Re: Not able to load a single DICOM file

#6 Post by artemmikheev » Wed, 2021-01-27, 20:13

Thank you for this.
I tried DCMDUMP.exe in the 3.6.5 binaries you pointed out.
It fails to dump this file (897.dcm)

Here is the message:
"E: DcmItem: ParseError in sequence item, found (fffe,e0dd) instead of item delimiter (fffe,e00d)"


Environment:
is Windows 10 -x64, AMD processor 3950X

alwittta
Posts: 111
Joined: Wed, 2006-03-15, 08:30

Re: Not able to load a single DICOM file

#7 Post by alwittta » Wed, 2021-01-27, 22:02

The dcmdump.exe which I used is from version 3.6.0 of DCMTK.

Here is a similar thread but bit older:
https://forum.dcmtk.org/viewtopic.php?t=706

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

Re: Not able to load a single DICOM file

#8 Post by artemmikheev » Wed, 2021-01-27, 22:17

Thank you for pointing this out.
However, I do not load any custom DataDictionary (like the User from the thread),
so I assume DCMTK internal dictionary is used. So I still have no clue why the
DCMDUMP 3.6.5 fails.
I will try the 3.6.0 version now.

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

Re: Not able to load a single DICOM file

#9 Post by artemmikheev » Wed, 2021-01-27, 22:27

I tried to run DcmDump 3.6.0 and it seems to produce the output that you sent.
However, I just noticed that your sent DcmDump 3.6.0 also contains an error:

W: DcmItem: Parse error in sequence item, found (fffe,e0dd) instead of an item delimiter

Still the dump of the file succeeds in 3.6.0, but the error is present.

Now the DcmDump 3.6.3 and 3.6.5 shows the same error, but then it stops not producing
any dump. And this is the behavior I observe in my C++ program.

Thank you so much for your time and I appreciate the help.
-Artem

Marco Eichelberg
OFFIS DICOM Team
OFFIS DICOM Team
Posts: 1280
Joined: Tue, 2004-11-02, 17:22
Location: Oldenburg, Germany
Contact:

Re: Not able to load a single DICOM file

#10 Post by Marco Eichelberg » Mon, 2021-02-01, 13:45

The problem here is that the file is not a valid DICOM file - the encoding of the sequences is not correct.
You can use the following call to fix the file:

Code: Select all

dcmconv --replace-wrong-delim --ignore-parse-errors <infile> <outfile>
If you want to include that functionality into your own code,dcmconv maps these options to API level calls as follows:

Code: Select all

dcmReplaceWrongDelimitationItem.set(OFTrue);
dcmIgnoreParsingErrors.set(OFTrue);

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

Re: Not able to load a single DICOM file

#11 Post by artemmikheev » Mon, 2021-02-01, 14:23

This is a perfect API solution, thank you so much for suggestion - it worked!
best regards,
-Artem

Post Reply

Who is online

Users browsing this forum: Baidu [Spider] and 1 guest