Problems using dcmdjpeg.exe

All other questions regarding DCMTK

Moderator: Moderator Team

Post Reply
Message
Author
vivalls
Posts: 8
Joined: Tue, 2008-02-05, 17:48

Problems using dcmdjpeg.exe

#1 Post by vivalls »

Hi all,

I'm trying use dcmdjpeg tool to convert a Dicom compressed image to a non compressed.

The process seems to work fine, I see the file size from new file is higher, however when try open the image with a Dicom Viewer (K-PACS, Acculite...) the image has two pixel color, white or black, doesn't exist a grey scale.

The dicom image is a CT image.

Any idea or sugestion?

Thanks a lot!

PD: This is the dicom dump from the compresed image:


# Dicom-File-Format

# Dicom-Meta-Information-Header
# Used TransferSyntax: LittleEndianExplicit
(0002,0000) UL 204 # 4, 1 MetaElementGroupLength
(0002,0001) OB 00\01 # 2, 1 FileMetaInformationVersion
(0002,0002) UI =CTImageStorage # 26, 1 MediaStorageSOPClassUID
(0002,0003) UI [1.2.392.200036.9116.2.2.2.1762661342.1200485157.254648] # 54, 1 MediaStorageSOPInstanceUID
(0002,0010) UI =JPEGLossless:Non-hierarchical:Process14 # 22, 1 TransferSyntaxUID
(0002,0012) UI [1.2.840.113773.7.5] # 18, 1 ImplementationClassUID
(0002,0013) SH [7.9.12] # 6, 1 ImplementationVersionName
(0002,0016) AE [TM_CT_CMW_V2.00] # 16, 1 SourceApplicationEntityTitle

# Dicom-Data-Set
# Used TransferSyntax: JPEG Lossless, Non-hierarchical, Process 14
(0008,0008) CS [ORIGINAL\PRIMARY\AXIAL] # 22, 3 ImageType
(0008,0016) UI =CTImageStorage # 26, 1 SOPClassUID
(0008,0018) UI [1.2.392.200036.9116.2.2.2.1762661342.1200485157.254648] # 54, 1 SOPInstanceUID
(0008,0020) DA [20080116] # 8, 1 StudyDate
(0008,0022) DA [20080116] # 8, 1 AcquisitionDate
(0008,0023) DA [20080116] # 8, 1 ContentDate
(0008,0030) TM [201000] # 6, 1 StudyTime
(0008,0032) TM [210454.200] # 10, 1 AcquisitionTime
(0008,0033) TM [210456.290] # 10, 1 ContentTime
(0008,0050) SH [070010331235207] # 16, 1 AccessionNumber
(0008,0060) CS [CT] # 2, 1 Modality
(0008,0070) LO [TOSHIBA] # 8, 1 Manufacturer
(0008,0080) LO (no value available) # 0, 0 InstitutionName
(0008,0090) PN [AAAAA] # 6, 1 ReferringPhysiciansName
(0008,1010) SH [000000001] # 10, 1 StationName
(0008,1030) LO (no value available) # 0, 0 StudyDescription
(0008,1040) LO [ID_DEPARTMENT] # 14, 1 InstitutionalDepartmentName
(0008,1090) LO [Aquilion] # 8, 1 ManufacturersModelName
(0010,0010) PN (no value available) # 0, 0 PatientsName
(0010,0020) LO (no value available) # 0, 0 PatientID
(0010,0030) DA [19620710] # 8, 1 PatientsBirthDate
(0010,0040) CS [F] # 2, 1 PatientsSex
(0010,4000) LT [T6] # 2, 1 PatientComments
(0018,0010) LO [CE] # 2, 1 ContrastBolusAgent
(0018,0022) CS [HELICAL_CT] # 10, 1 ScanOptions
(0018,0050) DS [6.0] # 4, 1 SliceThickness
(0018,0060) DS [120] # 4, 1 KVP
(0018,0090) DS [400.00] # 6, 1 DataCollectionDiameter
(0018,1000) LO [C1622303] # 8, 1 DeviceSerialNumber
(0018,1020) LO [V2.05ER001] # 10, 1 SoftwareVersions
(0018,1042) TM [210427.300] # 10, 1 ContrastBolusStartTime
(0018,1100) DS [360.937] # 8, 1 ReconstructionDiameter
(0018,1120) DS [+0.0] # 4, 1 GantryDetectorTilt
(0018,1130) DS [+88.00] # 6, 1 TableHeight
(0018,1140) CS [CW] # 2, 1 RotationDirection
(0018,1150) IS [500] # 4, 1 ExposureTime
(0018,1151) IS [300] # 4, 1 XRayTubeCurrent
(0018,1152) IS [150] # 4, 1 Exposure
(0018,1210) SH [FC11] # 4, 1 ConvolutionKernel
(0018,5100) CS [HFS] # 4, 1 PatientPosition
(0020,000d) UI [1.2.840.113773.2.10051.999.20071213085350.68215] # 48, 1 StudyInstanceUID
(0020,000e) UI [1.2.392.200036.9116.2.2.2.1762661342.1200485151.674001] # 54, 1 SeriesInstanceUID
(0020,0010) SH [879121] # 6, 1 StudyID
(0020,0011) IS [2] # 2, 1 SeriesNumber
(0020,0012) IS [2] # 2, 1 AcquisitionNumber
(0020,0013) IS [5] # 2, 1 InstanceNumber
(0020,0020) CS [L\P] # 4, 2 PatientOrientation
(0020,0032) DS [-178.906000\-180.468700\272.500000] # 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.9116.2.2.2.1762661342.1200484951.130807] # 54, 1 FrameOfReferenceUID
(0020,1040) LO (no value available) # 0, 0 PositionReferenceIndicator
(0020,1041) DS [+272.50] # 8, 1 SliceLocation
(0028,0002) US 1 # 2, 1 SamplesPerPixel
(0028,0004) CS [MONOCHROME2] # 12, 1 PhotometricInterpretation
(0028,0010) US 512 # 2, 1 Rows
(0028,0011) US 512 # 2, 1 Columns
(0028,0030) DS [0.705\0.705] # 12, 2 PixelSpacing
(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,1050) DS [40] # 2, 1 WindowCenter
(0028,1051) DS [400] # 4, 1 WindowWidth
(0028,1052) DS [0] # 2, 1 RescaleIntercept
(0028,1053) DS [1] # 2, 1 RescaleSlope
(0040,0002) DA [20080116] # 8, 1 ScheduledProcedureStepStartDate
(0040,0003) TM [210230.000] # 10, 1 ScheduledProcedureStepStartTime
(0040,0004) DA [20080116] # 8, 1 ScheduledProcedureStepEndDate
(0040,0005) TM [212230.000] # 10, 1 ScheduledProcedureStepEndTime
(0040,0244) DA [20080116] # 8, 1 PerformedProcedureStepStartDate
(0040,0245) TM [210230.000] # 10, 1 PerformedProcedureStepStartTime
(0040,0253) CS [33073] # 6, 1 PerformedProcedureStepID
(7fe0,0010) OB (PixelSequence #=2) # u/l, 1 PixelData
(fffe,e000) pi (no value available) # 0, 1 Item
(fffe,e000) pi ff\d8\ff\fe\00\0a\4a\50\45\47\20\50\72\6f\ff\c3\00\0b\10\02\00\02... # 179950, 1 Item
(fffe,e0dd) na (SequenceDelimitationItem) # 0, 0 SequenceDelimitationItem

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

#2 Post by Marco Eichelberg »

Most likely a defective compressed image. If you want us to look at the file, send it by e-mail to dicom <at> offis <dot> de.

vivalls
Posts: 8
Joined: Tue, 2008-02-05, 17:48

#3 Post by vivalls »

OK, I send you a mail with the compressed imaged.

Thanks a lot

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

#4 Post by Marco Eichelberg »

Thanks for the sample. The image has indeed be compressed in an incorrect manner. It seems that before compression the pixel data has been converted from signed to unsigned (by adding 32768 to each pixel value), but the DICOM header has not been updated to correctly reflect this change. This causes an incorrect interpretation of the image by (any correct) viewer. You can fix the image by applying the following change, before or after decompression:

Code: Select all

dcmodify -m PixelRepresentation=0 image.dcm
dcmodify -m RescaleIntercept=-32768 image.dcm

vivalls
Posts: 8
Joined: Tue, 2008-02-05, 17:48

#5 Post by vivalls »

Seems works fine, however I need modify the contrast because when open the image is in black.

Any sugestion?

Thanks for all!

vivalls
Posts: 8
Joined: Tue, 2008-02-05, 17:48

#6 Post by vivalls »

Hi Marco, seems I fixed the problem using the RescaleIntercept to 0 value.

Please continue working with dcmtk because there are a very powerful library.

Thanks!

vivalls
Posts: 8
Joined: Tue, 2008-02-05, 17:48

Not solved completely

#7 Post by vivalls »

Hi again,


I've open correctly the CT Image, but now I have a similiar problem with MRI image.

I've decompress the image using dcmdjpeg and modify the head using:

dcmodify -m PixelRepresentation=0 image.dcm
dcmodify -m RescaleIntercept=-32768 image.dcm

Seems the image is decompressed, however I can't see the image only see it in white.

Any suggestion?

Thanks for all

vivalls
Posts: 8
Joined: Tue, 2008-02-05, 17:48

#8 Post by vivalls »

Hi all,

the problem seems the tag RescaleIntercept doesn't exist in the header:

Processing file: c:\comparativa\b.IMG
Executing (option|path|value): m|RescaleIntercept|-32768
Error modifying tag: Tag Not Found
Renamed backup file to original
------------------------------------
There were 1 error(s)

So, is possible do something?

Thanks for all

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

#9 Post by Michael Onken »

Hi,

maybe you can use "dcmodify -i RescaleIntercept=-32768 c:\comparativa\b.IMG " to insert the attribute?

Regards,
Michael

vivalls
Posts: 8
Joined: Tue, 2008-02-05, 17:48

#10 Post by vivalls »

Hi,

I've add the RescaleIntercept attribute but the result is the same, the image is white completely.

Any idea?

Thnaks for all

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

#11 Post by Marco Eichelberg »

Any idea?
Poor viewer implementation would be my guess. The DCMTK visualization classes and tools work fine with the image once fixed as per my description. In particular, standard CT window/level pre-sets as well as the Window Centre/Width setting stored in the image should work after the transformation, and they will not if RescaleIntercept remains 0.

vivalls
Posts: 8
Joined: Tue, 2008-02-05, 17:48

#12 Post by vivalls »

Yes, is really a poor implementation, but I don't know understant why works correctly with a CT image but no in MR image.

Thanks for all

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest