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

itkDenseFiniteDifferenceImageFilter.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Insight Segmentation & Registration Toolkit
00004   Module:    $RCSfile: itkDenseFiniteDifferenceImageFilter.h,v $
00005   Language:  C++
00006   Date:      $Date: 2004/09/29 21:38:47 $
00007   Version:   $Revision: 1.17 $
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 __itkDenseFiniteDifferenceImageFilter_h_
00018 #define __itkDenseFiniteDifferenceImageFilter_h_
00019 
00020 #include "itkFiniteDifferenceImageFilter.h"
00021 #include "itkMultiThreader.h"
00022 
00023 namespace itk {
00024 
00065 template <class TInputImage, class TOutputImage>
00066 class ITK_EXPORT DenseFiniteDifferenceImageFilter  
00067   : public FiniteDifferenceImageFilter<TInputImage, TOutputImage>
00068 {
00069 public:
00071   typedef DenseFiniteDifferenceImageFilter Self;
00072   typedef FiniteDifferenceImageFilter<TInputImage, TOutputImage> Superclass;
00073   typedef SmartPointer<Self>  Pointer;
00074   typedef SmartPointer<const Self>  ConstPointer;
00075   
00077   itkTypeMacro(DenseFiniteDifferenceImageFilter, ImageToImageFilter );
00078   
00080   typedef typename Superclass::InputImageType  InputImageType;
00081   typedef typename Superclass::OutputImageType OutputImageType;
00082   typedef typename Superclass::FiniteDifferenceFunctionType
00083    FiniteDifferenceFunctionType;
00084   
00087   itkStaticConstMacro(ImageDimension, unsigned int,Superclass::ImageDimension);
00088 
00091   typedef typename Superclass::PixelType PixelType;
00092 
00094   typedef typename Superclass::TimeStepType TimeStepType;
00095 
00097   typedef OutputImageType UpdateBufferType;
00098   
00099 protected:
00100   DenseFiniteDifferenceImageFilter()
00101     { m_UpdateBuffer = UpdateBufferType::New(); }
00102   ~DenseFiniteDifferenceImageFilter() {}
00103   void PrintSelf(std::ostream& os, Indent indent) const;
00104 
00108   virtual void CopyInputToOutput();
00109 
00113   virtual void ApplyUpdate(TimeStepType dt);
00114 
00117   virtual UpdateBufferType* GetUpdateBuffer()
00118     { return m_UpdateBuffer; }
00119   
00120 private:
00121   DenseFiniteDifferenceImageFilter(const Self&); //purposely not implemented
00122   void operator=(const Self&); //purposely not implemented
00123 
00126   struct DenseFDThreadStruct
00127   {
00128     DenseFiniteDifferenceImageFilter *Filter;
00129     TimeStepType TimeStep;
00130     TimeStepType *TimeStepList;
00131     bool *ValidTimeStepList;
00132   };
00133   
00135   typedef typename UpdateBufferType::RegionType ThreadRegionType;
00136 
00139   virtual void AllocateUpdateBuffer();
00140   
00143   static ITK_THREAD_RETURN_TYPE ApplyUpdateThreaderCallback( void *arg );
00144   
00148   virtual TimeStepType CalculateChange();
00149 
00152   static ITK_THREAD_RETURN_TYPE CalculateChangeThreaderCallback( void *arg );
00153   
00160   //  virtual
00161   //  int SplitUpdateContainer(int i, int num, ThreadRegionType& splitRegion);
00162 
00167   virtual
00168   void ThreadedApplyUpdate(TimeStepType dt,
00169                            const ThreadRegionType &regionToProcess,
00170                            int threadId);
00171   // FOR ALL: iterator(output, splitRegion), iterator(update, splitRegion)
00172 
00177   virtual
00178   TimeStepType ThreadedCalculateChange(const ThreadRegionType &regionToProcess,
00179                                        int threadId);
00180   // FOR ALL : iterator(input, splitRegion), iterator(update, splitRegion)
00181 
00183   typename UpdateBufferType::Pointer m_UpdateBuffer;
00184 };
00185   
00186 
00187 }// end namespace itk
00188 
00189 #ifndef ITK_MANUAL_INSTANTIATION
00190 #include "itkDenseFiniteDifferenceImageFilter.txx"
00191 #endif
00192 
00193 #endif

Generated at Wed May 24 23:02:48 2006 for ITK by doxygen 1.3.5 written by Dimitri van Heesch, © 1997-2000