[Insight-users] brightness - contrast - gamma

Martim Guilherme Schnack martims at terra.com.br
Tue, 02 Mar 2004 10:34:45 -0300


Hi Luis,

so, to do changes in the Brightness, Contrast and Gamma of an image, i 
should use a visualization toolkit... I started to use VTK a few weeks 
ago, so I'm a newbie.

This functions are implemented in VTK?
If so, how do I use them?

Thanks,

Martim



-----Mensagem original-----
De: Luis Ibanez [mailto:luis.ibanez at kitware.com]
Enviada em: terça-feira, 2 de março de 2004 00:24
Para: Martim Guilherme Schnack
Cc: insight-users at itk.org
Assunto: Re: [Insight-users] brightness - contrast - gamma



Hi Martin,

The concepts of

     - "Brightness",
     - "Contrast"
     - "Gamma correction"

are mostly associated to visualization.


Gamma for example is a correction for non-linearities between the 
emision of CRT screens and the perception of the human visual system. 
Since ITK is an image analysis toolkit and not a visualization toolkit, 
you will find limited support for such features in ITK.


You can find the equivalent of contrast and brightness corrections in 
the filters:


  - ShiftScaleImageFilter. 
http://www.itk.org/Insight/Doxygen/html/classitk_1_1ShiftScaleImageFilter.html

  - RescaleIntensityImageFilter 
http://www.itk.org/Insight/Doxygen/html/classitk_1_1RescaleIntensityImageFilter.html

  - IntensityWindowingImageFilter 
http://www.itk.org/Insight/Doxygen/html/classitk_1_1IntensityWindowingImageFilter.html


If you are really attached to the idea of implementing
Gamma correction, you could easily do this by modifying
the code of the RescaleIntensityImageFilter, that derives
from the UnaryFunctorImageFilter. 
http://www.itk.org/Insight/Doxygen/html/classitk_1_1UnaryFunctorImageFilter.html

You simply program you Gamma function as a 'Functor' as
use it as the third template parameter of this filter.



If you are doing this only for visualization, you may
find more productive to combine ITK and VTK. Details on
how to do this are available in the tutorial sessions:

        http://www.itk.org/HTML/Tutorials.htm

in particular in

http://www.itk.org/CourseWare/Training/GettingStarted-II.pdf