itkSTAPLEImageFilter.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
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&);
00244 void operator=(const Self&);
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 }
00257
00258 #ifndef ITK_MANUAL_INSTANTIATION
00259 #include "itkSTAPLEImageFilter.txx"
00260 #endif
00261
00262 #endif
00263