Commit e7996c68 authored by Floris Berendsen's avatar Floris Berendsen
Browse files

WIP: Corrected template areguments of

GaussianExponentialDiffeomorphicTransformParametersAdaptor, added
interface to ImageRegistrationMethod
parent 4f44b716
......@@ -66,7 +66,7 @@ ItkGaussianExponentialDiffeomorphicTransformParametersAdaptorComponent< Dimensio
transformAdaptor->SetRequiredDirection(shrinkFilter->GetOutput()->GetDirection());
transformAdaptor->SetRequiredOrigin(shrinkFilter->GetOutput()->GetOrigin());
m_adaptors.push_back(transformAdaptor.GetPointer());
m_adaptors.push_back(transformAdaptor.GetPointer()); // Implicit cast back to TransformParametersAdaptorBase<itk::Transform<...>>
}
return 0;
......@@ -121,7 +121,8 @@ ItkGaussianExponentialDiffeomorphicTransformParametersAdaptorComponent< Dimensio
unsigned int resolutionIndex = 0;
for (auto const & criterionValue : criterion.second) // auto&& preferred?
{
m_shrinkFactorsPerLevel[resolutionIndex] = std::stoi(criterionValue);
m_shrinkFactorsPerLevel[resolutionIndex] = std::stoi(criterionValue);
++resolutionIndex;
}
}
......
......@@ -41,6 +41,7 @@ class ItkImageRegistrationMethodv4Component :
Accepting< itkImageFixedInterface< Dimensionality, TPixel >,
itkImageMovingInterface< Dimensionality, TPixel >,
itkTransformInterface< double, Dimensionality >,
itkGaussianExponentialDiffeomorphicTransformParametersAdaptorInterface< double, Dimensionality>,
itkMetricv4Interface< Dimensionality, TPixel >,
itkOptimizerv4Interface< double >
>,
......@@ -80,6 +81,8 @@ public:
virtual int Set( itkTransformInterface< TransformInternalComputationValueType, Dimensionality > * ) override;
virtual int Set( itkGaussianExponentialDiffeomorphicTransformParametersAdaptorInterface< TransformInternalComputationValueType, Dimensionality> *) override;
virtual int Set( itkMetricv4Interface< Dimensionality, TPixel > * ) override;
virtual int Set( itkOptimizerv4Interface< OptimizerInternalComputationValueType > * ) override;
......
......@@ -166,6 +166,18 @@ ItkImageRegistrationMethodv4Component< Dimensionality, TPixel >::Set( itkTransfo
return 0;
}
template< int Dimensionality, class TPixel >
int
ItkImageRegistrationMethodv4Component< Dimensionality, TPixel >::Set(itkGaussianExponentialDiffeomorphicTransformParametersAdaptorInterface< TransformInternalComputationValueType,
Dimensionality > * component)
{
auto adaptors = component->GetItkGaussianExponentialDiffeomorphicTransformParametersAdaptorsContainer();
//TODO check number of resolutions?
this->m_theItkFilter->SetTransformParametersAdaptorsPerLevel(adaptors);
return 0;
}
template< int Dimensionality, class TPixel >
int
......
......@@ -276,12 +276,17 @@ class itkGaussianExponentialDiffeomorphicTransformParametersAdaptorInterface
{
public:
// Cannot use BaseTransformType
//typedef itk::Transform< TransformInternalComputationValueType, Dimensionality, Dimensionality > BaseTransformType;
using TransformBaseType = itk::Transform< TransformInternalComputationValueType, Dimensionality, Dimensionality >;
using TransformParametersAdaptorBaseType = itk::TransformParametersAdaptorBase<TransformBaseType>;
using GaussianExponentialDiffeomorphicTransformType = itk::GaussianExponentialDiffeomorphicTransform< TransformInternalComputationValueType, Dimensionality >;
using TransformParametersAdaptorType = itk::GaussianExponentialDiffeomorphicTransformParametersAdaptor< GaussianExponentialDiffeomorphicTransformType >;
using TransformParametersAdaptorPointer = typename TransformParametersAdaptorType::Pointer;
using TransformParametersAdaptorsContainerType = std::vector<TransformParametersAdaptorPointer>;
//using TransformParametersAdaptorsContainerType = std::vector<TransformParametersAdaptorPointer>;
using TransformParametersAdaptorsContainerType = std::vector<typename TransformParametersAdaptorBaseType::Pointer>;
//using TransformParametersAdaptorsContainerType = typename TransformParametersAdaptorType::TransformParametersAdaptorsContainerType;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment