[vtk-developers] 12-bit grayscale display

David Gobbi david.gobbi at gmail.com
Thu Feb 7 11:48:14 EST 2013


On Thu, Feb 7, 2013 at 7:27 AM, Uma Maheshwaran <uma at lucidindia.com> wrote:

> Hello David,
>
> Thanks for the information. Please see the page 15, 16 of Totoku white
> paper on GrayScale resolution<http://www.totoku.com/display/support/pdf/Required_Grayscale_Accuracy_in_Medical_Displays(En)_V10.pdf>
>
> I am not able to get any details about "Customized conversion table".
>
> Please clarify following questions regarding lookup table,
>
>    -  We are using vtkColorTransferFunction and vtkImageResliceMapper. As
>    per your suggestion, we will have to change this to vtkLookupTable with
>    4096 entries to support monochrome 12-bit display.
>
> Yes, you should use a vtkLookupTable.  Do not use a
vtkColorTransferFunction.

>
>
> vtkSmartPointer <vtkColorTransferFunction> lookupTable = vtkSmartPointer
> <vtkColorTransferFunction> :: New();
>  lookupTable -> AddRGBPoint(range[0], 0, 0, 0); // scalarmin
> lookupTable -> AddRGBPoint(range[1], 1, 1, 1); //scalarmax
>
> vtkSmartPointer <vtkImageProperty> imageProp = vtkSmartPointer
> <vtkImageProperty> :: New();
>  imageProp -> SetLookupTable(lookupTable);
> imageProp -> SetInterpolationTypeToNearest();
>
>         vtkSmartPointer <vtkImageResliceMapper> mapper = vtkSmartPointer
> <vtkImageResliceMapper> :: New();
>  mapper -> SetInputConnection(imageData -> GetProducerPort());
>
>    - As per your suggestion in vtk-users forum, the following lookup
>    table is created for 11-bit grayscale. Luminance is calculated based on the
>    standard formula Y = R*0.30 + G*0.59 + B*0.11.  Please verify and I
>    will try to set this 2048 entries in vtkLookuptable.
>
>  R,G,B ->  y
>
>  0,0,0      0
>
>  0,0,1     0.11 (close to 0.125)
>
>  1,0,0     0.3 (close to 0.25)
>
>  1,0,1     0.41 (close to 0.375)
>
>  1,0,2     0.52 (close to 0.5)
>
>  0,1,0     0.59 (close to 0.625 )
>
>  0,1,2     0.81 (close to 0.75)
>
>  1,1,0     0.89 (close to 0.875)
>
>  1,1,1     1
>
>  1,1,2     ~1.125
>
>  2,1,1     ~1.25
>
>  2,1,2     ~1.375
>
>  2,1,3     ~1.5
>
>  1,2,1     ~1.625
>
>  1,2,3     ~1.75
>
>  2,2,1     ~1.875
>
>  2,2,2     2  (....etc upto 2048 entries)
>
>
Yes, this should provide 11 bits of grey on greyscale monitors.


>    - How to build 4096 entries lookup table?  For example, What R, G,B
>    value should be used to get 0.0625 luminance?  Do we have to use alpha
>    channel for generating 4096 entries?
>
>  R,G,B,A->       y
>
>  0,0,0 ,0          0
>  0,0,0,128       ~0.0625
>  0,0,1,0           ~0.125
>  0,0,1,128        ~0.1875....like this etc upto 4096 entries?
>
>
The alpha channel is not transmitted to the monitor, so it cannot be used.
There is no alpha in the equation: Y = R*0.30 + G*0.59 + B*0.11

For 12-bit, you need to choose the R, G, and B that provide Y values
that most closely approximate the desired greyscale values.  It will
be impossible to achieve a linear scale with 4096 distinct greys, but
I think that over 3000 will be possible.

You should also check with the manufacturer for the exact equation
that they use to convert R, G, B to Y.  The equation that I gave is
the one most commonly used in North America, but it is part of an
old video standard (CCIR 601).  That's why it would be best if you
can get the conversion table directly from Totoku.

 - David
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtk-developers/attachments/20130207/350c35ce/attachment.html>


More information about the vtk-developers mailing list