Main Page   Groups   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Concepts

itkKappaSigmaThresholdImageFilter.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Insight Segmentation & Registration Toolkit
00004   Module:    $RCSfile: itkKappaSigmaThresholdImageFilter.h,v $
00005   Language:  C++
00006   Date:      $Date: 2008-07-10 20:47:22 $
00007   Version:   $Revision: 1.5 $
00008 
00009   Copyright (c) Insight Software Consortium. All rights reserved.
00010   See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details.
00011 
00012      This software is distributed WITHOUT ANY WARRANTY; without even 
00013      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
00014      PURPOSE.  See the above copyright notices for more information.
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   itkGetMacro(OutsideValue,OutputPixelType);
00087 
00090   itkSetMacro(InsideValue,OutputPixelType);
00091 
00093   itkGetMacro(InsideValue,OutputPixelType);
00094 
00096   itkGetMacro(Threshold,InputPixelType);
00097 
00098   itkSetMacro(MaskValue, MaskPixelType);
00099   itkGetMacro(MaskValue, MaskPixelType);
00100 
00101   itkSetMacro(SigmaFactor, double);
00102   itkGetMacro(SigmaFactor, double);
00103 
00104   itkSetMacro(NumberOfIterations, unsigned int);
00105   itkGetMacro(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     // Process object is not const-correct so the const casting is required.
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&); //purposely not implemented
00169   void operator=(const Self&); //purposely not implemented
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 }; // end of class
00180 
00181 } // end namespace itk
00182   
00183 #ifndef ITK_MANUAL_INSTANTIATION
00184 #include "itkKappaSigmaThresholdImageFilter.txx"
00185 #endif
00186 
00187 #endif
00188 

Generated at Tue Jul 29 20:59:43 2008 for ITK by doxygen 1.5.1 written by Dimitri van Heesch, © 1997-2000