It appears that you are trying to visualize a JPEG (ITU 81) compressed DICOM file. According to the Photometric Interpretation value you gave us, it looks like Lossless compressed.
In any case the fact that the image is displayed with a greenish aspect is most likely caused by an inconsistency in between the color space indicated by the DICOM Photometric Interpretation and the actual color space indicated by the encapsulated Pixel Data JPEG stream.
Here is a small experiment you can try at home with your DICOM file:
$ sudo apt-get install libgdcm-tools
$ gdcmraw 1.2.826.0.1.3680043.214.533944214201189834015365840769154197151.dcm /tmp/pixel_data_stream.jpg
$ file /tmp/pixel_data_stream.jpg
/tmp/pixel_data_stream.jpg: JPEG image data
$ gdcmimg /tmp/pixel_data_stream.jpg /tmp/dicom.dcm
$ gdcminfo /tmp/dicom.dcm
[...]
TransferSyntax is 1.2.840.10008.1.2.4.70 [JPEG Lossless, Non-Hierarchical, First-Order Prediction (Process 14 [Selection Value 1]): Default Transfer Syntax for Lossless JPEG Image Compression]
NumberOfDimensions: 2
Dimensions: (256,256,1)
SamplesPerPixel :3
BitsAllocated :16
BitsStored :16
HighBit :15
PixelRepresentation:0
ScalarType found :UINT16
PhotometricInterpretation: RGB
PlanarConfiguration: 0
TransferSyntax: 1.2.840.10008.1.2.4.70
[...]
The goal of the experiment was to verify what was the actual color space as found in the JPEG bitstream. By removing the DICOM enveloppe (gdcmraw step), we make sure that gdcmimg
step will have no access to the DICOM Photometric Interpretation value and should deduce the right value directly from the JPEG stream itself.
In other word, if gdcmimg
reconstruct a DICOM file with a Photometric Interpretation different from the one as found in the original file, then you found your issue.
If you have access to the DCMTK toolkit, in particular dcmdjpeg, pay attention to the following advanced process option:
$ man dcmdjpeg
[...]
processing options
color space conversion:
+cp --conv-photometric
convert if YCbCr photometric interpretation (default)
# If the compressed image uses YBR_FULL or YBR_FULL_422 photometric
# interpretation, convert to RGB during decompression.
+cl --conv-lossy
convert YCbCr to RGB if lossy JPEG
# If the compressed image is encoded in lossy JPEG, assume YCbCr
# color model and convert to RGB.
+cg --conv-guess
convert to RGB if YCbCr is guessed by library
# If the underlying JPEG library "guesses" the color space of the
# compressed image to be YCbCr, convert to RGB.
+cgl --conv-guess-lossy
convert to RGB if lossy JPEG and YCbCr is
guessed by the underlying JPEG library
# If the compressed image is encoded in lossy JPEG and the underlying
# JPEG library "guesses" the color space to be YCbCr, convert to RGB.
+ca --conv-always
always convert YCbCr to RGB
# If the compressed image is a color image, assume YCbCr color model
# and convert to RGB.
+cn --conv-never
never convert color space
# Never convert color space during decompression.
Once your compressed DICOM file is decompressed by dcmdjpeg, the inconsistency in between the DICOM enveloppe and the JPEG bitstream is removed (only the Photometric Interpretation of the DICOM header can indicate the color space).
If you really want to keep your DICOM file with the original compressed bit stream. You may be able to fix the Photometric Interpretation value using something like this:
$ gdcmanon --dumb --replace 0028,0004=YBR_FULL 1.2.826.0.1.3680043.214.533944214201189834015365840769154197151.dcm /tmp/corrected.dcm
Or (if the compression is lossy):
$ gdcmanon --dumb --replace 0028,0004=YBR_FULL_422 1.2.826.0.1.3680043.214.533944214201189834015365840769154197151.dcm /tmp/corrected422.dcm