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-05-15 17:44:18 $
00007   Version:   $Revision: 1.3 $
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,
00102   class TOutputImage,
00103   class TFunction,
00104   typename TIdCell = unsigned int >
00105 class ITK_EXPORT MultiphaseDenseFiniteDifferenceImageFilter
00106   : public MultiphaseFiniteDifferenceImageFilter<TInputImage,
00107   TOutputImage,
00108   TFunction,
00109   TIdCell >
00110 {
00111 public:
00112 
00114   typedef MultiphaseDenseFiniteDifferenceImageFilter        Self;
00115   typedef MultiphaseFiniteDifferenceImageFilter<
00116     TInputImage, TOutputImage, TFunction >                  Superclass;
00117   typedef SmartPointer<Self>                                Pointer;
00118   typedef SmartPointer<const Self>                          ConstPointer;
00119 
00121   itkTypeMacro( MultiphaseDenseFiniteDifferenceImageFilter, ImageToImageFilter );
00122 
00124   typedef typename Superclass::InputImageType           InputImageType;
00125   typedef typename Superclass::InputSizeType            InputSizeType;
00126   typedef typename Superclass::InputImagePointer        InputImagePointer;
00127   typedef typename Superclass::InputRegionType          InputRegionType;
00128   typedef typename Superclass::InputSpacingType         InputSpacingType;
00129   typedef typename Superclass::InputPointType           InputPointType;
00130   typedef typename Superclass::InputPixelType           InputPixelType;
00131 
00132   typedef typename Superclass::OutputImageType          OutputImageType;
00133   typedef typename Superclass::OutputImagePointer       OutputImagePointer;
00134   typedef typename Superclass::OutputRegionType         OutputRegionType;
00135   typedef typename Superclass::OutputSizeType           OutputSizeType;
00136   typedef typename Superclass::OutputSizeValueType      SizeValueType;
00137   typedef typename Superclass::OutputIndexType          OutputIndexType;
00138   typedef typename Superclass::OutputIndexValueType     OutputIndexValueType;
00139   typedef typename OutputImageType::PixelType           OutputPixelType;
00140 
00141   typedef typename Superclass::IdCellType               IdCellType;
00142 
00143   typedef OutputImageType                               UpdateBufferType;
00144   typedef OutputImagePointer                            UpdateBufferPointer;
00145 
00147   typedef typename UpdateBufferType::RegionType         ThreadRegionType;
00148 
00149   typedef BinaryThresholdImageFilter< OutputImageType, OutputImageType >          ThresholdFilterType;
00150   typedef typename ThresholdFilterType::Pointer                                   ThresholdFilterPointer;
00151 
00152   typedef SignedMaurerDistanceMapImageFilter< OutputImageType, OutputImageType >  MaurerType;
00153   typedef typename MaurerType::Pointer                                            MaurerPointer;
00154 
00155   typedef ImageRegionIterator<UpdateBufferType> UpdateIteratorType;
00156 
00157   typedef typename Superclass::FiniteDifferenceFunctionType       FiniteDifferenceFunctionType;
00158   typedef typename Superclass::FiniteDifferenceFunctionPointer    FiniteDifferenceFunctionPointer;
00159   typedef typename FiniteDifferenceFunctionType::NeighborhoodType NeighborhoodIteratorType;
00160 
00163   itkStaticConstMacro(ImageDimension, unsigned int,Superclass::ImageDimension);
00164 
00166   typedef typename Superclass::TimeStepType TimeStepType;
00167 
00168 
00169   typedef NeighborhoodAlgorithm::ImageBoundaryFacesCalculator< OutputImageType >  FaceCalculatorType;
00170   typedef typename FaceCalculatorType::FaceListType                               FaceListType;
00171 
00172   void SetFunctionCount( const IdCellType& n );
00173 
00174 #ifdef ITK_USE_CONCEPT_CHECKING
00175 
00176   itkConceptMacro(OutputTimesDoubleCheck,
00177     (Concept::MultiplyOperator<OutputPixelType, double>));
00178   itkConceptMacro(OutputAdditiveOperatorsCheck,
00179     (Concept::AdditiveOperators<OutputPixelType>));
00180   itkConceptMacro(InputConvertibleToOutputCheck,
00181     (Concept::Convertible<InputPixelType, OutputPixelType>));
00182 
00184 #endif
00185 
00186 protected:
00187   MultiphaseDenseFiniteDifferenceImageFilter()
00188     {
00189     this->m_ReinitializeCounter = 1;  // FIXME: Should this be a bool ?
00190     this->m_UpdateCounter = 0;        // FIXME: Should this be a bool ?
00191     }
00192 
00193   ~MultiphaseDenseFiniteDifferenceImageFilter() {}
00194 
00198   virtual void CopyInputToOutput();
00199   virtual void PostProcessOutput();
00201 
00205   virtual void ApplyUpdate(TimeStepType dt);
00206 
00207   unsigned int m_ReinitializeCounter;  // FIXME: Should this be a boolean ?
00208   unsigned int m_UpdateCounter;        // FIXME: Should this be a boolean ?
00209 
00210 private:
00211   MultiphaseDenseFiniteDifferenceImageFilter(const Self&);
00212   void operator=(const Self&); //purposely not implemented
00213 
00216   virtual void AllocateUpdateBuffer();
00217 
00221   virtual TimeStepType CalculateChange();
00222 
00224   std::vector< UpdateBufferPointer > m_UpdateBuffers;
00225 };
00226 
00227 
00228 }// end namespace itk
00229 
00230 #ifndef ITK_MANUAL_INSTANTIATION
00231 #include "itkMultiphaseDenseFiniteDifferenceImageFilter.txx"
00232 #endif
00233 
00234 #endif
00235 

Generated at Thu May 28 10:52:02 2009 for ITK by doxygen 1.5.5 written by Dimitri van Heesch, © 1997-2000