Error: length of element larger than explicit length of surrounding item

All other questions regarding DCMTK

Moderator: Moderator Team

Post Reply
Message
Author
Jisu.Hu
Posts: 2
Joined: Mon, 2023-04-17, 08:36

Error: length of element larger than explicit length of surrounding item

#1 Post by Jisu.Hu »

Recently I encountered a problem when reading DICOM files using DCMTK 3.6.4. The following is the detailed log information.

W: Found element (2001,105f) with VR UN and undefined length, reading a sequence with transfer syntax LittleEndianImplicit (CP-246)
W: DcmItem: Length of element (2001,0010) is odd
W: DcmItem: Element PrivateCreator (2001,0010) larger (20053) than remaining bytes (468) of surrounding item

Could anyone solve this problem?

Thanks in advance.

Michael Onken
DCMTK Developer
Posts: 2048
Joined: Fri, 2004-11-05, 13:47
Location: Oldenburg, Germany
Contact:

Re: Error when reading DICOM files

#2 Post by Michael Onken »

Hi,

the file seems to be broken. You can try

Code: Select all

dcmdump --disable-cp246 <file>
to see whether a common workaround can be applied.

Also,

Code: Select all

dcmdump +E +Ep <file>
to force the parser to continue, sometimes it is able to recover. Additionally, option -d could provide more information (but I don't expect it here to help).

Best regards,
Michael

Jisu.Hu
Posts: 2
Joined: Mon, 2023-04-17, 08:36

Re: Error: length of element larger than explicit length of surrounding item

#3 Post by Jisu.Hu »

Thanks for your reply. It seems that the code you provided is used in the command line, but how can I fix this problem in C++ code?

Best regards,
Jisu Hu

Michael Onken
DCMTK Developer
Posts: 2048
Joined: Fri, 2004-11-05, 13:47
Location: Oldenburg, Germany
Contact:

Re: Error: length of element larger than explicit length of surrounding item

#4 Post by Michael Onken »

Try helping yourself: Look into dcmdump.cc how these command line options are provided to the parser when loading a file for dumping :)
I would do the same.

BR Michael

Post Reply

Who is online

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