dcmodify: image extremely truncated

All other questions regarding DCMTK

Moderator: Moderator Team

Post Reply
Message
Author
amunaaser
Posts: 40
Joined: Thu, 2020-03-26, 10:29

dcmodify: image extremely truncated

#1 Post by amunaaser »

Hi!
A DICOM ultrasound image with a size of ca. 4 GB is truncated to an image with a size of 34 kB using dcmodify, d.h. fundamentally no image data in the file after dcmodify.
Is this due to the size of the image? Some kind of "out of memory" perhaps? How should this be handled?

dcmodify -ie -gin -nb -ll error -ea "(0008,0014)" -ea "(0008,0081)" -ea "(0008,0092)" -ea "(0008,0094)" -ea "(0008,1010)" -ea "(0008,1030)" -ea "(0008,1040)" -ea "(0008,1048)" -ea "(0008,1060)" -ea "(0008,1070)" -ea "(0008,1080)" -ea "(0008,2111)" -ea "(0010,1000)" -ea "(0010,1001)" -ea "(0010,1002)" -ea "(0010,1010)" -ea "(0010,1020)" -ea "(0010,1030)" -ea "(0010,1040)" -ea "(0010,1090)" -ea "(0010,2160)" -ea "(0010,2180)" -ea "(0010,21B0)" -ea "(0010,4000)" -ea "(0018,1030)" -ea "(0020,4000)" -ea "(0040,0275)" -ea "(0040,A730)" -ea "(0088,0140)" -ea "(0018,1000)" -ea "(0018,1030)" -ea "(3006,00C2)" -ea "(0008,0021)" -ea "(0008,0023)" -ea "(0008,002A)" -ea "(0008,0031)" -ea "(0008,0033)" -ea "(0040,0241)" -ea "(0040,0244)" -ea "(0040,0245)" -ea "(0040,0250)" -ea "(0040,0251)" -ea "(0040,0253)" -ea "(0040,0254)" -ea "(0008,0012)" -ea "(0008,0013)" -ea "(0032,1032)" -ea "(0038,0010)" -ea "(0038,0300)" -ea "(0032,1033)" -ea "(0040,0275)" -ma "(0008,0050)=" -ma "(0008,0080)=" -ma "(0008,0090)=" -ma "(0008,1050)=" -ma "(0008,1155)=" -ma "(0010,0040)=" -ma "(0020,0010)=" -ma "(0032,1030)=" -ma "(0032,4000)=" -ma "(0040,1002)=" -ma "(0008,0018)=1.3.6.1.4.1.9590.100.1.2.36058659711651229809442305460807571742" -ma "(0020,0200)=1.3.6.1.4.1.9590.100.1.2.164874970611383393230241145950909823226" -ma "(0040,A124)=1.3.6.1.4.1.9590.100.1.2.247277532812982252713594625432174982444" -ma "(3006,0024)=1.3.6.1.4.1.9590.100.1.2.33592371211221921628120278123748390580" -ma "(3006,00C2)=1.3.6.1.4.1.9590.100.1.2.350836736113056166326922646341383640662" -ma "(0020,000D)=1.3.6.1.4.1.9590.100.1.2.352406380013392987205462655051469057925" -ma "(0020,000E)=1.3.6.1.4.1.9590.100.1.2.307363782611754475212322103410006047026" -ma "(0010,0020)=KC" -ma "(0010,0030)=19870101" -ma "(0010,0032)=12:00:00" -ma "(0010,0010)=KC" -ma "(0008,0020)=20220118" -ma "(0008,0030)=100205.990" -ma "(0008,103E)=VL_1" C:\DicomResult\2022-09-05_13-09-25-488\bfr2loc_1.3.51.0.1.1.172.16.20.234.78829105.79550419_VGRRTG\DICOM\VL_1\USm.1.3.46.670589.99.7154473517408479176.11484210288591675831.dcm

Thanks in advance
Best regards
Nasser Hosseini

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

Re: dcmodify: image extremely truncated

#2 Post by Michael Onken »

Hi,

hard to say without looking at the file, sorry, maybe the length field of the pixel data element in the file is already wrong before (but the field stores ca. 4GB anyway?). Is there no related output on the logger?

Best regards,
Michael

amunaaser
Posts: 40
Joined: Thu, 2020-03-26, 10:29

Re: dcmodify: image extremely truncated

#3 Post by amunaaser »

Hi Michael!
Thanks for the quick reply!
I could send you the file...
Below is what I get by using the debug mode. Can you see something that causes this truncatation?

Best regards
Nasser Hosseini

I: Processing file: C:\DicomResult\test\DICOM\USm.1.3.46.670589.99.8522846871569974419.2030391367630675584.dcm
I: Loading file into dataset manager: C:\DicomResult\test\DICOM\USm.1.3.46.670589.99.8522846871569974419.2030391367630675584.dcm
D: DcmItem::checkTransferSyntax() TransferSyntax="Little Endian Explicit"
I: Getting dataset from loaded file: C:\DicomResult\test\DICOM\USm.1.3.46.670589.99.8522846871569974419.2030391367630675584.dcm
I: Executing (option|path|value): gin||
I: Executing (option|path|value): ea|(0008,0014)|
E: modifying tag in file C:\DicomResult\test\DICOM\USm.1.3.46.670589.99.8522846871569974419.2030391367630675584.dcm: Tag not found
I: Executing (option|path|value): ea|(0008,0081)|
E: modifying tag in file C:\DicomResult\test\DICOM\USm.1.3.46.670589.99.8522846871569974419.2030391367630675584.dcm: Tag not found
I: Executing (option|path|value): ea|(0008,0092)|
E: modifying tag in file C:\DicomResult\test\DICOM\USm.1.3.46.670589.99.8522846871569974419.2030391367630675584.dcm: Tag not found
I: Executing (option|path|value): ea|(0008,0094)|
E: modifying tag in file C:\DicomResult\test\DICOM\USm.1.3.46.670589.99.8522846871569974419.2030391367630675584.dcm: Tag not found
I: Executing (option|path|value): ea|(0008,1010)|
I: Executing (option|path|value): ea|(0008,1030)|
I: Executing (option|path|value): ea|(0008,1040)|
I: Executing (option|path|value): ea|(0008,1048)|
E: modifying tag in file C:\DicomResult\test\DICOM\USm.1.3.46.670589.99.8522846871569974419.2030391367630675584.dcm: Tag not found
I: Executing (option|path|value): ea|(0008,1060)|
E: modifying tag in file C:\DicomResult\test\DICOM\USm.1.3.46.670589.99.8522846871569974419.2030391367630675584.dcm: Tag not found
I: Executing (option|path|value): ea|(0008,1070)|
I: Executing (option|path|value): ea|(0008,1080)|
E: modifying tag in file C:\DicomResult\test\DICOM\USm.1.3.46.670589.99.8522846871569974419.2030391367630675584.dcm: Tag not found
I: Executing (option|path|value): ea|(0008,2111)|
I: Executing (option|path|value): ea|(0010,1000)|
E: modifying tag in file C:\DicomResult\test\DICOM\USm.1.3.46.670589.99.8522846871569974419.2030391367630675584.dcm: Tag not found
I: Executing (option|path|value): ea|(0010,1001)|
E: modifying tag in file C:\DicomResult\test\DICOM\USm.1.3.46.670589.99.8522846871569974419.2030391367630675584.dcm: Tag not found
I: Executing (option|path|value): ea|(0010,1002)|
I: Executing (option|path|value): ea|(0010,1010)|
E: modifying tag in file C:\DicomResult\test\DICOM\USm.1.3.46.670589.99.8522846871569974419.2030391367630675584.dcm: Tag not found
I: Executing (option|path|value): ea|(0010,1020)|
E: modifying tag in file C:\DicomResult\test\DICOM\USm.1.3.46.670589.99.8522846871569974419.2030391367630675584.dcm: Tag not found
I: Executing (option|path|value): ea|(0010,1030)|
E: modifying tag in file C:\DicomResult\test\DICOM\USm.1.3.46.670589.99.8522846871569974419.2030391367630675584.dcm: Tag not found
I: Executing (option|path|value): ea|(0010,1040)|
E: modifying tag in file C:\DicomResult\test\DICOM\USm.1.3.46.670589.99.8522846871569974419.2030391367630675584.dcm: Tag not found
I: Executing (option|path|value): ea|(0010,1090)|
E: modifying tag in file C:\DicomResult\test\DICOM\USm.1.3.46.670589.99.8522846871569974419.2030391367630675584.dcm: Tag not found
I: Executing (option|path|value): ea|(0010,2160)|
E: modifying tag in file C:\DicomResult\test\DICOM\USm.1.3.46.670589.99.8522846871569974419.2030391367630675584.dcm: Tag not found
I: Executing (option|path|value): ea|(0010,2180)|
E: modifying tag in file C:\DicomResult\test\DICOM\USm.1.3.46.670589.99.8522846871569974419.2030391367630675584.dcm: Tag not found
I: Executing (option|path|value): ea|(0010,21B0)|
I: Executing (option|path|value): ea|(0010,4000)|
I: Executing (option|path|value): ea|(0018,1030)|
E: modifying tag in file C:\DicomResult\test\DICOM\USm.1.3.46.670589.99.8522846871569974419.2030391367630675584.dcm: Tag not found
I: Executing (option|path|value): ea|(0020,4000)|
I: Executing (option|path|value): ea|(0040,0275)|
I: Executing (option|path|value): ea|(0040,A730)|
E: modifying tag in file C:\DicomResult\test\DICOM\USm.1.3.46.670589.99.8522846871569974419.2030391367630675584.dcm: Tag not found
I: Executing (option|path|value): ea|(0088,0140)|
E: modifying tag in file C:\DicomResult\test\DICOM\USm.1.3.46.670589.99.8522846871569974419.2030391367630675584.dcm: Tag not found
I: Executing (option|path|value): ea|(0018,1000)|
I: Executing (option|path|value): ea|(0018,1030)|
E: modifying tag in file C:\DicomResult\test\DICOM\USm.1.3.46.670589.99.8522846871569974419.2030391367630675584.dcm: Tag not found
I: Executing (option|path|value): ea|(3006,00C2)|
E: modifying tag in file C:\DicomResult\test\DICOM\USm.1.3.46.670589.99.8522846871569974419.2030391367630675584.dcm: Tag not found
I: Executing (option|path|value): ea|(0008,0021)|
I: Executing (option|path|value): ea|(0008,0023)|
I: Executing (option|path|value): ea|(0008,002A)|
I: Executing (option|path|value): ea|(0008,0031)|
I: Executing (option|path|value): ea|(0008,0033)|
I: Executing (option|path|value): ea|(0040,0241)|
E: modifying tag in file C:\DicomResult\test\DICOM\USm.1.3.46.670589.99.8522846871569974419.2030391367630675584.dcm: Tag not found
I: Executing (option|path|value): ea|(0040,0244)|
I: Executing (option|path|value): ea|(0040,0245)|
I: Executing (option|path|value): ea|(0040,0250)|
I: Executing (option|path|value): ea|(0040,0251)|
I: Executing (option|path|value): ea|(0040,0253)|
E: modifying tag in file C:\DicomResult\test\DICOM\USm.1.3.46.670589.99.8522846871569974419.2030391367630675584.dcm: Tag not found
I: Executing (option|path|value): ea|(0040,0254)|
I: Executing (option|path|value): ea|(0008,0012)|
I: Executing (option|path|value): ea|(0008,0013)|
I: Executing (option|path|value): ea|(0032,1032)|
E: modifying tag in file C:\DicomResult\test\DICOM\USm.1.3.46.670589.99.8522846871569974419.2030391367630675584.dcm: Tag not found
I: Executing (option|path|value): ea|(0038,0010)|
E: modifying tag in file C:\DicomResult\test\DICOM\USm.1.3.46.670589.99.8522846871569974419.2030391367630675584.dcm: Tag not found
I: Executing (option|path|value): ea|(0038,0300)|
E: modifying tag in file C:\DicomResult\test\DICOM\USm.1.3.46.670589.99.8522846871569974419.2030391367630675584.dcm: Tag not found
I: Executing (option|path|value): ea|(0032,1033)|
E: modifying tag in file C:\DicomResult\test\DICOM\USm.1.3.46.670589.99.8522846871569974419.2030391367630675584.dcm: Tag not found
I: Executing (option|path|value): ea|(0040,0275)|
E: modifying tag in file C:\DicomResult\test\DICOM\USm.1.3.46.670589.99.8522846871569974419.2030391367630675584.dcm: Tag not found
I: Executing (option|path|value): ma|(0008,0050)|
D: looking for occurences of: (0008,0050)
D: found 1 occurences
D: accessing existing tag for modify operation
I: Executing (option|path|value): ma|(0008,0080)|
D: looking for occurences of: (0008,0080)
D: found 1 occurences
D: accessing existing tag for modify operation
I: Executing (option|path|value): ma|(0008,0090)|
D: looking for occurences of: (0008,0090)
D: found 1 occurences
D: accessing existing tag for modify operation
I: Executing (option|path|value): ma|(0008,1050)|
D: looking for occurences of: (0008,1050)
D: found 1 occurences
D: accessing existing tag for modify operation
I: Executing (option|path|value): ma|(0008,1155)|
D: looking for occurences of: (0008,1155)
D: found 0 occurences
E: modifying tag in file C:\DicomResult\test\DICOM\USm.1.3.46.670589.99.8522846871569974419.2030391367630675584.dcm: Tag not found
I: Executing (option|path|value): ma|(0010,0040)|
D: looking for occurences of: (0010,0040)
D: found 1 occurences
D: accessing existing tag for modify operation
I: Executing (option|path|value): ma|(0020,0010)|
D: looking for occurences of: (0020,0010)
D: found 1 occurences
D: accessing existing tag for modify operation
I: Executing (option|path|value): ma|(0032,1030)|
D: looking for occurences of: (0032,1030)
D: found 1 occurences
D: accessing existing tag for modify operation
I: Executing (option|path|value): ma|(0032,4000)|
D: looking for occurences of: (0032,4000)
D: found 0 occurences
E: modifying tag in file C:\DicomResult\test\DICOM\USm.1.3.46.670589.99.8522846871569974419.2030391367630675584.dcm: Tag not found
I: Executing (option|path|value): ma|(0040,1002)|
D: looking for occurences of: (0040,1002)
D: found 0 occurences
E: modifying tag in file C:\DicomResult\test\DICOM\USm.1.3.46.670589.99.8522846871569974419.2030391367630675584.dcm: Tag not found
I: Executing (option|path|value): ma|(0008,0018)|1.3.6.1.4.1.9590.100.1.2.251750770412976860824956361571060229624
D: looking for occurences of: (0008,0018)
D: found 1 occurences
D: accessing existing tag for modify operation
I: Executing (option|path|value): ma|(0020,0200)|1.3.6.1.4.1.9590.100.1.2.313147651512053466011411503863862427729
D: looking for occurences of: (0020,0200)
D: found 0 occurences
E: modifying tag in file C:\DicomResult\test\DICOM\USm.1.3.46.670589.99.8522846871569974419.2030391367630675584.dcm: Tag not found
I: Executing (option|path|value): ma|(0040,A124)|1.3.6.1.4.1.9590.100.1.2.256167648513573096521024019441405738872
D: looking for occurences of: (0040,a124)
D: found 0 occurences
E: modifying tag in file C:\DicomResult\test\DICOM\USm.1.3.46.670589.99.8522846871569974419.2030391367630675584.dcm: Tag not found
I: Executing (option|path|value): ma|(3006,0024)|1.3.6.1.4.1.9590.100.1.2.213787106911682453617758667523558178075
D: looking for occurences of: (3006,0024)
D: found 0 occurences
E: modifying tag in file C:\DicomResult\test\DICOM\USm.1.3.46.670589.99.8522846871569974419.2030391367630675584.dcm: Tag not found
I: Executing (option|path|value): ma|(3006,00C2)|1.3.6.1.4.1.9590.100.1.2.83748874312891329203882131630669242388
D: looking for occurences of: (3006,00c2)
D: found 0 occurences
E: modifying tag in file C:\DicomResult\test\DICOM\USm.1.3.46.670589.99.8522846871569974419.2030391367630675584.dcm: Tag not found
I: Executing (option|path|value): ma|(0020,000D)|1.3.6.1.4.1.9590.100.1.2.349637040312134520722922674390424678787
D: looking for occurences of: (0020,000d)
D: found 1 occurences
D: accessing existing tag for modify operation
I: Executing (option|path|value): ma|(0020,000E)|1.3.6.1.4.1.9590.100.1.2.114787026812403464241278084263062373733
D: looking for occurences of: (0020,000e)
D: found 1 occurences
D: accessing existing tag for modify operation
I: Executing (option|path|value): ma|(0010,0020)|truui
D: looking for occurences of: (0010,0020)
D: found 1 occurences
D: accessing existing tag for modify operation
I: Executing (option|path|value): ma|(0010,0030)|19560101
D: looking for occurences of: (0010,0030)
D: found 1 occurences
D: accessing existing tag for modify operation
I: Executing (option|path|value): ma|(0010,0032)|12:00:00
D: looking for occurences of: (0010,0032)
D: found 0 occurences
E: modifying tag in file C:\DicomResult\test\DICOM\USm.1.3.46.670589.99.8522846871569974419.2030391367630675584.dcm: Tag not found
I: Executing (option|path|value): ma|(0010,0010)|dfhj
D: looking for occurences of: (0010,0010)
D: found 1 occurences
D: accessing existing tag for modify operation
I: Executing (option|path|value): ma|(0008,0020)|20211005
D: looking for occurences of: (0008,0020)
D: found 1 occurences
D: accessing existing tag for modify operation
I: Executing (option|path|value): ma|(0008,0030)|081951.986
D: looking for occurences of: (0008,0030)
D: found 1 occurences
D: accessing existing tag for modify operation
I: Executing (option|path|value): ma|(0008,103E)|VL_1
D: looking for occurences of: (0008,103e)
D: found 1 occurences
D: accessing existing tag for modify operation
D: DcmFileFormat::checkMetaHeaderValue() Version of MetaHeader is ok: 0x0100
D: DcmFileFormat::checkMetaHeaderValue() use SOPInstanceUID [1.3.6.1.4.1.9590.100.1.2.251750770412976860824956361571060229624] from Dataset
D: DcmFileFormat::checkMetaHeaderValue() use new TransferSyntaxUID [Little Endian Explicit] on writing following Dataset
D: DcmFileFormat: Found 8 Elements in DcmMetaInfo 'metinf'
I: Saving current dataset to file: C:\DicomResult\test\DICOM\USm.1.3.46.670589.99.8522846871569974419.2030391367630675584.dcm
I: ------------------------------------
E: There were 36 errors

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

Re: dcmodify: image extremely truncated

#4 Post by Marco Eichelberg »

My guess is that this is indeed some out-of-memory condition. dcmodify calls DcmItem::loadAllDataIntoMemory() to load the entire DICOM file into main memory before starting to modify it, but apparently does not check the return code of this call.
Are you perhaps using a 32-bit binary? That would explain the problem. In that case using a 64-bit binary might solve the problem.

amunaaser
Posts: 40
Joined: Thu, 2020-03-26, 10:29

Re: dcmodify: image extremely truncated

#5 Post by amunaaser »

Hi!
Thank you Marco! This was my guess as well.

But, what did you mean by "32-bit binary" and "64-bit binary"? Are you referring to the version of dcmodify or something else?

Best regards
Nasser Hosseini

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

Re: dcmodify: image extremely truncated

#6 Post by Michael Onken »

Hi,

where did you download DCMTK? If you download from dcmtk.org you should use dcmtk-3.6.7-win64-dynamic.zip from that site, instead of dcmtk-3.6.7-win32-dynamic.zip. The latter will only be able to use 4 GB of memory per process while the 64 bit version is (practically) only limited to your system memory.

Best,
Michael

amunaaser
Posts: 40
Joined: Thu, 2020-03-26, 10:29

Re: dcmodify: image extremely truncated

#7 Post by amunaaser »

Hi!

All right! I understand. I am actually using an older version of DCMTK, probably a 32-bit version, I'm not sure.
I tried with the newest version some time ago but somehow it did not function well with the rest of the application. Perhaps I need to retest it.
I'll most probably get back to you with further questions... :)

Thanks again and have a nice day!
Best regards
Nasser Hosseini

amunaaser
Posts: 40
Joined: Thu, 2020-03-26, 10:29

Re: dcmodify: image extremely truncated

#8 Post by amunaaser »

Hi again!

Just wanted to let you know using dcmodify from dcmtk-3.6.7-win64-dynamic solved my problem. :)

Thanks a lot!
Best regards
Nasser Hosseini

Post Reply

Who is online

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