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: 2009-04-23 03:53:37 $
00007   Version:   $Revision: 1.4 $
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 __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 typename InputImageType::Pointer  InputImagePointer;
00149   typedef TOutputImage                      OutputImageType;
00150   typedef typename OutputImageType::Pointer OutputImagePointer;
00151 
00153   typedef typename Superclass::OutputImageRegionType OutputImageRegionType;
00154 
00156   itkSetMacro(ForegroundValue, InputPixelType);
00157   itkGetConstMacro(ForegroundValue, InputPixelType);
00159 
00163   const std::vector<double> &GetSpecificity() const
00164     {
00165     return m_Specificity;
00166     }
00167 
00171   const std::vector<double> &GetSensitivity() const
00172     {
00173     return m_Sensitivity;
00174     }
00175 
00178   double GetSensitivity(unsigned int i)
00179     {
00180     if (i > this->GetNumberOfInputs())
00181       {
00182       itkExceptionMacro(<< "Array reference out of bounds.");
00183       }
00184     return m_Sensitivity[i];
00185     }
00187 
00190   double GetSpecificity(unsigned int i)
00191     {
00192     if (i > this->GetNumberOfInputs())
00193       {
00194       itkExceptionMacro(<< "Array reference out of bounds.");
00195       }
00196     return m_Specificity[i];
00197     }
00199 
00203   itkSetMacro(MaximumIterations, unsigned int);
00204   itkGetConstMacro(MaximumIterations, unsigned int);
00206 
00214   itkSetMacro(ConfidenceWeight, double);
00215   itkGetConstMacro(ConfidenceWeight, double);
00217 
00219   itkGetConstMacro(ElapsedIterations, unsigned int);
00220 
00221 #ifdef ITK_USE_CONCEPT_CHECKING
00222 
00223   itkConceptMacro(InputHasNumericTraitsCheck,
00224                   (Concept::HasNumericTraits<InputPixelType>));
00225 
00227 #endif
00228 
00229 protected:
00230   STAPLEImageFilter()
00231     {
00232     m_ForegroundValue = NumericTraits<InputPixelType>::One;
00233     m_MaximumIterations = NumericTraits<unsigned int>::max();
00234     m_ElapsedIterations = 0;
00235     m_ConfidenceWeight = 1.0;
00236     }
00237   virtual ~STAPLEImageFilter() {}  
00238   void GenerateData( );
00239   
00240   void PrintSelf(std::ostream&, Indent) const;
00241 
00242 private:
00243   STAPLEImageFilter(const Self&); //purposely not implemented
00244   void operator=(const Self&); //purposely not implemented
00245 
00246   InputPixelType m_ForegroundValue;
00247   unsigned int   m_ElapsedIterations;
00248   unsigned int   m_MaximumIterations;
00249 
00250   double m_ConfidenceWeight;
00251   
00252   std::vector<double> m_Sensitivity;
00253   std::vector<double> m_Specificity;
00254 };
00255   
00256 } // end namespace itk
00257 
00258 #ifndef ITK_MANUAL_INSTANTIATION
00259 #include "itkSTAPLEImageFilter.txx"
00260 #endif
00261 
00262 #endif
00263 

Generated at Mon Jul 12 2010 19:58:00 for ITK by doxygen 1.7.1 written by Dimitri van Heesch, © 1997-2000