Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions

itk::TensorToRgbImageFilter< TInputImage, TOutputImage > Class Template Reference

#include <itkTensorToRgbImageFilter.h>

List of all members.

Public Types

typedef TensorToRgbImageFilter Self
typedef ImageToImageFilter
< TInputImage, TOutputImage > 
Superclass
typedef SmartPointer< SelfPointer
typedef SmartPointer< const SelfConstPointer
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 ()

Detailed Description

template<typename TInputImage, typename TOutputImage = itk::Image<itk::RGBAPixel<unsigned char>,3>>
class itk::TensorToRgbImageFilter< TInputImage, TOutputImage >

Definition at line 35 of file itkTensorToRgbImageFilter.h.


Member Typedef Documentation

template<typename TInputImage , typename TOutputImage = itk::Image<itk::RGBAPixel<unsigned char>,3>>
typedef SmartPointer<const Self> itk::TensorToRgbImageFilter< TInputImage, TOutputImage >::ConstPointer

Definition at line 44 of file itkTensorToRgbImageFilter.h.

template<typename TInputImage , typename TOutputImage = itk::Image<itk::RGBAPixel<unsigned char>,3>>
typedef Superclass::InputImageType itk::TensorToRgbImageFilter< TInputImage, TOutputImage >::InputImageType

Definition at line 46 of file itkTensorToRgbImageFilter.h.

template<typename TInputImage , typename TOutputImage = itk::Image<itk::RGBAPixel<unsigned char>,3>>
typedef TInputImage::PixelType itk::TensorToRgbImageFilter< TInputImage, TOutputImage >::InputPixelType

Definition at line 49 of file itkTensorToRgbImageFilter.h.

template<typename TInputImage , typename TOutputImage = itk::Image<itk::RGBAPixel<unsigned char>,3>>
typedef InputPixelType::ValueType itk::TensorToRgbImageFilter< TInputImage, TOutputImage >::InputValueType

Definition at line 50 of file itkTensorToRgbImageFilter.h.

template<typename TInputImage , typename TOutputImage = itk::Image<itk::RGBAPixel<unsigned char>,3>>
typedef Superclass::OutputImageType itk::TensorToRgbImageFilter< TInputImage, TOutputImage >::OutputImageType

Definition at line 47 of file itkTensorToRgbImageFilter.h.

template<typename TInputImage , typename TOutputImage = itk::Image<itk::RGBAPixel<unsigned char>,3>>
typedef OutputImageType::PixelType itk::TensorToRgbImageFilter< TInputImage, TOutputImage >::OutputPixelType

Definition at line 48 of file itkTensorToRgbImageFilter.h.

template<typename TInputImage , typename TOutputImage = itk::Image<itk::RGBAPixel<unsigned char>,3>>
typedef SmartPointer<Self> itk::TensorToRgbImageFilter< TInputImage, TOutputImage >::Pointer

Definition at line 43 of file itkTensorToRgbImageFilter.h.

template<typename TInputImage , typename TOutputImage = itk::Image<itk::RGBAPixel<unsigned char>,3>>
typedef TensorToRgbImageFilter itk::TensorToRgbImageFilter< TInputImage, TOutputImage >::Self

Standard class typedefs.

Definition at line 40 of file itkTensorToRgbImageFilter.h.

template<typename TInputImage , typename TOutputImage = itk::Image<itk::RGBAPixel<unsigned char>,3>>
typedef ImageToImageFilter<TInputImage,TOutputImage> itk::TensorToRgbImageFilter< TInputImage, TOutputImage >::Superclass

Definition at line 42 of file itkTensorToRgbImageFilter.h.


Constructor & Destructor Documentation

template<typename TInputImage , typename TOutputImage = itk::Image<itk::RGBAPixel<unsigned char>,3>>
itk::TensorToRgbImageFilter< TInputImage, TOutputImage >::TensorToRgbImageFilter (  ) [inline, protected]

Definition at line 70 of file itkTensorToRgbImageFilter.h.

{};
template<typename TInputImage , typename TOutputImage = itk::Image<itk::RGBAPixel<unsigned char>,3>>
virtual itk::TensorToRgbImageFilter< TInputImage, TOutputImage >::~TensorToRgbImageFilter (  ) [inline, protected, virtual]

Definition at line 71 of file itkTensorToRgbImageFilter.h.

{};

Member Function Documentation

template<typename TInputImage , typename TOutputImage = itk::Image<itk::RGBAPixel<unsigned char>,3>>
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;
      }

    }
template<typename TInputImage , typename TOutputImage = itk::Image<itk::RGBAPixel<unsigned char>,3>>
virtual const char* itk::TensorToRgbImageFilter< TInputImage, TOutputImage >::GetClassName (  ) const [virtual]

Run-time type information (and related methods).

template<typename TInputImage , typename TOutputImage = itk::Image<itk::RGBAPixel<unsigned char>,3>>
static Pointer itk::TensorToRgbImageFilter< TInputImage, TOutputImage >::New (  ) [static]

Method for creation through the object factory.

template<typename TInputImage , typename TOutputImage = itk::Image<itk::RGBAPixel<unsigned char>,3>>
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 ); }

The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines