18#ifndef itkMaskNegatedImageFilter_h
19#define itkMaskNegatedImageFilter_h
35template <
typename TInput,
typename TMask,
typename TOutput = TInput>
57 return static_cast<TOutput
>(A);
89 template <
typename TPixelType>
96 template <
typename TValue>
142template <
typename TInputImage,
typename TMaskImage,
typename TOutputImage = TInputImage>
154 MaskNegatedInput<typename TInputImage::PixelType, typename TMaskImage::PixelType, typename TOutputImage::PixelType>;
174 this->
GetFunctor().SetOutsideValue(outsideValue);
179 const typename TOutputImage::PixelType &
191 this->
GetFunctor().SetMaskingValue(maskingValue);
198 const typename TMaskImage::PixelType &
215 const MaskImageType *
233 os << indent <<
"OutsideValue: " << this->
GetOutsideValue() << std::endl;
239 using PixelType =
typename TOutputImage::PixelType;
256 template <
typename TPixelType>
261 template <
typename TValue>
272 zeroVector.Fill(TValue{});
274 if (currentValue == zeroVector)
276 zeroVector.SetSize(this->
GetOutput()->GetVectorLength());
277 zeroVector.Fill(TValue{});
278 this->
GetFunctor().SetOutsideValue(zeroVector);
282 itkExceptionMacro(
"Number of components in OutsideValue: "
284 <<
"number of components in the image: " << this->
GetOutput()->GetVectorLength());
BinaryGeneratorImageFilter()
void SetFunctor(const std::function< ConstRefFunctionType > &f)
OutputImageType * GetOutput()
void PrintSelf(std::ostream &os, Indent indent) const override
Control indentation during Print() invocation.
Functor:: MaskNegatedInput< typename TInputImage::PixelType, typename TMaskImage::PixelType, typename TOutputImage::PixelType > FunctorType
MaskNegatedImageFilter()=default
SmartPointer< Self > Pointer
MaskNegatedImageFilter Self
void BeforeThreadedGenerateData() override
BinaryGeneratorImageFilter< TInputImage, TMaskImage, TOutputImage > Superclass
void SetOutsideValue(const typename TOutputImage::PixelType &outsideValue)
void SetMaskImage(const MaskImageType *maskImage)
void CheckOutsideValue(const TPixelType *)
const TMaskImage::PixelType & GetMaskingValue() const
virtual const FunctorType & GetFunctor() const
void CheckOutsideValue(const VariableLengthVector< TValue > *)
void SetMaskingValue(const typename TMaskImage::PixelType &maskingValue)
~MaskNegatedImageFilter() override=default
void PrintSelf(std::ostream &os, Indent indent) const override
const TOutputImage::PixelType & GetOutsideValue() const
const MaskImageType * GetMaskImage()
SmartPointer< const Self > ConstPointer
FunctorType & GetFunctor()
virtual void Modified() const
virtual void SetNthInput(DataObjectPointerArraySizeType idx, DataObject *input)
DataObject * GetInput(const DataObjectIdentifierType &key)
Return an input.
Implements transparent reference counting.
#define itkConceptMacro(name, concept)
bool NotExactlyEquals(const TInput1 &x1, const TInput2 &x2)
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....