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 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&);
00231 void operator=(const Self&);
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 }
00244
00245 #ifndef ITK_MANUAL_INSTANTIATION
00246 #include "itkSTAPLEImageFilter.txx"
00247 #endif
00248
00249 #endif