Public Member Functions | |
| ScalarToRGBAConverter (const T *_dataPtr, unsigned char *_tmpPtr, int _sizeX, int _sizeY, int _sizeZ, mitk::TransferFunction::Pointer _tf) | |
| float | sample (int x, int y, int z) |
| int | clamp (int x) |
| void | write (int x, int y, int z, float grayValue, float gx, float gy, float gz) |
| void | compute (int x, int y, int z) |
| void | computeClamp (int x, int y, int z) |
| void | compute1D (int y, int z) |
| void | computeClamp1D (int y, int z) |
| void | computeClamp2D (int z) |
| void | compute2D (int z) |
| void | fillSlices () |
Definition at line 29 of file mitkColourImageProcessor.cpp.
| mitk::ScalarToRGBAConverter< T >::ScalarToRGBAConverter | ( | const T * | _dataPtr, |
| unsigned char * | _tmpPtr, | ||
| int | _sizeX, | ||
| int | _sizeY, | ||
| int | _sizeZ, | ||
| mitk::TransferFunction::Pointer | _tf | ||
| ) | [inline] |
Definition at line 44 of file mitkColourImageProcessor.cpp.
: ScalarToRGBAConverter( const T *_dataPtr,unsigned char *_tmpPtr,int _sizeX,int _sizeY,int _sizeZ,mitk::TransferFunction::Pointer _tf ) { dataPtr=_dataPtr; tmpPtr=_tmpPtr; sizeX=_sizeX; sizeY=_sizeY; sizeZ=_sizeZ;
| int mitk::ScalarToRGBAConverter< T >::clamp | ( | int | x ) | [inline] |
Definition at line 65 of file mitkColourImageProcessor.cpp.
| void mitk::ScalarToRGBAConverter< T >::compute | ( | int | x, |
| int | y, | ||
| int | z | ||
| ) | [inline] |
Definition at line 103 of file mitkColourImageProcessor.cpp.
| void mitk::ScalarToRGBAConverter< T >::compute1D | ( | int | y, |
| int | z | ||
| ) | [inline] |
Definition at line 136 of file mitkColourImageProcessor.cpp.
{
int x;
x=0;
computeClamp(x,y,z);
x++;
while(x<sizeX-1)
{
compute(x,y,z);
x++;
}
| void mitk::ScalarToRGBAConverter< T >::compute2D | ( | int | z ) | [inline] |
Definition at line 183 of file mitkColourImageProcessor.cpp.
References mitk::ScalarToRGBAConverter< T >::computeClamp1D().
{
computeClamp1D(y,z);
y++;
}
}
inline void compute2D(int z)
{
int y;
y=0;
computeClamp1D(y,z);
y++;
while(y<sizeY-1)
{
compute1D(y,z);
y++;
}
| void mitk::ScalarToRGBAConverter< T >::computeClamp | ( | int | x, |
| int | y, | ||
| int | z | ||
| ) | [inline] |
Definition at line 116 of file mitkColourImageProcessor.cpp.
Referenced by mitk::ScalarToRGBAConverter< T >::computeClamp1D(), and mitk::ScalarToRGBAConverter< T >::computeClamp2D().
{
float grayValue = sample(x,y,z);
float gx,gy,gz;
if(x==0) gx = 2.0f * ( sample(x+1,y,z) - grayValue );
else if(x==sizeXm1) gx = 2.0f * ( grayValue - sample(x-1,y,z) );
else gx = sample(x+1,y,z) - sample(x-1,y,z);
if(y==0) gy = 2.0f * ( sample(x,y+1,z) - grayValue );
else if(y==sizeYm1) gy = 2.0f * ( grayValue - sample(x,y-1,z) );
else gy = sample(x,y+1,z) - sample(x,y-1,z);
| void mitk::ScalarToRGBAConverter< T >::computeClamp1D | ( | int | y, |
| int | z | ||
| ) | [inline] |
Definition at line 157 of file mitkColourImageProcessor.cpp.
References mitk::ScalarToRGBAConverter< T >::computeClamp().
Referenced by mitk::ScalarToRGBAConverter< T >::compute2D(), and mitk::ScalarToRGBAConverter< T >::fillSlices().
{
computeClamp(x,y,z);
x++;
}
}
inline void computeClamp1D(int y,int z)
{
int x;
x=0;
| void mitk::ScalarToRGBAConverter< T >::computeClamp2D | ( | int | z ) | [inline] |
Definition at line 170 of file mitkColourImageProcessor.cpp.
References mitk::ScalarToRGBAConverter< T >::computeClamp().
{
computeClamp(x,y,z);
x++;
}
}
inline void computeClamp2D(int z)
{
int y;
y=0;
| void mitk::ScalarToRGBAConverter< T >::fillSlices | ( | ) | [inline] |
Definition at line 204 of file mitkColourImageProcessor.cpp.
References mitk::ScalarToRGBAConverter< T >::computeClamp1D().
{
computeClamp1D(y,z);
y++;
}
}
inline void fillSlices()
{
int z;
for(z=0;z<sizeZ;z++)
| float mitk::ScalarToRGBAConverter< T >::sample | ( | int | x, |
| int | y, | ||
| int | z | ||
| ) | [inline] |
Definition at line 60 of file mitkColourImageProcessor.cpp.
{
| void mitk::ScalarToRGBAConverter< T >::write | ( | int | x, |
| int | y, | ||
| int | z, | ||
| float | grayValue, | ||
| float | gx, | ||
| float | gy, | ||
| float | gz | ||
| ) | [inline] |
Definition at line 71 of file mitkColourImageProcessor.cpp.
{
if(x<0) x=0; else if(x>255) x=255;
return x;
}
inline void write(int x,int y,int z,float grayValue,float gx,float gy,float gz)
{
/*
gx /= aspect[0];
gy /= aspect[1];
gz /= aspect[2];
*/
// Compute the gradient magnitude
float t = sqrtf( gx*gx + gy*gy + gz*gz );
int doff = x + y * sizeX + z * sizeXY;
vtkPiecewiseFunction* opacityTransferFunction = tf->GetScalarOpacityFunction();
vtkPiecewiseFunction* gradientTransferFunction = tf->GetGradientOpacityFunction();
vtkColorTransferFunction* colorTransferFunction = tf->GetColorTransferFunction();
double rgb[3];
colorTransferFunction->GetColor( double(grayValue), rgb);
double opacity= opacityTransferFunction->GetValue( double(grayValue) );
1.7.2