00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef __itkVectorConfidenceConnectedImageFilter_h
00018 #define __itkVectorConfidenceConnectedImageFilter_h
00019
00020 #include "itkImage.h"
00021 #include "itkImageToImageFilter.h"
00022 #include "itkMahalanobisDistanceThresholdImageFunction.h"
00023
00024 namespace itk {
00025
00057 template <class TInputImage, class TOutputImage>
00058 class ITK_EXPORT VectorConfidenceConnectedImageFilter:
00059 public ImageToImageFilter<TInputImage,TOutputImage>
00060 {
00061 public:
00063 typedef VectorConfidenceConnectedImageFilter Self;
00064 typedef ImageToImageFilter<TInputImage,TOutputImage> Superclass;
00065 typedef SmartPointer<Self> Pointer;
00066 typedef SmartPointer<const Self> ConstPointer;
00067
00069 itkNewMacro(Self);
00070
00072 itkTypeMacro(VectorConfidenceConnectedImageFilter,
00073 ImageToImageFilter);
00074
00075 typedef TInputImage InputImageType;
00076 typedef typename InputImageType::Pointer InputImagePointer;
00077 typedef typename InputImageType::RegionType InputImageRegionType;
00078 typedef typename InputImageType::PixelType InputImagePixelType;
00079 typedef typename InputImageType::IndexType IndexType;
00080 typedef typename InputImageType::SizeType SizeType;
00081
00082 typedef TOutputImage OutputImageType;
00083 typedef typename OutputImageType::Pointer OutputImagePointer;
00084 typedef typename OutputImageType::RegionType OutputImageRegionType;
00085 typedef typename OutputImageType::PixelType OutputImagePixelType;
00086
00087 typedef std::vector< IndexType > SeedsContainerType;
00088
00089 typedef MahalanobisDistanceThresholdImageFunction<
00090 InputImageType >
00091 DistanceThresholdFunctionType;
00092
00093 typedef typename DistanceThresholdFunctionType::CovarianceMatrixType CovarianceMatrixType;
00094 typedef typename DistanceThresholdFunctionType::MeanVectorType MeanVectorType;
00095
00096
00097 typedef typename DistanceThresholdFunctionType::Pointer DistanceThresholdFunctionPointer;
00098
00099 void PrintSelf ( std::ostream& os, Indent indent ) const;
00100
00102 void SetSeed(const IndexType & seed)
00103 {
00104 m_Seeds.clear();
00105 this->AddSeed( seed );
00106 }
00108
00110 void AddSeed(const IndexType & seed)
00111 {
00112 m_Seeds.push_back( seed );
00113 this->Modified();
00114 }
00116
00119 itkSetMacro(Multiplier, double);
00120 itkGetMacro(Multiplier, double);
00122
00124 itkSetMacro(NumberOfIterations, unsigned int);
00125 itkGetMacro(NumberOfIterations, unsigned int);
00127
00129 itkSetMacro(ReplaceValue, OutputImagePixelType);
00130 itkGetMacro(ReplaceValue, OutputImagePixelType);
00132
00135 itkSetMacro( InitialNeighborhoodRadius, unsigned int );
00136 itkGetConstReferenceMacro( InitialNeighborhoodRadius, unsigned int );
00138
00140 const MeanVectorType & GetMean() const;
00141
00143 const CovarianceMatrixType & GetCovariance() const;
00144
00145 #ifdef ITK_USE_CONCEPT_CHECKING
00146
00147 itkConceptMacro(OutputEqualityComparableCheck,
00148 (Concept::EqualityComparable<OutputImagePixelType>));
00149 itkConceptMacro(InputHasNumericTraitsCheck,
00150 (Concept::HasNumericTraits<typename InputImagePixelType::ValueType>));
00151 itkConceptMacro(OutputOStreamWritableCheck,
00152 (Concept::OStreamWritable<OutputImagePixelType>));
00153
00155 #endif
00156
00157 protected:
00158 VectorConfidenceConnectedImageFilter();
00159
00160
00161
00162 void GenerateInputRequestedRegion();
00163
00164
00165 void EnlargeOutputRequestedRegion(DataObject *output);
00166
00167 void GenerateData();
00168
00169 private:
00170 VectorConfidenceConnectedImageFilter(const Self&);
00171 void operator=(const Self&);
00172
00173 SeedsContainerType m_Seeds;
00174 double m_Multiplier;
00175 unsigned int m_NumberOfIterations;
00176 OutputImagePixelType m_ReplaceValue;
00177 unsigned int m_InitialNeighborhoodRadius;
00178
00179 DistanceThresholdFunctionPointer m_ThresholdFunction;
00180
00181 };
00182
00183
00184 }
00185
00186 #ifndef ITK_MANUAL_INSTANTIATION
00187 #include "itkVectorConfidenceConnectedImageFilter.txx"
00188 #endif
00189
00190 #endif
00191