Commit 715e53be authored by Floris Berendsen's avatar Floris Berendsen
Browse files

STYLE: uncrustify

parent 9c85d908
......@@ -77,14 +77,14 @@ bool
ItkMeshSourceComponent< Dimensionality, TPixel >
::MeetsCriterion( const ComponentBase::CriterionType & criterion )
{
bool hasUndefinedCriteria(false);
bool meetsCriteria(false);
auto status = CheckTemplateProperties(this->TemplateProperties(), criterion);
if (status == CriterionStatus::Satisfied)
bool hasUndefinedCriteria( false );
bool meetsCriteria( false );
auto status = CheckTemplateProperties( this->TemplateProperties(), criterion );
if( status == CriterionStatus::Satisfied )
{
return true;
}
else if (status == CriterionStatus::Failed)
else if( status == CriterionStatus::Failed )
{
return false;
} // else: CriterionStatus::Unknown
......
......@@ -69,12 +69,11 @@ private:
protected:
// return the class name and the template arguments to uniquely identify this component.
static inline const std::map<std::string, std::string> TemplateProperties()
static inline const std::map< std::string, std::string > TemplateProperties()
{
return{ { keys::NameOfClass, "ItkANTSNeighborhoodCorrelationImageToImageMetricv4Component" }, { keys::PixelType, PodString<TPixel>::Get() }, { keys::Dimensionality, std::to_string(Dimensionality) } };
return { { keys::NameOfClass, "ItkANTSNeighborhoodCorrelationImageToImageMetricv4Component" }, { keys::PixelType, PodString< TPixel >::Get() }, { keys::Dimensionality, std::to_string( Dimensionality ) } };
}
};
} //end namespace selx
#ifndef ITK_MANUAL_INSTANTIATION
#include "selxItkANTSNeighborhoodCorrelationImageToImageMetricv4.hxx"
......
......@@ -51,12 +51,12 @@ bool
ItkANTSNeighborhoodCorrelationImageToImageMetricv4Component< Dimensionality, TPixel >
::MeetsCriterion( const ComponentBase::CriterionType & criterion )
{
auto status = CheckTemplateProperties(this->TemplateProperties(), criterion);
if (status == CriterionStatus::Satisfied)
auto status = CheckTemplateProperties( this->TemplateProperties(), criterion );
if( status == CriterionStatus::Satisfied )
{
return true;
}
else if (status == CriterionStatus::Failed)
else if( status == CriterionStatus::Failed )
{
return false;
} // else: CriterionStatus::Unknown
......
......@@ -65,9 +65,9 @@ private:
protected:
// return the class name and the template arguments to uniquely identify this component.
static inline const std::map<std::string, std::string> TemplateProperties()
static inline const std::map< std::string, std::string > TemplateProperties()
{
return{ { keys::NameOfClass, "ItkAffineTransformComponent" }, { keys::InternalComputationValueType, PodString<InternalComputationValueType>::Get() }, { keys::Dimensionality, std::to_string(Dimensionality) } };
return { { keys::NameOfClass, "ItkAffineTransformComponent" }, { keys::InternalComputationValueType, PodString< InternalComputationValueType >::Get() }, { keys::Dimensionality, std::to_string( Dimensionality ) } };
}
};
} //end namespace selx
......
......@@ -54,12 +54,12 @@ ItkAffineTransformComponent< InternalComputationValueType, Dimensionality >
bool hasUndefinedCriteria( false );
bool meetsCriteria( false );
auto status = CheckTemplateProperties(this->TemplateProperties(), criterion);
if (status == CriterionStatus::Satisfied)
auto status = CheckTemplateProperties( this->TemplateProperties(), criterion );
if( status == CriterionStatus::Satisfied )
{
return true;
}
else if (status == CriterionStatus::Failed)
else if( status == CriterionStatus::Failed )
{
return false;
} // else: CriterionStatus::Unknown
......
......@@ -74,9 +74,9 @@ private:
protected:
// return the class name and the template arguments to uniquely identify this component.
static inline const std::map<std::string, std::string> TemplateProperties()
static inline const std::map< std::string, std::string > TemplateProperties()
{
return{ { keys::NameOfClass, "ItkGaussianExponentialDiffeomorphicTransformComponent" }, { keys::InternalComputationValueType, PodString<InternalComputationValueType>::Get() }, { keys::Dimensionality, std::to_string(Dimensionality) } };
return { { keys::NameOfClass, "ItkGaussianExponentialDiffeomorphicTransformComponent" }, { keys::InternalComputationValueType, PodString< InternalComputationValueType >::Get() }, { keys::Dimensionality, std::to_string( Dimensionality ) } };
}
};
} //end namespace selx
......
......@@ -96,9 +96,9 @@ private:
protected:
static inline const std::map<std::string, std::string> TemplateProperties()
static inline const std::map< std::string, std::string > TemplateProperties()
{
return{ { keys::NameOfClass, "ItkGaussianExponentialDiffeomorphicTransformParametersAdaptorsContainerComponent" }, { keys::InternalComputationValueType, PodString<InternalComputationValueType>::Get() }, { keys::Dimensionality, std::to_string(Dimensionality) } };
return { { keys::NameOfClass, "ItkGaussianExponentialDiffeomorphicTransformParametersAdaptorsContainerComponent" }, { keys::InternalComputationValueType, PodString< InternalComputationValueType >::Get() }, { keys::Dimensionality, std::to_string( Dimensionality ) } };
}
};
} //end namespace selx
......
......@@ -26,7 +26,6 @@
#include <string.h>
#include "selxMacro.h"
namespace selx
{
template< class InternalComputationValueType >
......@@ -65,9 +64,9 @@ private:
protected:
// return the class name and the template arguments to uniquely identify this component.
static inline const std::map<std::string, std::string> TemplateProperties()
static inline const std::map< std::string, std::string > TemplateProperties()
{
return{ { keys::NameOfClass, "ItkGradientDescentOptimizerv4Component" }, { keys::InternalComputationValueType, PodString<InternalComputationValueType>::Get() } };
return { { keys::NameOfClass, "ItkGradientDescentOptimizerv4Component" }, { keys::InternalComputationValueType, PodString< InternalComputationValueType >::Get() } };
}
};
} //end namespace selx
......
......@@ -61,7 +61,7 @@ ItkGradientDescentOptimizerv4Component< InternalComputationValueType >
meetsCriteria = true;
for( auto const & criterionValue : criterion.second ) // auto&& preferred?
{
if (criterionValue != PodString<InternalComputationValueType>::Get()) // e.g. "GradientDescent", "SupportsSparseSamples
if( criterionValue != PodString< InternalComputationValueType >::Get() ) // e.g. "GradientDescent", "SupportsSparseSamples
{
meetsCriteria = false;
}
......
......@@ -33,7 +33,7 @@
namespace selx
{
template< int Dimensionality, class PixelType, class InternalComputationValueType>
template< int Dimensionality, class PixelType, class InternalComputationValueType >
class ItkImageRegistrationMethodv4Component :
public SuperElastixComponent<
Accepting< itkImageFixedInterface< Dimensionality, PixelType >,
......@@ -59,28 +59,28 @@ public:
// Get the type definitions from the interfaces
using FixedImageType = typename itkImageFixedInterface< Dimensionality, PixelType >::ItkImageType;
using MovingImageType = typename itkImageMovingInterface< Dimensionality, PixelType >::ItkImageType;
using TransformType = typename itkTransformInterface< InternalComputationValueType, Dimensionality >::TransformType;
using FixedImageType = typename itkImageFixedInterface< Dimensionality, PixelType >::ItkImageType;
using MovingImageType = typename itkImageMovingInterface< Dimensionality, PixelType >::ItkImageType;
using TransformType = typename itkTransformInterface< InternalComputationValueType, Dimensionality >::TransformType;
using TransformPointer = typename itkTransformInterface< InternalComputationValueType, Dimensionality >::TransformPointer;
using TransformParametersAdaptorsContainerInterfaceType
= itkTransformParametersAdaptorsContainerInterface< InternalComputationValueType, Dimensionality >;
typedef itk::ImageRegistrationMethodv4< FixedImageType, MovingImageType, TransformType > TheItkFilterType;
typedef typename TheItkFilterType::ImageMetricType ImageMetricType;
typedef itk::RegistrationParameterScalesFromPhysicalShift< ImageMetricType > ScalesEstimatorType;
typedef itk::ImageRegistrationMethodv4< FixedImageType, MovingImageType, TransformType > TheItkFilterType;
typedef typename TheItkFilterType::ImageMetricType ImageMetricType;
typedef itk::RegistrationParameterScalesFromPhysicalShift< ImageMetricType > ScalesEstimatorType;
//Accepting Interfaces:
virtual int Set(itkImageFixedInterface< Dimensionality, PixelType > *) override;
virtual int Set( itkImageFixedInterface< Dimensionality, PixelType > * ) override;
virtual int Set(itkImageMovingInterface< Dimensionality, PixelType > *) override;
virtual int Set( itkImageMovingInterface< Dimensionality, PixelType > * ) override;
virtual int Set( itkTransformInterface< InternalComputationValueType, Dimensionality > * ) override;
virtual int Set( TransformParametersAdaptorsContainerInterfaceType * ) override;
virtual int Set(itkMetricv4Interface< Dimensionality, PixelType, InternalComputationValueType > *) override;
virtual int Set( itkMetricv4Interface< Dimensionality, PixelType, InternalComputationValueType > * ) override;
virtual int Set( itkOptimizerv4Interface< InternalComputationValueType > * ) override;
......@@ -107,13 +107,11 @@ private:
protected:
// return the class name and the template arguments to uniquely identify this component.
static inline const std::map<std::string, std::string> TemplateProperties()
static inline const std::map< std::string, std::string > TemplateProperties()
{
return{ { keys::NameOfClass, "ItkImageRegistrationMethodv4Component" }, { keys::PixelType, PodString<PixelType>::Get() }, { keys::InternalComputationValueType, PodString<InternalComputationValueType>::Get() }, { keys::Dimensionality, std::to_string(Dimensionality) } };
return { { keys::NameOfClass, "ItkImageRegistrationMethodv4Component" }, { keys::PixelType, PodString< PixelType >::Get() }, { keys::InternalComputationValueType, PodString< InternalComputationValueType >::Get() }, { keys::Dimensionality, std::to_string( Dimensionality ) } };
}
};
} //end namespace selx
#ifndef ITK_MANUAL_INSTANTIATION
#include "selxItkImageRegistrationMethodv4Component.hxx"
......
......@@ -61,7 +61,7 @@ public:
typename TFilter::ShrinkFactorsPerDimensionContainerType shrinkFactors = filter->GetShrinkFactorsPerDimension( currentLevel );
typename TFilter::SmoothingSigmasArrayType smoothingSigmas = filter->GetSmoothingSigmasPerLevel();
typename TFilter::TransformParametersAdaptorsContainerType adaptors = filter->GetTransformParametersAdaptorsPerLevel();
// TODO optimizer is can be ObjectToObjectOptimizerBaseTemplate<double> or ObjectToObjectOptimizerBaseTemplate<float>
// dynamic cast will fail on <float>, since GradientDescentOptimizerv4Type is by default <double>
auto * optimizerBase = filter->GetOptimizer();
......@@ -117,7 +117,8 @@ public:
};
template< int Dimensionality, class TPixel, class InternalComputationValueType >
ItkImageRegistrationMethodv4Component< Dimensionality, TPixel, InternalComputationValueType >::ItkImageRegistrationMethodv4Component() : m_TransformAdaptorsContainerInterface(
ItkImageRegistrationMethodv4Component< Dimensionality, TPixel,
InternalComputationValueType >::ItkImageRegistrationMethodv4Component() : m_TransformAdaptorsContainerInterface(
nullptr )
{
m_theItkFilter = TheItkFilterType::New();
......@@ -161,7 +162,8 @@ ItkImageRegistrationMethodv4Component< Dimensionality, TPixel, InternalComputati
template< int Dimensionality, class TPixel, class InternalComputationValueType >
int
ItkImageRegistrationMethodv4Component< Dimensionality, TPixel, InternalComputationValueType >::Set( itkTransformInterface< InternalComputationValueType,
ItkImageRegistrationMethodv4Component< Dimensionality, TPixel, InternalComputationValueType >::Set(
itkTransformInterface< InternalComputationValueType,
Dimensionality > * component )
{
this->m_theItkFilter->SetInitialTransform( component->GetItkTransform() );
......@@ -172,7 +174,8 @@ ItkImageRegistrationMethodv4Component< Dimensionality, TPixel, InternalComputati
template< int Dimensionality, class TPixel, class InternalComputationValueType >
int
ItkImageRegistrationMethodv4Component< Dimensionality, TPixel, InternalComputationValueType >::Set( TransformParametersAdaptorsContainerInterfaceType * component )
ItkImageRegistrationMethodv4Component< Dimensionality, TPixel, InternalComputationValueType >::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;
......@@ -182,7 +185,8 @@ ItkImageRegistrationMethodv4Component< Dimensionality, TPixel, InternalComputati
template< int Dimensionality, class TPixel, class InternalComputationValueType >
int
ItkImageRegistrationMethodv4Component< Dimensionality, TPixel, InternalComputationValueType >::Set(itkMetricv4Interface< Dimensionality, TPixel, InternalComputationValueType > * component)
ItkImageRegistrationMethodv4Component< Dimensionality, TPixel, InternalComputationValueType >::Set( itkMetricv4Interface< Dimensionality, TPixel,
InternalComputationValueType > * component )
{
//TODO: The optimizer must be set explicitly, since this is a work-around for a bug in itkRegistrationMethodv4.
//TODO: report bug to itk: when setting a metric, the optimizer must be set explicitly as well, since default optimizer setup breaks.
......@@ -194,7 +198,8 @@ ItkImageRegistrationMethodv4Component< Dimensionality, TPixel, InternalComputati
template< int Dimensionality, class TPixel, class InternalComputationValueType >
int
ItkImageRegistrationMethodv4Component< Dimensionality, TPixel, InternalComputationValueType >::Set(itkOptimizerv4Interface< InternalComputationValueType > * component)
ItkImageRegistrationMethodv4Component< Dimensionality, TPixel, InternalComputationValueType >::Set(
itkOptimizerv4Interface< InternalComputationValueType > * component )
{
//TODO: The optimizer must be set explicitly, since this is a work-around for a bug in itkRegistrationMethodv4.
//TODO: report bug to itk: when setting a metric, the optimizer must be set explicitly as well, since default optimizer setup breaks.
......@@ -245,8 +250,8 @@ ItkImageRegistrationMethodv4Component< Dimensionality, TPixel, InternalComputati
if( this->m_TransformAdaptorsContainerInterface != nullptr )
{
auto adaptors = this->m_TransformAdaptorsContainerInterface->GetItkTransformParametersAdaptorsContainer();
this->m_theItkFilter->SetTransformParametersAdaptorsPerLevel( adaptors
);
this->m_theItkFilter->SetTransformParametersAdaptorsPerLevel( adaptors
);
}
typedef CommandIterationUpdate< TheItkFilterType > RegistrationCommandType;
......@@ -270,17 +275,17 @@ ItkImageRegistrationMethodv4Component< Dimensionality, TPixel, InternalComputati
template< int Dimensionality, class TPixel, class InternalComputationValueType >
bool
ItkImageRegistrationMethodv4Component< Dimensionality, TPixel, InternalComputationValueType >
::MeetsCriterion(const ComponentBase::CriterionType & criterion)
::MeetsCriterion( const ComponentBase::CriterionType & criterion )
{
bool hasUndefinedCriteria(false);
bool meetsCriteria(false);
bool hasUndefinedCriteria( false );
bool meetsCriteria( false );
auto status = CheckTemplateProperties(this->TemplateProperties(), criterion);
if (status == CriterionStatus::Satisfied)
auto status = CheckTemplateProperties( this->TemplateProperties(), criterion );
if( status == CriterionStatus::Satisfied )
{
return true;
}
else if (status == CriterionStatus::Failed)
else if( status == CriterionStatus::Failed )
{
return false;
} // else: CriterionStatus::Unknown
......
......@@ -27,7 +27,7 @@
#include "selxMacro.h"
namespace selx
{
template< int Dimensionality, class TPixel, class InternalComputationValueType >
template< int Dimensionality, class TPixel, class InternalComputationValueType >
class ItkMeanSquaresImageToImageMetricv4Component :
public SuperElastixComponent<
Accepting< >,
......@@ -53,7 +53,8 @@ public:
typedef typename itk::ImageToImageMetricv4< FixedImageType, MovingImageType > ImageToImageMetricv4Type;
typedef typename ImageToImageMetricv4Type::Pointer ItkMetricv4Pointer;
typedef typename itk::MeanSquaresImageToImageMetricv4< FixedImageType, MovingImageType, VirtualImageType, InternalComputationValueType > TheItkFilterType;
typedef typename itk::MeanSquaresImageToImageMetricv4< FixedImageType, MovingImageType, VirtualImageType,
InternalComputationValueType > TheItkFilterType;
virtual ItkMetricv4Pointer GetItkMetricv4() override;
......@@ -69,12 +70,13 @@ private:
protected:
// return the class name and the template arguments to uniquely identify this component.
static inline const std::map<std::string, std::string> TemplateProperties()
static inline const std::map< std::string, std::string > TemplateProperties()
{
return{ { keys::NameOfClass, "ItkMeanSquaresImageToImageMetricv4Component" }, { keys::PixelType, PodString<TPixel>::Get() }, { keys::Dimensionality, std::to_string(Dimensionality) }, { keys::InternalComputationValueType, PodString<InternalComputationValueType>::Get() } };
return { { keys::NameOfClass, "ItkMeanSquaresImageToImageMetricv4Component" }, { keys::PixelType, PodString< TPixel >::Get() },
{ keys::Dimensionality, std::to_string( Dimensionality ) },
{ keys::InternalComputationValueType, PodString< InternalComputationValueType >::Get() } };
}
};
} //end namespace selx
#ifndef ITK_MANUAL_INSTANTIATION
#include "selxItkMeanSquaresImageToImageMetricv4.hxx"
......
......@@ -22,8 +22,8 @@
namespace selx
{
template< int Dimensionality, class TPixel, class InternalComputationValueType >
ItkMeanSquaresImageToImageMetricv4Component< Dimensionality, TPixel, InternalComputationValueType >::ItkMeanSquaresImageToImageMetricv4Component()
template< int Dimensionality, class TPixel, class InternalComputationValueType >
ItkMeanSquaresImageToImageMetricv4Component< Dimensionality, TPixel, InternalComputationValueType >::ItkMeanSquaresImageToImageMetricv4Component()
{
m_theItkFilter = TheItkFilterType::New();
......@@ -53,12 +53,12 @@ ItkMeanSquaresImageToImageMetricv4Component< Dimensionality, TPixel, InternalCom
{
bool hasUndefinedCriteria( false );
bool meetsCriteria( false );
auto status = CheckTemplateProperties(this->TemplateProperties(), criterion);
if (status == CriterionStatus::Satisfied)
auto status = CheckTemplateProperties( this->TemplateProperties(), criterion );
if( status == CriterionStatus::Satisfied )
{
return true;
}
else if (status == CriterionStatus::Failed)
else if( status == CriterionStatus::Failed )
{
return false;
} // else: CriterionStatus::Unknown
......
......@@ -91,12 +91,11 @@ private:
protected:
// return the class name and the template arguments to uniquely identify this component.
static inline const std::map<std::string, std::string> TemplateProperties()
static inline const std::map< std::string, std::string > TemplateProperties()
{
return{ { keys::NameOfClass, "ItkResampleFilterComponent" }, { keys::PixelType, PodString<TPixel>::Get() }, { keys::InternalComputationValueType, PodString<TInternalComputationValue>::Get() }, { keys::Dimensionality, std::to_string(Dimensionality) } };
return { { keys::NameOfClass, "ItkResampleFilterComponent" }, { keys::PixelType, PodString< TPixel >::Get() }, { keys::InternalComputationValueType, PodString< TInternalComputationValue >::Get() }, { keys::Dimensionality, std::to_string( Dimensionality ) } };
}
};
} //end namespace selx
#ifndef ITK_MANUAL_INSTANTIATION
#include "selxItkResampleFilter.hxx"
......
......@@ -110,12 +110,12 @@ ItkResampleFilterComponent< Dimensionality, TPixel, TInternalComputationValue >
{
bool hasUndefinedCriteria( false );
bool meetsCriteria( false );
auto status = CheckTemplateProperties(this->TemplateProperties(), criterion);
if (status == CriterionStatus::Satisfied)
auto status = CheckTemplateProperties( this->TemplateProperties(), criterion );
if( status == CriterionStatus::Satisfied )
{
return true;
}
else if (status == CriterionStatus::Failed)
else if( status == CriterionStatus::Failed )
{
return false;
} // else: CriterionStatus::Unknown
......
......@@ -87,12 +87,11 @@ private:
protected:
// return the class name and the template arguments to uniquely identify this component.
static inline const std::map<std::string, std::string> TemplateProperties()
static inline const std::map< std::string, std::string > TemplateProperties()
{
return{ { keys::NameOfClass, "ItkTransformDisplacementFilterComponent" }, { keys::PixelType, PodString<TPixel>::Get() }, { keys::InternalComputationValueType, PodString<TInternalComputationValue>::Get() }, { keys::Dimensionality, std::to_string(Dimensionality) } };
return { { keys::NameOfClass, "ItkTransformDisplacementFilterComponent" }, { keys::PixelType, PodString< TPixel >::Get() }, { keys::InternalComputationValueType, PodString< TInternalComputationValue >::Get() }, { keys::Dimensionality, std::to_string( Dimensionality ) } };
}
};
} //end namespace selx
#ifndef ITK_MANUAL_INSTANTIATION
#include "selxItkTransformDisplacementFilter.hxx"
......
......@@ -98,12 +98,12 @@ ItkTransformDisplacementFilterComponent< Dimensionality, TPixel, TInternalComput
{
bool hasUndefinedCriteria( false );
bool meetsCriteria( false );
auto status = CheckTemplateProperties(this->TemplateProperties(), criterion);
if (status == CriterionStatus::Satisfied)
auto status = CheckTemplateProperties( this->TemplateProperties(), criterion );
if( status == CriterionStatus::Satisfied )
{
return true;
}
else if (status == CriterionStatus::Failed)
else if( status == CriterionStatus::Failed )
{
return false;
} // else: CriterionStatus::Unknown
......
......@@ -92,7 +92,7 @@ public:
ItkANTSNeighborhoodCorrelationImageToImageMetricv4Component< 3, double >,
ItkMeanSquaresImageToImageMetricv4Component< 3, double, double >,
ItkANTSNeighborhoodCorrelationImageToImageMetricv4Component< 2, float >,
ItkMeanSquaresImageToImageMetricv4Component< 2, float,double >,
ItkMeanSquaresImageToImageMetricv4Component< 2, float, double >,
ItkGradientDescentOptimizerv4Component< double >,
ItkAffineTransformComponent< double, 3 >,
ItkGaussianExponentialDiffeomorphicTransformComponent< double, 3 >,
......
......@@ -75,7 +75,7 @@ public:
virtual int Set( itkImageMovingInterface< Dimensionality, TPixel > * ) override;
virtual int Set(itkMetricv4Interface< Dimensionality, TPixel, double > *) override;
virtual int Set( itkMetricv4Interface< Dimensionality, TPixel, double > * ) override;
//Providing Interfaces:
virtual TransformPointer GetItkTransform() override;
......
......@@ -70,7 +70,7 @@ ItkSyNImageRegistrationMethodComponent< Dimensionality, TPixel >
template< int Dimensionality, class TPixel >
int
ItkSyNImageRegistrationMethodComponent< Dimensionality, TPixel >::Set(itkMetricv4Interface< Dimensionality, TPixel, double > * component)
ItkSyNImageRegistrationMethodComponent< Dimensionality, TPixel >::Set( itkMetricv4Interface< Dimensionality, TPixel, double > * component )
{
this->m_theItkFilter->SetMetric( component->GetItkMetricv4() );
......
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