18 #ifndef itkImageToImageRegistrationHelper_h 19 #define itkImageToImageRegistrationHelper_h 22 #include "itkCommand.h" 34 template <
class TImage>
57 TImage::ImageDimension );
146 void SaveImage(
const std::string filename,
const TImage * image );
213 ::LINEAR_INTERPOLATION,
const TImage * movingImage =
nullptr,
220 ::LINEAR_INTERPOLATION );
235 itkSetMacro( BaselineNumberOfFailedPixelsTolerance,
unsigned int );
237 itkSetMacro( BaselineRadiusTolerance,
unsigned int );
246 itkGetMacro( BaselineNumberOfFailedPixels,
unsigned int );
282 itkSetMacro( ExpectedOffsetPixelMagnitude,
double );
412 itkSetMacro( BSplineControlPointPixelSpacing,
double );
430 void PrintSelf( std::ostream & os, Indent indent )
const override;
437 LandmarkPointContainer;
440 void operator =(
const Self & );
443 typename TImage::ConstPointer m_FixedImage;
444 typename TImage::ConstPointer m_MovingImage;
446 bool m_SampleFromOverlap;
447 double m_SampleIntensityPortion;
449 bool m_UseFixedImageMaskObject;
450 typename MaskObjectType::ConstPointer m_FixedImageMaskObject;
451 bool m_UseMovingImageMaskObject;
452 typename MaskObjectType::ConstPointer m_MovingImageMaskObject;
454 bool m_UseRegionOfInterest;
458 unsigned int m_RandomNumberSeed;
461 bool m_EnableLoadedRegistration;
462 bool m_EnableInitialRegistration;
463 bool m_EnableRigidRegistration;
464 bool m_EnableAffineRegistration;
465 bool m_EnableBSplineRegistration;
467 double m_ExpectedOffsetPixelMagnitude;
468 double m_ExpectedRotationMagnitude;
469 double m_ExpectedScaleMagnitude;
470 double m_ExpectedSkewMagnitude;
472 bool m_CompletedInitialization;
474 bool m_CompletedResampling;
476 typename TImage::ConstPointer m_CurrentMovingImage;
477 typename MatrixTransformType::Pointer m_CurrentMatrixTransform;
478 typename BSplineTransformType::Pointer m_CurrentBSplineTransform;
480 typename TImage::ConstPointer m_LoadedTransformResampledImage;
481 typename TImage::ConstPointer m_MatrixTransformResampledImage;
482 typename TImage::ConstPointer m_BSplineTransformResampledImage;
484 double m_FinalMetricValue;
486 typename TImage::ConstPointer m_BaselineImage;
487 unsigned int m_BaselineNumberOfFailedPixelsTolerance;
489 unsigned int m_BaselineRadiusTolerance;
490 typename TImage::ConstPointer m_BaselineResampledMovingImage;
491 typename TImage::ConstPointer m_BaselineDifferenceImage;
492 unsigned int m_BaselineNumberOfFailedPixels;
493 bool m_BaselineTestPassed;
495 bool m_ReportProgress;
496 bool m_MinimizeMemory;
499 typename MatrixTransformType::Pointer m_LoadedMatrixTransform;
500 typename BSplineTransformType::Pointer m_LoadedBSplineTransform;
504 typename InitialTransformType::Pointer m_InitialTransform;
505 LandmarkPointContainer m_FixedLandmarks;
506 LandmarkPointContainer m_MovingLandmarks;
509 double m_RigidSamplingRatio;
510 double m_RigidTargetError;
511 unsigned int m_RigidMaxIterations;
513 typename RigidTransformType::Pointer m_RigidTransform;
517 double m_RigidMetricValue;
520 double m_AffineSamplingRatio;
521 double m_AffineTargetError;
522 unsigned int m_AffineMaxIterations;
524 typename AffineTransformType::Pointer m_AffineTransform;
528 double m_AffineMetricValue;
531 double m_BSplineSamplingRatio;
532 double m_BSplineTargetError;
533 unsigned int m_BSplineMaxIterations;
534 double m_BSplineControlPointPixelSpacing;
536 typename BSplineTransformType::Pointer m_BSplineTransform;
540 double m_BSplineMetricValue;
546 #ifndef ITK_MANUAL_INSTANTIATION 547 #include "itkImageToImageRegistrationHelper.txx"
AffineTransformType MatrixTransformType
void SetFixedLandmarks(const LandmarkVectorType &fixedLandmarks)
OptimizedImageToImageRegistrationMethod< TImage > OptimizedRegistrationMethodType
void SetLoadedBSplineTransform(const BSplineTransformType &tfm)
void LoadParameters(const std::string filename)
itkGetConstObjectMacro(FixedImage, TImage)
void SaveImage(const std::string filename, const TImage *image)
RigidRegistrationMethodType::TransformType RigidTransformType
void ComputeBaselineDifference()
void SaveParameters(const std::string filename)
void SetMovingLandmarks(const LandmarkVectorType &movingLandmarks)
Simplified inverse ITK transforms.
ImageToImageRegistrationHelper Self
itkTypeMacro(ImageToImageRegistrationHelper, Object)
RigidTransformType TransformType
BSplineImageToImageRegistrationMethod< TImage > BSplineRegistrationMethodType
TImage::PixelType PixelType
void LoadBaselineImage(const std::string filename)
AffineTransform< double, itkGetStaticConstMacro(ImageDimension)> TransformType
RegistrationMethodType::MaskObjectType MaskObjectType
OptimizedRegistrationMethodType::InterpolationMethodEnumType InterpolationMethodEnumType
OptimizedRegistrationMethodType::MetricMethodEnumType MetricMethodEnumType
std::vector< LandmarkPointType > LandmarkPointContainer
void SetMovingImageMaskObject(const MaskObjectType *mask)
void LoadFixedImage(const std::string filename)
void SetLoadedMatrixTransform(const MatrixTransformType &tfm)
AffineTransformType TransformType
RegistrationStageEnumType
SmartPointer< Self > Pointer
ImageToImageRegistrationMethod< TImage > RegistrationMethodType
void LoadMovingImage(const std::string filename)
~ImageToImageRegistrationHelper() override
InitialRegistrationMethodType::TransformType InitialTransformType
TImage::ConstPointer ResampleImage(InterpolationMethodEnumType interp=OptimizedRegistrationMethodType ::LINEAR_INTERPOLATION, const TImage *movingImage=nullptr, const MatrixTransformType *matrixTransform=nullptr, const BSplineTransformType *bsplineTransform=nullptr, PixelType defaultPixelValue=0)
Point< double, itkGetStaticConstMacro(ImageDimension)> LandmarkPointType
AffineRegistrationMethodType::TransformType AffineTransformType
SmartPointer< const Self > ConstPointer
InterpolationMethodEnumType
itkStaticConstMacro(ImageDimension, unsigned int, TImage::ImageDimension)
itkSetConstObjectMacro(FixedImage, TImage)
BSplineTransformType TransformType
void SaveTransform(const std::string filename)
AffineImageToImageRegistrationMethod< TImage > AffineRegistrationMethodType
void PrintSelf(std::ostream &os, Indent indent) const override
TImage::ConstPointer GetFinalMovingImage(InterpolationMethodEnumType interp=OptimizedRegistrationMethodType ::LINEAR_INTERPOLATION)
std::vector< std::vector< float > > LandmarkVectorType
itkSetMacro(RandomNumberSeed, unsigned int)
void SetRegionOfInterest(const PointType &point1, const PointType &point2)
ImageToImageRegistrationHelper()
SpatialObject< itkGetStaticConstMacro(ImageDimension)> MaskObjectType
itkGetConstMacro(UseFixedImageMaskObject, bool)
void LoadTransform(const std::string filename)
RigidImageToImageRegistrationMethod< TImage > RigidRegistrationMethodType
itkBooleanMacro(UseFixedImageMaskObject)
BSplineRegistrationMethodType::TransformType BSplineTransformType
itkGetMacro(RandomNumberSeed, unsigned int)
void SetFixedImageMaskObject(const MaskObjectType *mask)
TImage::PointType PointType
void PrintSelfHelper(std::ostream &os, Indent indent, const std::string basename, MetricMethodEnumType metric, InterpolationMethodEnumType interpolation) const
InitialImageToImageRegistrationMethod< TImage > InitialRegistrationMethodType