18 #ifndef itkGPUFiniteDifferenceImageFilter_h
19 #define itkGPUFiniteDifferenceImageFilter_h
35 template<
typename TInputImage,
typename TOutputImage,
typename TParentImageFilter =
36 FiniteDifferenceImageFilter< TInputImage, TOutputImage > >
58 static constexpr
unsigned int ImageDimension = OutputImageType::ImageDimension;
73 using TimeStepType =
typename FiniteDifferenceFunctionType::TimeStepType;
74 using RadiusType =
typename FiniteDifferenceFunctionType::RadiusType;
82 return this->m_DifferenceFunction;
90 itkDebugMacro(
"setting m_DifferenceFunction to " << differenceFunction);
91 if ( this->m_DifferenceFunction != differenceFunction )
93 this->m_DifferenceFunction = differenceFunction;
99 typedef enum { UNINITIALIZED = 0, INITIALIZED = 1 } FilterStateType;
104 this->SetState(INITIALIZED);
110 this->SetState(UNINITIALIZED);
114 #if !defined( ITK_WRAPPING_PARSER )
115 itkSetMacro(State, FilterStateType);
116 itkGetConstReferenceMacro(State, FilterStateType);
120 #ifdef ITK_USE_CONCEPT_CHECKING
128 itkGetConstReferenceMacro(InitTime,
TimeProbe);
129 itkGetConstReferenceMacro(ComputeUpdateTime,
TimeProbe);
130 itkGetConstReferenceMacro(ApplyUpdateTime,
TimeProbe);
131 itkGetConstReferenceMacro(SmoothFieldTime,
TimeProbe);
138 void PrintSelf(std::ostream & os,
Indent indent)
const override;
141 void AllocateUpdateBuffer()
override = 0;
146 virtual void GPUApplyUpdate(
const TimeStepType& dt) = 0;
153 virtual TimeStepType GPUCalculateChange() = 0;
158 void CopyInputToOutput()
override = 0;
163 void GPUGenerateData()
override;
176 void GenerateInputRequestedRegion()
override;
180 bool Halt()
override;
211 m_DifferenceFunction->InitializeIteration();
226 virtual TimeStepType ResolveTimeStep(
const std::vector<TimeStepType >& timeStepList,
227 const std::vector< bool >& valid)
const override;
257 void InitializeFunctionCoefficients();
271 #ifndef ITK_MANUAL_INSTANTIATION
272 #include "itkGPUFiniteDifferenceImageFilter.hxx"
class to abstract the behaviour of the GPU filters.
Light weight base class for most itk classes.
Computes the time passed between two points in code.
Define numeric traits for std::vector.
TParentImageFilter CPUSuperclass
void PostProcessOutput() override
TDisplacementField InputImageType
Base class for GPU Finite Difference Image Filters.
void Initialize() override
bool ThreadedHalt(void *) override
typename GPUSuperclass::OutputImageType OutputImageType
TimeProbe m_SmoothFieldTime
bool m_ManualReinitialization
void SetStateToInitialized()
void SetStateToUninitialized()
typename TDisplacementField::PixelType InputPixelType
Base class for GPU filters that take an image as input and overwrite that image as the output...
const FiniteDifferenceFunctionType::Pointer & GetDifferenceFunction() const override
typename FiniteDifferenceFunctionType::TimeStepType TimeStepType
typename GPUFiniteDifferenceFunction< TDisplacementField >::DifferenceFunctionType FiniteDifferenceFunctionType
typename FiniteDifferenceFunctionType::RadiusType RadiusType
typename FiniteDifferenceFunctionType::NeighborhoodScalesType NeighborhoodScalesType
typename TDisplacementField::PixelType OutputPixelType
typename NumericTraits< InputPixelType >::ValueType InputPixelValueType
FiniteDifferenceFunctionType::Pointer m_DifferenceFunction
Control indentation during Print() invocation.
typename NumericTraits< OutputPixelType >::ValueType OutputPixelValueType
#define itkConceptMacro(name, concept)
void InitializeIteration() override
OutputPixelType PixelType
void SetDifferenceFunction(FiniteDifferenceFunctionType *differenceFunction) override