Main Page | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members

mitkRGBToGrayFilter Class Reference

mitkRGBToGrayFilter - a filter to transfer RGB volume to gray volume More...

#include <mitkRGBToGrayFilter.h>

Inherits mitkVolumeToVolumeFilter.

Inheritance diagram for mitkRGBToGrayFilter:

Inheritance graph
[legend]
Collaboration diagram for mitkRGBToGrayFilter:

Collaboration graph
[legend]
List of all members.

Public Member Functions

virtual void PrintSelf (ostream &os)
void SetOutputDataType (int dataType)
void SetCoefficients (float coefRed, float coefGreen, float coefBlue)

Detailed Description

mitkRGBToGrayFilter - a filter to transfer RGB volume to gray volume

mitkRGBToGrayFilter is a filter to transfer RGB volume (with 3 channels) to gray volume (with 1 channel). The equation of the transform is:

$\mathbf{GRAY}=c_{\mathbf{RED}}*\mathbf{RED}+c_{\mathbf{GREEN}}*\mathbf{GREEN}+c_{\mathbf{BLUE}}*\mathbf{BLUE}$ where $c_{\mathbf{RED}}+c_{\mathbf{GREEN}}+c_{\mathbf{BLUE}}=1.0$ .
You can set $c_{\mathbf{RED}}$ , $c_{\mathbf{GREEN}}$ and $c_{\mathbf{BLUE}}$ by SetCoefficients().


Member Function Documentation

virtual void mitkRGBToGrayFilter::PrintSelf ostream &  os  )  [virtual]
 

Print the necessary information about this object for the debugging purpose.

Parameters:
os The specified ostream to output information.

Reimplemented from mitkVolumeToVolumeFilter.

void mitkRGBToGrayFilter::SetCoefficients float  coefRed,
float  coefGreen,
float  coefBlue
 

Set the transform coefficients. The coefficients will be normalized first so that $c_{\mathbf{RED}}+c_{\mathbf{GREEN}}+c_{\mathbf{BLUE}}=1.0$ . The final transform will be:

$\mathbf{GRAY}=c_{\mathbf{RED}}*\mathbf{RED}+c_{\mathbf{GREEN}}*\mathbf{GREEN}+c_{\mathbf{BLUE}}*\mathbf{BLUE}$ .
Parameters:
coefRed red coefficient
coefGreen green coefficient
coefBlue blue coefficient

void mitkRGBToGrayFilter::SetOutputDataType int  dataType  )  [inline]
 

Set data type of the output volume. MITK supports various data type.

Parameters:
data_type Its valid value and meaning is shown as follows:
MITK_CHAR The data type is char
MITK_UNSIGNED_CHAR The data type is unsigned char
MITK_SHORT The data type is short
MITK_UNSIGNED_SHORT The data type is unsigned short
MITK_INT The data type is int
MITK_UNSIGNED_INT The data type is unsigned int
MITK_LONG The data type is long
MITK_UNSIGNED_LONG The data type is unsigned long
MITK_FLOAT The data type is float
MITK_DOUBLE The data type is double


The documentation for this class was generated from the following file:
Generated on Tue Feb 25 15:05:43 2014 for MITK (Medical Imaging ToolKit) by  doxygen 1.4.3