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

itk::B0ImageExtractionImageFilter< TInputImagePixelType, TOutputImagePixelType > Class Template Reference

This class takes as input a T2-weighted image and computes a brainmask. More...

#include <itkB0ImageExtractionImageFilter.h>

List of all members.

Public Types

typedef
B0ImageExtractionImageFilter 
Self
typedef SmartPointer< SelfPointer
typedef SmartPointer< const SelfConstPointer
typedef ImageToImageFilter
< VectorImage
< TInputImagePixelType, 3 >
, Image< TOutputImagePixelType, 3 > > 
Superclass
typedef TInputImagePixelType InputPixelType
typedef TOutputImagePixelType OutputPixelType
typedef Superclass::InputImageType InputImageType
typedef Superclass::OutputImageType OutputImageType
typedef
Superclass::OutputImageRegionType 
OutputImageRegionType
typedef vnl_vector_fixed
< double, 3 > 
GradientDirectionType
typedef itk::VectorContainer
< unsigned int,
GradientDirectionType
GradientDirectionContainerType

Public Member Functions

virtual const char * GetClassName () const
GradientDirectionContainerType::Pointer GetDirections ()
void SetDirections (GradientDirectionContainerType::Pointer directions)

Static Public Member Functions

static Pointer New ()

Protected Member Functions

 B0ImageExtractionImageFilter ()
 ~B0ImageExtractionImageFilter ()
void GenerateData ()

Protected Attributes

GradientDirectionContainerType::Pointer m_Directions

Detailed Description

template<class TInputImagePixelType, class TOutputImagePixelType>
class itk::B0ImageExtractionImageFilter< TInputImagePixelType, TOutputImagePixelType >

This class takes as input a T2-weighted image and computes a brainmask.

Definition at line 31 of file itkB0ImageExtractionImageFilter.h.


Member Typedef Documentation

template<class TInputImagePixelType , class TOutputImagePixelType >
typedef SmartPointer<const Self> itk::B0ImageExtractionImageFilter< TInputImagePixelType, TOutputImagePixelType >::ConstPointer

Definition at line 40 of file itkB0ImageExtractionImageFilter.h.

template<class TInputImagePixelType , class TOutputImagePixelType >
typedef itk::VectorContainer< unsigned int, GradientDirectionType > itk::B0ImageExtractionImageFilter< TInputImagePixelType, TOutputImagePixelType >::GradientDirectionContainerType

Definition at line 65 of file itkB0ImageExtractionImageFilter.h.

template<class TInputImagePixelType , class TOutputImagePixelType >
typedef vnl_vector_fixed< double, 3 > itk::B0ImageExtractionImageFilter< TInputImagePixelType, TOutputImagePixelType >::GradientDirectionType

Definition at line 62 of file itkB0ImageExtractionImageFilter.h.

template<class TInputImagePixelType , class TOutputImagePixelType >
typedef Superclass::InputImageType itk::B0ImageExtractionImageFilter< TInputImagePixelType, TOutputImagePixelType >::InputImageType

Definition at line 56 of file itkB0ImageExtractionImageFilter.h.

template<class TInputImagePixelType , class TOutputImagePixelType >
typedef TInputImagePixelType itk::B0ImageExtractionImageFilter< TInputImagePixelType, TOutputImagePixelType >::InputPixelType

Definition at line 50 of file itkB0ImageExtractionImageFilter.h.

template<class TInputImagePixelType , class TOutputImagePixelType >
typedef Superclass::OutputImageRegionType itk::B0ImageExtractionImageFilter< TInputImagePixelType, TOutputImagePixelType >::OutputImageRegionType

Definition at line 60 of file itkB0ImageExtractionImageFilter.h.

template<class TInputImagePixelType , class TOutputImagePixelType >
typedef Superclass::OutputImageType itk::B0ImageExtractionImageFilter< TInputImagePixelType, TOutputImagePixelType >::OutputImageType

Definition at line 57 of file itkB0ImageExtractionImageFilter.h.

template<class TInputImagePixelType , class TOutputImagePixelType >
typedef TOutputImagePixelType itk::B0ImageExtractionImageFilter< TInputImagePixelType, TOutputImagePixelType >::OutputPixelType

Definition at line 54 of file itkB0ImageExtractionImageFilter.h.

template<class TInputImagePixelType , class TOutputImagePixelType >
typedef SmartPointer<Self> itk::B0ImageExtractionImageFilter< TInputImagePixelType, TOutputImagePixelType >::Pointer

Definition at line 39 of file itkB0ImageExtractionImageFilter.h.

template<class TInputImagePixelType , class TOutputImagePixelType >
typedef B0ImageExtractionImageFilter itk::B0ImageExtractionImageFilter< TInputImagePixelType, TOutputImagePixelType >::Self

Definition at line 38 of file itkB0ImageExtractionImageFilter.h.

template<class TInputImagePixelType , class TOutputImagePixelType >
typedef ImageToImageFilter< VectorImage< TInputImagePixelType, 3 >, Image< TOutputImagePixelType, 3 > > itk::B0ImageExtractionImageFilter< TInputImagePixelType, TOutputImagePixelType >::Superclass

Definition at line 43 of file itkB0ImageExtractionImageFilter.h.


Constructor & Destructor Documentation

template<class TInputImagePixelType , class TOutputImagePixelType >
itk::B0ImageExtractionImageFilter< TInputImagePixelType, TOutputImagePixelType >::B0ImageExtractionImageFilter (  ) [protected]

Definition at line 27 of file itkB0ImageExtractionImageFilter.txx.

  {
    // At least 1 inputs is necessary for a vector image.
    // For images added one at a time we need at least six
    this->SetNumberOfRequiredInputs( 1 ); 
  }
template<class TInputImagePixelType , class TOutputImagePixelType >
itk::B0ImageExtractionImageFilter< TInputImagePixelType, TOutputImagePixelType >::~B0ImageExtractionImageFilter (  ) [inline, protected]

Definition at line 75 of file itkB0ImageExtractionImageFilter.h.

{};

Member Function Documentation

template<class TInputImagePixelType , class TOutputImagePixelType >
void itk::B0ImageExtractionImageFilter< TInputImagePixelType, TOutputImagePixelType >::GenerateData (  ) [protected]

Definition at line 38 of file itkB0ImageExtractionImageFilter.txx.

  {

    typename GradientDirectionContainerType::Iterator begin = m_Directions->Begin();
    typename GradientDirectionContainerType::Iterator end = m_Directions->End();

    // Find the index of the b0 image
    std::vector<int> indices;
    int index = 0;
    while(begin!=end)
    {
      GradientDirectionType grad = begin->Value();

      if(grad[0] == 0 && grad[1] == 0 && grad[2] == 0)
      {
        indices.push_back(index);        
      }
      ++index;
      ++begin;
    }

    typedef itk::Image<float,3> TempImageType;
    TempImageType::Pointer tmp = TempImageType::New();
    typename TempImageType::RegionType region = this->GetInput()->GetLargestPossibleRegion();   

    tmp->SetSpacing(this->GetInput()->GetSpacing());
    tmp->SetOrigin(this->GetInput()->GetOrigin());
    tmp->SetDirection(this->GetInput()->GetDirection());
    tmp->SetRegions(region);
    tmp->Allocate();

    itk::ImageRegionIterator<TempImageType> it(tmp.GetPointer(), tmp->GetLargestPossibleRegion() );
    itk::ImageRegionConstIterator<InputImageType> vectorIt(this->GetInput(), this->GetInput()->GetLargestPossibleRegion() );

    it.GoToBegin();
    while(!it.IsAtEnd())
    {    
      it.Set(0);        
      ++it;
    }

    //Sum all images that have zero diffusion weighting (indices stored in vector index)
    for(std::vector<int>::iterator indexIt = indices.begin(); 
      indexIt != indices.end();
      indexIt++)
    {
      it.GoToBegin();
      vectorIt.GoToBegin();

      while(!it.IsAtEnd() && !vectorIt.IsAtEnd())
      {    
        typename InputImageType::PixelType vec = vectorIt.Get();
        it.Set((1.0 * it.Get()) + (1.0 * vec[*indexIt]) / (1.0 * indices.size()));        
        ++it;
        ++vectorIt;
      }      
    }

    typename OutputImageType::Pointer b0Image = 
      static_cast< OutputImageType * >(this->ProcessObject::GetOutput(0));
    typename OutputImageType::RegionType outregion = this->GetInput()->GetLargestPossibleRegion();   
    b0Image->SetSpacing(this->GetInput()->GetSpacing());
    b0Image->SetOrigin(this->GetInput()->GetOrigin());
    b0Image->SetDirection(this->GetInput()->GetDirection());
    b0Image->SetRegions(outregion);
    b0Image->Allocate();
    itk::ImageRegionIterator<TempImageType> itIn(tmp, tmp->GetLargestPossibleRegion() );
    itk::ImageRegionIterator<OutputImageType> itOut(b0Image, b0Image->GetLargestPossibleRegion() );
    itIn.GoToBegin();
    itOut.GoToBegin();
    while(!itIn.IsAtEnd())
    {    
      itOut.Set(itIn.Get());        
      ++itIn;
      ++itOut;
    }
  }
template<class TInputImagePixelType , class TOutputImagePixelType >
virtual const char* itk::B0ImageExtractionImageFilter< TInputImagePixelType, TOutputImagePixelType >::GetClassName (  ) const [virtual]

Runtime information support.

template<class TInputImagePixelType , class TOutputImagePixelType >
GradientDirectionContainerType::Pointer itk::B0ImageExtractionImageFilter< TInputImagePixelType, TOutputImagePixelType >::GetDirections (  ) [inline]
template<class TInputImagePixelType , class TOutputImagePixelType >
static Pointer itk::B0ImageExtractionImageFilter< TInputImagePixelType, TOutputImagePixelType >::New (  ) [static]

Method for creation through the object factory.

template<class TInputImagePixelType , class TOutputImagePixelType >
void itk::B0ImageExtractionImageFilter< TInputImagePixelType, TOutputImagePixelType >::SetDirections ( GradientDirectionContainerType::Pointer  directions ) [inline]

Member Data Documentation

template<class TInputImagePixelType , class TOutputImagePixelType >
GradientDirectionContainerType::Pointer itk::B0ImageExtractionImageFilter< TInputImagePixelType, TOutputImagePixelType >::m_Directions [protected]

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