Commit 16a26651 authored by Kasper Marstal's avatar Kasper Marstal
Browse files

BUG: Fix clang build

- Declare SuperElastixComponents with template parameters
- Explicitly set CXX standard to 14
- Various small fixes that looks like leftovers from previous merge
parent 40e0018c
......@@ -45,18 +45,15 @@ public:
typedef Blueprint::ParameterValueType ParameterValueType;
typedef Blueprint::ParameterMapType ParameterMapType;
typedef std::unique_ptr< Blueprint > BlueprintPointerType;
using PathType = boost::filesystem::path;
using PathType = boost::filesystem::path;
using PathsType = std::list<PathType>;
static BlueprintPointerType FromFile(const PathType & filename);
private:
typedef boost::property_tree::ptree PropertyTreeType;
typedef const boost::property_tree::ptree & ComponentOrConnectionTreeType;
using PathType = boost::filesystem::path;
using PathsType = std::list<PathType>;
static PropertyTreeType ReadPropertyTree(const PathType & filename);
......
......@@ -26,10 +26,6 @@ cmake_minimum_required( VERSION 3.0.2 )
# ---------------------------------------------------------------------
project( SuperElastix )
enable_language( C )
enable_language( CXX )
set( CMAKE_CXX_STANDARD 11 )
# Place executables in the bin directory
set( CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin" )
......@@ -45,9 +41,9 @@ list( APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/CMake" )
# -----------------------------------------------------------------
# Compilation settings
enable_language(C)
enable_language(CXX)
set( CMAKE_CXX_STANDARD 11 )
enable_language( CXX )
set( CMAKE_CXX_STANDARD 14 )
set( CMAKE_CXX_STANDARD_REQUIRED on )
mark_as_advanced( SUPERELASTIX_BUILD_SHARED_LIBS )
option( SUPERELASTIX_BUILD_SHARED_LIBS "Build SuperElastix with shared libraries." OFF )
......
......@@ -104,9 +104,6 @@ TEST_F( ComponentSelectorTest, SetSufficientCriteria )
ComponentType::Pointer component;
EXPECT_NO_THROW( component = componentSelector->GetComponent() );
//Sufficient criteria means one Component was selected."
EXPECT_TRUE( component );
//Based on the criteria MetricComponent1 should be selected
EXPECT_TRUE( component->MeetsCriterion( { "NameOfClass", { "MetricComponent1" } } ) );
}
......@@ -131,7 +128,7 @@ TEST_F( ComponentSelectorTest, AddCriteria )
//Sufficient criteria means one Component was selected."
EXPECT_FALSE( componentSelector->NumberOfComponents() > 1 );
EXPECT_TRUE( component );
//Based on the criteria TransformComponent1 should be selected
EXPECT_TRUE( component->MeetsCriterion( { "NameOfClass", { "TransformComponent1" } } ) );
}
......
......@@ -36,21 +36,32 @@ namespace selx
template< int Dimensionality, class TPixel >
class ElastixComponent :
public SuperElastixComponent<
Accepting<
itkImageFixedInterface< Dimensionality, TPixel >,
itkImageMovingInterface< Dimensionality, TPixel >
>,
Providing<
itkImageInterface< Dimensionality, TPixel >,
RunRegistrationInterface
>
Accepting<
itkImageFixedInterface< Dimensionality, TPixel >,
itkImageMovingInterface< Dimensionality, TPixel >
>,
Providing<
itkImageInterface< Dimensionality, TPixel >,
RunRegistrationInterface
>
>
{
public:
/** Standard ITK typedefs. */
typedef ElastixComponent Self;
typedef ComponentBase Superclass;
typedef ElastixComponent<
Dimensionality, TPixel
> Self;
typedef SuperElastixComponent<
Accepting<
itkImageFixedInterface< Dimensionality, TPixel >,
itkImageMovingInterface< Dimensionality, TPixel >
>,
Providing<
itkImageInterface< Dimensionality, TPixel >,
RunRegistrationInterface
>
> Superclass;
typedef std::shared_ptr< Self > Pointer;
typedef std::shared_ptr< const Self > ConstPointer;
......
......@@ -23,7 +23,7 @@
namespace selx
{
template< int Dimensionality, class TPixel >
ElastixComponent< Dimensionality, TPixel >::ElastixComponent( const std::string & name ) : SuperElastixComponent( name )
ElastixComponent< Dimensionality, TPixel >::ElastixComponent( const std::string & name ) : Superclass( name )
{
m_elastixFilter = ElastixFilterType::New();
m_transformixFilter = TransformixFilterType::New();
......
......@@ -36,22 +36,34 @@ namespace selx
template< int Dimensionality, class TPixel >
class MonolithicElastixComponent :
public SuperElastixComponent<
Accepting<
itkImageFixedInterface< Dimensionality, TPixel >,
itkImageMovingInterface< Dimensionality, TPixel >
>,
Providing<
elastixTransformParameterObjectInterface< itk::Image< TPixel, Dimensionality >, itk::Image< TPixel, Dimensionality >>,
itkImageInterface< Dimensionality, TPixel >,
RunRegistrationInterface
>
Accepting<
itkImageFixedInterface< Dimensionality, TPixel >,
itkImageMovingInterface< Dimensionality, TPixel >
>,
Providing<
elastixTransformParameterObjectInterface< itk::Image< TPixel, Dimensionality >, itk::Image< TPixel, Dimensionality >>,
itkImageInterface< Dimensionality, TPixel >,
RunRegistrationInterface
>
>
{
public:
/** Standard ITK typedefs. */
typedef MonolithicElastixComponent Self;
typedef ComponentBase Superclass;
typedef MonolithicElastixComponent<
Dimensionality, TPixel
> Self;
typedef SuperElastixComponent<
Accepting<
itkImageFixedInterface< Dimensionality, TPixel >,
itkImageMovingInterface< Dimensionality, TPixel >
>,
Providing<
elastixTransformParameterObjectInterface< itk::Image< TPixel, Dimensionality >, itk::Image< TPixel, Dimensionality >>,
itkImageInterface< Dimensionality, TPixel >,
RunRegistrationInterface
>
> Superclass;
typedef std::shared_ptr< Self > Pointer;
typedef std::shared_ptr< const Self > ConstPointer;
......
......@@ -23,7 +23,7 @@
namespace selx
{
template< int Dimensionality, class TPixel >
MonolithicElastixComponent< Dimensionality, TPixel >::MonolithicElastixComponent( const std::string & name ) : SuperElastixComponent( name )
MonolithicElastixComponent< Dimensionality, TPixel >::MonolithicElastixComponent( const std::string & name ) : Superclass( name )
{
m_elastixFilter = ElastixFilterType::New();
......
......@@ -37,22 +37,34 @@ namespace selx
template< int Dimensionality, class TPixel >
class MonolithicTransformixComponent :
public SuperElastixComponent<
Accepting<
itkImageDomainFixedInterface< Dimensionality >,
itkImageMovingInterface< Dimensionality, TPixel >,
elastixTransformParameterObjectInterface< itk::Image< TPixel, Dimensionality >, itk::Image< TPixel, Dimensionality >>
>,
Providing<
itkImageInterface< Dimensionality, TPixel >,
ReconnectTransformInterface
>
Accepting<
itkImageDomainFixedInterface< Dimensionality >,
itkImageMovingInterface< Dimensionality, TPixel >,
elastixTransformParameterObjectInterface< itk::Image< TPixel, Dimensionality >, itk::Image< TPixel, Dimensionality >>
>,
Providing<
itkImageInterface< Dimensionality, TPixel >,
ReconnectTransformInterface
>
>
{
public:
/** Standard ITK typedefs. */
typedef MonolithicTransformixComponent Self;
typedef ComponentBase Superclass;
typedef MonolithicTransformixComponent<
Dimensionality, TPixel
> Self;
typedef SuperElastixComponent<
Accepting<
itkImageDomainFixedInterface< Dimensionality >,
itkImageMovingInterface< Dimensionality, TPixel >,
elastixTransformParameterObjectInterface< itk::Image< TPixel, Dimensionality >, itk::Image< TPixel, Dimensionality >>
>,
Providing<
itkImageInterface< Dimensionality, TPixel >,
ReconnectTransformInterface
>
> Superclass;
typedef std::shared_ptr< Self > Pointer;
typedef std::shared_ptr< const Self > ConstPointer;
......
......@@ -24,7 +24,7 @@
namespace selx
{
template< int Dimensionality, class TPixel >
MonolithicTransformixComponent< Dimensionality, TPixel >::MonolithicTransformixComponent( const std::string & name ) : SuperElastixComponent( name )
MonolithicTransformixComponent< Dimensionality, TPixel >::MonolithicTransformixComponent( const std::string & name ) : Superclass( name )
{
m_transformixFilter = TransformixFilterType::New();
......
......@@ -34,17 +34,23 @@ namespace selx
template< int Dimensionality, class TPixel >
class ItkSmoothingRecursiveGaussianImageFilterComponent :
public SuperElastixComponent<
Accepting< itkImageInterface< Dimensionality, TPixel >>,
Providing< itkImageInterface< Dimensionality, TPixel >>
Accepting< itkImageInterface< Dimensionality, TPixel >>,
Providing< itkImageInterface< Dimensionality, TPixel >>
>
{
public:
/** Standard ITK typedefs. */
typedef ItkSmoothingRecursiveGaussianImageFilterComponent Self;
typedef ComponentBase Superclass;
typedef std::shared_ptr< Self > Pointer;
typedef std::shared_ptr< const Self > ConstPointer;
/** Standard typedefs. */
typedef ItkSmoothingRecursiveGaussianImageFilterComponent<
Dimensionality, TPixel
> Self;
typedef SuperElastixComponent<
Accepting< itkImageInterface< Dimensionality, TPixel >>,
Providing< itkImageInterface< Dimensionality, TPixel >>
> SuperClass;
typedef std::shared_ptr< Self > Pointer;
typedef std::shared_ptr< const Self > ConstPointer;
ItkSmoothingRecursiveGaussianImageFilterComponent( const std::string & name );
virtual ~ItkSmoothingRecursiveGaussianImageFilterComponent();
......
......@@ -24,7 +24,7 @@ namespace selx
{
template< int Dimensionality, class TPixel >
ItkSmoothingRecursiveGaussianImageFilterComponent< Dimensionality, TPixel >::ItkSmoothingRecursiveGaussianImageFilterComponent(
const std::string & name ) : SuperElastixComponent( name )
const std::string & name ) : SuperClass( name )
{
m_theItkFilter = TheItkFilterType::New();
}
......
......@@ -33,15 +33,18 @@ namespace selx
template< class TPixel >
class NiftyregReadImageComponent :
public SuperElastixComponent<
Accepting< >,
Providing< NiftyregReferenceImageInterface< TPixel >, NiftyregFloatingImageInterface< TPixel >>
Accepting< >,
Providing< NiftyregReferenceImageInterface< TPixel >, NiftyregFloatingImageInterface< TPixel >>
>
{
public:
/** Standard ITK typedefs. */
typedef NiftyregReadImageComponent< TPixel > Self;
typedef ComponentBase Superclass;
typedef SuperElastixComponent<
Accepting< >,
Providing< NiftyregReferenceImageInterface< TPixel >, NiftyregFloatingImageInterface< TPixel >>
> Superclass;
typedef std::shared_ptr< Self > Pointer;
typedef std::shared_ptr< const Self > ConstPointer;
......
......@@ -23,7 +23,7 @@
namespace selx
{
template< class TPixel >
NiftyregReadImageComponent< TPixel >::NiftyregReadImageComponent( const std::string & name ) : SuperElastixComponent( name )
NiftyregReadImageComponent< TPixel >::NiftyregReadImageComponent( const std::string & name ) : Superclass( name )
{
}
......
......@@ -31,15 +31,18 @@ namespace selx
template< class TPixel >
class Niftyregf3dComponent :
public SuperElastixComponent<
Accepting< NiftyregReferenceImageInterface< TPixel >, NiftyregFloatingImageInterface< TPixel >>,
Providing< RunRegistrationInterface >
Accepting< NiftyregReferenceImageInterface< TPixel >, NiftyregFloatingImageInterface< TPixel >>,
Providing< RunRegistrationInterface >
>
{
public:
/** Standard ITK typedefs. */
typedef Niftyregf3dComponent< TPixel > Self;
typedef ComponentBase Superclass;
typedef SuperElastixComponent<
Accepting< NiftyregReferenceImageInterface< TPixel >, NiftyregFloatingImageInterface< TPixel >>,
Providing< RunRegistrationInterface >
> Superclass;
typedef std::shared_ptr< Self > Pointer;
typedef std::shared_ptr< const Self > ConstPointer;
......
......@@ -23,7 +23,7 @@
namespace selx
{
template< class TPixel >
Niftyregf3dComponent< TPixel >::Niftyregf3dComponent( const std::string & name ) : SuperElastixComponent( name )
Niftyregf3dComponent< TPixel >::Niftyregf3dComponent( const std::string & name ) : Superclass( name )
{
m_reg_f3d = new reg_f3d< TPixel >( 1, 1 );
}
......
......@@ -34,17 +34,22 @@ namespace selx
template< int Dimensionality, class TPixel >
class DisplacementFieldItkImageFilterSinkComponent :
public SuperElastixComponent<
Accepting< DisplacementFieldItkImageSourceInterface< Dimensionality, TPixel >>,
Providing< SinkInterface >
Accepting< DisplacementFieldItkImageSourceInterface< Dimensionality, TPixel >>,
Providing< SinkInterface >
>
{
public:
/** Standard ITK typedefs. */
typedef DisplacementFieldItkImageFilterSinkComponent Self;
typedef ComponentBase Superclass;
typedef std::shared_ptr< Self > Pointer;
typedef std::shared_ptr< const Self > ConstPointer;
typedef DisplacementFieldItkImageFilterSinkComponent<
Dimensionality, TPixel
> Self;
typedef SuperElastixComponent<
Accepting< DisplacementFieldItkImageSourceInterface< Dimensionality, TPixel >>,
Providing< SinkInterface >
> Superclass;
typedef std::shared_ptr< Self > Pointer;
typedef std::shared_ptr< const Self > ConstPointer;
DisplacementFieldItkImageFilterSinkComponent( const std::string & name );
virtual ~DisplacementFieldItkImageFilterSinkComponent();
......
......@@ -24,7 +24,7 @@ namespace selx
{
template< int Dimensionality, class TPixel >
DisplacementFieldItkImageFilterSinkComponent< Dimensionality, TPixel >::DisplacementFieldItkImageFilterSinkComponent( const std::string & name ) :
SuperElastixComponent( name ), m_MiniPipelineOutputImage( nullptr ), m_NetworkBuilderOutputImage( nullptr )
Superclass( name ), m_MiniPipelineOutputImage( nullptr ), m_NetworkBuilderOutputImage( nullptr )
{
}
......
......@@ -35,15 +35,20 @@ namespace selx
template< int Dimensionality, class TPixel >
class ItkImageSinkComponent :
public SuperElastixComponent<
Accepting< itkImageInterface< Dimensionality, TPixel >>,
Providing< SinkInterface >
Accepting< itkImageInterface< Dimensionality, TPixel >>,
Providing< SinkInterface >
>
{
public:
/** Standard ITK typedefs. */
typedef ItkImageSinkComponent Self;
typedef ComponentBase Superclass;
typedef ItkImageSinkComponent<
Dimensionality, TPixel
> Self;
typedef SuperElastixComponent<
Accepting< itkImageInterface< Dimensionality, TPixel >>,
Providing< SinkInterface >
> Superclass;
typedef std::shared_ptr< Self > Pointer;
typedef std::shared_ptr< const Self > ConstPointer;
......
......@@ -23,7 +23,7 @@
namespace selx
{
template< int Dimensionality, class TPixel >
ItkImageSinkComponent< Dimensionality, TPixel >::ItkImageSinkComponent( const std::string & name ) : SuperElastixComponent( name ),
ItkImageSinkComponent< Dimensionality, TPixel >::ItkImageSinkComponent( const std::string & name ) : Superclass( name ),
m_MiniPipelineOutputImage( nullptr ), m_NetworkBuilderOutputImage( nullptr )
{
}
......
......@@ -33,17 +33,22 @@ namespace selx
template< int Dimensionality, class TPixel >
class ItkImageSourceComponent :
public SuperElastixComponent<
Accepting< >,
Providing< SourceInterface, itkImageInterface< Dimensionality, TPixel >>
Accepting< >,
Providing< SourceInterface, itkImageInterface< Dimensionality, TPixel >>
>
{
public:
/** Standard ITK typedefs. */
typedef ItkImageSourceComponent< Dimensionality, TPixel > Self;
typedef ComponentBase Superclass;
typedef std::shared_ptr< Self > Pointer;
typedef std::shared_ptr< const Self > ConstPointer;
typedef ItkImageSourceComponent<
Dimensionality, TPixel
> Self;
typedef SuperElastixComponent<
Accepting< >,
Providing< SourceInterface, itkImageInterface< Dimensionality, TPixel >>
> Superclass;
typedef std::shared_ptr< Self > Pointer;
typedef std::shared_ptr< const Self > ConstPointer;
ItkImageSourceComponent( const std::string & name );
virtual ~ItkImageSourceComponent();
......
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