18 #ifndef itkMaskNegatedImageFilter_h
19 #define itkMaskNegatedImageFilter_h
35 template <
typename TInput,
typename TMask,
typename TOutput = TInput>
60 return static_cast<TOutput>(A);
93 template <
typename TPixelType>
100 template <
typename TValue>
146 template <
typename TInputImage,
typename TMaskImage,
typename TOutputImage = TInputImage>
158 MaskNegatedInput<typename TInputImage::PixelType, typename TMaskImage::PixelType, typename TOutputImage::PixelType>;
178 this->GetFunctor().SetOutsideValue(outsideValue);
183 const typename TOutputImage::PixelType &
186 return this->GetFunctor().GetOutsideValue();
193 if (this->GetMaskingValue() != maskingValue)
195 this->GetFunctor().SetMaskingValue(maskingValue);
202 const typename TMaskImage::PixelType &
205 return this->GetFunctor().GetMaskingValue();
216 this->SetNthInput(1, const_cast<MaskImageType *>(maskImage));
219 const MaskImageType *
225 #ifdef ITK_USE_CONCEPT_CHECKING
240 Superclass::PrintSelf(os, indent);
241 os << indent <<
"OutsideValue: " << this->GetOutsideValue() << std::endl;
247 using PixelType =
typename TOutputImage::PixelType;
248 this->CheckOutsideValue(static_cast<PixelType *>(
nullptr));
251 this->SetFunctor(this->GetFunctor());
264 template <
typename TPixelType>
269 template <
typename TValue>
282 if (currentValue == zeroVector)
284 zeroVector.SetSize(this->GetOutput()->GetVectorLength());
286 this->GetFunctor().SetOutsideValue(zeroVector);
288 else if (this->GetFunctor().GetOutsideValue().GetSize() != this->GetOutput()->GetVectorLength())
290 itkExceptionMacro(<<
"Number of components in OutsideValue: " << this->GetFunctor().GetOutsideValue().GetSize()
291 <<
" is not the same as the "
292 <<
"number of components in the image: " << this->GetOutput()->GetVectorLength());