00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
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
00110
private:
00111 DenseFiniteDifferenceImageFilter(
const Self&);
00112
void operator=(
const Self&);
00113
00116
struct DenseFDThreadStruct
00117 {
00118 DenseFiniteDifferenceImageFilter *Filter;
00119
TimeStepType TimeStep;
00120
TimeStepType *TimeStepList;
00121
bool *ValidTimeStepList;
00122 };
00123
00125
typedef typename UpdateBufferType::RegionType ThreadRegionType;
00126
00129
virtual void AllocateUpdateBuffer();
00130
00134
virtual void ApplyUpdate(TimeStepType dt);
00135
00138
static ITK_THREAD_RETURN_TYPE ApplyUpdateThreaderCallback(
void *arg );
00139
00143
virtual TimeStepType CalculateChange();
00144
00147
static ITK_THREAD_RETURN_TYPE CalculateChangeThreaderCallback(
void *arg );
00148
00155
00156
00157
00162
virtual
00163
void ThreadedApplyUpdate(TimeStepType dt,
00164
const ThreadRegionType ®ionToProcess,
00165
int threadId);
00166
00167
00172
virtual
00173 TimeStepType ThreadedCalculateChange(
const ThreadRegionType ®ionToProcess,
00174
int threadId);
00175
00176
00178
typename UpdateBufferType::Pointer m_UpdateBuffer;
00179 };
00180
00181
00182 }
00183
00184
#ifndef ITK_MANUAL_INSTANTIATION
00185
#include "itkDenseFiniteDifferenceImageFilter.txx"
00186
#endif
00187
00188
#endif