Commit 0214973b authored by FBerendsen's avatar FBerendsen
Browse files

WIP: CompositeTransformComponent+Test

parent 1f115a83
......@@ -30,7 +30,7 @@ namespace selx
template< class InternalComputationValueType, int Dimensionality >
class ItkCompositeTransformComponent :
public SuperElastixComponent<
Accepting<MultiStageTransformInterface< InternalComputationValueType, Dimensionality > >,
Accepting<MultiStageTransformInterface< InternalComputationValueType, Dimensionality >, ReconnectTransformInterface >,
Providing<itkTransformInterface<InternalComputationValueType, Dimensionality>,
RegistrationControllerStartInterface>
>
......@@ -51,6 +51,8 @@ public:
virtual int Set(MultiStageTransformInterface< InternalComputationValueType, Dimensionality > *) override;
virtual int Set(ReconnectTransformInterface * ) override;
virtual void RegistrationControllerStart() override;
virtual typename TransformType::Pointer GetItkTransform() override;
......@@ -65,6 +67,8 @@ private:
typename CompositeTransformType::Pointer m_CompositeTransform;
typename std::vector<MultiStageTransformInterface< InternalComputationValueType, Dimensionality >*> m_registrationStages;
std::set< ReconnectTransformInterface * > m_ReconnectTransformInterfaces;
protected:
// return the class name and the template arguments to uniquely identify this component.
......
......@@ -46,6 +46,15 @@ ItkCompositeTransformComponent< InternalComputationValueType, Dimensionality >
return 1;
}
template< class InternalComputationValueType, int Dimensionality >
int
ItkCompositeTransformComponent< InternalComputationValueType, Dimensionality >
::Set( ReconnectTransformInterface * other )
{
this->m_ReconnectTransformInterfaces.insert( other );
return 0;
}
template< class InternalComputationValueType, int Dimensionality >
typename ItkCompositeTransformComponent< InternalComputationValueType, Dimensionality >::TransformType::Pointer
ItkCompositeTransformComponent< InternalComputationValueType, Dimensionality >::GetItkTransform()
......@@ -63,6 +72,10 @@ ItkCompositeTransformComponent< InternalComputationValueType, Dimensionality >::
stage->RunRegistration();
this->m_CompositeTransform->AppendTransform(stage->GetItkTransform());
}
for( auto && reconnectTransformInterface : this->m_ReconnectTransformInterfaces )
{
reconnectTransformInterface->ReconnectTransform();
}
return;
}
......
......@@ -686,7 +686,7 @@ TEST_F(RegistrationItkv4Test, CompositeTransform)
blueprint->AddComponent("Metric2", { { "NameOfClass", { "ItkANTSNeighborhoodCorrelationImageToImageMetricv4Component" } } });
blueprint->AddConnection("Metric2", "RegistrationMethod2", {});
blueprint->AddComponent("Transform2", { { "NameOfClass", { "ItkGaussianExponentialDiffeomorphicTransformParametersAdaptorsContainerComponent" } } });
blueprint->AddComponent("Transform2", { { "NameOfClass", { "ItkGaussianExponentialDiffeomorphicTransformComponent" } } });
blueprint->AddConnection("Transform2", "RegistrationMethod2", {});
blueprint->AddComponent("TransformResolutionAdaptor2", { { "NameOfClass", { "ItkGaussianExponentialDiffeomorphicTransformParametersAdaptorsContainerComponent" } },
{ "ShrinkFactorsPerLevel", { "2", "1" } } });
......@@ -733,7 +733,7 @@ TEST_F(RegistrationItkv4Test, CompositeTransform)
//superElastixFilter->Update();
// Update call on the writers triggers SuperElastix to configure and execute
EXPECT_NO_THROW(resultImageWriter->Update());
//EXPECT_NO_THROW(resultImageWriter->Update());
resultImageWriter->Update();
}
} // namespace selx
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