18 #ifndef itkFEMFiniteDifferenceFunctionLoad_h
19 #define itkFEMFiniteDifferenceFunctionLoad_h
66 template <
typename TMoving,
typename TFixed>
78 itkSimpleNewMacro(
Self);
86 virtual::itk::LightObject::Pointer CreateAnother(
void) const ITK_OVERRIDE;
99 itkStaticConstMacro(ImageDimension,
unsigned int,
100 MovingImageType::ImageDimension);
125 typedef
Image<PixelType, itkGetStaticConstMacro(ImageDimension)>
127 typedef itk::
Vector<
float, itkGetStaticConstMacro(ImageDimension)>
165 void SetDifferenceFunction( FiniteDifferenceFunctionTypePointer drfp)
167 drfp->SetFixedImage(m_FixedImage);
168 drfp->SetMovingImage(m_MovingImage);
169 drfp->SetRadius(m_MetricRadius);
170 drfp->SetDisplacementField(m_DisplacementField);
171 drfp->InitializeIteration();
172 this->m_DifferenceFunction = drfp;
177 this->SetDifferenceFunction( static_cast<FiniteDifferenceFunctionType *>(
180 m_FixedSize = m_DisplacementField->GetLargestPossibleRegion().GetSize();
187 m_MovingSize = m_MovingImage->GetLargestPossibleRegion().GetSize();
188 if( this->m_DifferenceFunction )
190 this->m_DifferenceFunction->SetMovingImage(m_MovingImage);
199 m_FixedSize = T->GetLargestPossibleRegion().GetSize();
200 if( this->m_DifferenceFunction )
202 this->m_DifferenceFunction->SetFixedImage(m_MovingImage);
209 return m_MovingImage;
226 return m_MetricRadius;
235 m_NumberOfIntegrationPoints = i;
240 return m_NumberOfIntegrationPoints;
275 return m_Solution->GetSolutionValue(i, which);
278 Float EvaluateMetricGivenSolution( ElementContainerType *el, Float step = 1.0);
284 FEMVectorType Fe(FEMVectorType);
289 m_DisplacementField = df;
295 return m_DisplacementField;
298 void InitializeIteration();
300 void InitializeMetric();
302 void PrintCurrentEnergy();
304 double GetCurrentEnergy();
306 void SetCurrentEnergy(
double e = 0.0);
338 #ifndef ITK_MANUAL_INSTANTIATION
339 #include "itkFEMFiniteDifferenceFunctionLoad.hxx"
unsigned long ElementIdentifier
FixedImageType::PixelType FixedPixelType
FixedNeighborhoodIteratorType::RadiusType FixedRadiusType
MovingImageType::ConstPointer MovingConstPointer
void SetDescentDirectionMinimize()
virtual Solution::ConstPointer GetSolution() override
Light weight base class for most itk classes.
void SetDisplacementField(DisplacementFieldTypePointer df)
FiniteDifferenceFunctionType::TimeStepType TimeStepType
unsigned int GetNumberOfIntegrationPoints()
SmartPointer< Self > Pointer
DisplacementFieldType::Pointer m_DisplacementField
FixedImageType::ConstPointer FixedConstPointer
MovingNeighborhoodIteratorType::RadiusType MovingRadiusType
ObjectType * GetPointer() const
MovingImageType * MovingPointer
FixedPointer GetFixedImage()
void SetNumberOfIntegrationPoints(unsigned int i)
MovingRadiusType GetMetricRadius()
FiniteDifferenceFunctionLoad Self
Provides functions to access the values of the solution vector.
General image pair load that uses the itkFiniteDifferenceFunctions.
void SetMetricRadius(MovingRadiusType T)
A templated class holding a n-Dimensional vector.
MovingNeighborhoodIteratorType::IndexType MovingNeighborhoodIndexType
DisplacementFieldTypePointer GetDisplacementField()
FixedNeighborhoodIteratorType::IndexType FixedNeighborhoodIndexType
vnl_vector< Float > FEMVectorType
FixedImageType * FixedPointer
Float GetSolution(unsigned int i, unsigned int which=0)
A multi-dimensional iterator templated over image type that walks pixels within a region and is speci...
void SetMovingImage(MovingImageType *R)
unsigned int m_SolutionIndex2
vnl_vector< Float > VectorType
Virtual element load base class.
MovingImageType::SizeType m_MovingSize
unsigned int m_SolutionIndex
virtual void SetSolution(Solution::ConstPointer ptr) override
MovingPointer GetMovingImage()
Abstract base element class.
MovingNeighborhoodIteratorType::RadiusType RadiusType
MovingImageType::PixelType MovingPixelType
void SetFixedImage(FixedImageType *T)
Solution::ConstPointer m_Solution
Define a front-end to the STL "vector" container that conforms to the IndexedContainerInterface.
void SetMetric(FiniteDifferenceFunctionTypePointer drfp)
FiniteDifferenceFunctionTypePointer m_DifferenceFunction
unsigned int m_NumberOfIntegrationPoints
MovingPointer m_MovingImage
SmartPointer< const Self > ConstPointer
static ITK_CONSTEXPR_VAR double e
The base of the natural logarithm or Euler's number
FixedPointer m_FixedImage
Defines iteration of a local N-dimensional neighborhood of pixels across an itk::Image.
Templated n-dimensional image class.
FixedImageType::SizeType m_FixedSize
void SetDescentDirectionMaximize()