16 Bit to 12 & 8 Bit Converter - DICOM

This is a discussion on 16 Bit to 12 & 8 Bit Converter - DICOM ; Hello I am looking for an algorithm or ready tool to convert 16 bit DICOM images to 12 or 8 bit images. Can somebody provides me right pointers? Regards, Prashant...

+ Reply to Thread
Results 1 to 2 of 2

Thread: 16 Bit to 12 & 8 Bit Converter

  1. 16 Bit to 12 & 8 Bit Converter

    Hello

    I am looking for an algorithm or ready tool to convert 16 bit DICOM
    images to 12 or 8 bit images.
    Can somebody provides me right pointers?

    Regards,
    Prashant


  2. Re: 16 Bit to 12 & 8 Bit Converter

    Please check whether the following code helps u out

    //16bit to 8 bit conversion-
    double[] subtract = new double[1]; subtract[0] = 0;
    double[] divide = new double[1]; divide[0] = 1./12.;
    // Now we can rescale the pixels gray levels:
    ParameterBlock pbRescale = new ParameterBlock();
    pbRescale.add(divide);
    pbRescale.add(subtract);
    pbRescale.addSource(source);//source is source image

    PlanarImage outputImage = (PlanarImage)JAI.create("rescale",
    pbRescale, null);
    // Make sure it is a byte image - force conversion.
    ParameterBlock pbConvert = new ParameterBlock();
    pbConvert.addSource(outputImage);
    pbConvert.add(DataBuffer.TYPE_BYTE);
    outputImage = JAI.create("format", pbConvert);
    Prash wrote:
    > Hello
    >
    > I am looking for an algorithm or ready tool to convert 16 bit DICOM
    > images to 12 or 8 bit images.
    > Can somebody provides me right pointers?
    >
    > Regards,
    > Prashant



+ Reply to Thread