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

itkSTAPLEImageFilter.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Insight Segmentation & Registration Toolkit
00004   Module:    $RCSfile: itkSTAPLEImageFilter.h,v $
00005   Language:  C++
00006   Date:      $Date: 2004/03/01 19:44:21 $
00007   Version:   $Revision: 1.1 $
00008 
00009   Copyright (c) 2002 Insight 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 __itkSTAPLEImageFilter_h
00018 #define __itkSTAPLEImageFilter_h
00019 
00020 #include "itkImageToImageFilter.h"
00021 #include "itkImage.h"
00022 #include <vector>
00023 
00024 namespace itk
00025 {
00118 template <typename TInputImage, typename TOutputImage>
00119 class ITK_EXPORT STAPLEImageFilter :
00120     public ImageToImageFilter< TInputImage, TOutputImage >
00121 {
00122 public:
00124   typedef STAPLEImageFilter Self;
00125   typedef ImageToImageFilter< TInputImage, TOutputImage > Superclass;
00126   typedef SmartPointer<Self> Pointer;
00127   typedef SmartPointer<const Self>  ConstPointer;
00128 
00130   itkNewMacro(Self);
00131 
00133   itkTypeMacro(STAPLEImageFilter, ImageToImageFilter);
00134   
00137   typedef typename TOutputImage::PixelType OutputPixelType;
00138   typedef typename TInputImage::PixelType InputPixelType;
00139   typedef typename NumericTraits<InputPixelType>::RealType RealType;
00140 
00143   itkStaticConstMacro(ImageDimension, unsigned int,
00144                       TOutputImage::ImageDimension);
00145   
00147   typedef TInputImage  InputImageType;
00148   typedef TOutputImage OutputImageType;
00149   typedef typename InputImageType::Pointer InputImagePointer;
00150   typedef typename OutputImageType::Pointer OutputImagePointer;
00151   
00153   typedef typename Superclass::OutputImageRegionType OutputImageRegionType;
00154 
00156   itkSetMacro(ForegroundValue, InputPixelType);
00157   itkGetMacro(ForegroundValue, InputPixelType);
00158 
00162   const std::vector<double> &GetSpecificity() const
00163   {
00164     return m_Specificity;
00165   }
00166 
00170   const std::vector<double> &GetSensitivity() const
00171   {
00172     return m_Sensitivity;
00173   }
00174 
00177   double GetSensitivity(unsigned int i)
00178   {
00179     if (i > this->GetNumberOfInputs())
00180       {
00181       itkExceptionMacro(<< "Array reference out of bounds.");
00182       }
00183     return m_Sensitivity[i];
00184   }
00185 
00188   double GetSpecificity(unsigned int i)
00189   {
00190     if (i > this->GetNumberOfInputs())
00191       {
00192       itkExceptionMacro(<< "Array reference out of bounds.");
00193       }
00194     return m_Specificity[i];
00195   }
00196 
00200   itkSetMacro(MaximumIterations, unsigned int);
00201   itkGetMacro(MaximumIterations, unsigned int);
00202 
00210   itkSetMacro(ConfidenceWeight, double);
00211   itkGetMacro(ConfidenceWeight, double);
00212 
00214   itkGetMacro(ElapsedIterations, unsigned int);
00215   
00216 protected:
00217   STAPLEImageFilter()
00218   {
00219     m_ForegroundValue = NumericTraits<InputPixelType>::One;
00220     m_MaximumIterations = NumericTraits<unsigned int>::max();
00221     m_ElapsedIterations = 0;
00222     m_ConfidenceWeight = 1.0;
00223   }
00224   virtual ~STAPLEImageFilter() {}  
00225   void GenerateData( );
00226   
00227   void PrintSelf(std::ostream&, Indent) const;
00228 
00229 private:
00230   STAPLEImageFilter(const Self&); //purposely not implemented
00231   void operator=(const Self&); //purposely not implemented
00232 
00233   InputPixelType m_ForegroundValue;
00234   unsigned int m_ElapsedIterations;
00235   unsigned int m_MaximumIterations;
00236 
00237   double m_ConfidenceWeight;
00238   
00239   std::vector<double> m_Sensitivity;
00240   std::vector<double> m_Specificity;
00241 };
00242   
00243 } // end namespace itk
00244 
00245 #ifndef ITK_MANUAL_INSTANTIATION
00246 #include "itkSTAPLEImageFilter.txx"
00247 #endif
00248 
00249 #endif

Generated at Thu May 25 00:07:00 2006 for ITK by doxygen 1.3.5 written by Dimitri van Heesch, © 1997-2000