|
ITK
5.2.0
Insight Toolkit
|
Go to the documentation of this file.
18 #ifndef itkVectorIndexSelectionCastImageFilter_h
19 #define itkVectorIndexSelectionCastImageFilter_h
27 template <
typename TInput,
typename TOutput>
58 return !(*
this != other);
64 return static_cast<TOutput>(A[
m_Index]);
95 template <
typename TInputImage,
typename TOutputImage>
100 Functor::VectorIndexSelectionCast<typename TInputImage::PixelType, typename TOutputImage::PixelType>>
138 #ifdef ITK_USE_CONCEPT_CHECKING
151 const unsigned int index = this->
GetIndex();
152 const TInputImage * image = this->
GetInput();
154 const unsigned int numberOfRunTimeComponents = image->GetNumberOfComponentsPerPixel();
156 using PixelType =
typename TInputImage::PixelType;
162 const unsigned int numberOfCompileTimeComponents =
sizeof(PixelRealType) /
sizeof(PixelScalarRealType);
164 unsigned int numberOfComponents = numberOfRunTimeComponents;
166 if (numberOfCompileTimeComponents > numberOfRunTimeComponents)
168 numberOfComponents = numberOfCompileTimeComponents;
171 if (index >= numberOfComponents)
173 itkExceptionMacro(<<
"Selected index = " << index
174 <<
" is greater than the number of components = " << numberOfComponents);
void SetIndex(unsigned int i)
unsigned int GetIndex() const
Implements pixel-wise generic operation on one image.
VectorIndexSelectionCastImageFilter()=default
Extracts the selected index of the vector that is the input pixel type.
Base class for all process objects that output image data.
bool operator!=(const VectorIndexSelectionCast &other) const
void SetIndex(unsigned int i)
void BeforeThreadedGenerateData() override
TOutput operator()(const TInput &A) const
VectorIndexSelectionCast()
Define additional traits for native types such as int or float.
const InputImageType * GetInput() const
bool operator==(const VectorIndexSelectionCast &other) const
#define itkConceptMacro(name, concept)
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
unsigned int GetIndex() const
The base class for all process objects (source, filters, mappers) in the Insight data processing pipe...
FunctorType & GetFunctor()
~VectorIndexSelectionCastImageFilter() override=default
virtual void Modified() const
~VectorIndexSelectionCast()=default