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

itkVectorConfidenceConnectedImageFilter.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Insight Segmentation & Registration Toolkit
00004   Module:    $RCSfile: itkVectorConfidenceConnectedImageFilter.h,v $
00005   Language:  C++
00006   Date:      $Date: 2006/04/03 15:07:52 $
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 __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:
00062 
00064   typedef VectorConfidenceConnectedImageFilter Self;
00065   typedef ImageToImageFilter<TInputImage,TOutputImage> Superclass;
00066   typedef SmartPointer<Self> Pointer;
00067   typedef SmartPointer<const Self> ConstPointer;
00068 
00070   itkNewMacro(Self);
00071 
00073   itkTypeMacro(VectorConfidenceConnectedImageFilter,
00074                ImageToImageFilter);
00075 
00076   typedef TInputImage InputImageType;
00077   typedef typename InputImageType::Pointer      InputImagePointer;
00078   typedef typename InputImageType::RegionType   InputImageRegionType; 
00079   typedef typename InputImageType::PixelType    InputImagePixelType; 
00080   typedef typename InputImageType::IndexType    IndexType;
00081   typedef typename InputImageType::SizeType     SizeType;
00082   
00083   typedef TOutputImage OutputImageType;
00084   typedef typename OutputImageType::Pointer     OutputImagePointer;
00085   typedef typename OutputImageType::RegionType  OutputImageRegionType; 
00086   typedef typename OutputImageType::PixelType   OutputImagePixelType; 
00087   
00088   typedef std::vector< IndexType >              SeedsContainerType;
00089 
00090   typedef MahalanobisDistanceThresholdImageFunction<
00091                                            InputImageType >
00092                                                 DistanceThresholdFunctionType;
00093   
00094   typedef typename DistanceThresholdFunctionType::CovarianceMatrixType CovarianceMatrixType; 
00095   typedef typename DistanceThresholdFunctionType::MeanVectorType       MeanVectorType;
00096 
00097 
00098   typedef  typename DistanceThresholdFunctionType::Pointer DistanceThresholdFunctionPointer;
00099 
00100   void PrintSelf ( std::ostream& os, Indent indent ) const;
00101 
00103   void SetSeed(const IndexType & seed)
00104   {
00105     m_Seeds.clear();
00106     this->AddSeed( seed );
00107   };
00109 
00110 
00112   void AddSeed(const IndexType & seed)
00113   {
00114     m_Seeds.push_back( seed );
00115     this->Modified();
00116   };
00118 
00121   itkSetMacro(Multiplier, double);
00122   itkGetMacro(Multiplier, double);
00124 
00126   itkSetMacro(NumberOfIterations, unsigned int);
00127   itkGetMacro(NumberOfIterations, unsigned int);
00129 
00131   itkSetMacro(ReplaceValue, OutputImagePixelType);
00132   itkGetMacro(ReplaceValue, OutputImagePixelType);
00134 
00137   itkSetMacro( InitialNeighborhoodRadius, unsigned int );
00138   itkGetConstReferenceMacro( InitialNeighborhoodRadius, unsigned int );
00140 
00142   const MeanVectorType & GetMean() const;
00143 
00145   const CovarianceMatrixType & GetCovariance() const;
00146 
00147 #ifdef ITK_USE_CONCEPT_CHECKING
00148 
00149   itkConceptMacro(OutputEqualityComparableCheck,
00150     (Concept::EqualityComparable<OutputImagePixelType>));
00151   itkConceptMacro(InputHasNumericTraitsCheck,
00152     (Concept::HasNumericTraits<typename InputImagePixelType::ValueType>));
00153   itkConceptMacro(OutputOStreamWritableCheck,
00154     (Concept::OStreamWritable<OutputImagePixelType>));
00155 
00157 #endif
00158 
00159 protected:
00160   VectorConfidenceConnectedImageFilter();
00161   
00162   
00163   // Override since the filter needs all the data for the algorithm
00164   void GenerateInputRequestedRegion();
00165 
00166   // Override since the filter produces the entire dataset
00167   void EnlargeOutputRequestedRegion(DataObject *output);
00168 
00169   void GenerateData();
00170   
00171 private:
00172   VectorConfidenceConnectedImageFilter(const Self&); //purposely not implemented
00173   void operator=(const Self&); //purposely not implemented
00174 
00175   SeedsContainerType      m_Seeds;
00176   double                  m_Multiplier;
00177   unsigned int            m_NumberOfIterations;
00178   OutputImagePixelType    m_ReplaceValue;
00179   unsigned int            m_InitialNeighborhoodRadius;
00180   
00181   DistanceThresholdFunctionPointer      m_ThresholdFunction;
00182 
00183 };
00184 
00185 
00186 } // end namespace itk
00187 
00188 #ifndef ITK_MANUAL_INSTANTIATION
00189 #include "itkVectorConfidenceConnectedImageFilter.txx"
00190 #endif
00191 
00192 #endif
00193 

Generated at Mon Mar 12 03:17:53 2007 for ITK by doxygen 1.5.1 written by Dimitri van Heesch, © 1997-2000