18 #ifndef itkMaskNegatedImageFilter_h
19 #define itkMaskNegatedImageFilter_h
35 template <
typename TInput,
typename TMask,
typename TOutput = TInput>
57 return static_cast<TOutput>(A);
89 template <
typename TPixelType>
96 template <
typename TValue>
142 template <
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 &
182 return this->GetFunctor().GetOutsideValue();
189 if (this->GetMaskingValue() != maskingValue)
191 this->GetFunctor().SetMaskingValue(maskingValue);
198 const typename TMaskImage::PixelType &
201 return this->GetFunctor().GetMaskingValue();
212 this->SetNthInput(1, const_cast<MaskImageType *>(maskImage));
215 const MaskImageType *
221 #ifdef ITK_USE_CONCEPT_CHECKING
236 Superclass::PrintSelf(os, indent);
237 os << indent <<
"OutsideValue: " << this->GetOutsideValue() << std::endl;
243 using PixelType =
typename TOutputImage::PixelType;
244 this->CheckOutsideValue(static_cast<PixelType *>(
nullptr));
247 this->SetFunctor(this->GetFunctor());
260 template <
typename TPixelType>
265 template <
typename TValue>
276 zeroVector.
Fill(TValue{});
278 if (currentValue == zeroVector)
280 zeroVector.SetSize(this->GetOutput()->GetVectorLength());
281 zeroVector.Fill(TValue{});
282 this->GetFunctor().SetOutsideValue(zeroVector);
284 else if (this->GetFunctor().GetOutsideValue().GetSize() != this->GetOutput()->GetVectorLength())
286 itkExceptionMacro(
"Number of components in OutsideValue: "
287 << this->GetFunctor().GetOutsideValue().GetSize() <<
" is not the same as the "
288 <<
"number of components in the image: " << this->GetOutput()->GetVectorLength());