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 > >
97 TInputImage, TOutputImage,
99 typename TOutputImage::PixelType > >;
126 #ifdef ITK_USE_CONCEPT_CHECKING
139 const unsigned int index = this->
GetIndex();
140 const TInputImage *image = this->
GetInput();
142 const unsigned int numberOfRunTimeComponents =
143 image->GetNumberOfComponentsPerPixel();
145 using PixelType =
typename TInputImage::PixelType;
151 const unsigned int numberOfCompileTimeComponents =
152 sizeof( PixelRealType ) /
sizeof( PixelScalarRealType );
154 unsigned int numberOfComponents = numberOfRunTimeComponents;
156 if ( numberOfCompileTimeComponents > numberOfRunTimeComponents )
158 numberOfComponents = numberOfCompileTimeComponents;
161 if ( index >= numberOfComponents )
164 <<
"Selected index = " << index
165 <<
" is greater than the number of components = "
166 << numberOfComponents);
~VectorIndexSelectionCastImageFilter() override=default
unsigned int GetIndex() const
Define numeric traits for std::vector.
bool operator!=(const VectorIndexSelectionCast &other) const
void SetIndex(unsigned int i)
The base class for all process objects (source, filters, mappers) in the Insight data processing pipe...
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
~VectorIndexSelectionCast()=default
unsigned int GetIndex() const
TOutput operator()(const TInput &A) const
virtual void Modified() const
FunctorType & GetFunctor()
VectorIndexSelectionCastImageFilter()=default
Implements pixel-wise generic operation on one image.
Extracts the selected index of the vector that is the input pixel type.
#define itkConceptMacro(name, concept)
void BeforeThreadedGenerateData() override