[Insight-users] ManagedITK DICOM Losing Color

rlee rlee at usc.edu
Wed Nov 5 02:42:05 EST 2008


I'm trying to use ManagedITK 3.8 to read in a DICOM ultrasound with transfer
syntax 1.2.840.10008.1.2.4.70 (Lossless JPEG) and convert it to a Bitmap
using the following code:

itkImageBase image = itk.itkImage_SS2.New();
itk.itkImageFileReader_ISS2 reader = itk.itkImageFileReader_ISS2.New();
itk.itkGDCMImageIO gdcmImageIO = itk.itkGDCMImageIO.New();
reader.SetImageIO(gdcmImageIO);
                        
reader.FileName = dicomFileInfo.FullName;
reader.Update();
reader.GetOutput(image);

Bitmap bitmap;
PixelFormat format = PixelFormat.Format24bppRgb;

bitmap = new Bitmap(image.Size[0], image.Size[1], format);
itk.itkImageRegionConstIteratorWithIndex_ISS2 iterator = new
itk.itkImageRegionConstIteratorWithIndex_ISS2(image,
image.LargestPossibleRegion);
int pixelCounter = 0;

The salient DICOM headers are:

0028,0002 Samples Per Pixel = 3
0028,0004 Photometric Interpretation = RGB
0028,0006 Planar Configuration = 0
0028,0010 Rows = 480
0028,0011 Columns = 640
0028,0100 Bits Allocated = 8
0028,0101 Bits Stored = 8
0028,0102 High Bit = 7
0028,0103 Pixel Representation = 0

Strangely, the resulting image object has a "number of components per pixel"
= 1. When I render the bitmap, it is a shade of blue.

When I try loading DICOM images with the default transfer syntax, I notice
the same effect. There is only one component per pixel and the bitmap
renders a a shade of blue.

Can someone let me know if I'm approaching this incorrectly?

Thanks!

rlee
-- 
View this message in context: http://www.nabble.com/ManagedITK-DICOM-Losing-Color-tp20337287p20337287.html
Sent from the ITK - Users mailing list archive at Nabble.com.



More information about the Insight-users mailing list