Commit 99a957c5 authored by Floris Berendsen's avatar Floris Berendsen
Browse files

ENH: add SmoothingSigmasPerLevel option and update WBIRDemoTest

accordingly
parent 5c57aee8
......@@ -238,18 +238,6 @@ ItkImageRegistrationMethodv4Component< Dimensionality, TPixel >::RunRegistration
this->m_theItkFilter->SetOptimizer( optimizer );
// Below some hard coded options. Eventually, these should be part of new components.
this->m_theItkFilter->SetNumberOfLevels( 3 );
// Smooth by specified gaussian sigmas for each level. These values are specified in
// physical units.
typename TheItkFilterType::SmoothingSigmasArrayType smoothingSigmasPerLevel;
smoothingSigmasPerLevel.SetSize( 3 );
smoothingSigmasPerLevel[ 0 ] = 4;
smoothingSigmasPerLevel[ 1 ] = 2;
smoothingSigmasPerLevel[ 2 ] = 1;
this->m_theItkFilter->SetSmoothingSigmasPerLevel( smoothingSigmasPerLevel );
this->m_theItkFilter->SetTransformParametersAdaptorsPerLevel(this->m_TransformAdaptorInterface->GetItkGaussianExponentialDiffeomorphicTransformParametersAdaptorsContainer());
......
......@@ -386,7 +386,8 @@ TEST_F( RegistrationItkv4Test, FullyConfigured3d )
blueprint->AddComponent("RegistrationMethod", { { "NameOfClass", { "ItkImageRegistrationMethodv4Component" } },
{ "Dimensionality", { "3" } },
{ "ShrinkFactorsPerLevel", { "4", "2", "1" } } });
{ "NumberOfLevels", { "2" } },
{ "ShrinkFactorsPerLevel", { "2", "1" } } });
ParameterMapType component1Parameters;
component1Parameters[ "NameOfClass" ] = { "ItkImageSourceFixedComponent" };
......@@ -431,7 +432,7 @@ TEST_F( RegistrationItkv4Test, FullyConfigured3d )
blueprint->AddComponent("TransformResolutionAdaptor", { { "NameOfClass", { "ItkGaussianExponentialDiffeomorphicTransformParametersAdaptorComponent" } },
{ "Dimensionality", { "3" } },
{ "ShrinkFactorsPerLevel", { "4", "2", "1" } } });
{ "ShrinkFactorsPerLevel", { "2", "1" } } });
blueprint->AddComponent( "Controller", { { "NameOfClass", { "RegistrationControllerComponent" } } } );
......
......@@ -145,7 +145,9 @@ TEST_F( WBIRDemoTest, itkv4_SVF_ANTSCC )
/** make example blueprint configuration */
blueprint = Blueprint::New();
blueprint->AddComponent("RegistrationMethod", { { "NameOfClass", { "ItkImageRegistrationMethodv4Component" } },
{ "ShrinkFactorsPerLevel", { "4", "2", "1" } } });
{ "NumberOfLevels", { "3" } },
{ "ShrinkFactorsPerLevel", { "4", "2", "1" } },
{ "SmoothingSigmasPerLevel", { "4", "2", "1" } } });
blueprint->AddComponent( "Metric", { { "NameOfClass", { "ItkANTSNeighborhoodCorrelationImageToImageMetricv4Component" } } } );
blueprint->AddComponent( "Optimizer", { { "NameOfClass", { "ItkGradientDescentOptimizerv4Component" } },
......@@ -256,12 +258,17 @@ TEST_F( WBIRDemoTest, itkv4_SVF_MSD )
/** make example blueprint configuration */
blueprint = Blueprint::New();
blueprint->AddComponent( "RegistrationMethod", { { "NameOfClass", { "ItkImageRegistrationMethodv4Component" } } } );
blueprint->AddComponent("RegistrationMethod", { { "NameOfClass", { "ItkImageRegistrationMethodv4Component" } },
{ "NumberOfLevels", { "3" } },
{ "ShrinkFactorsPerLevel", { "4", "2", "1" } },
{ "SmoothingSigmasPerLevel", { "4", "2", "1" } } });
blueprint->AddComponent( "Metric", { { "NameOfClass", { "ItkMeanSquaresImageToImageMetricv4Component" } } } );
blueprint->AddComponent( "Optimizer", { { "NameOfClass", { "ItkGradientDescentOptimizerv4Component" } },
{ "NumberOfIterations", { "100" } },
{ "LearningRate", { "0.001" } } } );
blueprint->AddComponent( "Transform", { { "NameOfClass", { "ItkGaussianExponentialDiffeomorphicTransformComponent" } } } );
blueprint->AddComponent("TransformResolutionAdaptor", { { "NameOfClass", { "ItkGaussianExponentialDiffeomorphicTransformParametersAdaptorComponent" } },
{ "ShrinkFactorsPerLevel", { "4", "2", "1" } } });
blueprint->AddComponent( "ResampleFilter", { { "NameOfClass", { "ItkResampleFilterComponent" } } } );
blueprint->AddComponent( "TransformDisplacementFilter", { { "NameOfClass", { "ItkTransformDisplacementFilterComponent" } } } );
......@@ -294,6 +301,8 @@ TEST_F( WBIRDemoTest, itkv4_SVF_MSD )
blueprint->AddConnection( "FixedImageSource", "Transform", { {} } );
blueprint->AddConnection( "Transform", "RegistrationMethod", { {} } );
blueprint->AddConnection("FixedImageSource", "TransformResolutionAdaptor", { {} });
blueprint->AddConnection("TransformResolutionAdaptor", "RegistrationMethod", { {} });
blueprint->AddConnection( "Optimizer", "RegistrationMethod", { {} } );
blueprint->AddConnection( "RegistrationMethod", "TransformDisplacementFilter", { {} } );
blueprint->AddConnection( "FixedImageSource", "TransformDisplacementFilter", { {} } );
......@@ -304,8 +313,7 @@ TEST_F( WBIRDemoTest, itkv4_SVF_MSD )
blueprint->AddConnection( "RegistrationMethod", "Controller", { {} } ); //RunRegistrationInterface
blueprint->AddConnection( "ResampleFilter", "Controller", { {} } ); //ReconnectTransformInterface
blueprint->AddConnection( "TransformDisplacementFilter", "Controller", { {} } ); //ReconnectTransformInterface
blueprint->AddConnection( "ResultImageSink", "Controller", { {} } ); //AfterRegistrationInterface
blueprint->AddConnection( "ResultDisplacementFieldSink", "Controller", { {} } ); //AfterRegistrationInterface
// Data manager provides the paths to the input and output data for unit tests
DataManagerType::Pointer dataManager = DataManagerType::New();
......
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