18 #ifndef __itkMaskImageFilter_h
19 #define __itkMaskImageFilter_h
34 template<
class TInput,
class TMask,
class TOutput = TInput >
52 return !( *
this != other );
55 inline TOutput
operator()(
const TInput & A,
const TMask & B)
const
59 return static_cast< TOutput
>( A );
81 template <
class TPixelType >
87 template <
class TValueType >
131 template<
class TInputImage,
class TMaskImage,
class TOutputImage = TInputImage >
136 typename TInputImage::PixelType,
137 typename TMaskImage::PixelType,
138 typename TOutputImage::PixelType > >
146 typename TInputImage::PixelType,
147 typename TMaskImage::PixelType,
148 typename TOutputImage::PixelType >
171 this->SetNthInput( 1, const_cast< MaskImageType * >( maskImage ) );
180 void SetOutsideValue(
const typename TOutputImage::PixelType & outsideValue)
182 if ( this->GetOutsideValue() != outsideValue )
185 this->GetFunctor().SetOutsideValue(outsideValue);
190 const typename TOutputImage::PixelType & GetOutsideValue()
const
192 return this->GetFunctor().GetOutsideValue();
195 void BeforeThreadedGenerateData()
197 typedef typename TOutputImage::PixelType PixelType;
198 this->CheckOutsideValue( static_cast<PixelType*>(
NULL) );
201 #ifdef ITK_USE_CONCEPT_CHECKING
207 typename TOutputImage::PixelType > ) );
216 void PrintSelf(std::ostream & os,
Indent indent)
const
218 Superclass::PrintSelf(os, indent);
219 os << indent <<
"OutsideValue: " << this->GetOutsideValue() << std::endl;
224 void operator=(
const Self &);
226 template <
class TPixelType >
229 template <
class TValue >
238 this->GetFunctor().GetOutsideValue();
242 if ( currentValue == zeroVector )
244 zeroVector.SetSize( this->GetOutput()->GetVectorLength() );
246 this->GetFunctor().SetOutsideValue( zeroVector );
248 else if ( this->GetFunctor().GetOutsideValue().GetSize() !=
249 this->GetOutput()->GetVectorLength() )
252 <<
"Number of components in OutsideValue: "
253 << this->GetFunctor().GetOutsideValue().GetSize()
254 <<
" is not the same as the "
255 <<
"number of components in the image: "
256 << this->GetOutput()->GetVectorLength());