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 >
145 template<
typename TInputImage,
typename TMaskImage,
typename TOutputImage = TInputImage >
150 typename TInputImage::PixelType,
151 typename TMaskImage::PixelType,
152 typename TOutputImage::PixelType > >
160 typename TInputImage::PixelType,
161 typename TMaskImage::PixelType,
162 typename TOutputImage::PixelType >
185 this->SetNthInput( 1, const_cast< MaskImageType * >( maskImage ) );
199 this->GetFunctor().SetOutsideValue(outsideValue);
206 return this->GetFunctor().GetOutsideValue();
215 this->GetFunctor().SetMaskingValue(maskingValue);
223 return this->GetFunctor().GetMaskingValue();
228 typedef typename TOutputImage::PixelType PixelType;
229 this->CheckOutsideValue( static_cast<PixelType*>(ITK_NULLPTR) );
232 #ifdef ITK_USE_CONCEPT_CHECKING 238 typename TOutputImage::PixelType > ) );
248 Superclass::PrintSelf(os, indent);
249 os << indent <<
"OutsideValue: " << this->
GetOutsideValue() << std::endl;
254 void operator=(
const Self &) ITK_DELETE_FUNCTION;
256 template <
typename TPixelType >
259 template <
typename TValue >
268 this->GetFunctor().GetOutsideValue();
272 if ( currentValue == zeroVector )
274 zeroVector.SetSize( this->GetOutput()->GetVectorLength() );
276 this->GetFunctor().SetOutsideValue( zeroVector );
279 this->GetOutput()->GetVectorLength() )
282 <<
"Number of components in OutsideValue: " 284 <<
" is not the same as the " 285 <<
"number of components in the image: " 286 << this->GetOutput()->GetVectorLength());
const MaskImageType * GetMaskImage()
virtual ~MaskImageFilter()
SmartPointer< const Self > ConstPointer
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes...
const TOutputImage::PixelType & GetOutsideValue() const
BinaryFunctorImageFilter< TInputImage, TMaskImage, TOutputImage, Functor::MaskInput< typename TInputImage::PixelType, typename TMaskImage::PixelType, typename TOutputImage::PixelType > > Superclass
void CheckOutsideValue(const VariableLengthVector< TValue > *)
void Fill(TValue const &v) noexcept
Represents an array whose length can be defined at run-time.
const TMaskImage::PixelType & GetMaskingValue() const
void BeforeThreadedGenerateData() override
bool NotExactlyEquals(const TInput1 &x1, const TInput2 &x2)
DataObject * GetInput(const DataObjectIdentifierType &key)
Return an input.
SmartPointer< Self > Pointer
Mask an image with a mask.
Control indentation during Print() invocation.
void CheckOutsideValue(const TPixelType *)
Define additional traits for native types such as int or float.
unsigned int GetSize(void) const noexcept
void SetMaskImage(const MaskImageType *maskImage)
#define itkConceptMacro(name, concept)
Implements pixel-wise generic operation of two images, or of an image and a constant.
void PrintSelf(std::ostream &os, Indent indent) const override
void SetMaskingValue(const typename TMaskImage::PixelType &maskingValue)
void SetOutsideValue(const typename TOutputImage::PixelType &outsideValue)