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

ENH: changed ImageRegistrationMethodv4Component's

itkGaussianExponentialDiffeomorhicTransformParametersAdaptorInterface into
a generic itkTransformParametersAdaptorInterface
parent 3e8ab0f8
......@@ -41,7 +41,7 @@ class ItkGaussianExponentialDiffeomorphicTransformParametersAdaptorComponent :
public SuperElastixComponent<
Accepting< itkImageDomainFixedInterface< Dimensionality >
>,
Providing< itkGaussianExponentialDiffeomorphicTransformParametersAdaptorInterface< TransformInternalComputationValueType, Dimensionality>
Providing< itkTransformParametersAdaptorInterface< TransformInternalComputationValueType, Dimensionality>
>
>
{
......@@ -56,14 +56,14 @@ public:
// Get the type definitions from the interfaces
typedef typename itkImageDomainFixedInterface< Dimensionality >::ItkImageDomainType FixedImageDomainType;
//typedef itk::GaussianExponentialDiffeomorphicTransform< TransformInternalComputationValueType, Dimensionality> TransformType;
using itkTransformParametersAdaptorInterfaceType = itkTransformParametersAdaptorInterface< TransformInternalComputationValueType, Dimensionality >;
using TransformParametersAdaptorsContainerType = typename itkTransformParametersAdaptorInterfaceType::TransformParametersAdaptorsContainerType;
// BaseTransformType acts as a container of the types: TParametersValueType, NInputDimensions, NOutputDimensions
typedef itk::Transform< TransformInternalComputationValueType, Dimensionality, Dimensionality > BaseTransformType;
using itkGaussianExponentialDiffeomorphicTransformParametersAdaptorInterfaceType = itkGaussianExponentialDiffeomorphicTransformParametersAdaptorInterface< TransformInternalComputationValueType, Dimensionality >;
using TransformParametersAdaptorType = typename itkGaussianExponentialDiffeomorphicTransformParametersAdaptorInterfaceType::TransformParametersAdaptorType;;
using TransformParametersAdaptorsContainerType = typename itkGaussianExponentialDiffeomorphicTransformParametersAdaptorInterfaceType::TransformParametersAdaptorsContainerType;
// Since the itkTransformParametersAdaptorInterface is only defined by BaseType Adaptors and Transforms, we cannot use the ItkTransformParametersAdaptorInterfaceType::TransformParametersAdaptorBaseType;
// Specific to this componenent is the full definition of TransformParametersAdaptorType being GaussianExponentialDiffeomorphic
using TransformParametersAdaptorType = itk::GaussianExponentialDiffeomorphicTransformParametersAdaptor< itk::GaussianExponentialDiffeomorphicTransform<TransformInternalComputationValueType, Dimensionality> >;
typedef itk::Array<itk::SizeValueType> ShrinkFactorsArrayType;
typedef itk::Array<TransformInternalComputationValueType> SmoothingSigmasArrayType;
......@@ -72,7 +72,7 @@ public:
virtual int Set( itkImageDomainFixedInterface< Dimensionality > * ) override;
//Providing Interfaces:
virtual typename TransformParametersAdaptorsContainerType GetItkGaussianExponentialDiffeomorphicTransformParametersAdaptorsContainer() override;
virtual typename TransformParametersAdaptorsContainerType GetItkTransformParametersAdaptorsContainer() override;
//BaseClass methods
virtual bool MeetsCriterion( const ComponentBase::CriterionType & criterion ) override;
......
......@@ -76,7 +76,7 @@ ItkGaussianExponentialDiffeomorphicTransformParametersAdaptorComponent< Dimensio
template< int Dimensionality, class TransformInternalComputationValueType >
typename ItkGaussianExponentialDiffeomorphicTransformParametersAdaptorComponent<Dimensionality, TransformInternalComputationValueType >::TransformParametersAdaptorsContainerType
ItkGaussianExponentialDiffeomorphicTransformParametersAdaptorComponent< Dimensionality, TransformInternalComputationValueType >
::GetItkGaussianExponentialDiffeomorphicTransformParametersAdaptorsContainer()
::GetItkTransformParametersAdaptorsContainer()
{
return this->m_adaptors;
}
......
......@@ -30,8 +30,6 @@
#include "selxMacro.h"
#include "itkComposeDisplacementFieldsImageFilter.h"
#include "itkGaussianExponentialDiffeomorphicTransform.h"
#include "itkGaussianExponentialDiffeomorphicTransformParametersAdaptor.h"
namespace selx
{
......@@ -41,7 +39,7 @@ class ItkImageRegistrationMethodv4Component :
Accepting< itkImageFixedInterface< Dimensionality, TPixel >,
itkImageMovingInterface< Dimensionality, TPixel >,
itkTransformInterface< double, Dimensionality >,
itkGaussianExponentialDiffeomorphicTransformParametersAdaptorInterface< double, Dimensionality>,
itkTransformParametersAdaptorInterface< double, Dimensionality>,
itkMetricv4Interface< Dimensionality, TPixel >,
itkOptimizerv4Interface< double >
>,
......@@ -71,7 +69,7 @@ public:
typedef typename itkTransformInterface< TransformInternalComputationValueType, Dimensionality >::TransformType TransformType;
typedef typename itkTransformInterface< TransformInternalComputationValueType, Dimensionality >::TransformPointer TransformPointer;
using TransformParametersAdaptorInterfaceType = itkGaussianExponentialDiffeomorphicTransformParametersAdaptorInterface< TransformInternalComputationValueType, Dimensionality>;
using TransformParametersAdaptorInterfaceType = itkTransformParametersAdaptorInterface< TransformInternalComputationValueType, Dimensionality>;
typedef itk::ImageRegistrationMethodv4< FixedImageType, MovingImageType > TheItkFilterType;
typedef typename TheItkFilterType::ImageMetricType ImageMetricType;
......@@ -84,7 +82,7 @@ public:
virtual int Set( itkTransformInterface< TransformInternalComputationValueType, Dimensionality > * ) override;
virtual int Set(TransformParametersAdaptorInterfaceType *) override;
virtual int Set( TransformParametersAdaptorInterfaceType *) override;
virtual int Set( itkMetricv4Interface< Dimensionality, TPixel > * ) override;
......
......@@ -168,8 +168,7 @@ ItkImageRegistrationMethodv4Component< Dimensionality, TPixel >::Set( itkTransfo
template< int Dimensionality, class TPixel >
int
ItkImageRegistrationMethodv4Component< Dimensionality, TPixel >::Set(itkGaussianExponentialDiffeomorphicTransformParametersAdaptorInterface< TransformInternalComputationValueType,
Dimensionality > * component)
ItkImageRegistrationMethodv4Component< Dimensionality, TPixel >::Set( TransformParametersAdaptorInterfaceType * component)
{
// store the interface to the ParametersAdaptorsContainer since during the setup of the connections the TransformParametersAdaptorComponent might not be fully connected and thus does not have the adaptors ready.
this->m_TransformAdaptorInterface = component;
......@@ -238,7 +237,7 @@ ItkImageRegistrationMethodv4Component< Dimensionality, TPixel >::RunRegistration
this->m_theItkFilter->SetOptimizer( optimizer );
this->m_theItkFilter->SetTransformParametersAdaptorsPerLevel(this->m_TransformAdaptorInterface->GetItkGaussianExponentialDiffeomorphicTransformParametersAdaptorsContainer());
this->m_theItkFilter->SetTransformParametersAdaptorsPerLevel(this->m_TransformAdaptorInterface->GetItkTransformParametersAdaptorsContainer());
typedef CommandIterationUpdate< TheItkFilterType > RegistrationCommandType;
......
......@@ -239,6 +239,16 @@ struct InterfaceName< ReconnectTransformInterface >
}
};
template< class InternalComputationValueType, int D >
struct InterfaceName< itkTransformParametersAdaptorInterface< InternalComputationValueType, D > >
{
static const char * Get()
{
return "itkTransformParametersAdaptorInterface";
}
};
template< class InternalComputationValueType, int D >
struct InterfaceName< itkGaussianExponentialDiffeomorphicTransformParametersAdaptorInterface< InternalComputationValueType, D > >
{
......
......@@ -259,16 +259,16 @@ public:
virtual TransformPointer GetItkTransform() = 0;
};
template< class TitkTransformType >
template<class TransformInternalComputationValueType, int Dimensionality >
class itkTransformParametersAdaptorInterface
{
public:
// TransformBaseType acts as a container of the types: TParametersValueType, NInputDimensions, NOutputDimensions
using TransformBaseType = itk::Transform< TransformInternalComputationValueType, Dimensionality, Dimensionality >;
using TransformParametersAdaptorBaseType = itk::TransformParametersAdaptorBase<TransformBaseType>;
using TransformParametersAdaptorsContainerType = std::vector<typename TransformParametersAdaptorBaseType::Pointer>;
typedef TitkTransformType TransformType;
typedef typename itk::TransformParametersAdaptorBase< TransformType > TransformParametersAdaptorType;
typedef typename TransformParametersAdaptorType::Pointer TransformParametersAdaptorPointer;
virtual TransformParametersAdaptorPointer GetItkTransformParametersAdaptor() = 0;
virtual TransformParametersAdaptorsContainerType GetItkTransformParametersAdaptorsContainer() = 0;
};
template< class TransformInternalComputationValueType, int Dimensionality >
......
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