00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef __itkSimpleContourExtractorImageFilter_h
00018 #define __itkSimpleContourExtractorImageFilter_h
00019
00020 #include "itkImageToImageFilter.h"
00021 #include "itkImage.h"
00022 #include "itkNumericTraits.h"
00023
00024 namespace itk
00025 {
00046 template <class TInputImage, class TOutputImage>
00047 class ITK_EXPORT SimpleContourExtractorImageFilter :
00048 public ImageToImageFilter< TInputImage, TOutputImage >
00049 {
00050 public:
00052 itkStaticConstMacro(InputImageDimension, unsigned int,
00053 TInputImage::ImageDimension);
00054 itkStaticConstMacro(OutputImageDimension, unsigned int,
00055 TOutputImage::ImageDimension);
00057
00059 typedef TInputImage InputImageType;
00060 typedef TOutputImage OutputImageType;
00061
00063 typedef SimpleContourExtractorImageFilter Self;
00064 typedef ImageToImageFilter< InputImageType, OutputImageType> Superclass;
00065 typedef SmartPointer<Self> Pointer;
00066 typedef SmartPointer<const Self> ConstPointer;
00067
00069 itkNewMacro(Self);
00070
00072 itkTypeMacro(SimpleContourExtractorImageFilter, ImageToImageFilter);
00073
00075 typedef typename InputImageType::PixelType InputPixelType;
00076 typedef typename OutputImageType::PixelType OutputPixelType;
00077 typedef typename NumericTraits<InputPixelType>::RealType InputRealType;
00078
00079 typedef typename InputImageType::RegionType InputImageRegionType;
00080 typedef typename OutputImageType::RegionType OutputImageRegionType;
00081
00082 typedef typename InputImageType::SizeType InputSizeType;
00083
00086 itkSetMacro(Radius, InputSizeType);
00087
00090 itkGetConstReferenceMacro(Radius, InputSizeType);
00091
00094 itkSetMacro(InputForegroundValue, InputPixelType);
00095
00098 itkGetConstReferenceMacro(InputForegroundValue, InputPixelType);
00099
00102 itkSetMacro(InputBackgroundValue, InputPixelType);
00103
00106 itkGetConstReferenceMacro(InputBackgroundValue, InputPixelType);
00107
00110 itkSetMacro(OutputForegroundValue, OutputPixelType);
00111
00114 itkGetConstReferenceMacro(OutputForegroundValue, OutputPixelType);
00115
00118 itkSetMacro(OutputBackgroundValue, OutputPixelType);
00119
00122 itkGetConstReferenceMacro(OutputBackgroundValue, OutputPixelType);
00123
00131 virtual void GenerateInputRequestedRegion() throw(InvalidRequestedRegionError);
00132
00133 #ifdef ITK_USE_CONCEPT_CHECKING
00134
00135 itkConceptMacro(InputHasNumericTraitsCheck,
00136 (Concept::HasNumericTraits<InputPixelType>));
00137 itkConceptMacro(OutputHasNumericTraitsCheck,
00138 (Concept::HasNumericTraits<OutputPixelType>));
00139
00141 #endif
00142
00143 protected:
00144 SimpleContourExtractorImageFilter();
00145 virtual ~SimpleContourExtractorImageFilter() {}
00146 void PrintSelf(std::ostream& os, Indent indent) const;
00147
00159 void ThreadedGenerateData(const OutputImageRegionType& outputRegionForThread,
00160 int threadId );
00161
00162 private:
00163 SimpleContourExtractorImageFilter(const Self&);
00164 void operator=(const Self&);
00165
00166 InputSizeType m_Radius;
00167 InputPixelType m_InputForegroundValue;
00168 InputPixelType m_InputBackgroundValue;
00169 OutputPixelType m_OutputForegroundValue;
00170 OutputPixelType m_OutputBackgroundValue;
00171 };
00172
00173 }
00174
00175 #ifndef ITK_MANUAL_INSTANTIATION
00176 #include "itkSimpleContourExtractorImageFilter.txx"
00177 #endif
00178
00179 #endif
00180