18 #ifndef itkMaskImageFilter_h
19 #define itkMaskImageFilter_h
35 template<
typename TInput,
typename TMask,
typename TOutput = TInput >
54 return !( *
this != other );
57 inline TOutput
operator()(
const TInput & A,
const TMask & B)
const
61 return static_cast< TOutput
>( A );
95 template <
typename TPixelType >
101 template <
typename TValue >
146 template<
typename TInputImage,
typename TMaskImage,
typename TOutputImage = TInputImage >
160 typename TMaskImage::PixelType,
161 typename TOutputImage::PixelType >;
183 this->
SetNthInput( 1, const_cast< MaskImageType * >( maskImage ) );
224 #ifdef ITK_USE_CONCEPT_CHECKING
230 typename TOutputImage::PixelType > ) );
241 os << indent <<
"OutsideValue: " << this->
GetOutsideValue() << std::endl;
246 using PixelType =
typename TOutputImage::PixelType;
258 template <
typename TPixelType >
261 template <
typename TValue >
274 if ( currentValue == zeroVector )
276 zeroVector.SetSize( this->
GetOutput()->GetVectorLength() );
284 <<
"Number of components in OutsideValue: "
286 <<
" is not the same as the "
287 <<
"number of components in the image: "
288 << this->
GetOutput()->GetVectorLength());
void PrintSelf(std::ostream &os, Indent indent) const override
void PrintSelf(std::ostream &os, Indent indent) const override
const MaskImageType * GetMaskImage()
FunctorType & GetFunctor()
Define numeric traits for std::vector.
The base class for all process objects (source, filters, mappers) in the Insight data processing pipe...
const TOutputImage::PixelType & GetOutsideValue() const
Functor::MaskInput< typename TInputImage::PixelType, typename TMaskImage::PixelType, typename TOutputImage::PixelType > FunctorType
Base class for all process objects that output image data.
unsigned int GetSize() const
void CheckOutsideValue(const VariableLengthVector< TValue > *)
~MaskImageFilter() override=default
Represents an array whose length can be defined at run-time.
const TMaskImage::PixelType & GetMaskingValue() const
virtual const FunctorType & GetFunctor() const
Implements pixel-wise generic operation of two images, or of an image and a constant.
void BeforeThreadedGenerateData() override
bool NotExactlyEquals(const TInput1 &x1, const TInput2 &x2)
virtual void Modified() const
void SetFunctor(const std::function< ConstRefFunctionType > &f)
MaskImageFilter()=default
DataObject * GetInput(const DataObjectIdentifierType &key)
Return an input.
Mask an image with a mask.
OutputImageType * GetOutput()
Control indentation during Print() invocation.
void CheckOutsideValue(const TPixelType *)
virtual void SetNthInput(DataObjectPointerArraySizeType num, DataObject *input)
void SetMaskImage(const MaskImageType *maskImage)
void Fill(TValue const &v)
#define itkConceptMacro(name, concept)
void SetMaskingValue(const typename TMaskImage::PixelType &maskingValue)
void SetOutsideValue(const typename TOutputImage::PixelType &outsideValue)