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

itkMultiphaseDenseFiniteDifferenceImageFilter.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Insight Segmentation & Registration Toolkit
00004   Module:    $RCSfile: itkMultiphaseDenseFiniteDifferenceImageFilter.h,v $
00005   Language:  C++
00006   Date:      $Date: 2009-07-29 15:13:55 $
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 
00018 #ifndef __itkMultiphaseDenseFiniteDifferenceImageFilter_h
00019 #define __itkMultiphaseDenseFiniteDifferenceImageFilter_h
00020 
00021 #include "itkMultiphaseFiniteDifferenceImageFilter.h"
00022 #include "itkBinaryThresholdImageFilter.h"
00023 #include "itkSignedMaurerDistanceMapImageFilter.h"
00024 #include "itkImageRegionConstIterator.h"
00025 #include "itkImageRegionIterator.h"
00026 #include "itkNumericTraits.h"
00027 #include "itkNeighborhoodAlgorithm.h"
00028 
00029 #include <list>
00030 
00031 
00032 namespace itk {
00033 
00101 template < class TInputImage, class TFeatureImage, class TOutputImage, class TFunction,
00102   typename TIdCell = unsigned int >
00103 class ITK_EXPORT MultiphaseDenseFiniteDifferenceImageFilter :
00104   public MultiphaseFiniteDifferenceImageFilter< TInputImage, TFeatureImage,
00105   TOutputImage, TFunction, TIdCell >
00106 {
00107 public:
00108 
00110   typedef MultiphaseDenseFiniteDifferenceImageFilter        Self;
00111   typedef MultiphaseFiniteDifferenceImageFilter< TInputImage,
00112     TFeatureImage, TOutputImage, TFunction >                Superclass;
00113   typedef SmartPointer<Self>                                Pointer;
00114   typedef SmartPointer<const Self>                          ConstPointer;
00115 
00117   itkTypeMacro( MultiphaseDenseFiniteDifferenceImageFilter, ImageToImageFilter );
00118 
00121   itkStaticConstMacro(ImageDimension, unsigned int, Superclass::ImageDimension);
00122 
00124   typedef typename Superclass::InputImageType           InputImageType;
00125   typedef typename Superclass::InputImagePointer        InputImagePointer;
00126   typedef typename Superclass::InputRegionType          InputRegionType;
00127   typedef typename Superclass::InputSizeType            InputSizeType;
00128   typedef typename Superclass::InputSizeValueType       InputSizeValueType;
00129   typedef typename Superclass::InputIndexType           InputIndexType;
00130   typedef typename Superclass::InputIndexValueType      InputIndexValueType;
00131   typedef typename Superclass::InputPixelType           InputPixelType;
00132   typedef typename Superclass::InputPointType           InputPointType;
00133   typedef typename Superclass::InputSpacingType         InputSpacingType;
00134   typedef typename InputImageType::ValueType            ValueType;
00135 
00136   typedef typename Superclass::FeatureImageType         FeatureImageType;
00137   typedef typename Superclass::FeatureSizeType          FeatureSizeType;
00138   typedef typename Superclass::FeatureImagePointer      FeatureImagePointer;
00139   typedef typename Superclass::FeatureRegionType        FeatureRegionType;
00140   typedef typename Superclass::FeatureSpacingType       FeatureSpacingType;
00141   typedef typename Superclass::FeaturePointType         FeaturePointType;
00142   typedef typename Superclass::FeaturePixelType         FeaturePixelType;
00143 
00144   typedef typename Superclass::OutputImageType          OutputImageType;
00145   typedef typename Superclass::OutputImagePointer       OutputImagePointer;
00146   typedef typename Superclass::OutputRegionType         OutputRegionType;
00147   typedef typename Superclass::OutputSizeType           OutputSizeType;
00148   typedef typename Superclass::OutputSizeValueType      SizeValueType;
00149   typedef typename Superclass::OutputIndexType          OutputIndexType;
00150   typedef typename Superclass::OutputIndexValueType     OutputIndexValueType;
00151   typedef typename OutputImageType::PixelType           OutputPixelType;
00152 
00153   typedef typename Superclass::IdCellType               IdCellType;
00154 
00155   typedef BinaryThresholdImageFilter< InputImageType, InputImageType >
00156                                                         ThresholdFilterType;
00157   typedef typename ThresholdFilterType::Pointer
00158                                                         ThresholdFilterPointer;
00159 
00160   typedef SignedMaurerDistanceMapImageFilter< InputImageType, InputImageType >
00161                                                         MaurerType;
00162   typedef typename MaurerType::Pointer                  MaurerPointer;
00163 
00164   typedef typename Superclass::FiniteDifferenceFunctionType
00165                                                         FiniteDifferenceFunctionType;
00166   typedef typename Superclass::FiniteDifferenceFunctionPointer
00167                                                         FiniteDifferenceFunctionPointer;
00168   typedef typename FiniteDifferenceFunctionType::NeighborhoodType
00169                                                         NeighborhoodIteratorType;
00170 
00172   typedef typename Superclass::TimeStepType TimeStepType;
00173 
00174 
00175   typedef NeighborhoodAlgorithm::ImageBoundaryFacesCalculator< InputImageType >
00176                                                         FaceCalculatorType;
00177   typedef typename FaceCalculatorType::FaceListType     FaceListType;
00178 
00179   void SetFunctionCount( const IdCellType& n );
00180 
00181 #ifdef ITK_USE_CONCEPT_CHECKING
00182 
00183   itkConceptMacro(OutputTimesDoubleCheck,
00184     (Concept::MultiplyOperator<OutputPixelType, double>));
00185   itkConceptMacro(OutputAdditiveOperatorsCheck,
00186     (Concept::AdditiveOperators<OutputPixelType>));
00187   itkConceptMacro(InputConvertibleToOutputCheck,
00188     (Concept::Convertible<FeaturePixelType, OutputPixelType>));
00189 
00191 #endif
00192 
00193 protected:
00194   MultiphaseDenseFiniteDifferenceImageFilter()
00195     {
00196     this->m_ReinitializeCounter = 1;
00197     this->m_UpdateCounter = 0;        // FIXME: Should this be a bool ?
00198     }
00199 
00200   ~MultiphaseDenseFiniteDifferenceImageFilter() {}
00201 
00205   virtual void CopyInputToOutput();
00206   virtual void PostProcessOutput();
00208 
00212   virtual void ApplyUpdate(TimeStepType dt);
00213 
00214   unsigned int m_ReinitializeCounter;  // FIXME: Should this be a boolean ?
00215   unsigned int m_UpdateCounter;        // FIXME: Should this be a boolean ?
00216 
00217 private:
00218   MultiphaseDenseFiniteDifferenceImageFilter(const Self&);
00219   void operator=(const Self&); //purposely not implemented
00220 
00223   virtual void AllocateUpdateBuffer();
00224 
00228   virtual TimeStepType CalculateChange();
00229 
00231   std::vector< InputImagePointer > m_UpdateBuffers;
00232 };
00233 
00234 
00235 }// end namespace itk
00236 
00237 #ifndef ITK_MANUAL_INSTANTIATION
00238 #include "itkMultiphaseDenseFiniteDifferenceImageFilter.txx"
00239 #endif
00240 
00241 #endif
00242 

Generated at Tue Sep 15 04:02:54 2009 for ITK by doxygen 1.5.8 written by Dimitri van Heesch, © 1997-2000