18 #ifndef itkMaskNegatedImageFilter_h
19 #define itkMaskNegatedImageFilter_h
35 template <
typename TInput,
typename TMask,
typename TOutput = TInput>
58 return static_cast<TOutput>(A);
91 template <
typename TPixelType>
98 template <
typename TValue>
144 template <
typename TInputImage,
typename TMaskImage,
typename TOutputImage = TInputImage>
156 MaskNegatedInput<typename TInputImage::PixelType, typename TMaskImage::PixelType, typename TOutputImage::PixelType>;
176 this->GetFunctor().SetOutsideValue(outsideValue);
181 const typename TOutputImage::PixelType &
184 return this->GetFunctor().GetOutsideValue();
191 if (this->GetMaskingValue() != maskingValue)
193 this->GetFunctor().SetMaskingValue(maskingValue);
200 const typename TMaskImage::PixelType &
203 return this->GetFunctor().GetMaskingValue();
214 this->SetNthInput(1, const_cast<MaskImageType *>(maskImage));
217 const MaskImageType *
223 #ifdef ITK_USE_CONCEPT_CHECKING
238 Superclass::PrintSelf(os, indent);
239 os << indent <<
"OutsideValue: " << this->GetOutsideValue() << std::endl;
245 using PixelType =
typename TOutputImage::PixelType;
246 this->CheckOutsideValue(static_cast<PixelType *>(
nullptr));
249 this->SetFunctor(this->GetFunctor());
262 template <
typename TPixelType>
267 template <
typename TValue>
278 zeroVector.
Fill(TValue{});
280 if (currentValue == zeroVector)
282 zeroVector.SetSize(this->GetOutput()->GetVectorLength());
283 zeroVector.Fill(TValue{});
284 this->GetFunctor().SetOutsideValue(zeroVector);
286 else if (this->GetFunctor().GetOutsideValue().GetSize() != this->GetOutput()->GetVectorLength())
288 itkExceptionMacro(
"Number of components in OutsideValue: "
289 << this->GetFunctor().GetOutsideValue().GetSize() <<
" is not the same as the "
290 <<
"number of components in the image: " << this->GetOutput()->GetVectorLength());