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);
00056
00058 typedef TInputImage InputImageType;
00059 typedef TOutputImage OutputImageType;
00060
00062 typedef SimpleContourExtractorImageFilter Self;
00063 typedef ImageToImageFilter< InputImageType, OutputImageType> Superclass;
00064 typedef SmartPointer<Self> Pointer;
00065 typedef SmartPointer<const Self> ConstPointer;
00066
00068 itkNewMacro(Self);
00069
00071 itkTypeMacro(SimpleContourExtractorImageFilter, ImageToImageFilter);
00072
00074 typedef typename InputImageType::PixelType InputPixelType;
00075 typedef typename OutputImageType::PixelType OutputPixelType;
00076 typedef typename NumericTraits<InputPixelType>::RealType InputRealType;
00077
00078 typedef typename InputImageType::RegionType InputImageRegionType;
00079 typedef typename OutputImageType::RegionType OutputImageRegionType;
00080
00081 typedef typename InputImageType::SizeType InputSizeType;
00082
00085 itkSetMacro(Radius, InputSizeType);
00086
00089 itkGetConstReferenceMacro(Radius, InputSizeType);
00090
00093 itkSetMacro(InputForegroundValue, InputPixelType);
00094
00097 itkGetConstReferenceMacro(InputForegroundValue, InputPixelType);
00098
00101 itkSetMacro(InputBackgroundValue, InputPixelType);
00102
00105 itkGetConstReferenceMacro(InputBackgroundValue, InputPixelType);
00106
00109 itkSetMacro(OutputForegroundValue, OutputPixelType);
00110
00113 itkGetConstReferenceMacro(OutputForegroundValue, OutputPixelType);
00114
00117 itkSetMacro(OutputBackgroundValue, OutputPixelType);
00118
00121 itkGetConstReferenceMacro(OutputBackgroundValue, OutputPixelType);
00122
00130 virtual void GenerateInputRequestedRegion() throw(InvalidRequestedRegionError);
00131
00132 protected:
00133 SimpleContourExtractorImageFilter();
00134 virtual ~SimpleContourExtractorImageFilter() {}
00135 void PrintSelf(std::ostream& os, Indent indent) const;
00136
00148 void ThreadedGenerateData(const OutputImageRegionType& outputRegionForThread,
00149 int threadId );
00150
00151 private:
00152 SimpleContourExtractorImageFilter(const Self&);
00153 void operator=(const Self&);
00154
00155 InputSizeType m_Radius;
00156 InputPixelType m_InputForegroundValue;
00157 InputPixelType m_InputBackgroundValue;
00158 OutputPixelType m_OutputForegroundValue;
00159 OutputPixelType m_OutputBackgroundValue;
00160 };
00161
00162 }
00163
00164 #ifndef ITK_MANUAL_INSTANTIATION
00165 #include "itkSimpleContourExtractorImageFilter.txx"
00166 #endif
00167
00168 #endif