00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
#ifndef __itkFiniteDifferenceImageFilter_h_
00018
#define __itkFiniteDifferenceImageFilter_h_
00019
00020
#include "itkImageToImageFilter.h"
00021
#include "itkFiniteDifferenceFunction.h"
00022
00023
namespace itk {
00024
00121
template <
class TInputImage,
class TOutputImage>
00122 class ITK_EXPORT FiniteDifferenceImageFilter
00123 :
public ImageToImageFilter<TInputImage, TOutputImage>
00124 {
00125
public:
00127
typedef FiniteDifferenceImageFilter
Self;
00128 typedef ImageToImageFilter<TInputImage, TOutputImage> Superclass;
00129 typedef SmartPointer<Self> Pointer;
00130 typedef SmartPointer<const Self> ConstPointer;
00131
00133
itkTypeMacro(FiniteDifferenceImageFilter,
ImageToImageFilter );
00134
00136
typedef TInputImage
InputImageType;
00137 typedef TOutputImage
OutputImageType;
00138
00140
itkStaticConstMacro(ImageDimension,
unsigned int,
00141 OutputImageType::ImageDimension);
00142
00144
typedef typename TOutputImage::PixelType
PixelType;
00145
00149
typedef FiniteDifferenceFunction<TOutputImage> FiniteDifferenceFunctionType;
00150 typedef typename FiniteDifferenceFunctionType::TimeStepType
TimeStepType;
00151
00153
itkGetConstMacro(ElapsedIterations,
unsigned int);
00154
00158
itkGetConstReferenceObjectMacro(DifferenceFunction,
00159
FiniteDifferenceFunctionType );
00160
00164
itkSetObjectMacro(DifferenceFunction,
FiniteDifferenceFunctionType );
00165
00166
protected:
00167 FiniteDifferenceImageFilter() : m_ElapsedIterations(0) {m_DifferenceFunction = 0;}
00168 ~FiniteDifferenceImageFilter() {}
00169 void PrintSelf(std::ostream& os,
Indent indent)
const;
00170
00172
virtual void AllocateUpdateBuffer() = 0;
00173
00177
virtual void ApplyUpdate(
TimeStepType dt) = 0;
00178
00184
virtual TimeStepType CalculateChange() = 0;
00185
00189
virtual void CopyInputToOutput() = 0;
00190
00194
virtual void GenerateData();
00195
00207
virtual void GenerateInputRequestedRegion();
00208
00211
virtual bool Halt() = 0;
00217
virtual void Initialize() { };
00218
00225
virtual void InitializeIteration()
00226 { m_DifferenceFunction->InitializeIteration(); }
00227
00241
virtual TimeStepType ResolveTimeStep(
const TimeStepType* timeStepList,
00242
const bool* valid,
int size);
00243
00245
itkSetMacro(ElapsedIterations,
unsigned int);
00246
00249
virtual void PostProcessOutput() {}
00250
00251 private:
00252 FiniteDifferenceImageFilter(
const Self&);
00253
void operator=(
const Self&);
00254
00257
unsigned int m_ElapsedIterations;
00258
00260
typename FiniteDifferenceFunctionType::Pointer m_DifferenceFunction;
00261 };
00262
00263 }
00264
00265
#ifndef ITK_MANUAL_INSTANTIATION
00266
#include "itkFiniteDifferenceImageFilter.txx"
00267
#endif
00268
00269
#endif
00270