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: 2002/09/11 19:57:12 $
00007   Version:   $Revision: 1.11 $
00008 
00009   Copyright (c) 2002 Insight 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 DenseFiniteDifferenceImageFilter  
00067   : public FiniteDifferenceImageFilter<TInputImage, TOutputImage>
00068 {
00069 public:
00071   typedef DenseFiniteDifferenceImageFilter Self;
00072   typedef FiniteDifferenceImageFilter<TInputImage, TOutputImage> Superclass;
00073   
00075   itkTypeMacro(DenseFiniteDifferenceImageFilter, ImageToImageFilter );
00076   
00078   typedef typename Superclass::InputImageType  InputImageType;
00079   typedef typename Superclass::OutputImageType OutputImageType;
00080   typedef typename Superclass::FiniteDifferenceFunctionType
00081    FiniteDifferenceFunctionType;
00082   
00085   itkStaticConstMacro(ImageDimension, unsigned int,Superclass::ImageDimension);
00086 
00089   typedef typename Superclass::PixelType PixelType;
00090 
00092   typedef typename Superclass::TimeStepType TimeStepType;
00093 
00095   typedef OutputImageType UpdateBufferType;
00096   
00097 protected:
00098   DenseFiniteDifferenceImageFilter()
00099     { m_UpdateBuffer = UpdateBufferType::New(); }
00100   ~DenseFiniteDifferenceImageFilter() {}
00101   void PrintSelf(std::ostream& os, Indent indent) const;
00102 
00103 private:
00104   DenseFiniteDifferenceImageFilter(const Self&); //purposely not implemented
00105   void operator=(const Self&); //purposely not implemented
00106 
00109   struct DenseFDThreadStruct
00110   {
00111     DenseFiniteDifferenceImageFilter *Filter;
00112     TimeStepType TimeStep;
00113     TimeStepType *TimeStepList;
00114     bool *ValidTimeStepList;
00115   };
00116   
00118   typedef typename UpdateBufferType::RegionType ThreadRegionType;
00119 
00122   virtual void AllocateUpdateBuffer();
00123   
00127   virtual void ApplyUpdate(TimeStepType dt);
00128 
00131   static ITK_THREAD_RETURN_TYPE ApplyUpdateThreaderCallback( void *arg );
00132   
00136   virtual TimeStepType CalculateChange();
00137 
00140   static ITK_THREAD_RETURN_TYPE CalculateChangeThreaderCallback( void *arg );
00141   
00148   //  virtual
00149   //  int SplitUpdateContainer(int i, int num, ThreadRegionType& splitRegion);
00150 
00155   virtual
00156   void ThreadedApplyUpdate(TimeStepType dt,
00157                            const ThreadRegionType &regionToProcess,
00158                            int threadId);
00159   // FOR ALL: iterator(output, splitRegion), iterator(update, splitRegion)
00160 
00165   virtual
00166   TimeStepType ThreadedCalculateChange(const ThreadRegionType &regionToProcess,
00167                                        int threadId);
00168   // FOR ALL : iterator(input, splitRegion), iterator(update, splitRegion)
00169 
00171   typename UpdateBufferType::Pointer m_UpdateBuffer;
00172 };
00173   
00174 
00175 }// end namespace itk
00176 
00177 #ifndef ITK_MANUAL_INSTANTIATION
00178 #include "itkDenseFiniteDifferenceImageFilter.txx"
00179 #endif
00180 
00181 #endif

Generated at Fri May 21 01:14:38 2004 for ITK by doxygen 1.2.15 written by Dimitri van Heesch, © 1997-2000