#include <itkTensorToRgbImageFilter.h>
Public Types | |
| typedef TensorToRgbImageFilter | Self |
| typedef ImageToImageFilter < TInputImage, TOutputImage > | Superclass |
| typedef SmartPointer< Self > | Pointer |
| typedef SmartPointer< const Self > | ConstPointer |
| typedef Superclass::InputImageType | InputImageType |
| typedef Superclass::OutputImageType | OutputImageType |
| typedef OutputImageType::PixelType | OutputPixelType |
| typedef TInputImage::PixelType | InputPixelType |
| typedef InputPixelType::ValueType | InputValueType |
Public Member Functions | |
| virtual const char * | GetClassName () const |
| void | PrintSelf (std::ostream &os, Indent indent) const |
Static Public Member Functions | |
| static Pointer | New () |
Protected Member Functions | |
| TensorToRgbImageFilter () | |
| virtual | ~TensorToRgbImageFilter () |
| void | GenerateData () |
Definition at line 35 of file itkTensorToRgbImageFilter.h.
| typedef SmartPointer<const Self> itk::TensorToRgbImageFilter< TInputImage, TOutputImage >::ConstPointer |
Definition at line 44 of file itkTensorToRgbImageFilter.h.
| typedef Superclass::InputImageType itk::TensorToRgbImageFilter< TInputImage, TOutputImage >::InputImageType |
Definition at line 46 of file itkTensorToRgbImageFilter.h.
| typedef TInputImage::PixelType itk::TensorToRgbImageFilter< TInputImage, TOutputImage >::InputPixelType |
Definition at line 49 of file itkTensorToRgbImageFilter.h.
| typedef InputPixelType::ValueType itk::TensorToRgbImageFilter< TInputImage, TOutputImage >::InputValueType |
Definition at line 50 of file itkTensorToRgbImageFilter.h.
| typedef Superclass::OutputImageType itk::TensorToRgbImageFilter< TInputImage, TOutputImage >::OutputImageType |
Definition at line 47 of file itkTensorToRgbImageFilter.h.
| typedef OutputImageType::PixelType itk::TensorToRgbImageFilter< TInputImage, TOutputImage >::OutputPixelType |
Definition at line 48 of file itkTensorToRgbImageFilter.h.
| typedef SmartPointer<Self> itk::TensorToRgbImageFilter< TInputImage, TOutputImage >::Pointer |
Definition at line 43 of file itkTensorToRgbImageFilter.h.
| typedef TensorToRgbImageFilter itk::TensorToRgbImageFilter< TInputImage, TOutputImage >::Self |
Standard class typedefs.
Definition at line 40 of file itkTensorToRgbImageFilter.h.
| typedef ImageToImageFilter<TInputImage,TOutputImage> itk::TensorToRgbImageFilter< TInputImage, TOutputImage >::Superclass |
Definition at line 42 of file itkTensorToRgbImageFilter.h.
| itk::TensorToRgbImageFilter< TInputImage, TOutputImage >::TensorToRgbImageFilter | ( | ) | [inline, protected] |
Definition at line 70 of file itkTensorToRgbImageFilter.h.
{};
| virtual itk::TensorToRgbImageFilter< TInputImage, TOutputImage >::~TensorToRgbImageFilter | ( | ) | [inline, protected, virtual] |
Definition at line 71 of file itkTensorToRgbImageFilter.h.
{};
| void itk::TensorToRgbImageFilter< TInputImage, TOutputImage >::GenerateData | ( | ) | [inline, protected] |
Definition at line 73 of file itkTensorToRgbImageFilter.h.
References __IMG_DAT_ITEM__CEIL_ZERO_ONE__.
{
typename InputImageType::Pointer tensorImage = static_cast< InputImageType * >( this->ProcessObject::GetInput(0) );
typename OutputImageType::Pointer outputImage =
static_cast< OutputImageType * >(this->ProcessObject::GetOutput(0));
typename InputImageType::RegionType region = tensorImage->GetLargestPossibleRegion();
outputImage->SetSpacing( tensorImage->GetSpacing() ); // Set the image spacing
outputImage->SetOrigin( tensorImage->GetOrigin() ); // Set the image origin
outputImage->SetDirection( tensorImage->GetDirection() ); // Set the image direction
outputImage->SetRegions( tensorImage->GetLargestPossibleRegion());
outputImage->Allocate();
typedef ImageRegionConstIterator< InputImageType > TensorImageIteratorType;
TensorImageIteratorType tensorIt(tensorImage, tensorImage->GetLargestPossibleRegion());
typedef ImageRegionIterator< OutputImageType > OutputImageIteratorType;
OutputImageIteratorType outputIt(outputImage, outputImage->GetLargestPossibleRegion());
tensorIt.GoToBegin();
outputIt.GoToBegin();
while(!tensorIt.IsAtEnd() && !outputIt.IsAtEnd()){
InputPixelType x = tensorIt.Get();
// eigenvalues are sorted in ascending order by default because the
// itk::SymmetricEigenAnalysis defaults are not touched in the tensor implementation
typename InputPixelType::EigenValuesArrayType eigenvalues;
typename InputPixelType::EigenVectorsMatrixType eigenvectors;
x.ComputeEigenAnalysis(eigenvalues, eigenvectors);
// int index = 2;
// if( (eigenvalues[0] >= eigenvalues[1])
// && (eigenvalues[0] >= eigenvalues[2]) )
// index = 0;
// else if(eigenvalues[1] >= eigenvalues[2])
// index = 1;
const float fa = x.GetFractionalAnisotropy();
float r = fabs(eigenvectors(2/*index*/,0)) * fa;
float g = fabs(eigenvectors(2/*index*/,1)) * fa;
float b = fabs(eigenvectors(2/*index*/,2)) * fa;
// float a = (fa-(m_OpacLevel-m_OpacWindow/2.0f))/m_OpacWindow;
float a = fa;
__IMG_DAT_ITEM__CEIL_ZERO_ONE__(r);
__IMG_DAT_ITEM__CEIL_ZERO_ONE__(g);
__IMG_DAT_ITEM__CEIL_ZERO_ONE__(b);
__IMG_DAT_ITEM__CEIL_ZERO_ONE__(a);
OutputPixelType out;
out.SetRed( r * 255.0f);
out.SetGreen( g * 255.0f);
out.SetBlue( b * 255.0f);
out.SetAlpha( a * 255.0f);
outputIt.Set(out);
++tensorIt;
++outputIt;
}
}
| virtual const char* itk::TensorToRgbImageFilter< TInputImage, TOutputImage >::GetClassName | ( | ) | const [virtual] |
Run-time type information (and related methods).
| static Pointer itk::TensorToRgbImageFilter< TInputImage, TOutputImage >::New | ( | ) | [static] |
Method for creation through the object factory.
| void itk::TensorToRgbImageFilter< TInputImage, TOutputImage >::PrintSelf | ( | std::ostream & | os, |
| Indent | indent | ||
| ) | const [inline] |
Print internal ivars
Definition at line 59 of file itkTensorToRgbImageFilter.h.
{ this->Superclass::PrintSelf( os, indent ); }
1.7.2