[Insight-users] Writing DICOM PALETTE COLOR images

Todd Jensen todd.jensen at ieee.org
Sun Nov 11 20:38:26 EST 2007


I'm trying to write some secondary capture images.  I currently have it working to generate MONOCHROME2 photometric interpretation type images, but want to convert them to PALETTE COLOR.

So, I have the following:

    typedef itk::Array< short > PaletteDescType;
    PaletteDescType paletteDescriptor( 3 );
    paletteDescriptor[ 0 ] = 256;  // 256 values in colormap

    paletteDescriptor[ 1 ] = 0;  // start at zero

    paletteDescriptor[ 2 ] = 8;  // 8-bit values in colormap.
    itk::EncapsulateMetaData< PaletteDescType >( outMetaData, "0018|1101", paletteDescriptor );  // red

    typedef itk::Array< unsigned short > PaletteType;
    PaletteType red( 256 );
    [ ... set up red colormap ... ]

    itk::EncapsulateMetaData< PaletteType >( outMetaData, "0018|1201", paletteDescriptor );  // red

    [ ... repeat for green and blue ... ]

But my DICOM header has just a zero for the palette descriptor and the actual palettes are empty or nonsense.

Is there another type I should be using instead of itk::Array for these elements?  I have searched the user manual, examples, and mailing list and have not found a good sample.

Todd Jensen




More information about the Insight-users mailing list