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

ENH: got rid of ControllerComponent #136

parent 22367ec5
......@@ -42,7 +42,7 @@ class ElastixComponent :
>,
Providing<
itkImageInterface< Dimensionality, TPixel >,
RunRegistrationInterface
UpdateInterface
>
>
{
......@@ -59,7 +59,7 @@ public:
>,
Providing<
itkImageInterface< Dimensionality, TPixel >,
RunRegistrationInterface
UpdateInterface
>
> Superclass;
typedef std::shared_ptr< Self > Pointer;
......@@ -92,7 +92,7 @@ public:
virtual ItkImagePointer GetItkImage() override;
virtual void RunRegistration() override;
virtual void Update() override;
virtual bool MeetsCriterion( const CriterionType & criterion ) override;
......
......@@ -101,7 +101,7 @@ ElastixComponent< Dimensionality, TPixel >::GetItkImage()
template< int Dimensionality, class TPixel >
void
ElastixComponent< Dimensionality, TPixel >::RunRegistration( void )
ElastixComponent< Dimensionality, TPixel >::Update( void )
{
// TODO currently, the pipeline with elastix and tranformix can only be created after the update of elastix
this->m_elastixFilter->Update();
......
......@@ -27,8 +27,6 @@
#include "selxItkImageSourceComponent.h"
#include "selxDisplacementFieldItkImageFilterSinkComponent.h"
#include "selxRegistrationControllerComponent.h"
#include "itkImageFileReader.h"
#include "itkImageFileWriter.h"
......@@ -54,8 +52,7 @@ public:
ItkImageSinkComponent< 2, float >,
DisplacementFieldItkImageFilterSinkComponent< 2, float >,
ItkImageSourceComponent< 2, float >,
ItkImageSourceComponent< 3, double >,
RegistrationControllerComponent< >> RegisterComponents;
ItkImageSourceComponent< 3, double >> RegisterComponents;
typedef itk::Image< float, 2 > Image2DType;
typedef itk::ImageFileReader< Image2DType > ImageReader2DType;
......@@ -119,8 +116,6 @@ TEST_F( ElastixComponentTest, ImagesOnly )
component3Parameters[ "Dimensionality" ] = { "2" }; // should be derived from the inputs
blueprint->SetComponent( "ResultImageSink", component3Parameters );
blueprint->SetComponent( "Controller", { { "NameOfClass", { "RegistrationControllerComponent" } } } );
ParameterMapType connection1Parameters;
//connection1Parameters["NameOfInterface"] = { "itkImageFixedInterface" };
blueprint->SetConnection( "FixedImageSource", "RegistrationMethod", connection1Parameters );
......@@ -133,9 +128,6 @@ TEST_F( ElastixComponentTest, ImagesOnly )
//connection3Parameters["NameOfInterface"] = { "GetItkImageInterface" };
blueprint->SetConnection( "RegistrationMethod", "ResultImageSink", connection3Parameters );
blueprint->SetConnection( "RegistrationMethod", "Controller", { {} } ); //
blueprint->SetConnection( "ResultImageSink", "Controller", { {} } ); //
// Set up the readers and writers
ImageReader2DType::Pointer fixedImageReader = ImageReader2DType::New();
fixedImageReader->SetFileName( dataManager->GetInputFile( "BrainProtonDensitySliceBorder20.png" ) );
......
......@@ -34,7 +34,7 @@ template< class TPixel >
class NiftyregAladinComponent :
public SuperElastixComponent<
Accepting< NiftyregReferenceImageInterface< TPixel >, NiftyregFloatingImageInterface< TPixel >>,
Providing< NiftyregWarpedImageInterface< TPixel >, NiftyregAffineMatrixInterface< TPixel >, RunRegistrationInterface >
Providing< NiftyregWarpedImageInterface< TPixel >, NiftyregAffineMatrixInterface< TPixel >, UpdateInterface >
>
{
public:
......@@ -43,7 +43,7 @@ public:
typedef NiftyregAladinComponent< TPixel > Self;
typedef SuperElastixComponent<
Accepting< NiftyregReferenceImageInterface< TPixel >, NiftyregFloatingImageInterface< TPixel >>,
Providing< NiftyregWarpedImageInterface< TPixel >, NiftyregAffineMatrixInterface< TPixel >, RunRegistrationInterface >
Providing< NiftyregWarpedImageInterface< TPixel >, NiftyregAffineMatrixInterface< TPixel >, UpdateInterface >
> Superclass;
typedef std::shared_ptr< Self > Pointer;
typedef std::shared_ptr< const Self > ConstPointer;
......@@ -59,7 +59,7 @@ public:
virtual mat44 * GetAffineNiftiMatrix() override;
virtual void RunRegistration() override;
virtual void Update() override;
virtual bool MeetsCriterion( const ComponentBase::CriterionType & criterion ) override;
......
......@@ -81,7 +81,7 @@ NiftyregAladinComponent< TPixel >
template< class TPixel >
void
NiftyregAladinComponent< TPixel >
::RunRegistration()
::Update()
{
this->m_Logger.Log(LogLevel::TRC, "RunRegistration");
this->m_reg_aladin->Run();
......
......@@ -33,7 +33,7 @@ template< class TPixel >
class NiftyregSplineToDisplacementFieldComponent :
public SuperElastixComponent<
Accepting< NiftyregControlPointPositionImageInterface< TPixel >, NiftyregReferenceImageInterface< TPixel > >,
Providing< NiftyregDisplacementFieldImageInterface< TPixel >, ReconnectTransformInterface >
Providing< NiftyregDisplacementFieldImageInterface< TPixel >, UpdateInterface >
>
{
public:
......@@ -42,7 +42,7 @@ public:
typedef NiftyregSplineToDisplacementFieldComponent< TPixel > Self;
typedef SuperElastixComponent<
Accepting< NiftyregControlPointPositionImageInterface< TPixel >, NiftyregReferenceImageInterface< TPixel >>,
Providing< NiftyregDisplacementFieldImageInterface< TPixel >, ReconnectTransformInterface >
Providing< NiftyregDisplacementFieldImageInterface< TPixel >, UpdateInterface >
> Superclass;
typedef std::shared_ptr< Self > Pointer;
typedef std::shared_ptr< const Self > ConstPointer;
......@@ -59,8 +59,8 @@ public:
// Providing NiftyregWarpedImageInterface
virtual std::shared_ptr< nifti_image > GetDisplacementFieldNiftiImage() override;
// Providing ReconnectTransformInterface
virtual void ReconnectTransform() override;
// Providing UpdateInterface
virtual void Update() override;
virtual bool MeetsCriterion( const ComponentBase::CriterionType & criterion ) override;
......
......@@ -57,7 +57,7 @@ NiftyregSplineToDisplacementFieldComponent< TPixel >
template< class TPixel >
void
NiftyregSplineToDisplacementFieldComponent< TPixel >
::ReconnectTransform()
::Update()
{
nifti_image * inputTransformationImage = this->m_NiftyregControlPointPositionImageInterface->GetControlPointPositionImage().get();
......
......@@ -34,7 +34,7 @@ template< class TPixel >
class Niftyregf3dComponent :
public SuperElastixComponent<
Accepting< NiftyregReferenceImageInterface< TPixel >, NiftyregFloatingImageInterface< TPixel >, NiftyregAffineMatrixInterface< TPixel >>,
Providing< NiftyregWarpedImageInterface< TPixel >, NiftyregControlPointPositionImageInterface< TPixel >, RunRegistrationInterface >
Providing< NiftyregWarpedImageInterface< TPixel >, NiftyregControlPointPositionImageInterface< TPixel >, UpdateInterface >
>
{
public:
......@@ -43,7 +43,7 @@ public:
typedef Niftyregf3dComponent< TPixel > Self;
typedef SuperElastixComponent<
Accepting< NiftyregReferenceImageInterface< TPixel >, NiftyregFloatingImageInterface< TPixel >, NiftyregAffineMatrixInterface< TPixel >>,
Providing< NiftyregWarpedImageInterface< TPixel >, NiftyregControlPointPositionImageInterface< TPixel >, RunRegistrationInterface >
Providing< NiftyregWarpedImageInterface< TPixel >, NiftyregControlPointPositionImageInterface< TPixel >, UpdateInterface >
> Superclass;
typedef std::shared_ptr< Self > Pointer;
typedef std::shared_ptr< const Self > ConstPointer;
......@@ -66,8 +66,8 @@ public:
// Providing NiftyregControlPointPositionImageInterface
virtual std::shared_ptr< nifti_image > GetControlPointPositionImage() override;
// Providing RunRegistrationInterface
virtual void RunRegistration() override;
// Providing UpdateInterface
virtual void Update() override;
virtual bool MeetsCriterion( const ComponentBase::CriterionType & criterion ) override;
......
......@@ -87,7 +87,7 @@ Niftyregf3dComponent< TPixel >
template< class TPixel >
void
Niftyregf3dComponent< TPixel >
::RunRegistration()
::Update()
{
this->m_Logger.Log(LogLevel::TRC, "RunRegistration");
//this->m_reg_f3d->UseSSD( 0, true );
......
......@@ -19,8 +19,6 @@
#include "selxSuperElastixFilterCustomComponents.h"
#include "selxRegistrationControllerComponent.h"
#include "selxNiftyregReadImageComponent.h"
#include "selxNiftyregWriteImageComponent.h"
#include "selxNiftyregWriteImageComponent.h"
......@@ -59,8 +57,7 @@ public:
ItkImageSourceComponent< 3, float >,
NiftyregSplineToDisplacementFieldComponent< float>,
DisplacementFieldNiftiToItkImageSinkComponent< 2, float>,
NiftyregAladinComponent< float >,
RegistrationControllerComponent< >> RegisterComponents;
NiftyregAladinComponent< float >> RegisterComponents;
typedef SuperElastixFilterCustomComponents< RegisterComponents > SuperElastixFilterType;
......@@ -99,13 +96,10 @@ TEST_F( NiftyregComponentTest, Register2d_nifti )
blueprint->SetComponent( "MovingImage", { { "NameOfClass", { "NiftyregReadImageComponent" } }, { "FileName", { this->dataManager->GetInputFile( "r64slice.nii.gz" ) } } } );
blueprint->SetComponent( "RegistrationMethod", { { "NameOfClass", { "Niftyregf3dComponent" } } } );
blueprint->SetComponent( "ResultImage", { { "NameOfClass", { "NiftyregWriteImageComponent" } }, { "FileName", { this->dataManager->GetOutputFile( "Nifty_warped_r64to16.nii.gz" ) } } } );
blueprint->SetComponent( "Controller", { { "NameOfClass", { "RegistrationControllerComponent" } } } );
blueprint->SetConnection( "FixedImage", "RegistrationMethod", { { "NameOfInterface", { "NiftyregReferenceImageInterface" } } } );
blueprint->SetConnection( "MovingImage", "RegistrationMethod", { { "NameOfInterface", { "NiftyregFloatingImageInterface" } } } );
blueprint->SetConnection( "RegistrationMethod", "ResultImage", { {} } ); //{ { "NameOfInterface", { "NiftyregWarpedImageInterface" } } });
blueprint->SetConnection( "RegistrationMethod", "Controller", { {} } );
blueprint->SetConnection( "ResultImage", "Controller", { {} } );
EXPECT_NO_THROW( superElastixFilter->SetBlueprint( blueprint ) );
EXPECT_NO_THROW(superElastixFilter->SetLogger(logger));
......@@ -117,10 +111,8 @@ TEST_F( NiftyregComponentTest, ItkToNiftiImage )
BlueprintPointer blueprint = Blueprint::New();
blueprint->SetComponent( "FixedImage", { { "NameOfClass", { "ItkToNiftiImageSourceComponent" } }, { "Dimensionality", { "3" } }, { "PixelType", { "float" } } } );
blueprint->SetComponent( "ResultImage", { { "NameOfClass", { "NiftyregWriteImageComponent" } }, { "FileName", { this->dataManager->GetOutputFile( "ItkToNiftiImage_converted.nii.gz" ) } } } );
blueprint->SetComponent( "Controller", { { "NameOfClass", { "RegistrationControllerComponent" } } } );
blueprint->SetConnection( "FixedImage", "ResultImage", { { "NameOfInterface", { "NiftyregWarpedImageInterface" } } } );
blueprint->SetConnection( "ResultImage", "Controller", { { "NameOfInterface", { "AfterRegistrationInterface" } } } );
EXPECT_NO_THROW(superElastixFilter->SetBlueprint(blueprint));
EXPECT_NO_THROW(superElastixFilter->SetLogger(logger));
......@@ -145,11 +137,9 @@ TEST_F( NiftyregComponentTest, NiftiToItkImage )
blueprint->SetComponent( "FixedImage", { { "NameOfClass", { "NiftyregReadImageComponent" } }, { "FileName", { this->dataManager->GetOutputFile( "ItkToNiftiImage_converted.nii.gz" ) } } } );
blueprint->SetComponent( "ResultDomainImage", { { "NameOfClass", { "ItkImageSourceComponent" } } } );
blueprint->SetComponent( "ResultImage", { { "NameOfClass", { "NiftiToItkImageSinkComponent" } }, { "Dimensionality", { "3" } }, { "PixelType", { "float" } } } );
blueprint->SetComponent( "Controller", { { "NameOfClass", { "RegistrationControllerComponent" } } } );
blueprint->SetConnection( "FixedImage", "ResultImage", { { "NameOfInterface", { "NiftyregWarpedImageInterface" } } } );
blueprint->SetConnection( "ResultDomainImage", "ResultImage", { { "NameOfInterface", { "itkImageDomainFixedInterface" } } } );
blueprint->SetConnection( "ResultImage", "Controller", { { "NameOfInterface", { "AfterRegistrationInterface" } } } );
EXPECT_NO_THROW(superElastixFilter->SetBlueprint(blueprint));
EXPECT_NO_THROW(superElastixFilter->SetLogger(logger));
......@@ -185,14 +175,11 @@ TEST_F( NiftyregComponentTest, Register2d_itkImages )
blueprint->SetComponent( "FixedImage", { { "NameOfClass", { "ItkToNiftiImageSourceComponent" } }, { "Dimensionality", { "2" } }, { "PixelType", { "float" } } } );
blueprint->SetComponent( "MovingImage", { { "NameOfClass", { "ItkToNiftiImageSourceComponent" } }, { "Dimensionality", { "2" } }, { "PixelType", { "float" } } } );
blueprint->SetComponent( "ResultImage", { { "NameOfClass", { "NiftiToItkImageSinkComponent" } }, { "Dimensionality", { "2" } }, { "PixelType", { "float" } } } );
blueprint->SetComponent( "Controller", { { "NameOfClass", { "RegistrationControllerComponent" } } } );
blueprint->SetConnection( "FixedImage", "RegistrationMethod", { { "NameOfInterface", { "NiftyregReferenceImageInterface" } } } );
blueprint->SetConnection( "MovingImage", "RegistrationMethod", { { "NameOfInterface", { "NiftyregFloatingImageInterface" } } } );
blueprint->SetConnection( "FixedImage", "ResultImage", { { "NameOfInterface", { "itkImageDomainFixedInterface" } } } );
blueprint->SetConnection( "RegistrationMethod", "ResultImage", { { "NameOfInterface", { "NiftyregWarpedImageInterface" } } } );
blueprint->SetConnection( "RegistrationMethod", "Controller", { {} } );
blueprint->SetConnection( "ResultImage", "Controller", { {} } );
blueprint->Write( dataManager->GetOutputFile( "Niftyreg_WBIR.dot" ) );
......@@ -240,20 +227,16 @@ TEST_F( NiftyregComponentTest, WBIRDemo )
blueprint->SetComponent( "ResultImage", { { "NameOfClass", { "NiftiToItkImageSinkComponent" } }, { "Dimensionality", { "2" } }, { "PixelType", { "float" } } } );
blueprint->SetComponent( "TransformToDisplacementField", { { "NameOfClass", { "NiftyregSplineToDisplacementFieldComponent" } }, { "PixelType", { "float" } } });
blueprint->SetComponent( "ResultDisplacementField", { { "NameOfClass", { "DisplacementFieldNiftiToItkImageSinkComponent" } }, { "Dimensionality", { "2" } }, { "PixelType", { "float" } } });
blueprint->SetComponent( "Controller", { { "NameOfClass", { "RegistrationControllerComponent" } } } );
blueprint->SetConnection( "FixedImage", "RegistrationMethod", { { "NameOfInterface", { "NiftyregReferenceImageInterface" } } } );
blueprint->SetConnection( "MovingImage", "RegistrationMethod", { { "NameOfInterface", { "NiftyregFloatingImageInterface" } } } );
blueprint->SetConnection( "FixedImage", "ResultImage", { { "NameOfInterface", { "itkImageDomainFixedInterface" } } } );
blueprint->SetConnection( "RegistrationMethod", "ResultImage", { { "NameOfInterface", { "NiftyregWarpedImageInterface" } } } );
blueprint->SetConnection( "RegistrationMethod", "Controller", { {} } );
blueprint->SetConnection( "ResultImage", "Controller", { {} } );
blueprint->SetConnection( "RegistrationMethod", "TransformToDisplacementField", { {} });
blueprint->SetConnection( "FixedImage", "TransformToDisplacementField", { {} });
blueprint->SetConnection( "TransformToDisplacementField", "Controller", { {} });
blueprint->SetConnection( "TransformToDisplacementField", "ResultDisplacementField", { {} });
blueprint->SetConnection( "FixedImage", "ResultDisplacementField", { {} });
blueprint->SetConnection( "ResultDisplacementField", "Controller", { {} });
blueprint->Write( dataManager->GetOutputFile( "Niftyreg_WBIR.dot" ) );
......@@ -300,14 +283,11 @@ TEST_F( NiftyregComponentTest, AladinWBIRDemo )
blueprint->SetComponent( "FixedImage", { { "NameOfClass", { "ItkToNiftiImageSourceComponent" } }, { "Dimensionality", { "2" } }, { "PixelType", { "float" } } } );
blueprint->SetComponent( "MovingImage", { { "NameOfClass", { "ItkToNiftiImageSourceComponent" } }, { "Dimensionality", { "2" } }, { "PixelType", { "float" } } } );
blueprint->SetComponent( "ResultImage", { { "NameOfClass", { "NiftiToItkImageSinkComponent" } }, { "Dimensionality", { "2" } }, { "PixelType", { "float" } } } );
blueprint->SetComponent( "Controller", { { "NameOfClass", { "RegistrationControllerComponent" } } } );
blueprint->SetConnection( "FixedImage", "RegistrationMethod", { { "NameOfInterface", { "NiftyregReferenceImageInterface" } } } );
blueprint->SetConnection( "MovingImage", "RegistrationMethod", { { "NameOfInterface", { "NiftyregFloatingImageInterface" } } } );
blueprint->SetConnection( "FixedImage", "ResultImage", { { "NameOfInterface", { "itkImageDomainFixedInterface" } } } );
blueprint->SetConnection( "RegistrationMethod", "ResultImage", { { "NameOfInterface", { "NiftyregWarpedImageInterface" } } } );
blueprint->SetConnection( "RegistrationMethod", "Controller", { {} } );
blueprint->SetConnection( "ResultImage", "Controller", { {} } );
blueprint->Write( dataManager->GetOutputFile( "NiftyregAladin_WBIR.dot" ) );
......@@ -349,23 +329,18 @@ TEST_F(NiftyregComponentTest, AffineAndBSpline)
blueprint->SetComponent("FixedImage", { { "NameOfClass", { "ItkToNiftiImageSourceComponent" } }, { "Dimensionality", { "2" } }, { "PixelType", { "float" } } });
blueprint->SetComponent("MovingImage", { { "NameOfClass", { "ItkToNiftiImageSourceComponent" } }, { "Dimensionality", { "2" } }, { "PixelType", { "float" } } });
blueprint->SetComponent("ResultImage", { { "NameOfClass", { "NiftiToItkImageSinkComponent" } }, { "Dimensionality", { "2" } }, { "PixelType", { "float" } } });
blueprint->SetComponent("Controller1", { { "NameOfClass", { "RegistrationControllerComponent" } } });
blueprint->SetComponent("RegistrationMethod2", { { "NameOfClass", { "Niftyregf3dComponent" } } });
blueprint->SetComponent("Controller2", { { "NameOfClass", { "RegistrationControllerComponent" } } });
blueprint->SetConnection("FixedImage", "RegistrationMethod1", { { "NameOfInterface", { "NiftyregReferenceImageInterface" } } });
blueprint->SetConnection("MovingImage", "RegistrationMethod1", { { "NameOfInterface", { "NiftyregFloatingImageInterface" } } });
blueprint->SetConnection("FixedImage", "ResultImage", { { "NameOfInterface", { "itkImageDomainFixedInterface" } } });
blueprint->SetConnection("RegistrationMethod1", "Controller1", { {} });
blueprint->SetConnection("FixedImage", "RegistrationMethod2", { { "NameOfInterface", { "NiftyregReferenceImageInterface" } } });
blueprint->SetConnection("MovingImage", "RegistrationMethod2", { { "NameOfInterface", { "NiftyregFloatingImageInterface" } } });
blueprint->SetConnection("RegistrationMethod1", "RegistrationMethod2", { { "NameOfInterface", { "NiftyregAffineMatrixInterface" } } });
blueprint->SetConnection("RegistrationMethod2", "ResultImage", { { "NameOfInterface", { "NiftyregWarpedImageInterface" } } });
blueprint->SetConnection("RegistrationMethod2", "Controller2", { {} });
blueprint->SetConnection("ResultImage", "Controller2", { {} });
blueprint->Write(dataManager->GetOutputFile("NiftyregAffineAndBspline.dot"));
......
......@@ -34,7 +34,7 @@ class ItkCompositeTransformComponent :
public SuperElastixComponent<
Accepting< MultiStageTransformInterface<
InternalComputationValueType, Dimensionality >,
ReconnectTransformInterface
UpdateInterface
>,
Providing<
itkTransformInterface< InternalComputationValueType, Dimensionality
......@@ -51,7 +51,7 @@ public:
typedef SuperElastixComponent<
Accepting< MultiStageTransformInterface<
InternalComputationValueType, Dimensionality >,
ReconnectTransformInterface
UpdateInterface
>,
Providing<
itkTransformInterface< InternalComputationValueType, Dimensionality
......@@ -71,7 +71,7 @@ public:
virtual int Accept( typename MultiStageTransformInterface< InternalComputationValueType, Dimensionality >::Pointer ) override;
virtual int Accept( ReconnectTransformInterface::Pointer ) override;
virtual int Accept( UpdateInterface::Pointer ) override;
virtual void Update() override;
......@@ -89,7 +89,7 @@ private:
typename CompositeTransformType::Pointer m_CompositeTransform;
typename std::vector< typename MultiStageTransformInterface< InternalComputationValueType, Dimensionality >::Pointer > m_registrationStages;
std::set< ReconnectTransformInterface::Pointer > m_ReconnectTransformInterfaces;
std::set< UpdateInterface::Pointer > m_ReconnectTransformInterfaces;
std::vector< std::string > m_ExecutionOrder;
protected:
......
......@@ -53,7 +53,7 @@ ItkCompositeTransformComponent< InternalComputationValueType, Dimensionality >
template< class InternalComputationValueType, int Dimensionality >
int
ItkCompositeTransformComponent< InternalComputationValueType, Dimensionality >
::Accept( ReconnectTransformInterface::Pointer other )
::Accept( UpdateInterface::Pointer other )
{
this->m_ReconnectTransformInterfaces.insert( other );
return 0;
......@@ -111,7 +111,7 @@ ItkCompositeTransformComponent< InternalComputationValueType, Dimensionality >::
return thisStage->GetComponentName() == stageName;
} );
( *stageIterator )->SetMovingInitialTransform( this->m_CompositeTransform );
( *stageIterator )->RunRegistration();
( *stageIterator )->Update();
this->m_CompositeTransform->AppendTransform( ( *stageIterator )->GetItkTransform() );
}
......
......@@ -47,7 +47,7 @@ class ItkImageRegistrationMethodv4Component :
>,
Providing< itkTransformInterface< InternalComputationValueType, Dimensionality >,
MultiStageTransformInterface< InternalComputationValueType, Dimensionality >,
RunRegistrationInterface
UpdateInterface
>
>
{
......@@ -68,7 +68,7 @@ public:
>,
Providing< itkTransformInterface< InternalComputationValueType, Dimensionality >,
MultiStageTransformInterface< InternalComputationValueType, Dimensionality >,
RunRegistrationInterface
UpdateInterface
>
> Superclass;
typedef std::shared_ptr< Self > Pointer;
......@@ -108,7 +108,7 @@ public:
//Providing Interfaces:
virtual TransformPointer GetItkTransform() override;
virtual void RunRegistration() override;
virtual void Update() override;
virtual void SetFixedInitialTransform( typename CompositeTransformType::Pointer fixedInitialTransform ) override;
......
......@@ -206,7 +206,7 @@ ItkImageRegistrationMethodv4Component< Dimensionality, TPixel, InternalComputati
template< int Dimensionality, class TPixel, class InternalComputationValueType >
void
ItkImageRegistrationMethodv4Component< Dimensionality, TPixel, InternalComputationValueType >::RunRegistration( void )
ItkImageRegistrationMethodv4Component< Dimensionality, TPixel, InternalComputationValueType >::Update( void )
{
typename FixedImageType::ConstPointer fixedImage = this->m_theItkFilter->GetFixedImage();
typename MovingImageType::ConstPointer movingImage = this->m_theItkFilter->GetMovingImage();
......@@ -424,8 +424,6 @@ bool
ItkImageRegistrationMethodv4Component< Dimensionality, TPixel, InternalComputationValueType >
::ConnectionsSatisfied()
{
auto providedTo = this->ConnectionInfo<RunRegistrationInterface>::GetProvidedTo();
// This function overrides the default behavior, in which all accepting interfaces must be set, by allowing the itkTransformParametersAdaptorsContainerInterface not being set.
// TODO: see I we can reduce the amount of code with helper (meta-)functions
if( !this->InterfaceAcceptor< itkImageFixedInterface< Dimensionality, TPixel >>::GetAccepted())
......
......@@ -43,7 +43,7 @@ class ItkResampleFilterComponent :
itkImageMovingInterface< Dimensionality, TPixel >
>,
Providing< itkImageInterface< Dimensionality, TPixel >,
ReconnectTransformInterface
UpdateInterface
>
>
{
......@@ -59,7 +59,7 @@ public:
itkImageMovingInterface< Dimensionality, TPixel >
>,
Providing< itkImageInterface< Dimensionality, TPixel >,
ReconnectTransformInterface
UpdateInterface
>
> Superclass;
typedef std::shared_ptr< Self > Pointer;
......@@ -87,7 +87,7 @@ public:
//Providing Interfaces:
virtual typename ResultImageType::Pointer GetItkImage() override;
virtual void ReconnectTransform() override;
virtual void Update() override;
//BaseClass methods
virtual bool MeetsCriterion( const ComponentBase::CriterionType & criterion ) override;
......
......@@ -96,7 +96,7 @@ ItkResampleFilterComponent< Dimensionality, TPixel, TInternalComputationValue >
template< int Dimensionality, class TPixel, class TInternalComputationValue >
void
ItkResampleFilterComponent< Dimensionality, TPixel, TInternalComputationValue >
::ReconnectTransform()
::Update()
{
auto transform = this->m_TransformComponent->GetItkTransform();
// reconnect the tranform, since it does not comply with the itk pipeline
......
......@@ -42,7 +42,7 @@ class ItkTransformDisplacementFilterComponent :
itkImageDomainFixedInterface< Dimensionality >
>,
Providing< DisplacementFieldItkImageSourceInterface< Dimensionality, TPixel >,
ReconnectTransformInterface
UpdateInterface
>
>
{
......@@ -57,7 +57,7 @@ public:
itkImageDomainFixedInterface< Dimensionality >
>,
Providing< DisplacementFieldItkImageSourceInterface< Dimensionality, TPixel >,
ReconnectTransformInterface
UpdateInterface
>
> Superclass;
typedef std::shared_ptr< Self > Pointer;
......@@ -82,7 +82,7 @@ public:
//Providing Interfaces:
virtual typename DisplacementFieldImageType::Pointer GetDisplacementFieldItkImage() override;
virtual void ReconnectTransform() override;
virtual void Update() override;
//BaseClass methods
virtual bool MeetsCriterion( const ComponentBase::CriterionType & criterion ) override;
......
......@@ -84,7 +84,7 @@ ItkTransformDisplacementFilterComponent< Dimensionality, TPixel, TInternalComput
template< int Dimensionality, class TPixel, class TInternalComputationValue >
void
ItkTransformDisplacementFilterComponent< Dimensionality, TPixel, TInternalComputationValue >
::ReconnectTransform()
::Update()
{
auto transform = this->m_TransformComponent->GetItkTransform();
// reconnect the tranform, since it does not comply with the itk pipeline
......
......@@ -38,7 +38,7 @@ template< int Dimensionality, class InternalComputationValueType >
class ItkTransformSinkComponent :
public SuperElastixComponent<
Accepting< itkTransformInterface< InternalComputationValueType, Dimensionality >>,
Providing< SinkInterface, AfterRegistrationInterface >
Providing< SinkInterface, UpdateInterface >
>
{
public:
......@@ -49,7 +49,7 @@ public:
> Self;
typedef SuperElastixComponent<
Accepting< itkTransformInterface< InternalComputationValueType, Dimensionality >>,
Providing< SinkInterface, AfterRegistrationInterface >
Providing< SinkInterface, UpdateInterface >
> Superclass;
typedef std::shared_ptr< Self > Pointer;
typedef std::shared_ptr< const Self > ConstPointer;
......@@ -74,7 +74,7 @@ public:
virtual itk::DataObject::Pointer GetInitializedOutput( void ) override;
// providing AfterRegistrationInterface
virtual void AfterRegistration() override;
virtual void Update() override;
virtual bool MeetsCriterion( const ComponentBase::CriterionType & criterion ) override;
......
......@@ -81,7 +81,7 @@ ItkTransformSinkComponent< Dimensionality, TInternalComputationValue >::GetIniti
template< int Dimensionality, class TInternalComputationValue >
void
ItkTransformSinkComponent< Dimensionality, TInternalComputationValue >::AfterRegistration()
ItkTransformSinkComponent< Dimensionality, TInternalComputationValue >::Update()
{
// Only after having performed the registration we can get the pointer to the result transform.
auto transform = this->m_TransformInterface->GetItkTransform();
......
Markdown is supported
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