Public Member Functions | |
| ScalarBinaryToRGBAConverter (const T *_dataPtr, const B *_data2Ptr, unsigned char *_tmpPtr, int _sizeX, int _sizeY, int _sizeZ, mitk::TransferFunction::Pointer _tf) | |
| float | sample (int x, int y, int z) |
| bool | sampleBinary (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 301 of file mitkColourImageProcessor.cpp.
| mitk::ScalarBinaryToRGBAConverter< T, B >::ScalarBinaryToRGBAConverter | ( | const T * | _dataPtr, |
| const B * | _data2Ptr, | ||
| unsigned char * | _tmpPtr, | ||
| int | _sizeX, | ||
| int | _sizeY, | ||
| int | _sizeZ, | ||
| mitk::TransferFunction::Pointer | _tf | ||
| ) | [inline] |
Definition at line 317 of file mitkColourImageProcessor.cpp.
: ScalarBinaryToRGBAConverter( const T *_dataPtr,const B *_data2Ptr,unsigned char *_tmpPtr,int _sizeX,int _sizeY,int _sizeZ,mitk::TransferFunction::Pointer _tf ) { dataPtr=_dataPtr; data2Ptr=_data2Ptr; tmpPtr=_tmpPtr; sizeX=_sizeX; sizeY=_sizeY; sizeZ=_sizeZ;
| int mitk::ScalarBinaryToRGBAConverter< T, B >::clamp | ( | int | x ) | [inline] |
Definition at line 344 of file mitkColourImageProcessor.cpp.
| void mitk::ScalarBinaryToRGBAConverter< T, B >::compute | ( | int | x, |
| int | y, | ||
| int | z | ||
| ) | [inline] |
Definition at line 393 of file mitkColourImageProcessor.cpp.
| void mitk::ScalarBinaryToRGBAConverter< T, B >::compute1D | ( | int | y, |
| int | z | ||
| ) | [inline] |
Definition at line 426 of file mitkColourImageProcessor.cpp.
{
int x;
x=0;
computeClamp(x,y,z);
x++;
while(x<sizeX-1)
{
compute(x,y,z);
x++;
}
| void mitk::ScalarBinaryToRGBAConverter< T, B >::compute2D | ( | int | z ) | [inline] |
Definition at line 473 of file mitkColourImageProcessor.cpp.
References mitk::ScalarBinaryToRGBAConverter< T, B >::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::ScalarBinaryToRGBAConverter< T, B >::computeClamp | ( | int | x, |
| int | y, | ||
| int | z | ||
| ) | [inline] |
Definition at line 406 of file mitkColourImageProcessor.cpp.
Referenced by mitk::ScalarBinaryToRGBAConverter< T, B >::computeClamp1D(), and mitk::ScalarBinaryToRGBAConverter< T, B >::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::ScalarBinaryToRGBAConverter< T, B >::computeClamp1D | ( | int | y, |
| int | z | ||
| ) | [inline] |
Definition at line 447 of file mitkColourImageProcessor.cpp.
References mitk::ScalarBinaryToRGBAConverter< T, B >::computeClamp().
Referenced by mitk::ScalarBinaryToRGBAConverter< T, B >::compute2D(), and mitk::ScalarBinaryToRGBAConverter< T, B >::fillSlices().
{
computeClamp(x,y,z);
x++;
}
}
inline void computeClamp1D(int y,int z)
{
int x;
x=0;
| void mitk::ScalarBinaryToRGBAConverter< T, B >::computeClamp2D | ( | int | z ) | [inline] |
Definition at line 460 of file mitkColourImageProcessor.cpp.
References mitk::ScalarBinaryToRGBAConverter< T, B >::computeClamp().
{
computeClamp(x,y,z);
x++;
}
}
inline void computeClamp2D(int z)
{
int y;
y=0;
| void mitk::ScalarBinaryToRGBAConverter< T, B >::fillSlices | ( | ) | [inline] |
Definition at line 494 of file mitkColourImageProcessor.cpp.
References mitk::ScalarBinaryToRGBAConverter< T, B >::computeClamp1D().
{
computeClamp1D(y,z);
y++;
}
}
inline void fillSlices()
{
int z;
for(z=0;z<sizeZ;z++)
| float mitk::ScalarBinaryToRGBAConverter< T, B >::sample | ( | int | x, |
| int | y, | ||
| int | z | ||
| ) | [inline] |
Definition at line 334 of file mitkColourImageProcessor.cpp.
{
| bool mitk::ScalarBinaryToRGBAConverter< T, B >::sampleBinary | ( | int | x, |
| int | y, | ||
| int | z | ||
| ) | [inline] |
Definition at line 339 of file mitkColourImageProcessor.cpp.
{
| void mitk::ScalarBinaryToRGBAConverter< T, B >::write | ( | int | x, |
| int | y, | ||
| int | z, | ||
| float | grayValue, | ||
| float | gx, | ||
| float | gy, | ||
| float | gz | ||
| ) | [inline] |
Definition at line 350 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)
{
if(sampleBinary(x,y,z))
{
/*
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) );
opacity *= gradientTransferFunction->GetValue( double(0.5f*t) );
tmpPtr[doff*4+0] = int( rgb[0]*255 + 0.5 );
tmpPtr[doff*4+1] = int( rgb[1]*255 + 0.5 );
tmpPtr[doff*4+2] = int( rgb[2]*255 + 0.5 );
tmpPtr[doff*4+3] = int( opacity*255 + 0.5 );
}
else
{
1.7.2