Commit 19b23a09 authored by Kasper Marstal's avatar Kasper Marstal
Browse files

Merge branch 'develop' of https://github.com/kaspermarstal/SuperElastix into develop

parents 23f85669 70217591
......@@ -18,7 +18,6 @@ public:
typedef Overlord::Pointer OverlordPointerType;
typedef Blueprint::Pointer BlueprintPointerType;
typedef Blueprint::ConstPointer BlueprintConstPointerType;
typedef Blueprint::ComponentIndexType ComponentIndexType;
typedef Blueprint::ParameterMapType ParameterMapType;
typedef Blueprint::ParameterValueType ParameterValueType;
typedef DataManager DataManagerType;
......@@ -54,36 +53,35 @@ TEST_F(ElastixComponentTest, ImagesOnly)
ParameterMapType component0Parameters;
component0Parameters["NameOfClass"] = { "ElastixComponent" };
component0Parameters["RegistrationSettings"] = { "rigid" };
ComponentIndexType index0 = blueprint->AddComponent(component0Parameters);
blueprint->AddComponent("RegistrationMethod", component0Parameters);
ParameterMapType component1Parameters;
component1Parameters["NameOfClass"] = { "ItkImageSourceFixedComponent" };
component1Parameters["Dimensionality"] = { "2" }; // should be derived from the inputs
ComponentIndexType index1 = blueprint->AddComponent(component1Parameters);
blueprint->AddComponent("FixedImageSource", component1Parameters);
ParameterMapType component2Parameters;
component2Parameters["NameOfClass"] = { "ItkImageSourceMovingComponent" };
component2Parameters["Dimensionality"] = { "2" }; // should be derived from the inputs
ComponentIndexType index2 = blueprint->AddComponent(component2Parameters);
blueprint->AddComponent("MovingImageSource", component2Parameters);
ParameterMapType component3Parameters;
component3Parameters["NameOfClass"] = { "ItkImageSinkComponent" };
component3Parameters["Dimensionality"] = { "2" }; // should be derived from the inputs
ComponentIndexType index3 = blueprint->AddComponent(component3Parameters);
blueprint->AddComponent("ResultImageSink", component3Parameters);
ParameterMapType connection1Parameters;
connection1Parameters["NameOfInterface"] = { "itkImageSourceFixedInterface" };
blueprint->AddConnection(index1, index0, connection1Parameters);
blueprint->AddConnection("FixedImageSource", "RegistrationMethod", connection1Parameters);
ParameterMapType connection2Parameters;
connection2Parameters["NameOfInterface"] = { "itkImageSourceMovingInterface" };
blueprint->AddConnection(index2, index0, connection2Parameters);
blueprint->AddConnection("MovingImageSource", "RegistrationMethod", connection2Parameters);
ParameterMapType connection3Parameters;
connection3Parameters["NameOfInterface"] = { "GetItkImageInterface" };
blueprint->AddConnection(index0, index3, connection3Parameters);
blueprint->AddConnection("RegistrationMethod", "ResultImageSink", connection3Parameters);
EXPECT_NO_THROW(overlord = Overlord::New());
......
......@@ -30,7 +30,6 @@ public:
typedef Overlord::Pointer OverlordPointerType;
typedef Blueprint::Pointer BlueprintPointerType;
typedef Blueprint::ConstPointer BlueprintConstPointerType;
typedef Blueprint::ComponentIndexType ComponentIndexType;
typedef Blueprint::ParameterMapType ParameterMapType;
typedef Blueprint::ParameterValueType ParameterValueType;
typedef DataManager DataManagerType;
......@@ -94,35 +93,35 @@ TEST_F(RegistrationItkv4Test, ImagesOnly)
ParameterMapType component0Parameters;
component0Parameters["NameOfClass"] = { "ItkImageRegistrationMethodv4Component" };
component0Parameters["Dimensionality"] = { "3" }; // should be derived from the inputs
ComponentIndexType index0 = blueprint->AddComponent(component0Parameters);
blueprint->AddComponent("RegistrationMethod", component0Parameters);
ParameterMapType component1Parameters;
component1Parameters["NameOfClass"] = { "ItkImageSourceFixedComponent" };
component1Parameters["Dimensionality"] = { "3" }; // should be derived from the inputs
ComponentIndexType index1 = blueprint->AddComponent(component1Parameters);
blueprint->AddComponent("FixedImageSource", component1Parameters);
ParameterMapType component2Parameters;
component2Parameters["NameOfClass"] = { "ItkImageSourceMovingComponent" };
component2Parameters["Dimensionality"] = { "3" }; // should be derived from the inputs
ComponentIndexType index2 = blueprint->AddComponent(component2Parameters);
blueprint->AddComponent("MovingImageSource", component2Parameters);
ParameterMapType component3Parameters;
component3Parameters["NameOfClass"] = { "ItkImageFilterSinkComponent" };
component3Parameters["Dimensionality"] = { "3" }; // should be derived from the outputs
ComponentIndexType index3 = blueprint->AddComponent(component3Parameters);
blueprint->AddComponent("ResultImageSink", component3Parameters);
ParameterMapType connection1Parameters;
connection1Parameters["NameOfInterface"] = { "itkImageSourceFixedInterface" };
blueprint->AddConnection(index1, index0, connection1Parameters);
blueprint->AddConnection("FixedImageSource", "RegistrationMethod", connection1Parameters);
ParameterMapType connection2Parameters;
connection2Parameters["NameOfInterface"] = { "itkImageSourceMovingInterface" };
blueprint->AddConnection(index2, index0, connection2Parameters);
blueprint->AddConnection("MovingImageSource", "RegistrationMethod", connection2Parameters);
ParameterMapType connection3Parameters;
connection3Parameters["NameOfInterface"] = { "itkImageSourceInterface" };
blueprint->AddConnection(index0, index3, connection3Parameters);
blueprint->AddConnection("RegistrationMethod", "ResultImageSink", connection3Parameters);
EXPECT_NO_THROW(overlord = Overlord::New());
EXPECT_NO_THROW(overlord->SetBlueprint(blueprint));
......@@ -147,44 +146,44 @@ TEST_F(RegistrationItkv4Test, WithANTSCCMetric)
ParameterMapType component0Parameters;
component0Parameters["NameOfClass"] = { "ItkImageRegistrationMethodv4Component" };
component0Parameters["Dimensionality"] = { "3" }; // should be derived from the inputs
ComponentIndexType index0 = blueprint->AddComponent(component0Parameters);
blueprint->AddComponent("RegistrationMethod", component0Parameters);
ParameterMapType component1Parameters;
component1Parameters["NameOfClass"] = { "ItkImageSourceFixedComponent" };
component1Parameters["Dimensionality"] = { "3" }; // should be derived from the inputs
ComponentIndexType index1 = blueprint->AddComponent(component1Parameters);
blueprint->AddComponent("FixedImageSource", component1Parameters);
ParameterMapType component2Parameters;
component2Parameters["NameOfClass"] = { "ItkImageSourceMovingComponent" };
component2Parameters["Dimensionality"] = { "3" }; // should be derived from the inputs
ComponentIndexType index2 = blueprint->AddComponent(component2Parameters);
blueprint->AddComponent("MovingImageSource", component2Parameters);
ParameterMapType component3Parameters;
component3Parameters["NameOfClass"] = { "ItkImageFilterSinkComponent" };
component3Parameters["Dimensionality"] = { "3" }; // should be derived from the inputs
ComponentIndexType index3 = blueprint->AddComponent(component3Parameters);
component3Parameters["Dimensionality"] = { "3" }; // should be derived from the outputs
blueprint->AddComponent("ResultImageSink", component3Parameters);
ParameterMapType component4Parameters;
component4Parameters["NameOfClass"] = { "ItkANTSNeighborhoodCorrelationImageToImageMetricv4Component" };
component4Parameters["Dimensionality"] = { "3" }; // should be derived from the inputs
ComponentIndexType index4 = blueprint->AddComponent(component4Parameters);
blueprint->AddComponent("Metric", component4Parameters);
ParameterMapType connection1Parameters;
connection1Parameters["NameOfInterface"] = { "itkImageSourceFixedInterface" };
blueprint->AddConnection(index1, index0, connection1Parameters);
blueprint->AddConnection("FixedImageSource", "RegistrationMethod", connection1Parameters);
ParameterMapType connection2Parameters;
connection2Parameters["NameOfInterface"] = { "itkImageSourceMovingInterface" };
blueprint->AddConnection(index2, index0, connection2Parameters);
blueprint->AddConnection("MovingImageSource", "RegistrationMethod", connection2Parameters);
ParameterMapType connection3Parameters;
connection3Parameters["NameOfInterface"] = { "itkImageSourceInterface" };
blueprint->AddConnection(index0, index3, connection3Parameters);
blueprint->AddConnection("RegistrationMethod", "ResultImageSink", connection3Parameters);
ParameterMapType connection4Parameters;
connection4Parameters["NameOfInterface"] = { "itkMetricv4Interface" };
blueprint->AddConnection(index4, index0, connection4Parameters);
blueprint->AddConnection("Metric", "RegistrationMethod", connection4Parameters);
EXPECT_NO_THROW(overlord = Overlord::New());
EXPECT_NO_THROW(overlord->SetBlueprint(blueprint));
......@@ -208,44 +207,44 @@ TEST_F(RegistrationItkv4Test, WithMeanSquaresMetric)
ParameterMapType component0Parameters;
component0Parameters["NameOfClass"] = { "ItkImageRegistrationMethodv4Component" };
component0Parameters["Dimensionality"] = { "3" }; // should be derived from the inputs
ComponentIndexType index0 = blueprint->AddComponent(component0Parameters);
blueprint->AddComponent("RegistrationMethod", component0Parameters);
ParameterMapType component1Parameters;
component1Parameters["NameOfClass"] = { "ItkImageSourceFixedComponent" };
component1Parameters["Dimensionality"] = { "3" }; // should be derived from the inputs
ComponentIndexType index1 = blueprint->AddComponent(component1Parameters);
blueprint->AddComponent("FixedImageSource", component1Parameters);
ParameterMapType component2Parameters;
component2Parameters["NameOfClass"] = { "ItkImageSourceMovingComponent" };
component2Parameters["Dimensionality"] = { "3" }; // should be derived from the inputs
ComponentIndexType index2 = blueprint->AddComponent(component2Parameters);
blueprint->AddComponent("MovingImageSource", component2Parameters);
ParameterMapType component3Parameters;
component3Parameters["NameOfClass"] = { "ItkImageFilterSinkComponent" };
component3Parameters["Dimensionality"] = { "3" }; // should be derived from the inputs
ComponentIndexType index3 = blueprint->AddComponent(component3Parameters);
component3Parameters["Dimensionality"] = { "3" }; // should be derived from the outputs
blueprint->AddComponent("ResultImageSink", component3Parameters);
ParameterMapType component4Parameters;
component4Parameters["NameOfClass"] = { "ItkMeanSquaresImageToImageMetricv4Component" };
component4Parameters["Dimensionality"] = { "3" }; // should be derived from the inputs
ComponentIndexType index4 = blueprint->AddComponent(component4Parameters);
blueprint->AddComponent("Metric", component4Parameters);
ParameterMapType connection1Parameters;
connection1Parameters["NameOfInterface"] = { "itkImageSourceFixedInterface" };
blueprint->AddConnection(index1, index0, connection1Parameters);
blueprint->AddConnection("FixedImageSource", "RegistrationMethod", connection1Parameters);
ParameterMapType connection2Parameters;
connection2Parameters["NameOfInterface"] = { "itkImageSourceMovingInterface" };
blueprint->AddConnection(index2, index0, connection2Parameters);
blueprint->AddConnection("MovingImageSource", "RegistrationMethod", connection2Parameters);
ParameterMapType connection3Parameters;
connection3Parameters["NameOfInterface"] = { "itkImageSourceInterface" };
blueprint->AddConnection(index0, index3, connection3Parameters);
blueprint->AddConnection("RegistrationMethod", "ResultImageSink", connection3Parameters);
ParameterMapType connection4Parameters;
connection4Parameters["NameOfInterface"] = { "itkMetricv4Interface" };
blueprint->AddConnection(index4, index0, connection4Parameters);
blueprint->AddConnection("Metric", "RegistrationMethod", connection4Parameters);
EXPECT_NO_THROW(overlord = Overlord::New());
EXPECT_NO_THROW(overlord->SetBlueprint(blueprint));
......@@ -270,62 +269,62 @@ TEST_F(RegistrationItkv4Test, DisplacementField2D)
ParameterMapType component0Parameters;
component0Parameters["NameOfClass"] = { "ItkImageRegistrationMethodv4Component" };
component0Parameters["Dimensionality"] = { "2" }; // should be derived from the inputs
ComponentIndexType index0 = blueprint->AddComponent(component0Parameters);
blueprint->AddComponent("RegistrationMethod", component0Parameters);
ParameterMapType component1Parameters;
component1Parameters["NameOfClass"] = { "ItkImageSourceFixedComponent" };
component1Parameters["Dimensionality"] = { "2" }; // should be derived from the inputs
ComponentIndexType index1 = blueprint->AddComponent(component1Parameters);
blueprint->AddComponent("FixedImageSource", component1Parameters);
ParameterMapType component2Parameters;
component2Parameters["NameOfClass"] = { "ItkImageSourceMovingComponent" };
component2Parameters["Dimensionality"] = { "2" }; // should be derived from the inputs
ComponentIndexType index2 = blueprint->AddComponent(component2Parameters);
blueprint->AddComponent("MovingImageSource", component2Parameters);
ParameterMapType component3Parameters;
component3Parameters["NameOfClass"] = { "ItkImageFilterSinkComponent" };
component3Parameters["Dimensionality"] = { "2" }; // should be derived from the outputs
ComponentIndexType index3 = blueprint->AddComponent(component3Parameters);
blueprint->AddComponent("ResultImageSink", component3Parameters);
ParameterMapType component4Parameters;
component4Parameters["NameOfClass"] = { "DisplacementFieldItkImageFilterSinkComponent" };
component4Parameters["Dimensionality"] = { "2" }; // should be derived from the outputs
ComponentIndexType index4 = blueprint->AddComponent(component4Parameters);
blueprint->AddComponent("ResultDisplacementFieldSink", component4Parameters);
ParameterMapType component5Parameters;
component5Parameters["NameOfClass"] = { "ItkANTSNeighborhoodCorrelationImageToImageMetricv4Component" };
component5Parameters["Dimensionality"] = { "2" }; // should be derived from the inputs
ComponentIndexType index5 = blueprint->AddComponent(component5Parameters);
blueprint->AddComponent("Metric", component5Parameters);
ParameterMapType connection1Parameters;
connection1Parameters["NameOfInterface"] = { "itkImageSourceFixedInterface" };
blueprint->AddConnection(index1, index0, connection1Parameters);
blueprint->AddConnection("FixedImageSource", "RegistrationMethod", connection1Parameters);
ParameterMapType connection2Parameters;
connection2Parameters["NameOfInterface"] = { "itkImageSourceMovingInterface" };
blueprint->AddConnection(index2, index0, connection2Parameters);
blueprint->AddConnection("MovingImageSource", "RegistrationMethod", connection2Parameters);
ParameterMapType connection3Parameters;
connection3Parameters["NameOfInterface"] = { "itkImageSourceInterface" };
blueprint->AddConnection(index0, index3, connection3Parameters);
blueprint->AddConnection("RegistrationMethod", "ResultImageSink", connection3Parameters);
ParameterMapType connection4Parameters;
connection4Parameters["NameOfInterface"] = { "DisplacementFieldItkImageSourceInterface" };
blueprint->AddConnection(index0, index4, connection4Parameters);
blueprint->AddConnection("RegistrationMethod", "ResultDisplacementFieldSink", connection4Parameters);
ParameterMapType connection5Parameters;
connection5Parameters["NameOfInterface"] = { "itkMetricv4Interface" };
blueprint->AddConnection(index5, index0, connection5Parameters);
blueprint->AddConnection("Metric", "RegistrationMethod", connection5Parameters);
EXPECT_NO_THROW(overlord = Overlord::New());
EXPECT_NO_THROW(overlord->SetBlueprint(blueprint));
//The Overlord is not yet an itkfilter with inputs and outputs, therefore it reads and writes the files temporarily.
DataManagerType::Pointer dataManager = DataManagerType::New();
overlord->inputFileNames = { dataManager->GetInputFile("BrainProtonDensitySliceBorder20.png"), dataManager->GetInputFile("BrainProtonDensitySliceR10X13Y17.png") };
overlord->outputFileNames = { dataManager->GetOutputFile("RegistrationItkv4Test_BrainProtonDensity.mhd"), dataManager->GetOutputFile("RegistrationItkv4Test_Displacement_BrainProtonDensity.mhd") };
EXPECT_NO_THROW(overlord->SetBlueprint(blueprint));
bool allUniqueComponents;
EXPECT_NO_THROW(allUniqueComponents = overlord->Configure());
EXPECT_TRUE(allUniqueComponents);
......
......@@ -44,7 +44,6 @@ public:
typedef Overlord::Pointer OverlordPointerType;
typedef Blueprint::Pointer BlueprintPointerType;
typedef Blueprint::ConstPointer BlueprintConstPointerType;
typedef Blueprint::ComponentIndexType ComponentIndexType;
typedef Blueprint::ParameterMapType ParameterMapType;
typedef Blueprint::ParameterValueType ParameterValueType;
typedef DataManager DataManagerType;
......@@ -83,53 +82,53 @@ TEST_F(WBIRDemoTest, itkv4_SVF_ANTSCC)
ParameterMapType component0Parameters;
component0Parameters["NameOfClass"] = { "ItkImageRegistrationMethodv4Component" };
ComponentIndexType index0 = blueprint->AddComponent(component0Parameters);
blueprint->AddComponent("RegistrationMethod", component0Parameters);
ParameterMapType component1Parameters;
component1Parameters["NameOfClass"] = { "ItkImageSourceFixedComponent" };
ComponentIndexType index1 = blueprint->AddComponent(component1Parameters);
blueprint->AddComponent("FixedImageSource", component1Parameters);
ParameterMapType component2Parameters;
component2Parameters["NameOfClass"] = { "ItkImageSourceMovingComponent" };
ComponentIndexType index2 = blueprint->AddComponent(component2Parameters);
blueprint->AddComponent("MovingImageSource", component2Parameters);
ParameterMapType component3Parameters;
component3Parameters["NameOfClass"] = { "ItkImageFilterSinkComponent" };
ComponentIndexType index3 = blueprint->AddComponent(component3Parameters);
blueprint->AddComponent("ResultImageSink", component3Parameters);
ParameterMapType component4Parameters;
component4Parameters["NameOfClass"] = { "DisplacementFieldItkImageFilterSinkComponent" };
ComponentIndexType index4 = blueprint->AddComponent(component4Parameters);
blueprint->AddComponent("ResultDisplacementFieldSink", component4Parameters);
ParameterMapType component5Parameters;
component5Parameters["NameOfClass"] = { "ItkANTSNeighborhoodCorrelationImageToImageMetricv4Component" };
ComponentIndexType index5 = blueprint->AddComponent(component5Parameters);
blueprint->AddComponent("Metric", component5Parameters);
ParameterMapType connection1Parameters;
//optionally, tie properties to connection to avoid ambiguities
//connection1Parameters["NameOfInterface"] = { "itkImageSourceFixedInterface" };
blueprint->AddConnection(index1, index0, connection1Parameters);
blueprint->AddConnection("FixedImageSource", "RegistrationMethod", connection1Parameters);
ParameterMapType connection2Parameters;
//optionally, tie properties to connection to avoid ambiguities
//connection2Parameters["NameOfInterface"] = { "itkImageSourceMovingInterface" };
blueprint->AddConnection(index2, index0, connection2Parameters);
blueprint->AddConnection("MovingImageSource", "RegistrationMethod", connection2Parameters);
ParameterMapType connection3Parameters;
//optionally, tie properties to connection to avoid ambiguities
//connection3Parameters["NameOfInterface"] = { "itkImageSourceInterface" };
blueprint->AddConnection(index0, index3, connection3Parameters);
blueprint->AddConnection("RegistrationMethod", "ResultImageSink", connection3Parameters);
ParameterMapType connection4Parameters;
//optionally, tie properties to connection to avoid ambiguities
//connection4Parameters["NameOfInterface"] = { "DisplacementFieldItkImageSourceInterface" };
blueprint->AddConnection(index0, index4, connection4Parameters);
blueprint->AddConnection("RegistrationMethod", "ResultDisplacementFieldSink", connection4Parameters);
ParameterMapType connection5Parameters;
//optionally, tie properties to connection to avoid ambiguities
//connection5Parameters["NameOfInterface"] = { "itkMetricv4Interface" };
blueprint->AddConnection(index5, index0, connection5Parameters);
blueprint->AddConnection("Metric", "RegistrationMethod", connection5Parameters);
blueprint->WriteBlueprint("itkv4_SVF_ANTSCC.dot");
......@@ -155,53 +154,53 @@ TEST_F(WBIRDemoTest, itkv4_SVF_MSD)
ParameterMapType component0Parameters;
component0Parameters["NameOfClass"] = { "ItkImageRegistrationMethodv4Component" };
ComponentIndexType index0 = blueprint->AddComponent(component0Parameters);
blueprint->AddComponent("RegistrationMethod", component0Parameters);
ParameterMapType component1Parameters;
component1Parameters["NameOfClass"] = { "ItkImageSourceFixedComponent" };
ComponentIndexType index1 = blueprint->AddComponent(component1Parameters);
blueprint->AddComponent("FixedImageSource", component1Parameters);
ParameterMapType component2Parameters;
component2Parameters["NameOfClass"] = { "ItkImageSourceMovingComponent" };
ComponentIndexType index2 = blueprint->AddComponent(component2Parameters);
blueprint->AddComponent("MovingImageSource", component2Parameters);
ParameterMapType component3Parameters;
component3Parameters["NameOfClass"] = { "ItkImageFilterSinkComponent" };
ComponentIndexType index3 = blueprint->AddComponent(component3Parameters);
blueprint->AddComponent("ResultImageSink", component3Parameters);
ParameterMapType component4Parameters;
component4Parameters["NameOfClass"] = { "DisplacementFieldItkImageFilterSinkComponent" };
ComponentIndexType index4 = blueprint->AddComponent(component4Parameters);
blueprint->AddComponent("ResultDisplacementFieldSink", component4Parameters);
ParameterMapType component5Parameters;
component5Parameters["NameOfClass"] = { "ItkMeanSquaresImageToImageMetricv4Component" };
ComponentIndexType index5 = blueprint->AddComponent(component5Parameters);
blueprint->AddComponent("Metric", component5Parameters);
ParameterMapType connection1Parameters;
//optionally, tie properties to connection to avoid ambiguities
//connection1Parameters["NameOfInterface"] = { "itkImageSourceFixedInterface" };
blueprint->AddConnection(index1, index0, connection1Parameters);
blueprint->AddConnection("FixedImageSource", "RegistrationMethod", connection1Parameters);
ParameterMapType connection2Parameters;
//optionally, tie properties to connection to avoid ambiguities
//connection2Parameters["NameOfInterface"] = { "itkImageSourceMovingInterface" };
blueprint->AddConnection(index2, index0, connection2Parameters);
blueprint->AddConnection("MovingImageSource", "RegistrationMethod", connection2Parameters);
ParameterMapType connection3Parameters;
//optionally, tie properties to connection to avoid ambiguities
//connection3Parameters["NameOfInterface"] = { "itkImageSourceInterface" };
blueprint->AddConnection(index0, index3, connection3Parameters);
blueprint->AddConnection("RegistrationMethod", "ResultImageSink", connection3Parameters);
ParameterMapType connection4Parameters;
//optionally, tie properties to connection to avoid ambiguities
//connection4Parameters["NameOfInterface"] = { "DisplacementFieldItkImageSourceInterface" };
blueprint->AddConnection(index0, index4, connection4Parameters);
blueprint->AddConnection("RegistrationMethod", "ResultDisplacementFieldSink", connection4Parameters);
ParameterMapType connection5Parameters;
//optionally, tie properties to connection to avoid ambiguities
//connection5Parameters["NameOfInterface"] = { "itkMetricv4Interface" };
blueprint->AddConnection(index5, index0, connection5Parameters);
blueprint->AddConnection("Metric", "RegistrationMethod", connection5Parameters);
blueprint->WriteBlueprint("itkv4_SVF_MSD.dot");
......@@ -230,35 +229,34 @@ TEST_F(WBIRDemoTest, elastix_BS_NCC)
//component0Parameters["RegistrationPreset"] = { "rigid" };
component0Parameters["Transform"] = { "BSplineTransform" };
component0Parameters["Metric"] = { "AdvancedNormalizedCorrelation" };
ComponentIndexType index0 = blueprint->AddComponent(component0Parameters);
blueprint->AddComponent("RegistrationMethod", component0Parameters);
ParameterMapType component1Parameters;
component1Parameters["NameOfClass"] = { "ItkImageSourceFixedComponent" };
ComponentIndexType index1 = blueprint->AddComponent(component1Parameters);
blueprint->AddComponent("FixedImageSource", component1Parameters);
ParameterMapType component2Parameters;
component2Parameters["NameOfClass"] = { "ItkImageSourceMovingComponent" };
ComponentIndexType index2 = blueprint->AddComponent(component2Parameters);
blueprint->AddComponent("MovingImageSource", component2Parameters);
ParameterMapType component3Parameters;
component3Parameters["NameOfClass"] = { "ItkImageSinkComponent" };
ComponentIndexType index3 = blueprint->AddComponent(component3Parameters);
blueprint->AddComponent("ResultImageSink", component3Parameters);
ParameterMapType connection1Parameters;
//optionally, tie properties to connection to avoid ambiguities
//connection1Parameters["NameOfInterface"] = { "itkImageSourceFixedInterface" };
blueprint->AddConnection(index1, index0, connection1Parameters);
blueprint->AddConnection("FixedImageSource", "RegistrationMethod", connection1Parameters);
ParameterMapType connection2Parameters;
//optionally, tie properties to connection to avoid ambiguities
//connection2Parameters["NameOfInterface"] = { "itkImageSourceMovingInterface" };
blueprint->AddConnection(index2, index0, connection2Parameters);
blueprint->AddConnection("MovingImageSource", "RegistrationMethod", connection2Parameters);
ParameterMapType connection3Parameters;
//optionally, tie properties to connection to avoid ambiguities
//connection3Parameters["NameOfInterface"] = { "GetItkImageInterface" };
blueprint->AddConnection(index0, index3, connection3Parameters);
blueprint->AddConnection("RegistrationMethod", "ResultImageSink", connection3Parameters);
blueprint->WriteBlueprint("elastix_BS_NCC.dot");
......@@ -289,35 +287,34 @@ TEST_F(WBIRDemoTest, elastix_BS_MSD)
//component0Parameters["RegistrationPreset"] = { "rigid" };
component0Parameters["Transform"] = { "BSplineTransform" };
component0Parameters["Metric"] = { "AdvancedMeanSquares" };
ComponentIndexType index0 = blueprint->AddComponent(component0Parameters);
blueprint->AddComponent("RegistrationMethod", component0Parameters);
ParameterMapType component1Parameters;
component1Parameters["NameOfClass"] = { "ItkImageSourceFixedComponent" };
ComponentIndexType index1 = blueprint->AddComponent(component1Parameters);
blueprint->AddComponent("FixedImageSource", component1Parameters);
ParameterMapType component2Parameters;
component2Parameters["NameOfClass"] = { "ItkImageSourceMovingComponent" };
ComponentIndexType index2 = blueprint->AddComponent(component2Parameters);
blueprint->AddComponent("MovingImageSource", component2Parameters);
ParameterMapType component3Parameters;
component3Parameters["NameOfClass"] = { "ItkImageSinkComponent" };
ComponentIndexType index3 = blueprint->AddComponent(component3Parameters);
blueprint->AddComponent("ResultImageSink", component3Parameters);
ParameterMapType connection1Parameters;
connection1Parameters["NameOfInterface"] = { "itkImageSourceFixedInterface" };
blueprint->AddConnection(index1, index0, connection1Parameters);
//optionally, tie properties to connection to avoid ambiguities
//connection1Parameters["NameOfInterface"] = { "itkImageSourceFixedInterface" };
blueprint->AddConnection("FixedImageSource", "RegistrationMethod", connection1Parameters);
ParameterMapType connection2Parameters;
//optionally, tie properties to connection to avoid ambiguities
//connection2Parameters["NameOfInterface"] = { "itkImageSourceMovingInterface" };
blueprint->AddConnection(index2, index0, connection2Parameters);
blueprint->AddConnection("MovingImageSource", "RegistrationMethod", connection2Parameters);
ParameterMapType connection3Parameters;
//optionally, tie properties to connection to avoid ambiguities
//connection3Parameters["NameOfInterface"] = { "GetItkImageInterface" };
blueprint->AddConnection(index0, index3, connection3Parameters);
blueprint->AddConnection("RegistrationMethod", "ResultImageSink", connection3Parameters);
blueprint->WriteBlueprint("elastix_BS_MSD.dot");
......
......@@ -3,6 +3,7 @@
#include "boost/graph/graph_traits.hpp"
#include "boost/graph/directed_graph.hpp"
#include "boost/graph/labeled_graph.hpp"
#include "itkObjectFactory.h"
#include "itkDataObject.h"
......@@ -20,10 +21,13 @@ public:
typedef std::string ParameterKeyType;
typedef std::vector< std::string > ParameterValueType;
typedef std::map< ParameterKeyType, ParameterValueType > ParameterMapType;
// Component parameter map that sits on a node in the graph
typedef std::string ComponentNameType;
// Component parameter map that sits on a node in the graph
// and holds component configuration settings
struct ComponentPropertyType {
ComponentNameType name;
ParameterMapType parameterMap;
};
......@@ -33,11 +37,17 @@ public:
ParameterMapType parameterMap;
};
typedef boost::adjacency_list< boost::vecS,
boost::vecS,
boost::directedS,
ComponentPropertyType,
ConnectionPropertyType > GraphType;
typedef boost::labeled_graph < boost::adjacency_list <
boost::vecS,
boost::vecS,
boost::directedS,
ComponentPropertyType,
ConnectionPropertyType
>,
ComponentNameType > GraphType;
//typedef GraphType::label_type ComponentNameType;
typedef std::vector<ComponentNameType> ComponentNamesType;