00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef __itkKappaSigmaThresholdImageFilter_h
00018 #define __itkKappaSigmaThresholdImageFilter_h
00019
00020 #include "itkImageToImageFilter.h"
00021 #include "itkKappaSigmaThresholdImageCalculator.h"
00022
00023 namespace itk {
00024
00048 template<class TInputImage,
00049 class TMaskImage=Image<unsigned char,::itk::GetImageDimension<TInputImage>::ImageDimension>,
00050 class TOutputImage=TInputImage>
00051 class ITK_EXPORT KappaSigmaThresholdImageFilter :
00052 public ImageToImageFilter<TInputImage, TOutputImage>
00053 {
00054 public:
00056 typedef KappaSigmaThresholdImageFilter Self;
00057 typedef ImageToImageFilter<TInputImage,TOutputImage> Superclass;
00058 typedef SmartPointer<Self> Pointer;
00059 typedef SmartPointer<const Self> ConstPointer;
00060
00062 itkNewMacro(Self);
00063
00065 itkTypeMacro(KappaSigmaThresholdImageFilter, ImageToImageFilter);
00066
00068 typedef TInputImage InputImageType;
00069 typedef TMaskImage MaskImageType;
00070
00072 typedef typename TInputImage::PixelType InputPixelType;
00073 typedef typename TOutputImage::PixelType OutputPixelType;
00074 typedef typename TMaskImage::PixelType MaskPixelType;
00075
00077 typedef typename TInputImage::Pointer InputImagePointer;
00078 typedef typename TOutputImage::Pointer OutputImagePointer;
00079 typedef typename TMaskImage::Pointer MaskImagePointer;
00080
00083 itkSetMacro(OutsideValue,OutputPixelType);
00084
00086 itkGetConstMacro(OutsideValue,OutputPixelType);
00087
00090 itkSetMacro(InsideValue,OutputPixelType);
00091
00093 itkGetConstMacro(InsideValue,OutputPixelType);
00094
00096 itkGetConstMacro(Threshold,InputPixelType);
00097
00098 itkSetMacro(MaskValue, MaskPixelType);
00099 itkGetConstMacro(MaskValue, MaskPixelType);
00100
00101 itkSetMacro(SigmaFactor, double);
00102 itkGetConstMacro(SigmaFactor, double);
00103
00104 itkSetMacro(NumberOfIterations, unsigned int);
00105 itkGetConstMacro(NumberOfIterations, unsigned int);
00106
00107 #ifdef ITK_USE_CONCEPT_CHECKING
00108
00109 itkConceptMacro(OutputComparableCheck,
00110 (Concept::Comparable<OutputPixelType>));
00111 itkConceptMacro(OutputOStreamWritableCheck,
00112 (Concept::OStreamWritable<OutputPixelType>));
00113
00115 #endif
00116
00118 void SetMaskImage(const MaskImageType *input)
00119 {
00120
00121 this->SetNthInput( 1, const_cast<MaskImageType *>(input) );
00122 }
00123
00125 const MaskImageType * GetMaskImage() const
00126 {
00127 return static_cast<MaskImageType*>(const_cast<DataObject *>(this->ProcessObject::GetInput(1)));
00128 }
00129
00131 void SetInput1(const TInputImage *input)
00132 {
00133 this->SetInput( input );
00134 }
00135
00137 void SetInput2(const MaskImageType *input)
00138 {
00139 this->SetMaskImage( input );
00140 }
00141
00142 protected:
00143 KappaSigmaThresholdImageFilter();
00144 ~KappaSigmaThresholdImageFilter(){};
00145 void PrintSelf(std::ostream& os, Indent indent) const;
00146
00147 void GenerateInputRequestedRegion();
00148 void GenerateData ();
00149
00150 typedef typename TInputImage::SizeType InputSizeType;
00151 typedef typename TInputImage::IndexType InputIndexType;
00152 typedef typename TInputImage::RegionType InputImageRegionType;
00153 typedef typename TOutputImage::SizeType OutputSizeType;
00154 typedef typename TOutputImage::IndexType OutputIndexType;
00155 typedef typename TOutputImage::RegionType OutputImageRegionType;
00156
00157 typedef KappaSigmaThresholdImageCalculator< TInputImage, TMaskImage > CalculatorType;
00158
00160 itkStaticConstMacro(InputImageDimension, unsigned int,
00161 TInputImage::ImageDimension );
00162 itkStaticConstMacro(OutputImageDimension, unsigned int,
00163 TOutputImage::ImageDimension );
00165
00166
00167 private:
00168 KappaSigmaThresholdImageFilter(const Self&);
00169 void operator=(const Self&);
00170
00171 MaskPixelType m_MaskValue;
00172 double m_SigmaFactor;
00173 unsigned int m_NumberOfIterations;
00174 InputPixelType m_Threshold;
00175 OutputPixelType m_InsideValue;
00176 OutputPixelType m_OutsideValue;
00177
00178
00179 };
00180
00181 }
00182
00183 #ifndef ITK_MANUAL_INSTANTIATION
00184 #include "itkKappaSigmaThresholdImageFilter.txx"
00185 #endif
00186
00187 #endif
00188