18 #ifndef itkVectorIndexSelectionCastImageFilter_h
19 #define itkVectorIndexSelectionCastImageFilter_h
27 template<
typename TInput,
typename TOutput >
48 return !( *
this != other );
53 return static_cast< TOutput
>( A[
m_Index] );
84 template<
typename TInputImage,
typename TOutputImage >
88 Functor::VectorIndexSelectionCast< typename TInputImage::PixelType,
89 typename TOutputImage::PixelType > >
95 TInputImage, TOutputImage,
97 typename TOutputImage::PixelType > >
125 #ifdef ITK_USE_CONCEPT_CHECKING
138 const unsigned int index = this->
GetIndex();
139 const TInputImage *image = this->
GetInput();
141 const unsigned int numberOfRunTimeComponents =
142 image->GetNumberOfComponentsPerPixel();
144 typedef typename TInputImage::PixelType PixelType;
152 const unsigned int numberOfCompileTimeComponents =
153 sizeof( PixelRealType ) /
sizeof( PixelScalarRealType );
155 unsigned int numberOfComponents = numberOfRunTimeComponents;
157 if ( numberOfCompileTimeComponents > numberOfRunTimeComponents )
159 numberOfComponents = numberOfCompileTimeComponents;
162 if ( index >= numberOfComponents )
165 <<
"Selected index = " << index
166 <<
" is greater than the number of components = "
167 << numberOfComponents);
unsigned int GetIndex() const
virtual ~VectorIndexSelectionCastImageFilter() override
SmartPointer< Self > Pointer
bool operator!=(const VectorIndexSelectionCast &other) const
virtual void BeforeThreadedGenerateData() override
void SetIndex(unsigned int i)
Base class for all process objects that output image data.
VectorIndexSelectionCast()
bool operator==(const VectorIndexSelectionCast &other) const
void SetIndex(unsigned int i)
const InputImageType * GetInput() const
TOutput operator()(const TInput &A) const
virtual void Modified() const
VectorIndexSelectionCastImageFilter Self
FunctorType & GetFunctor()
Implements pixel-wise generic operation on one image.
unsigned int GetIndex(void) const
VectorIndexSelectionCastImageFilter()
Extracts the selected index of the vector that is the input pixel type.
SmartPointer< const Self > ConstPointer
Define additional traits for native types such as int or float.
~VectorIndexSelectionCast()
#define itkConceptMacro(name, concept)
UnaryFunctorImageFilter< TInputImage, TOutputImage, Functor::VectorIndexSelectionCast< typename TInputImage::PixelType, typename TOutputImage::PixelType > > Superclass