00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef __itkMaskNeighborhoodOperatorImageFilter_h
00018 #define __itkMaskNeighborhoodOperatorImageFilter_h
00019
00020 #include "itkNeighborhoodOperatorImageFilter.h"
00021
00022 namespace itk
00023 {
00043 template <class TInputImage, class TMaskImage, class TOutputImage, class TOperatorValueType=ITK_TYPENAME TOutputImage::PixelType>
00044 class ITK_EXPORT MaskNeighborhoodOperatorImageFilter :
00045 public NeighborhoodOperatorImageFilter< TInputImage, TOutputImage, TOperatorValueType >
00046 {
00047 public:
00049 typedef MaskNeighborhoodOperatorImageFilter Self;
00050 typedef NeighborhoodOperatorImageFilter<
00051 TInputImage, TOutputImage, TOperatorValueType >
00052 Superclass;
00053 typedef SmartPointer<Self> Pointer;
00054 typedef SmartPointer<const Self> ConstPointer;
00055
00057 itkNewMacro(Self);
00058
00060 itkTypeMacro(MaskNeighborhoodOperatorImageFilter, NeighborhoodOperatorImageFilter);
00061
00064 typedef typename TOutputImage::PixelType OutputPixelType;
00065 typedef typename TOutputImage::InternalPixelType OutputInternalPixelType;
00066 typedef typename TInputImage::PixelType InputPixelType;
00067 typedef typename TInputImage::InternalPixelType InputInternalPixelType;
00068 typedef typename TMaskImage::PixelType MaskPixelType;
00069 typedef typename TMaskImage::InternalPixelType MaskInternalPixelType;
00070
00073 itkStaticConstMacro(ImageDimension, unsigned int,
00074 TOutputImage::ImageDimension);
00075 itkStaticConstMacro(InputImageDimension, unsigned int,
00076 TInputImage::ImageDimension);
00077 itkStaticConstMacro(MaskImageDimension, unsigned int,
00078 TMaskImage::ImageDimension);
00080
00082 typedef TInputImage InputImageType;
00083 typedef TMaskImage MaskImageType;
00084 typedef TOutputImage OutputImageType;
00085 typedef typename InputImageType::Pointer InputImagePointer;
00086 typedef typename MaskImageType::Pointer MaskImagePointer;
00087
00089 typedef ImageBoundaryCondition<OutputImageType> *
00090 ImageBoundaryConditionPointerType;
00091
00093 typedef typename Superclass::OutputImageRegionType OutputImageRegionType;
00094 typedef typename Superclass::OperatorValueType OperatorValueType;
00095
00097 typedef typename Superclass::OutputNeighborhoodType OutputNeighborhoodType;
00098
00102 void SetMaskImage( const TMaskImage* mask);
00103
00107 const TMaskImage* GetMaskImage() const;
00108
00112 itkSetMacro( DefaultValue, OutputPixelType );
00113
00116 itkGetMacro( DefaultValue, OutputPixelType );
00117
00121 itkSetMacro(UseDefaultValue,bool);
00122
00124 itkGetConstReferenceMacro(UseDefaultValue,bool);
00125
00127 itkBooleanMacro(UseDefaultValue);
00128
00129 #ifdef ITK_USE_CONCEPT_CHECKING
00130
00131 itkConceptMacro(OutputEqualityComparableCheck,
00132 (Concept::EqualityComparable<OutputPixelType>));
00133 itkConceptMacro(SameDimensionCheck1,
00134 (Concept::SameDimension<InputImageDimension, ImageDimension>));
00135 itkConceptMacro(SameDimensionCheck2,
00136 (Concept::SameDimension<InputImageDimension, MaskImageDimension>));
00137 itkConceptMacro(InputConvertibleToOutputCheck,
00138 (Concept::Convertible<InputPixelType, OutputPixelType>));
00139 itkConceptMacro(OperatorConvertibleToOutputCheck,
00140 (Concept::Convertible<OperatorValueType, OutputPixelType>));
00141 itkConceptMacro(OutputOStreamWritable,
00142 (Concept::OStreamWritable<OutputPixelType>));
00143
00145 #endif
00146
00147 protected:
00148 MaskNeighborhoodOperatorImageFilter() : m_DefaultValue( NumericTraits<OutputPixelType>::Zero), m_UseDefaultValue(true) {}
00149 virtual ~MaskNeighborhoodOperatorImageFilter() {}
00150 void PrintSelf(std::ostream& os, Indent indent) const;
00151
00157 void GenerateInputRequestedRegion() throw (InvalidRequestedRegionError);
00158
00170 void ThreadedGenerateData(const OutputImageRegionType& outputRegionForThread,
00171 int threadId );
00172
00173 private:
00174 MaskNeighborhoodOperatorImageFilter(const Self&);
00175 void operator=(const Self&);
00176
00177 OutputPixelType m_DefaultValue;
00178 bool m_UseDefaultValue;
00179 };
00180
00181 }
00182
00183 #ifndef ITK_MANUAL_INSTANTIATION
00184 #include "itkMaskNeighborhoodOperatorImageFilter.txx"
00185 #endif
00186
00187 #endif
00188