itkLargestForegroundFilledMaskImageFilter.h

Go to the documentation of this file.
00001 #ifndef __itkLargestForegroundFilledMaskImageFilter_h
00002 #define __itkLargestForegroundFilledMaskImageFilter_h
00003 
00004 #include <itkImage.h>
00005 #include <itkImageToImageFilter.h>
00006 #include <itkNumericTraits.h>
00007 
00008 namespace itk
00009 {
00038 template< class TInputImage, class TOutputImage = TInputImage >
00039 class ITK_EXPORT LargestForegroundFilledMaskImageFilter:
00040   public ImageToImageFilter< TInputImage, TOutputImage >
00041 {
00042 public:
00044   itkStaticConstMacro(InputImageDimension, unsigned int,
00045                       TInputImage::ImageDimension);
00046   itkStaticConstMacro(OutputImageDimension, unsigned int,
00047                       TOutputImage::ImageDimension);
00048 
00050   typedef TInputImage                           InputImageType;
00051   typedef typename InputImageType::ConstPointer InputImagePointer;
00052   typedef typename InputImageType::RegionType   InputImageRegionType;
00053   typedef typename InputImageType::PixelType    InputPixelType;
00054 
00055   typedef TOutputImage                         OutputImageType;
00056   typedef typename OutputImageType::Pointer    OutputImagePointer;
00057   typedef typename OutputImageType::RegionType OutputImageRegionType;
00058   typedef typename OutputImageType::PixelType  OutputPixelType;
00059 
00060   typedef LargestForegroundFilledMaskImageFilter                   Self;
00061   typedef ImageToImageFilter< InputImageType, OutputImageType >    Superclass;
00062   typedef SmartPointer< Self >                                     Pointer;
00063   typedef Image< unsigned short, OutputImageType::ImageDimension > IntegerImageType;
00064   typedef typename IntegerImageType::PixelType                     IntegerPixelType;
00065 
00067   itkNewMacro(Self);
00068 
00070   itkTypeMacro(LargestForegroundFilledMaskImageFilter, ImageToImageFilter);
00071 
00073   itkSetMacro(OtsuPercentileLowerThreshold, double);
00074   itkGetConstMacro(OtsuPercentileLowerThreshold, double);
00075   itkSetMacro(OtsuPercentileUpperThreshold, double);
00076   itkGetConstMacro(OtsuPercentileUpperThreshold, double);
00077 
00082   void SetOtsuPercentileThreshold(const double percentile)
00083   {
00084     this->SetOtsuPercentileLowerThreshold(percentile);
00085     this->SetOtsuPercentileUpperThreshold(1.0 - percentile);
00086   }
00087 
00088   double GetOtsuPercentileThreshold(void) const
00089   {
00090     return this->GetOtsuPercentileLowerThreshold();
00091   }
00092 
00096   itkSetMacro(ClosingSize, double);
00097   itkGetConstMacro(ClosingSize, double);
00101   itkSetMacro(DilateSize, double);
00102   itkGetConstMacro(DilateSize, double);
00103   itkSetMacro(InsideValue, IntegerPixelType);
00104   itkGetMacro(InsideValue, IntegerPixelType);
00105   itkSetMacro(OutsideValue, IntegerPixelType);
00106   itkGetMacro(OutsideValue, IntegerPixelType);
00107   itkSetMacro(ThresholdCorrectionFactor, double);
00108   itkGetConstMacro(ThresholdCorrectionFactor, double);
00109 protected:
00110   LargestForegroundFilledMaskImageFilter();
00111   ~LargestForegroundFilledMaskImageFilter();
00112   void PrintSelf(std::ostream & os, Indent indent) const;
00113 
00114   virtual void GenerateData();
00115 
00116 private:
00121   unsigned int SetLowHigh(InputPixelType & low,
00122                           InputPixelType & high);
00123 
00124   void ImageMinMax(InputPixelType & min, InputPixelType & max);
00125 
00126   // No longer used  double m_OtsuPercentileThreshold;
00127   double           m_OtsuPercentileLowerThreshold;
00128   double           m_OtsuPercentileUpperThreshold;
00129   double           m_ThresholdCorrectionFactor;
00130   double           m_ClosingSize;
00131   double           m_DilateSize;
00132   IntegerPixelType m_InsideValue;
00133   IntegerPixelType m_OutsideValue;
00134 };
00135 } // end namespace itk
00136 
00137 #if ITK_TEMPLATE_TXX
00138 #  include "itkLargestForegroundFilledMaskImageFilter.txx"
00139 #endif
00140 
00141 #endif

Generated on 6 Apr 2011 for Slicer3 by  doxygen 1.6.1