All metric and optimizer parameters of Automatic Registration are moved to Config file
This commit is contained in:
@ -20,6 +20,7 @@ SET(SRCS
|
|||||||
vtkContourTopogramProjectionFilter.cxx
|
vtkContourTopogramProjectionFilter.cxx
|
||||||
DRTMetaInformation.cpp
|
DRTMetaInformation.cpp
|
||||||
itkReg23.cpp
|
itkReg23.cpp
|
||||||
|
itkReg23MetaInformation.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
SET(HDR
|
SET(HDR
|
||||||
@ -31,6 +32,7 @@ SET(HDR
|
|||||||
vtkContourTopogramProjectionFilter.h
|
vtkContourTopogramProjectionFilter.h
|
||||||
DRTMetaInformation.h
|
DRTMetaInformation.h
|
||||||
itkReg23.h
|
itkReg23.h
|
||||||
|
itkReg23MetaInformation.h
|
||||||
)
|
)
|
||||||
|
|
||||||
ADD_LIBRARY(${LIB_NAME} ${SRCS} ${HDR})
|
ADD_LIBRARY(${LIB_NAME} ${SRCS} ${HDR})
|
||||||
|
@ -549,7 +549,6 @@ R23MetaInformation (){
|
|||||||
m_DegreeOfFreedom = tDegreeOfFreedomEnum::UNKNOWN;
|
m_DegreeOfFreedom = tDegreeOfFreedomEnum::UNKNOWN;
|
||||||
m_OptimizerType = tOptimizerTypeEnum::POWELL;
|
m_OptimizerType = tOptimizerTypeEnum::POWELL;
|
||||||
m_MetricType = tMetricTypeEnum::NCC;
|
m_MetricType = tMetricTypeEnum::NCC;
|
||||||
m_MaxIterations = 6;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -622,8 +622,7 @@ public:
|
|||||||
itkSetEnumMacro(MetricType, tMetricTypeEnum);
|
itkSetEnumMacro(MetricType, tMetricTypeEnum);
|
||||||
itkGetEnumMacro(MetricType, tMetricTypeEnum);
|
itkGetEnumMacro(MetricType, tMetricTypeEnum);
|
||||||
|
|
||||||
itkSetEnumMacro(MaxIterations, int);
|
|
||||||
itkGetEnumMacro(MaxIterations, int);
|
|
||||||
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
@ -637,9 +636,6 @@ protected:
|
|||||||
tMetricTypeEnum
|
tMetricTypeEnum
|
||||||
m_MetricType;
|
m_MetricType;
|
||||||
|
|
||||||
int
|
|
||||||
m_MaxIterations;
|
|
||||||
|
|
||||||
/** Default Constructor **/
|
/** Default Constructor **/
|
||||||
R23MetaInformation ();
|
R23MetaInformation ();
|
||||||
/** Default Destructor **/
|
/** Default Destructor **/
|
||||||
|
@ -98,6 +98,18 @@ itkImageProcessor::itkImageProcessor()
|
|||||||
m_r23MetaInfo = NULL;
|
m_r23MetaInfo = NULL;
|
||||||
m_r23MetaInfo = R23MetaInformation::New();
|
m_r23MetaInfo = R23MetaInformation::New();
|
||||||
|
|
||||||
|
m_PowellOptimizerMetaInfo = NULL;
|
||||||
|
m_PowellOptimizerMetaInfo = PowellOptimizerMetaInformation::New();
|
||||||
|
|
||||||
|
m_AmoebaOptimizerMetaInfo = NULL;
|
||||||
|
m_AmoebaOptimizerMetaInfo = AmoebaOptimizerMetaInformation::New();
|
||||||
|
|
||||||
|
m_MIMetricMetaInfo = NULL;
|
||||||
|
m_MIMetricMetaInfo = MIMetricMetaInformation::New();
|
||||||
|
|
||||||
|
m_NCCMetricMetaInfo = NULL;
|
||||||
|
m_NCCMetricMetaInfo = NCCMetricMetaInformation::New();
|
||||||
|
|
||||||
/* Initialise the projection geoemtry with defaults */
|
/* Initialise the projection geoemtry with defaults */
|
||||||
m_DRTGeometryMetaInfo = NULL;
|
m_DRTGeometryMetaInfo = NULL;
|
||||||
m_DRTGeometryMetaInfo
|
m_DRTGeometryMetaInfo
|
||||||
@ -1190,11 +1202,50 @@ void itkImageProcessor::SetMetric(std::string metric)
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void itkImageProcessor::SetMaxNumberOfIterations(int iNum)
|
void itkImageProcessor::SetDegreeOfFreedom(tDegreeOfFreedomEnum dof){
|
||||||
{
|
|
||||||
m_r23MetaInfo->SetMaxIterations(iNum);
|
m_r23MetaInfo->SetDegreeOfFreedom(dof);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
void itkImageProcessor::SetPowellOptimParameters(
|
||||||
|
double dStepT,
|
||||||
|
double dValTol,
|
||||||
|
double dStepL,
|
||||||
|
int iMaxLinI,
|
||||||
|
int iMaxIter){
|
||||||
|
|
||||||
|
m_PowellOptimizerMetaInfo->SetStepTolerance(dStepT);
|
||||||
|
m_PowellOptimizerMetaInfo->SetValueTolerance(dValTol);
|
||||||
|
m_PowellOptimizerMetaInfo->SetStepLength(dStepL);
|
||||||
|
m_PowellOptimizerMetaInfo->SetMaximumLineInteration(iMaxLinI);
|
||||||
|
m_PowellOptimizerMetaInfo->SetMaxIterations(iMaxIter);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void itkImageProcessor::SetAmoebaOptimParameters(
|
||||||
|
double dParConvTol,
|
||||||
|
double dFuntConvTol,
|
||||||
|
double dSimplex,
|
||||||
|
int iMaxIter){
|
||||||
|
m_AmoebaOptimizerMetaInfo->SetParametersConvergenceTolerance(dParConvTol);
|
||||||
|
m_AmoebaOptimizerMetaInfo->SetFunctionConvergenceTolerance(dFuntConvTol);
|
||||||
|
m_AmoebaOptimizerMetaInfo->SetSimplexDelta(dSimplex);
|
||||||
|
m_AmoebaOptimizerMetaInfo->SetMaxIterations(iMaxIter);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void itkImageProcessor::SetMIMetricParameters(double dMaxT){
|
||||||
|
m_MIMetricMetaInfo->SetMaxTranslation(dMaxT);
|
||||||
|
}
|
||||||
|
|
||||||
|
void itkImageProcessor::SetNCCMetricParameters(double dMaxT,bool bSm){
|
||||||
|
m_NCCMetricMetaInfo->SetMaxTranslation(dMaxT);
|
||||||
|
m_NCCMetricMetaInfo->SetSubtractMean(bSm);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void itkImageProcessor::InitializeProjector()
|
void itkImageProcessor::InitializeProjector()
|
||||||
{
|
{
|
||||||
|
|
||||||
@ -2512,15 +2563,18 @@ void itkImageProcessor::ResetROIRegions(){
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void itkImageProcessor::InizializeRegistration(double stepLength,
|
void itkImageProcessor::InizializeRegistration(){
|
||||||
double maxTranslation,
|
|
||||||
eDegreeOfFreedomType dof){
|
|
||||||
|
|
||||||
m_r23MetaInfo->SetDegreeOfFreedom(dof);
|
|
||||||
m_R23->SetPA(m_PASourceDupli->GetOutput());
|
m_R23->SetPA(m_PASourceDupli->GetOutput());
|
||||||
m_R23->SetLAT(m_LATSourceDupli->GetOutput());
|
m_R23->SetLAT(m_LATSourceDupli->GetOutput());
|
||||||
m_R23->SetVolume(m_VolumeSourceDupli->GetOutput());
|
m_R23->SetVolume(m_VolumeSourceDupli->GetOutput());
|
||||||
|
|
||||||
m_R23->Setr23Meta(m_r23MetaInfo);
|
m_R23->Setr23Meta(m_r23MetaInfo);
|
||||||
|
m_R23->SetPowellMeta(m_PowellOptimizerMetaInfo);
|
||||||
|
m_R23->SetAmoebaMeta(m_AmoebaOptimizerMetaInfo);
|
||||||
|
m_R23->SetMIMeta(m_MIMetricMetaInfo);
|
||||||
|
m_R23->SetNCCMeta(m_NCCMetricMetaInfo);
|
||||||
|
|
||||||
m_R23->SetInternalTransf1(m_InternalTransf1);
|
m_R23->SetInternalTransf1(m_InternalTransf1);
|
||||||
m_R23->SetInternalTransf2(m_InternalTransf2);
|
m_R23->SetInternalTransf2(m_InternalTransf2);
|
||||||
m_R23->Setfilter1(filter1);
|
m_R23->Setfilter1(filter1);
|
||||||
@ -2529,8 +2583,7 @@ void itkImageProcessor::InizializeRegistration(double stepLength,
|
|||||||
m_R23->Setinterpolator2(interpolator2);
|
m_R23->Setinterpolator2(interpolator2);
|
||||||
m_R23->SetTransformMetaInfo(m_TransformMetaInfo);
|
m_R23->SetTransformMetaInfo(m_TransformMetaInfo);
|
||||||
|
|
||||||
m_R23->InitializeRegistration(
|
m_R23->InitializeRegistration();
|
||||||
stepLength,maxTranslation,dof);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -47,6 +47,7 @@ gfattori 08.11.2021
|
|||||||
#include "itkImageProcessorHelpers.h"
|
#include "itkImageProcessorHelpers.h"
|
||||||
|
|
||||||
#include "itkReg23.h"
|
#include "itkReg23.h"
|
||||||
|
#include "itkReg23MetaInformation.h"
|
||||||
|
|
||||||
namespace itk
|
namespace itk
|
||||||
{
|
{
|
||||||
@ -86,12 +87,9 @@ public:
|
|||||||
void SetRegionFixed1(int,int,int,int);
|
void SetRegionFixed1(int,int,int,int);
|
||||||
void SetRegionFixed2(int,int,int,int);
|
void SetRegionFixed2(int,int,int,int);
|
||||||
void ResetROIRegions();
|
void ResetROIRegions();
|
||||||
void InizializeRegistration(double stepLength,
|
void InizializeRegistration();
|
||||||
double maxTranslation,
|
|
||||||
eDegreeOfFreedomType dof);
|
|
||||||
|
|
||||||
/** Maximum number of iterations for the optimizer */
|
/** Maximum number of iterations for the optimizer */
|
||||||
void SetMaxNumberOfIterations(int);
|
|
||||||
itkGetMacro(R23, itkReg23::Pointer);
|
itkGetMacro(R23, itkReg23::Pointer);
|
||||||
|
|
||||||
|
|
||||||
@ -103,6 +101,21 @@ public:
|
|||||||
void SetMetric(std::string);
|
void SetMetric(std::string);
|
||||||
void SetMetric(tMetricTypeEnum);
|
void SetMetric(tMetricTypeEnum);
|
||||||
|
|
||||||
|
/** Set DOF */
|
||||||
|
void SetDegreeOfFreedom(tDegreeOfFreedomEnum);
|
||||||
|
|
||||||
|
/** Set PowellOptimizer */
|
||||||
|
void SetPowellOptimParameters(double,double,double,int,int);
|
||||||
|
|
||||||
|
/** Set AmoebaOptimizer */
|
||||||
|
void SetAmoebaOptimParameters(double,double,double,int);
|
||||||
|
|
||||||
|
/** Set MI */
|
||||||
|
void SetMIMetricParameters(double);
|
||||||
|
|
||||||
|
/** Set NCC */
|
||||||
|
void SetNCCMetricParameters(double,bool);
|
||||||
|
|
||||||
/** Set number of logic CPU to be made available to interpolators*/
|
/** Set number of logic CPU to be made available to interpolators*/
|
||||||
void SetNumberOfWorkingUnits(int iN);
|
void SetNumberOfWorkingUnits(int iN);
|
||||||
|
|
||||||
@ -390,6 +403,18 @@ private:
|
|||||||
R23MetaInformation::Pointer
|
R23MetaInformation::Pointer
|
||||||
m_r23MetaInfo;
|
m_r23MetaInfo;
|
||||||
|
|
||||||
|
PowellOptimizerMetaInformation::Pointer
|
||||||
|
m_PowellOptimizerMetaInfo;
|
||||||
|
|
||||||
|
AmoebaOptimizerMetaInformation::Pointer
|
||||||
|
m_AmoebaOptimizerMetaInfo;
|
||||||
|
|
||||||
|
MIMetricMetaInformation::Pointer
|
||||||
|
m_MIMetricMetaInfo;
|
||||||
|
|
||||||
|
NCCMetricMetaInformation::Pointer
|
||||||
|
m_NCCMetricMetaInfo;
|
||||||
|
|
||||||
InternalTransformMetaInformation::Pointer
|
InternalTransformMetaInformation::Pointer
|
||||||
m_InternalTransf1,
|
m_InternalTransf1,
|
||||||
m_InternalTransf2;
|
m_InternalTransf2;
|
||||||
|
@ -71,10 +71,7 @@ void itkReg23::PrintSelf(std::ostream& os, Indent indent) const
|
|||||||
Superclass::PrintSelf(os, indent);
|
Superclass::PrintSelf(os, indent);
|
||||||
}
|
}
|
||||||
|
|
||||||
void itkReg23::InitializeRegistration(
|
void itkReg23::InitializeRegistration()
|
||||||
double stepLength,
|
|
||||||
double maxTranslation,
|
|
||||||
eDegreeOfFreedomType dof)
|
|
||||||
{
|
{
|
||||||
std::cout << "*" << __COMPACT_PRETTY_FUNCTION__ << std::endl;
|
std::cout << "*" << __COMPACT_PRETTY_FUNCTION__ << std::endl;
|
||||||
|
|
||||||
@ -126,6 +123,17 @@ void itkReg23::InitializeRegistration(
|
|||||||
itkExceptionMacro(<< "m_interpolator2 data not present");
|
itkExceptionMacro(<< "m_interpolator2 data not present");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// std::cout << "Print r23" <<
|
||||||
|
// m_r23Meta->GetMetricType() << " " << m_r23Meta->GetDegreeOfFreedom() << std::endl;
|
||||||
|
// std::cout << "Print Powell" <<
|
||||||
|
// m_PowellMeta->GetStepLength() << " " << m_PowellMeta->GetStepTolerance() << std::endl;
|
||||||
|
// std::cout << "Print Amoeba" <<
|
||||||
|
// m_AmoebaMeta->GetFunctionConvergenceTolerance() << " " << m_AmoebaMeta->GetSimplexDelta() << std::endl;
|
||||||
|
// std::cout << "Print NCC" <<
|
||||||
|
// m_NCCMeta->GetSubtractMean() << " " << m_NCCMeta->GetMaxTranslation() << std::endl;
|
||||||
|
// std::cout << "Print MI" <<
|
||||||
|
// m_MIMeta->GetMaxTranslation() << std::endl;
|
||||||
|
|
||||||
AmoebaOptimizerType::ParametersType simplexDelta(3);
|
AmoebaOptimizerType::ParametersType simplexDelta(3);
|
||||||
ExhaustiveOptimizerType::StepsType steps(3);
|
ExhaustiveOptimizerType::StepsType steps(3);
|
||||||
const int numberOfSteps = 25; //In each direction. Total number of steps is ((2*numberOfSteps+1))^3. For 25 -> 132651.
|
const int numberOfSteps = 25; //In each direction. Total number of steps is ((2*numberOfSteps+1))^3. For 25 -> 132651.
|
||||||
@ -137,11 +145,11 @@ void itkReg23::InitializeRegistration(
|
|||||||
std::cout<< "Using POWELL Optimizer" <<std::endl;
|
std::cout<< "Using POWELL Optimizer" <<std::endl;
|
||||||
|
|
||||||
PowellOptimizer->SetMaximize(false); // for NCC and MI
|
PowellOptimizer->SetMaximize(false); // for NCC and MI
|
||||||
PowellOptimizer->SetMaximumIteration(m_r23Meta->GetMaxIterations());
|
PowellOptimizer->SetMaximumIteration(m_PowellMeta->GetMaxIterations());
|
||||||
PowellOptimizer->SetMaximumLineIteration(4); // for Powell's method
|
PowellOptimizer->SetMaximumLineIteration(m_PowellMeta->GetMaximumLineInteration()); // for Powell's method
|
||||||
PowellOptimizer->SetStepLength(stepLength);
|
PowellOptimizer->SetStepLength(m_PowellMeta->GetStepLength());
|
||||||
PowellOptimizer->SetStepTolerance(0.01);
|
PowellOptimizer->SetStepTolerance(m_PowellMeta->GetStepTolerance());
|
||||||
PowellOptimizer->SetValueTolerance(0.000002);
|
PowellOptimizer->SetValueTolerance(m_PowellMeta->GetValueTolerance());
|
||||||
PowellOptimizer->RemoveAllObservers();
|
PowellOptimizer->RemoveAllObservers();
|
||||||
PowellOptimizer->AddObserver(itk::IterationEvent(), m_OptimizerObserver);
|
PowellOptimizer->AddObserver(itk::IterationEvent(), m_OptimizerObserver);
|
||||||
|
|
||||||
@ -153,17 +161,17 @@ void itkReg23::InitializeRegistration(
|
|||||||
std::cout<< "Using AMOEBA Optimizer" <<std::endl;
|
std::cout<< "Using AMOEBA Optimizer" <<std::endl;
|
||||||
|
|
||||||
AmoebaOptimizer->SetMinimize(true);
|
AmoebaOptimizer->SetMinimize(true);
|
||||||
AmoebaOptimizer->SetMaximumNumberOfIterations(m_r23Meta->GetMaxIterations());
|
AmoebaOptimizer->SetMaximumNumberOfIterations(m_AmoebaMeta->GetMaxIterations());
|
||||||
AmoebaOptimizer->SetParametersConvergenceTolerance(0.1);
|
AmoebaOptimizer->SetParametersConvergenceTolerance(m_AmoebaMeta->GetParametersConvergenceTolerance());
|
||||||
AmoebaOptimizer->SetFunctionConvergenceTolerance(0.000002);
|
AmoebaOptimizer->SetFunctionConvergenceTolerance(m_AmoebaMeta->GetFunctionConvergenceTolerance());
|
||||||
AmoebaOptimizer->SetAutomaticInitialSimplex(false);
|
AmoebaOptimizer->SetAutomaticInitialSimplex(false);
|
||||||
//Initial size of the simplex (otherwise it is a very small number and optimizer stops immeditaly)
|
//Initial size of the simplex (otherwise it is a very small number and optimizer stops immeditaly)
|
||||||
// 2 mm / 2 degrees seems to be a good value which performs well.
|
// 2 mm / 2 degrees seems to be a good value which performs well.
|
||||||
if (GetNumberOfDOF(dof) == 0) {
|
if (GetNumberOfDOF(m_r23Meta->GetDegreeOfFreedom()) == 0) {
|
||||||
itkExceptionMacro(<< "Unkown or unsupported degree of freedom");
|
itkExceptionMacro(<< "Unkown or unsupported degree of freedom");
|
||||||
}
|
}
|
||||||
for (int i = 0; i < GetNumberOfDOF(dof); i++) {
|
for (int i = 0; i < GetNumberOfDOF(m_r23Meta->GetDegreeOfFreedom()); i++) {
|
||||||
simplexDelta[i] = 2.0;
|
simplexDelta[i] = m_AmoebaMeta->GetSimplexDelta();
|
||||||
}
|
}
|
||||||
AmoebaOptimizer->SetInitialSimplexDelta(simplexDelta);
|
AmoebaOptimizer->SetInitialSimplexDelta(simplexDelta);
|
||||||
AmoebaOptimizer->RemoveAllObservers();
|
AmoebaOptimizer->RemoveAllObservers();
|
||||||
@ -176,13 +184,13 @@ void itkReg23::InitializeRegistration(
|
|||||||
case tOptimizerTypeEnum::EXHAUSTIVE:
|
case tOptimizerTypeEnum::EXHAUSTIVE:
|
||||||
std::cout<< "Using Extensive Optimizer" <<std::endl;
|
std::cout<< "Using Extensive Optimizer" <<std::endl;
|
||||||
|
|
||||||
steps[0] = numberOfSteps;
|
// steps[0] = numberOfSteps;
|
||||||
steps[1] = numberOfSteps;
|
// steps[1] = numberOfSteps;
|
||||||
steps[2] = numberOfSteps;
|
// steps[2] = numberOfSteps;
|
||||||
ExhaustiveOptimizer->SetNumberOfSteps(steps);
|
// ExhaustiveOptimizer->SetNumberOfSteps(steps);
|
||||||
ExhaustiveOptimizer->SetStepLength(stepLength);
|
// ExhaustiveOptimizer->SetStepLength(stepLength);
|
||||||
|
|
||||||
registration->SetOptimizer(ExhaustiveOptimizer);
|
// registration->SetOptimizer(ExhaustiveOptimizer);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@ -198,7 +206,7 @@ void itkReg23::InitializeRegistration(
|
|||||||
|
|
||||||
registration->SetMetric(MImetric);
|
registration->SetMetric(MImetric);
|
||||||
MImetric->ComputeGradientOff();
|
MImetric->ComputeGradientOff();
|
||||||
MImetric->SetMaxTranslation(maxTranslation);
|
MImetric->SetMaxTranslation(m_MIMeta->GetMaxTranslation());
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@ -207,7 +215,7 @@ void itkReg23::InitializeRegistration(
|
|||||||
registration->SetMetric(NCCmetric);
|
registration->SetMetric(NCCmetric);
|
||||||
NCCmetric->ComputeGradientOff();
|
NCCmetric->ComputeGradientOff();
|
||||||
NCCmetric->SetSubtractMean(true);
|
NCCmetric->SetSubtractMean(true);
|
||||||
NCCmetric->SetMaxTranslation(maxTranslation);
|
NCCmetric->SetMaxTranslation(m_NCCMeta->GetMaxTranslation());
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -18,6 +18,8 @@
|
|||||||
#include "itkImageProcessorHelpers.h"
|
#include "itkImageProcessorHelpers.h"
|
||||||
#include "itkQtIterationUpdate.h"
|
#include "itkQtIterationUpdate.h"
|
||||||
|
|
||||||
|
#include "itkReg23MetaInformation.h"
|
||||||
|
|
||||||
|
|
||||||
namespace itk{
|
namespace itk{
|
||||||
|
|
||||||
@ -50,6 +52,19 @@ public:
|
|||||||
itkSetMacro(r23Meta, R23MetaInformation::Pointer);
|
itkSetMacro(r23Meta, R23MetaInformation::Pointer);
|
||||||
itkGetMacro(r23Meta, R23MetaInformation::Pointer);
|
itkGetMacro(r23Meta, R23MetaInformation::Pointer);
|
||||||
|
|
||||||
|
itkSetMacro(PowellMeta, PowellOptimizerMetaInformation::Pointer);
|
||||||
|
itkGetMacro(PowellMeta, PowellOptimizerMetaInformation::Pointer);
|
||||||
|
|
||||||
|
itkSetMacro(AmoebaMeta, AmoebaOptimizerMetaInformation::Pointer);
|
||||||
|
itkGetMacro(AmoebaMeta, AmoebaOptimizerMetaInformation::Pointer);
|
||||||
|
|
||||||
|
itkSetMacro(MIMeta, MIMetricMetaInformation::Pointer);
|
||||||
|
itkGetMacro(MIMeta, MIMetricMetaInformation::Pointer);
|
||||||
|
|
||||||
|
itkSetMacro(NCCMeta, NCCMetricMetaInformation::Pointer);
|
||||||
|
itkGetMacro(NCCMeta, NCCMetricMetaInformation::Pointer);
|
||||||
|
|
||||||
|
|
||||||
itkSetMacro(Volume, InternalImageType::Pointer);
|
itkSetMacro(Volume, InternalImageType::Pointer);
|
||||||
itkGetMacro(Volume, InternalImageType::Pointer);
|
itkGetMacro(Volume, InternalImageType::Pointer);
|
||||||
|
|
||||||
@ -92,9 +107,7 @@ public:
|
|||||||
/** Auto Reg23 methods */
|
/** Auto Reg23 methods */
|
||||||
|
|
||||||
/** Initialize the registration pipeline*/
|
/** Initialize the registration pipeline*/
|
||||||
void InitializeRegistration(double stepLength,
|
void InitializeRegistration();
|
||||||
double maxTranslation,
|
|
||||||
eDegreeOfFreedomType dof);
|
|
||||||
/** Start the registration process*/
|
/** Start the registration process*/
|
||||||
int StartRegistration(std::string extraInfo);
|
int StartRegistration(std::string extraInfo);
|
||||||
/** Get the current cost function value from the optimizer*/
|
/** Get the current cost function value from the optimizer*/
|
||||||
@ -151,6 +164,18 @@ private:
|
|||||||
R23MetaInformation::Pointer
|
R23MetaInformation::Pointer
|
||||||
m_r23Meta;
|
m_r23Meta;
|
||||||
|
|
||||||
|
PowellOptimizerMetaInformation::Pointer
|
||||||
|
m_PowellMeta;
|
||||||
|
|
||||||
|
AmoebaOptimizerMetaInformation::Pointer
|
||||||
|
m_AmoebaMeta;
|
||||||
|
|
||||||
|
MIMetricMetaInformation::Pointer
|
||||||
|
m_MIMeta;
|
||||||
|
|
||||||
|
NCCMetricMetaInformation::Pointer
|
||||||
|
m_NCCMeta;
|
||||||
|
|
||||||
InternalImageType::Pointer
|
InternalImageType::Pointer
|
||||||
m_Volume,
|
m_Volume,
|
||||||
m_PA,
|
m_PA,
|
||||||
|
103
reg23Topograms/itkDTRrecon/itkReg23MetaInformation.cpp
Normal file
103
reg23Topograms/itkDTRrecon/itkReg23MetaInformation.cpp
Normal file
@ -0,0 +1,103 @@
|
|||||||
|
#include "itkReg23MetaInformation.h"
|
||||||
|
|
||||||
|
|
||||||
|
namespace itk {
|
||||||
|
|
||||||
|
PowellOptimizerMetaInformation::
|
||||||
|
PowellOptimizerMetaInformation(){
|
||||||
|
|
||||||
|
this->m_MaximumLineInteration = 4;
|
||||||
|
this->m_StepLength = 2.0;
|
||||||
|
this->m_StepTolerance = 0.01;
|
||||||
|
this->m_ValueTolerance = 0.000002;
|
||||||
|
|
||||||
|
this->m_MaxIterations = 6;
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
PowellOptimizerMetaInformation
|
||||||
|
::PrintSelf(std::ostream& os, itk::Indent indent) const
|
||||||
|
{
|
||||||
|
Superclass::PrintSelf(os, indent);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
PowellOptimizerMetaInformation
|
||||||
|
::~PowellOptimizerMetaInformation ()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
AmoebaOptimizerMetaInformation::
|
||||||
|
AmoebaOptimizerMetaInformation(){
|
||||||
|
|
||||||
|
this->m_ParametersConvergenceTolerance = 0.1;
|
||||||
|
this->m_FunctionConvergenceTolerance = 0.000002;
|
||||||
|
this->m_SimplexDelta = 2.0;
|
||||||
|
|
||||||
|
this->m_MaxIterations = 100;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void
|
||||||
|
AmoebaOptimizerMetaInformation
|
||||||
|
::PrintSelf(std::ostream& os, itk::Indent indent) const
|
||||||
|
{
|
||||||
|
Superclass::PrintSelf(os, indent);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
AmoebaOptimizerMetaInformation
|
||||||
|
::~AmoebaOptimizerMetaInformation ()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
MIMetricMetaInformation::
|
||||||
|
MIMetricMetaInformation(){
|
||||||
|
|
||||||
|
this->m_MaxTranslation = 100.0;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void
|
||||||
|
MIMetricMetaInformation
|
||||||
|
::PrintSelf(std::ostream& os, itk::Indent indent) const
|
||||||
|
{
|
||||||
|
Superclass::PrintSelf(os, indent);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
MIMetricMetaInformation
|
||||||
|
::~MIMetricMetaInformation ()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
NCCMetricMetaInformation::
|
||||||
|
NCCMetricMetaInformation(){
|
||||||
|
|
||||||
|
this->m_MaxTranslation = 100.0;
|
||||||
|
this->m_SubtractMean = true;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void
|
||||||
|
NCCMetricMetaInformation
|
||||||
|
::PrintSelf(std::ostream& os, itk::Indent indent) const
|
||||||
|
{
|
||||||
|
Superclass::PrintSelf(os, indent);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
NCCMetricMetaInformation
|
||||||
|
::~NCCMetricMetaInformation ()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
228
reg23Topograms/itkDTRrecon/itkReg23MetaInformation.h
Normal file
228
reg23Topograms/itkDTRrecon/itkReg23MetaInformation.h
Normal file
@ -0,0 +1,228 @@
|
|||||||
|
#ifndef ITKREG23METAINFORMATION_H
|
||||||
|
#define ITKREG23METAINFORMATION_H
|
||||||
|
|
||||||
|
#include "itkObject.h"
|
||||||
|
#include "itkObjectFactory.h"
|
||||||
|
#include "itkSmartPointer.h"
|
||||||
|
#include "itkMacro.h"
|
||||||
|
|
||||||
|
|
||||||
|
namespace itk {
|
||||||
|
|
||||||
|
|
||||||
|
class PowellOptimizerMetaInformation :
|
||||||
|
public itk::Object{
|
||||||
|
|
||||||
|
public:
|
||||||
|
/** standard typedefs **/
|
||||||
|
typedef PowellOptimizerMetaInformation Self;
|
||||||
|
typedef itk::Object Superclass;
|
||||||
|
typedef itk::SmartPointer<Self> Pointer;
|
||||||
|
|
||||||
|
/** Method for creation through the object factory. */
|
||||||
|
itkNewMacro(Self);
|
||||||
|
|
||||||
|
/** Run-time type information (and related methods). */
|
||||||
|
itkTypeMacro(PowellOptimizerMetaInformation, itk::Object);
|
||||||
|
|
||||||
|
/** object information streaming **/
|
||||||
|
void PrintSelf(std::ostream& os, itk::Indent indent) const;
|
||||||
|
|
||||||
|
|
||||||
|
itkSetMacro(StepTolerance,double);
|
||||||
|
itkGetMacro(StepTolerance,double);
|
||||||
|
|
||||||
|
itkSetMacro(ValueTolerance,double);
|
||||||
|
itkGetMacro(ValueTolerance,double);
|
||||||
|
|
||||||
|
itkSetMacro(StepLength,double);
|
||||||
|
itkGetMacro(StepLength,double);
|
||||||
|
|
||||||
|
itkSetMacro(MaximumLineInteration,int);
|
||||||
|
itkGetMacro(MaximumLineInteration,int);
|
||||||
|
|
||||||
|
itkSetEnumMacro(MaxIterations, int);
|
||||||
|
itkGetEnumMacro(MaxIterations, int);
|
||||||
|
|
||||||
|
|
||||||
|
protected:
|
||||||
|
|
||||||
|
double m_StepTolerance;
|
||||||
|
|
||||||
|
double m_ValueTolerance;
|
||||||
|
|
||||||
|
double m_StepLength;
|
||||||
|
|
||||||
|
int m_MaximumLineInteration;
|
||||||
|
|
||||||
|
int
|
||||||
|
m_MaxIterations;
|
||||||
|
|
||||||
|
/** Default Constructor **/
|
||||||
|
PowellOptimizerMetaInformation ();
|
||||||
|
/** Default Destructor **/
|
||||||
|
virtual ~PowellOptimizerMetaInformation ();
|
||||||
|
|
||||||
|
private:
|
||||||
|
/** purposely not implemented **/
|
||||||
|
PowellOptimizerMetaInformation (const Self&);
|
||||||
|
|
||||||
|
/** purposely not implemented **/
|
||||||
|
void operator=(const Self&);
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
class AmoebaOptimizerMetaInformation :
|
||||||
|
public itk::Object{
|
||||||
|
|
||||||
|
public:
|
||||||
|
/** standard typedefs **/
|
||||||
|
typedef AmoebaOptimizerMetaInformation Self;
|
||||||
|
typedef itk::Object Superclass;
|
||||||
|
typedef itk::SmartPointer<Self> Pointer;
|
||||||
|
|
||||||
|
/** Method for creation through the object factory. */
|
||||||
|
itkNewMacro(Self);
|
||||||
|
|
||||||
|
/** Run-time type information (and related methods). */
|
||||||
|
itkTypeMacro(AmoebaOptimizerMetaInformation, itk::Object);
|
||||||
|
|
||||||
|
/** object information streaming **/
|
||||||
|
void PrintSelf(std::ostream& os, itk::Indent indent) const;
|
||||||
|
|
||||||
|
|
||||||
|
itkSetMacro(ParametersConvergenceTolerance,double);
|
||||||
|
itkGetMacro(ParametersConvergenceTolerance,double);
|
||||||
|
|
||||||
|
itkSetMacro(FunctionConvergenceTolerance,double);
|
||||||
|
itkGetMacro(FunctionConvergenceTolerance,double);
|
||||||
|
|
||||||
|
itkSetMacro(SimplexDelta,double);
|
||||||
|
itkGetMacro(SimplexDelta,double);
|
||||||
|
|
||||||
|
itkSetEnumMacro(MaxIterations, int);
|
||||||
|
itkGetEnumMacro(MaxIterations, int);
|
||||||
|
|
||||||
|
protected:
|
||||||
|
|
||||||
|
double m_ParametersConvergenceTolerance;
|
||||||
|
|
||||||
|
double m_FunctionConvergenceTolerance;
|
||||||
|
|
||||||
|
double m_SimplexDelta;
|
||||||
|
|
||||||
|
int
|
||||||
|
m_MaxIterations;
|
||||||
|
|
||||||
|
/** Default Constructor **/
|
||||||
|
AmoebaOptimizerMetaInformation ();
|
||||||
|
/** Default Destructor **/
|
||||||
|
virtual ~AmoebaOptimizerMetaInformation ();
|
||||||
|
|
||||||
|
private:
|
||||||
|
/** purposely not implemented **/
|
||||||
|
AmoebaOptimizerMetaInformation (const Self&);
|
||||||
|
|
||||||
|
/** purposely not implemented **/
|
||||||
|
void operator=(const Self&);
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
class MIMetricMetaInformation :
|
||||||
|
public itk::Object{
|
||||||
|
|
||||||
|
public:
|
||||||
|
/** standard typedefs **/
|
||||||
|
typedef MIMetricMetaInformation Self;
|
||||||
|
typedef itk::Object Superclass;
|
||||||
|
typedef itk::SmartPointer<Self> Pointer;
|
||||||
|
|
||||||
|
/** Method for creation through the object factory. */
|
||||||
|
itkNewMacro(Self);
|
||||||
|
|
||||||
|
/** Run-time type information (and related methods). */
|
||||||
|
itkTypeMacro(MIMetricMetaInformation, itk::Object);
|
||||||
|
|
||||||
|
/** object information streaming **/
|
||||||
|
void PrintSelf(std::ostream& os, itk::Indent indent) const;
|
||||||
|
|
||||||
|
|
||||||
|
itkSetMacro(MaxTranslation,double);
|
||||||
|
itkGetMacro(MaxTranslation,double);
|
||||||
|
|
||||||
|
|
||||||
|
protected:
|
||||||
|
|
||||||
|
double m_MaxTranslation;
|
||||||
|
|
||||||
|
|
||||||
|
/** Default Constructor **/
|
||||||
|
MIMetricMetaInformation ();
|
||||||
|
/** Default Destructor **/
|
||||||
|
virtual ~MIMetricMetaInformation ();
|
||||||
|
|
||||||
|
private:
|
||||||
|
/** purposely not implemented **/
|
||||||
|
MIMetricMetaInformation (const Self&);
|
||||||
|
|
||||||
|
/** purposely not implemented **/
|
||||||
|
void operator=(const Self&);
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
class NCCMetricMetaInformation :
|
||||||
|
public itk::Object{
|
||||||
|
|
||||||
|
public:
|
||||||
|
/** standard typedefs **/
|
||||||
|
typedef NCCMetricMetaInformation Self;
|
||||||
|
typedef itk::Object Superclass;
|
||||||
|
typedef itk::SmartPointer<Self> Pointer;
|
||||||
|
|
||||||
|
/** Method for creation through the object factory. */
|
||||||
|
itkNewMacro(Self);
|
||||||
|
|
||||||
|
/** Run-time type information (and related methods). */
|
||||||
|
itkTypeMacro(NCCMetricMetaInformation, itk::Object);
|
||||||
|
|
||||||
|
/** object information streaming **/
|
||||||
|
void PrintSelf(std::ostream& os, itk::Indent indent) const;
|
||||||
|
|
||||||
|
|
||||||
|
itkSetMacro(MaxTranslation,double);
|
||||||
|
itkGetMacro(MaxTranslation,double);
|
||||||
|
|
||||||
|
itkSetMacro(SubtractMean,bool);
|
||||||
|
itkGetMacro(SubtractMean,bool);
|
||||||
|
|
||||||
|
protected:
|
||||||
|
|
||||||
|
double m_MaxTranslation;
|
||||||
|
|
||||||
|
bool m_SubtractMean;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/** Default Constructor **/
|
||||||
|
NCCMetricMetaInformation ();
|
||||||
|
/** Default Destructor **/
|
||||||
|
virtual ~NCCMetricMetaInformation ();
|
||||||
|
|
||||||
|
private:
|
||||||
|
/** purposely not implemented **/
|
||||||
|
NCCMetricMetaInformation (const Self&);
|
||||||
|
|
||||||
|
/** purposely not implemented **/
|
||||||
|
void operator=(const Self&);
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#endif
|
Reference in New Issue
Block a user