Commit 398113fa authored by Floris Berendsen's avatar Floris Berendsen
Browse files

STYLE: uncrustify

parent 64b97a93
......@@ -63,12 +63,12 @@ ItkAffineTransformComponent< InternalComputationValueType, Dimensionality >
}
}
}
else if (criterion.first == "Dimensionality") //Supports this?
else if( criterion.first == "Dimensionality" ) //Supports this?
{
meetsCriteria = true;
for (auto const & criterionValue : criterion.second) // auto&& preferred?
for( auto const & criterionValue : criterion.second ) // auto&& preferred?
{
if (std::stoi(criterionValue) != Dimensionality)
if( std::stoi( criterionValue ) != Dimensionality )
{
meetsCriteria = false;
}
......
......@@ -41,7 +41,7 @@ class ItkGaussianExponentialDiffeomorphicTransformParametersAdaptorsContainerCom
public SuperElastixComponent<
Accepting< itkImageDomainFixedInterface< Dimensionality >
>,
Providing< itkTransformParametersAdaptorsContainerInterface< TransformInternalComputationValueType, Dimensionality>
Providing< itkTransformParametersAdaptorsContainerInterface< TransformInternalComputationValueType, Dimensionality >
>
>
{
......@@ -55,22 +55,25 @@ public:
virtual ~ItkGaussianExponentialDiffeomorphicTransformParametersAdaptorsContainerComponent();
// Get the type definitions from the interfaces
typedef typename itkImageDomainFixedInterface< Dimensionality >::ItkImageDomainType FixedImageDomainType;
using itkTransformParametersAdaptorsContainerInterfaceType = itkTransformParametersAdaptorsContainerInterface< TransformInternalComputationValueType, Dimensionality >;
using TransformParametersAdaptorsContainerType = typename itkTransformParametersAdaptorsContainerInterfaceType::TransformParametersAdaptorsContainerType;
typedef typename itkImageDomainFixedInterface< Dimensionality >::ItkImageDomainType FixedImageDomainType;
using itkTransformParametersAdaptorsContainerInterfaceType
= itkTransformParametersAdaptorsContainerInterface< TransformInternalComputationValueType, Dimensionality >;
using TransformParametersAdaptorsContainerType
= typename itkTransformParametersAdaptorsContainerInterfaceType::TransformParametersAdaptorsContainerType;
// Since the itkTransformParametersAdaptorsContainerInterface is only defined by BaseType Adaptors and Transforms, we cannot use the ItkTransformParametersAdaptorsContainerInterfaceType::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;
using TransformParametersAdaptorType
= itk::GaussianExponentialDiffeomorphicTransformParametersAdaptor< itk::GaussianExponentialDiffeomorphicTransform<
TransformInternalComputationValueType, Dimensionality >>;
typedef itk::Array< itk::SizeValueType > ShrinkFactorsArrayType;
typedef itk::Array< TransformInternalComputationValueType > SmoothingSigmasArrayType;
//Accepting Interfaces:
virtual int Set( itkImageDomainFixedInterface< Dimensionality > * ) override;
//Providing Interfaces:
virtual typename TransformParametersAdaptorsContainerType GetItkTransformParametersAdaptorsContainer() override;
......@@ -81,6 +84,7 @@ public:
static const char * GetDescription() { return "ItkImageRegistrationMethodv4 Component"; }
private:
typename TransformParametersAdaptorsContainerType m_adaptors;
// Shrink the virtual domain by specified factors for each level. See documentation
......@@ -98,12 +102,11 @@ protected:
static inline const std::string GetTypeNameString()
{
itkGenericExceptionMacro(<< "Unknown ScalarType" << typeid(TransformInternalComputationValueType).name());
itkGenericExceptionMacro( << "Unknown ScalarType" << typeid( TransformInternalComputationValueType ).name() );
// TODO: provide the user instructions how to enable the compilation of the component with the required template types (if desired)
// We might define an exception object that can communicate various error messages: for simple user, for developer user, etc
}
};
} //end namespace selx
#ifndef ITK_MANUAL_INSTANTIATION
#include "selxItkGaussianExponentialDiffeomorphicTransformParametersAdaptorsContainerComponent.hxx"
......
......@@ -21,15 +21,16 @@
namespace selx
{
template< int Dimensionality, class TransformInternalComputationValueType >
ItkGaussianExponentialDiffeomorphicTransformParametersAdaptorsContainerComponent< Dimensionality, TransformInternalComputationValueType >::ItkGaussianExponentialDiffeomorphicTransformParametersAdaptorsContainerComponent()
ItkGaussianExponentialDiffeomorphicTransformParametersAdaptorsContainerComponent< Dimensionality,
TransformInternalComputationValueType >::ItkGaussianExponentialDiffeomorphicTransformParametersAdaptorsContainerComponent()
{
}
template< int Dimensionality, class TransformInternalComputationValueType >
ItkGaussianExponentialDiffeomorphicTransformParametersAdaptorsContainerComponent< Dimensionality, TransformInternalComputationValueType >::~ItkGaussianExponentialDiffeomorphicTransformParametersAdaptorsContainerComponent()
ItkGaussianExponentialDiffeomorphicTransformParametersAdaptorsContainerComponent< Dimensionality,
TransformInternalComputationValueType >::~ItkGaussianExponentialDiffeomorphicTransformParametersAdaptorsContainerComponent()
{
}
......@@ -41,32 +42,31 @@ ItkGaussianExponentialDiffeomorphicTransformParametersAdaptorsContainerComponent
{
auto fixedImageDomain = component->GetItkImageDomainFixed();
for (unsigned int level = 0; level < m_shrinkFactorsPerLevel.Size(); level++)
for( unsigned int level = 0; level < m_shrinkFactorsPerLevel.Size(); level++ )
{
// We use the shrink image filter to calculate the fixed parameters of the virtual
// domain at each level. To speed up calculation and avoid unnecessary memory
// usage, we could calculate these fixed parameters directly.
typedef itk::Image< TransformInternalComputationValueType, Dimensionality > FixedImageType;
typedef itk::Image<TransformInternalComputationValueType, Dimensionality > FixedImageType;
FixedImageType::Pointer fixedImage = FixedImageType::New();
fixedImage->CopyInformation(fixedImageDomain);
fixedImage->CopyInformation( fixedImageDomain );
//fixedImage->Allocate();
typedef itk::ShrinkImageFilter< FixedImageType, FixedImageType > ShrinkFilterType;
typename ShrinkFilterType::Pointer shrinkFilter = ShrinkFilterType::New();
shrinkFilter->SetShrinkFactors(m_shrinkFactorsPerLevel[level]);
shrinkFilter->SetInput(fixedImage);
shrinkFilter->SetShrinkFactors( m_shrinkFactorsPerLevel[ level ] );
shrinkFilter->SetInput( fixedImage );
shrinkFilter->UpdateOutputInformation();
typename TransformParametersAdaptorType::Pointer transformAdaptor = TransformParametersAdaptorType::New();
transformAdaptor->SetRequiredSpacing(shrinkFilter->GetOutput()->GetSpacing());
transformAdaptor->SetRequiredSize(shrinkFilter->GetOutput()->GetLargestPossibleRegion().GetSize());
transformAdaptor->SetRequiredDirection(shrinkFilter->GetOutput()->GetDirection());
transformAdaptor->SetRequiredOrigin(shrinkFilter->GetOutput()->GetOrigin());
transformAdaptor->SetRequiredSpacing( shrinkFilter->GetOutput()->GetSpacing() );
transformAdaptor->SetRequiredSize( shrinkFilter->GetOutput()->GetLargestPossibleRegion().GetSize() );
transformAdaptor->SetRequiredDirection( shrinkFilter->GetOutput()->GetDirection() );
transformAdaptor->SetRequiredOrigin( shrinkFilter->GetOutput()->GetOrigin() );
m_adaptors.push_back(transformAdaptor.GetPointer()); // Implicit cast back to TransformParametersAdaptorBase<itk::Transform<...>>
m_adaptors.push_back( transformAdaptor.GetPointer() ); // Implicit cast back to TransformParametersAdaptorBase<itk::Transform<...>>
}
return 0;
......@@ -74,7 +74,8 @@ ItkGaussianExponentialDiffeomorphicTransformParametersAdaptorsContainerComponent
template< int Dimensionality, class TransformInternalComputationValueType >
typename ItkGaussianExponentialDiffeomorphicTransformParametersAdaptorsContainerComponent<Dimensionality, TransformInternalComputationValueType >::TransformParametersAdaptorsContainerType
typename ItkGaussianExponentialDiffeomorphicTransformParametersAdaptorsContainerComponent< Dimensionality,
TransformInternalComputationValueType >::TransformParametersAdaptorsContainerType
ItkGaussianExponentialDiffeomorphicTransformParametersAdaptorsContainerComponent< Dimensionality, TransformInternalComputationValueType >
::GetItkTransformParametersAdaptorsContainer()
{
......@@ -111,17 +112,17 @@ ItkGaussianExponentialDiffeomorphicTransformParametersAdaptorsContainerComponent
}
}
}
else if (criterion.first == "ShrinkFactorsPerLevel") //Supports this?
else if( criterion.first == "ShrinkFactorsPerLevel" ) //Supports this?
{
meetsCriteria = true;
const int NumberOfResolutions = criterion.second.size(); // maybe check with criterion "NumberOfResolutions"?
m_shrinkFactorsPerLevel.SetSize(NumberOfResolutions);
m_shrinkFactorsPerLevel.SetSize( NumberOfResolutions );
unsigned int resolutionIndex = 0;
for (auto const & criterionValue : criterion.second) // auto&& preferred?
for( auto const & criterionValue : criterion.second ) // auto&& preferred?
{
m_shrinkFactorsPerLevel[resolutionIndex] = std::stoi(criterionValue);
m_shrinkFactorsPerLevel[ resolutionIndex ] = std::stoi( criterionValue );
++resolutionIndex;
}
}
......
......@@ -39,7 +39,7 @@ class ItkImageRegistrationMethodv4Component :
Accepting< itkImageFixedInterface< Dimensionality, TPixel >,
itkImageMovingInterface< Dimensionality, TPixel >,
itkTransformInterface< double, Dimensionality >,
itkTransformParametersAdaptorsContainerInterface< double, Dimensionality>,
itkTransformParametersAdaptorsContainerInterface< double, Dimensionality >,
itkMetricv4Interface< Dimensionality, TPixel >,
itkOptimizerv4Interface< double >
>,
......@@ -62,14 +62,16 @@ public:
// Get the type definitions from the interfaces
typedef typename itkOptimizerv4Interface< TransformInternalComputationValueType >::InternalComputationValueType OptimizerInternalComputationValueType; //should be from class template
typedef typename itkOptimizerv4Interface< TransformInternalComputationValueType >::InternalComputationValueType
OptimizerInternalComputationValueType; //should be from class template
typedef typename itkImageFixedInterface< Dimensionality, TPixel >::ItkImageType FixedImageType;
typedef typename itkImageMovingInterface< Dimensionality, TPixel >::ItkImageType MovingImageType;
typedef typename itkImageFixedInterface< Dimensionality, TPixel >::ItkImageType FixedImageType;
typedef typename itkImageMovingInterface< Dimensionality, TPixel >::ItkImageType MovingImageType;
typedef typename itkTransformInterface< TransformInternalComputationValueType, Dimensionality >::TransformType TransformType;
typedef typename itkTransformInterface< TransformInternalComputationValueType, Dimensionality >::TransformPointer TransformPointer;
using TransformParametersAdaptorsContainerInterfaceType = itkTransformParametersAdaptorsContainerInterface< TransformInternalComputationValueType, Dimensionality>;
using TransformParametersAdaptorsContainerInterfaceType
= itkTransformParametersAdaptorsContainerInterface< TransformInternalComputationValueType, Dimensionality >;
typedef itk::ImageRegistrationMethodv4< FixedImageType, MovingImageType > TheItkFilterType;
typedef typename TheItkFilterType::ImageMetricType ImageMetricType;
......@@ -82,8 +84,8 @@ public:
virtual int Set( itkTransformInterface< TransformInternalComputationValueType, Dimensionality > * ) override;
virtual int Set( TransformParametersAdaptorsContainerInterfaceType *) override;
virtual int Set( TransformParametersAdaptorsContainerInterfaceType * ) override;
virtual int Set( itkMetricv4Interface< Dimensionality, TPixel > * ) override;
virtual int Set( itkOptimizerv4Interface< OptimizerInternalComputationValueType > * ) override;
......@@ -102,11 +104,12 @@ public:
private:
typename TheItkFilterType::Pointer m_theItkFilter;
// The settings SmoothingSigmas and ShrinkFactors imply NumberOfLevels, if the user
// provides inconsistent numbers we should detect that and report about it.
std::string m_NumberOfLevelsLastSetBy;
TransformParametersAdaptorsContainerInterfaceType* m_TransformAdaptorsContainerInterface;
// The settings SmoothingSigmas and ShrinkFactors imply NumberOfLevels, if the user
// provides inconsistent numbers we should detect that and report about it.
std::string m_NumberOfLevelsLastSetBy;
TransformParametersAdaptorsContainerInterfaceType * m_TransformAdaptorsContainerInterface;
protected:
/* The following struct returns the string name of computation type */
......
......@@ -115,7 +115,8 @@ public:
};
template< int Dimensionality, class TPixel >
ItkImageRegistrationMethodv4Component< Dimensionality, TPixel >::ItkImageRegistrationMethodv4Component() : m_TransformAdaptorsContainerInterface(nullptr)
ItkImageRegistrationMethodv4Component< Dimensionality, TPixel >::ItkImageRegistrationMethodv4Component() : m_TransformAdaptorsContainerInterface(
nullptr )
{
m_theItkFilter = TheItkFilterType::New();
m_theItkFilter->InPlaceOn();
......@@ -166,9 +167,10 @@ ItkImageRegistrationMethodv4Component< Dimensionality, TPixel >::Set( itkTransfo
return 0;
}
template< int Dimensionality, class TPixel >
int
ItkImageRegistrationMethodv4Component< Dimensionality, TPixel >::Set(TransformParametersAdaptorsContainerInterfaceType * component)
ItkImageRegistrationMethodv4Component< Dimensionality, TPixel >::Set( TransformParametersAdaptorsContainerInterfaceType * 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_TransformAdaptorsContainerInterface = component;
......@@ -237,9 +239,10 @@ ItkImageRegistrationMethodv4Component< Dimensionality, TPixel >::RunRegistration
this->m_theItkFilter->SetOptimizer( optimizer );
if (this->m_TransformAdaptorsContainerInterface != nullptr)
if( this->m_TransformAdaptorsContainerInterface != nullptr )
{
this->m_theItkFilter->SetTransformParametersAdaptorsPerLevel(this->m_TransformAdaptorsContainerInterface->GetItkTransformParametersAdaptorsContainer());
this->m_theItkFilter->SetTransformParametersAdaptorsPerLevel(
this->m_TransformAdaptorsContainerInterface->GetItkTransformParametersAdaptorsContainer() );
}
typedef CommandIterationUpdate< TheItkFilterType > RegistrationCommandType;
......@@ -300,20 +303,20 @@ ItkImageRegistrationMethodv4Component< Dimensionality, TPixel >
}
}
}
else if (criterion.first == "NumberOfLevels") //Supports this?
else if( criterion.first == "NumberOfLevels" ) //Supports this?
{
meetsCriteria = true;
if (criterion.second.size() == 1)
if( criterion.second.size() == 1 )
{
if (this->m_NumberOfLevelsLastSetBy == "") // check if some other settings set the NumberOfLevels
if( this->m_NumberOfLevelsLastSetBy == "" ) // check if some other settings set the NumberOfLevels
{
// try catch?
this->m_theItkFilter->SetNumberOfLevels(std::stoi(criterion.second[0]));
this->m_theItkFilter->SetNumberOfLevels( std::stoi( criterion.second[ 0 ] ) );
this->m_NumberOfLevelsLastSetBy = criterion.first;
}
else
{
if (this->m_theItkFilter->GetNumberOfLevels() != std::stoi(criterion.second[0]))
if( this->m_theItkFilter->GetNumberOfLevels() != std::stoi( criterion.second[ 0 ] ) )
{
// TODO log error?
std::cout << "A conflicting NumberOfLevels was set by " << this->m_NumberOfLevelsLastSetBy << std::endl;
......@@ -329,80 +332,79 @@ ItkImageRegistrationMethodv4Component< Dimensionality, TPixel >
meetsCriteria = false;
return meetsCriteria;
}
}
else if (criterion.first == "ShrinkFactorsPerLevel") //Supports this?
else if( criterion.first == "ShrinkFactorsPerLevel" ) //Supports this?
{
meetsCriteria = true;
const int impliedNumberOfResolutions = criterion.second.size();
if (this->m_NumberOfLevelsLastSetBy == "") // check if some other settings set the NumberOfLevels
if( this->m_NumberOfLevelsLastSetBy == "" ) // check if some other settings set the NumberOfLevels
{
// try catch?
this->m_theItkFilter->SetNumberOfLevels(impliedNumberOfResolutions);
this->m_theItkFilter->SetNumberOfLevels( impliedNumberOfResolutions );
this->m_NumberOfLevelsLastSetBy = criterion.first;
}
else
{
if (this->m_theItkFilter->GetNumberOfLevels() != impliedNumberOfResolutions)
if( this->m_theItkFilter->GetNumberOfLevels() != impliedNumberOfResolutions )
{
// TODO log error?
std::cout << "A conflicting NumberOfLevels was set by " << this->m_NumberOfLevelsLastSetBy << std::endl;
meetsCriteria = false;
return meetsCriteria;;
return meetsCriteria;
}
}
itk::Array<itk::SizeValueType> shrinkFactorsPerLevel;
shrinkFactorsPerLevel.SetSize(impliedNumberOfResolutions);
itk::Array< itk::SizeValueType > shrinkFactorsPerLevel;
shrinkFactorsPerLevel.SetSize( impliedNumberOfResolutions );
unsigned int resolutionIndex = 0;
for (auto const & criterionValue : criterion.second) // auto&& preferred?
for( auto const & criterionValue : criterion.second ) // auto&& preferred?
{
shrinkFactorsPerLevel[resolutionIndex] = std::stoi(criterionValue);
shrinkFactorsPerLevel[ resolutionIndex ] = std::stoi( criterionValue );
++resolutionIndex;
}
// try catch?
this->m_theItkFilter->SetShrinkFactorsPerLevel(shrinkFactorsPerLevel);
this->m_theItkFilter->SetShrinkFactorsPerLevel( shrinkFactorsPerLevel );
}
else if (criterion.first == "SmoothingSigmasPerLevel") //Supports this?
else if( criterion.first == "SmoothingSigmasPerLevel" ) //Supports this?
{
meetsCriteria = true;
const int impliedNumberOfResolutions = criterion.second.size();
if (this->m_NumberOfLevelsLastSetBy == "") // check if some other settings set the NumberOfLevels
if( this->m_NumberOfLevelsLastSetBy == "" ) // check if some other settings set the NumberOfLevels
{
// try catch?
this->m_theItkFilter->SetNumberOfLevels(impliedNumberOfResolutions);
this->m_theItkFilter->SetNumberOfLevels( impliedNumberOfResolutions );
this->m_NumberOfLevelsLastSetBy = criterion.first;
}
else
{
if (this->m_theItkFilter->GetNumberOfLevels() != impliedNumberOfResolutions)
if( this->m_theItkFilter->GetNumberOfLevels() != impliedNumberOfResolutions )
{
// TODO log error?
std::cout << "A conflicting NumberOfLevels was set by " << this->m_NumberOfLevelsLastSetBy << std::endl;
meetsCriteria = false;
return meetsCriteria;;
return meetsCriteria;
}
}
itk::Array<TransformInternalComputationValueType> smoothingSigmasPerLevel;
itk::Array< TransformInternalComputationValueType > smoothingSigmasPerLevel;
smoothingSigmasPerLevel.SetSize(impliedNumberOfResolutions);
smoothingSigmasPerLevel.SetSize( impliedNumberOfResolutions );
unsigned int resolutionIndex = 0;
for (auto const & criterionValue : criterion.second) // auto&& preferred?
for( auto const & criterionValue : criterion.second ) // auto&& preferred?
{
smoothingSigmasPerLevel[resolutionIndex] = std::stoi(criterionValue);
smoothingSigmasPerLevel[ resolutionIndex ] = std::stoi( criterionValue );
++resolutionIndex;
}
// try catch?
// Smooth by specified gaussian sigmas for each level. These values are specified in
// physical units.
this->m_theItkFilter->SetSmoothingSigmasPerLevel(smoothingSigmasPerLevel);
this->m_theItkFilter->SetSmoothingSigmasPerLevel( smoothingSigmasPerLevel );
}
return meetsCriteria;
......
......@@ -59,14 +59,14 @@ public:
typedef TPixel PixelType;
// Get the type definitions from the interfaces
typedef typename itkImageDomainFixedInterface< Dimensionality>::ItkImageDomainType FixedImageDomainType;
typedef typename itkImageMovingInterface< Dimensionality, TPixel >::ItkImageType MovingImageType;
typedef typename itkImageInterface< Dimensionality, TPixel >::ItkImageType ResultImageType;
typedef typename itkImageDomainFixedInterface< Dimensionality >::ItkImageDomainType FixedImageDomainType;
typedef typename itkImageMovingInterface< Dimensionality, TPixel >::ItkImageType MovingImageType;
typedef typename itkImageInterface< Dimensionality, TPixel >::ItkImageType ResultImageType;
typedef itk::ResampleImageFilter< MovingImageType, ResultImageType > ResampleFilterType;
//Accepting Interfaces:
virtual int Set( itkImageDomainFixedInterface< Dimensionality> * ) override;
virtual int Set( itkImageDomainFixedInterface< Dimensionality > * ) override;
virtual int Set( itkImageMovingInterface< Dimensionality, TPixel > * ) override;
......
......@@ -45,10 +45,10 @@ ItkResampleFilterComponent< Dimensionality, TPixel, TInternalComputationValue >
// connect the itk pipeline
//this->m_ResampleFilter->SetSize(fixedImage->GetBufferedRegion().GetSize()); //should be virtual image...
this->m_ResampleFilter->SetSize( fixedImageDomain->GetLargestPossibleRegion().GetSize()); //should be virtual image...
this->m_ResampleFilter->SetOutputOrigin( fixedImageDomain->GetOrigin());
this->m_ResampleFilter->SetOutputSpacing( fixedImageDomain->GetSpacing());
this->m_ResampleFilter->SetOutputDirection( fixedImageDomain->GetDirection());
this->m_ResampleFilter->SetSize( fixedImageDomain->GetLargestPossibleRegion().GetSize() ); //should be virtual image...
this->m_ResampleFilter->SetOutputOrigin( fixedImageDomain->GetOrigin() );
this->m_ResampleFilter->SetOutputSpacing( fixedImageDomain->GetSpacing() );
this->m_ResampleFilter->SetOutputDirection( fixedImageDomain->GetDirection() );
this->m_ResampleFilter->SetDefaultPixelValue( 0 );
return 0;
}
......
......@@ -96,7 +96,7 @@ public:
ItkGradientDescentOptimizerv4Component< double >,
ItkAffineTransformComponent< double, 3 >,
ItkGaussianExponentialDiffeomorphicTransformComponent< double, 3 >,
ItkGaussianExponentialDiffeomorphicTransformParametersAdaptorsContainerComponent<3, double>,
ItkGaussianExponentialDiffeomorphicTransformParametersAdaptorsContainerComponent< 3, double >,
ItkTransformDisplacementFilterComponent< 2, float, double >,
ItkTransformDisplacementFilterComponent< 3, double, double >,
ItkResampleFilterComponent< 2, float, double >,
......@@ -384,10 +384,10 @@ TEST_F( RegistrationItkv4Test, FullyConfigured3d )
/** make example blueprint configuration */
blueprint = Blueprint::New();
blueprint->AddComponent("RegistrationMethod", { { "NameOfClass", { "ItkImageRegistrationMethodv4Component" } },
{ "Dimensionality", { "3" } },
{ "NumberOfLevels", { "2" } },
{ "ShrinkFactorsPerLevel", { "2", "1" } } });
blueprint->AddComponent( "RegistrationMethod", { { "NameOfClass", { "ItkImageRegistrationMethodv4Component" } },
{ "Dimensionality", { "3" } },
{ "NumberOfLevels", { "2" } },
{ "ShrinkFactorsPerLevel", { "2", "1" } } } );
ParameterMapType component1Parameters;
component1Parameters[ "NameOfClass" ] = { "ItkImageSourceFixedComponent" };
......@@ -429,11 +429,11 @@ TEST_F( RegistrationItkv4Test, FullyConfigured3d )
blueprint->AddComponent( "Transform", { { "NameOfClass", { "ItkGaussianExponentialDiffeomorphicTransformComponent" } },
{ "Dimensionality", { "3" } } } );
blueprint->AddComponent("TransformResolutionAdaptor", { { "NameOfClass", { "ItkGaussianExponentialDiffeomorphicTransformParametersAdaptorsContainerComponent" } },
{ "Dimensionality", { "3" } },
{ "ShrinkFactorsPerLevel", { "2", "1" } } });
blueprint->AddComponent( "TransformResolutionAdaptor", { { "NameOfClass", { "ItkGaussianExponentialDiffeomorphicTransformParametersAdaptorsContainerComponent" } },
{ "Dimensionality", { "3" } },
{ "ShrinkFactorsPerLevel", { "2", "1" } } } );
blueprint->AddComponent( "Controller", { { "NameOfClass", { "RegistrationControllerComponent" } } } );
ParameterMapType connection1Parameters;
......@@ -458,9 +458,9 @@ TEST_F( RegistrationItkv4Test, FullyConfigured3d )
blueprint->AddConnection( "FixedImageSource", "Transform", { {} } );
blueprint->AddConnection( "Transform", "RegistrationMethod", { {} } );
blueprint->AddConnection( "FixedImageSource", "TransformResolutionAdaptor", { {} });
blueprint->AddConnection( "TransformResolutionAdaptor", "RegistrationMethod", { {} });
blueprint->AddConnection( "FixedImageSource", "TransformResolutionAdaptor", { {} } );
blueprint->AddConnection( "TransformResolutionAdaptor", "RegistrationMethod", { {} } );
blueprint->AddConnection( "Optimizer", "RegistrationMethod", { {} } );
blueprint->AddConnection( "RegistrationMethod", "TransformDisplacementFilter", { {} } );
blueprint->AddConnection( "FixedImageSource", "TransformDisplacementFilter", { {} } );
......@@ -509,127 +509,127 @@ TEST_F( RegistrationItkv4Test, FullyConfigured3d )
blueprint->WriteBlueprint( dataManager->GetOutputFile( "RegistrationItkv4Test_DisplacementField_network.dot" ) );
}
TEST_F(RegistrationItkv4Test, FullyConfigured3dAffine)
TEST_F( RegistrationItkv4Test, FullyConfigured3dAffine )
{
/** make example blueprint configuration */
blueprint = Blueprint::New();
blueprint->AddComponent("RegistrationMethod", { { "NameOfClass", { "ItkImageRegistrationMethodv4Component" } },
{ "Dimensionality", { "3" } },
{ "NumberOfLevels", { "2" } } });
blueprint->AddComponent( "RegistrationMethod", { { "NameOfClass", { "ItkImageRegistrationMethodv4Component" } },
{ "Dimensionality", { "3" } },
{ "NumberOfLevels", { "2" } } } );
ParameterMapType component1Parameters;
component1Parameters["NameOfClass"] = { "ItkImageSourceFixedComponent" };
component1Parameters["Dimensionality"] = { "3" }; // should be derived from the inputs
blueprint->AddComponent("FixedImageSource", component1Parameters);
component1Parameters[ "NameOfClass" ] = { "ItkImageSourceFixedComponent" };
component1Parameters[ "Dimensionality" ] = { "3" }; // should be derived from the inputs
blueprint->AddComponent( "FixedImageSource", component1Parameters );
ParameterMapType component2Parameters;
component2Parameters["NameOfClass"] = { "ItkImageSourceMovingComponent" };
component2Parameters["Dimensionality"] = { "3" }; // should be derived from the inputs
blueprint->AddComponent("MovingImageSource", component2Parameters);
component2Parameters[ "NameOfClass" ] = { "ItkImageSourceMovingComponent" };
component2Parameters[ "Dimensionality" ] = { "3" }; // should be derived from the inputs
blueprint->AddComponent( "MovingImageSource", component2Parameters );
ParameterMapType component3Parameters;
component3Parameters["NameOfClass"] = { "ItkImageSinkComponent" };
component3Parameters["Dimensionality"] = { "3" }; // should be derived from the outputs
blueprint->AddComponent("ResultImageSink", component3Parameters);
component3Parameters[ "NameOfClass" ] = { "ItkImageSinkComponent" };
component3Parameters[ "Dimensionality" ] = { "3" }; // should be derived from the outputs
blueprint->AddComponent( "ResultImageSink", component3Parameters );
ParameterMapType component4Parameters;
component4Parameters["NameOfClass"] = { "DisplacementFieldItkImageFilterSinkComponent" };
component4Parameters["Dimensionality"] = { "3" }; // should be derived from the outputs
blueprint->AddComponent("ResultDisplacementFieldSink", component4Parameters);
component4Parameters[ "NameOfClass" ] = { "DisplacementFieldItkImageFilterSinkComponent" };
component4Parameters[ "Dimensionality" ] = { "3" }; // should be derived from the outputs
blueprint->AddComponent( "ResultDisplacementFieldSink", component4Parameters );
ParameterMapType component5Parameters;
component5Parameters["NameOfClass"] = { "ItkANTSNeighborhoodCorrelationImageToImageMetricv4Component" };
component5Parameters["Dimensionality"] = { "3" }; // should be derived from the inputs
blueprint->AddComponent("Metric", component5Parameters);
component5Parameters[ "NameOfClass" ] = { "ItkANTSNeighborhoodCorrelationImageToImageMetricv4Component" };
component5Parameters[ "Dimensionality" ] = { "3" }; // should be derived from the inputs
blueprint->AddComponent( "Metric", component5Parameters );
ParameterMapType component6Parameters;