This class takes as input a T2-weighted image and computes a brainmask. More...
#include <itkB0ImageExtractionImageFilter.h>
Public Types | |
| typedef B0ImageExtractionImageFilter | Self |
| typedef SmartPointer< Self > | Pointer |
| typedef SmartPointer< const Self > | ConstPointer |
| 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 |
This class takes as input a T2-weighted image and computes a brainmask.
Definition at line 31 of file itkB0ImageExtractionImageFilter.h.
| typedef SmartPointer<const Self> itk::B0ImageExtractionImageFilter< TInputImagePixelType, TOutputImagePixelType >::ConstPointer |
Definition at line 40 of file itkB0ImageExtractionImageFilter.h.
| typedef itk::VectorContainer< unsigned int, GradientDirectionType > itk::B0ImageExtractionImageFilter< TInputImagePixelType, TOutputImagePixelType >::GradientDirectionContainerType |
Definition at line 65 of file itkB0ImageExtractionImageFilter.h.
| typedef vnl_vector_fixed< double, 3 > itk::B0ImageExtractionImageFilter< TInputImagePixelType, TOutputImagePixelType >::GradientDirectionType |
Definition at line 62 of file itkB0ImageExtractionImageFilter.h.
| typedef Superclass::InputImageType itk::B0ImageExtractionImageFilter< TInputImagePixelType, TOutputImagePixelType >::InputImageType |
Definition at line 56 of file itkB0ImageExtractionImageFilter.h.
| typedef TInputImagePixelType itk::B0ImageExtractionImageFilter< TInputImagePixelType, TOutputImagePixelType >::InputPixelType |
Definition at line 50 of file itkB0ImageExtractionImageFilter.h.
| typedef Superclass::OutputImageRegionType itk::B0ImageExtractionImageFilter< TInputImagePixelType, TOutputImagePixelType >::OutputImageRegionType |
Definition at line 60 of file itkB0ImageExtractionImageFilter.h.
| typedef Superclass::OutputImageType itk::B0ImageExtractionImageFilter< TInputImagePixelType, TOutputImagePixelType >::OutputImageType |
Definition at line 57 of file itkB0ImageExtractionImageFilter.h.
| typedef TOutputImagePixelType itk::B0ImageExtractionImageFilter< TInputImagePixelType, TOutputImagePixelType >::OutputPixelType |
Definition at line 54 of file itkB0ImageExtractionImageFilter.h.
| typedef SmartPointer<Self> itk::B0ImageExtractionImageFilter< TInputImagePixelType, TOutputImagePixelType >::Pointer |
Definition at line 39 of file itkB0ImageExtractionImageFilter.h.
| typedef B0ImageExtractionImageFilter itk::B0ImageExtractionImageFilter< TInputImagePixelType, TOutputImagePixelType >::Self |
Definition at line 38 of file itkB0ImageExtractionImageFilter.h.
| typedef ImageToImageFilter< VectorImage< TInputImagePixelType, 3 >, Image< TOutputImagePixelType, 3 > > itk::B0ImageExtractionImageFilter< TInputImagePixelType, TOutputImagePixelType >::Superclass |
Definition at line 43 of file itkB0ImageExtractionImageFilter.h.
| 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 );
}
| itk::B0ImageExtractionImageFilter< TInputImagePixelType, TOutputImagePixelType >::~B0ImageExtractionImageFilter | ( | ) | [inline, protected] |
Definition at line 75 of file itkB0ImageExtractionImageFilter.h.
{};
| 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;
}
}
| virtual const char* itk::B0ImageExtractionImageFilter< TInputImagePixelType, TOutputImagePixelType >::GetClassName | ( | ) | const [virtual] |
Runtime information support.
| GradientDirectionContainerType::Pointer itk::B0ImageExtractionImageFilter< TInputImagePixelType, TOutputImagePixelType >::GetDirections | ( | ) | [inline] |
Definition at line 67 of file itkB0ImageExtractionImageFilter.h.
References itk::B0ImageExtractionImageFilter< TInputImagePixelType, TOutputImagePixelType >::m_Directions.
{ return m_Directions; }
| static Pointer itk::B0ImageExtractionImageFilter< TInputImagePixelType, TOutputImagePixelType >::New | ( | ) | [static] |
Method for creation through the object factory.
| void itk::B0ImageExtractionImageFilter< TInputImagePixelType, TOutputImagePixelType >::SetDirections | ( | GradientDirectionContainerType::Pointer | directions ) | [inline] |
Definition at line 69 of file itkB0ImageExtractionImageFilter.h.
References itk::B0ImageExtractionImageFilter< TInputImagePixelType, TOutputImagePixelType >::m_Directions.
{ this->m_Directions = directions; }
GradientDirectionContainerType::Pointer itk::B0ImageExtractionImageFilter< TInputImagePixelType, TOutputImagePixelType >::m_Directions [protected] |
1.7.2