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)>
164 void SetDifferenceFunction( FiniteDifferenceFunctionTypePointer drfp)
166 drfp->SetFixedImage(m_FixedImage);
167 drfp->SetMovingImage(m_MovingImage);
168 drfp->SetRadius(m_MetricRadius);
169 drfp->SetDisplacementField(m_DisplacementField);
170 drfp->InitializeIteration();
171 this->m_DifferenceFunction = drfp;
176 this->SetDifferenceFunction( static_cast<FiniteDifferenceFunctionType *>(
179 m_FixedSize = m_DisplacementField->GetLargestPossibleRegion().GetSize();
186 m_MovingSize = m_MovingImage->GetLargestPossibleRegion().GetSize();
187 if( this->m_DifferenceFunction )
189 this->m_DifferenceFunction->SetMovingImage(m_MovingImage);
198 m_FixedSize = T->GetLargestPossibleRegion().GetSize();
199 if( this->m_DifferenceFunction )
201 this->m_DifferenceFunction->SetFixedImage(m_MovingImage);
208 return m_MovingImage;
225 return m_MetricRadius;
234 m_NumberOfIntegrationPoints = i;
239 return m_NumberOfIntegrationPoints;
274 return m_Solution->GetSolutionValue(i, which);
277 Float EvaluateMetricGivenSolution( ElementContainerType *el, Float step = 1.0);
283 FEMVectorType Fe(FEMVectorType);
288 m_DisplacementField = df;
294 return m_DisplacementField;
297 void InitializeIteration();
299 void InitializeMetric();
301 void PrintCurrentEnergy();
303 double GetCurrentEnergy();
305 void SetCurrentEnergy(
double e = 0.0 );
311 virtual void PrintSelf(std::ostream& os,
Indent indent)
const ITK_OVERRIDE;
341 #ifndef ITK_MANUAL_INSTANTIATION
342 #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()
MovingRadiusType m_MetricRadius
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
Control indentation during Print() invocation.
unsigned int m_NumberOfIntegrationPoints
ImageBaseType::SizeType SizeType
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
ImageBaseType::IndexType IndexType
void SetDescentDirectionMaximize()