Skip to content
Snippets Groups Projects
Commit eaf4136c authored by Floris Berendsen's avatar Floris Berendsen
Browse files

ENH: Minor; Renamed itkImageFilterTest and added comments

parent 972d2ef9
No related branches found
No related tags found
No related merge requests found
...@@ -10,7 +10,7 @@ set( ElastixUnitTestFilenames ...@@ -10,7 +10,7 @@ set( ElastixUnitTestFilenames
elxComponentFactoryTest.cxx elxComponentFactoryTest.cxx
elxComponentInterfaceTest.cxx elxComponentInterfaceTest.cxx
elxOverlordTest.cxx elxOverlordTest.cxx
elxProcessObjectComponentTest.cxx elxitkImageFilterTest.cxx
) )
# --------------------------------------------------------------------- # ---------------------------------------------------------------------
......
...@@ -5,9 +5,19 @@ ...@@ -5,9 +5,19 @@
#include "gtest/gtest.h" #include "gtest/gtest.h"
/** this test uses the following blueprint setup
[SourceComponent] - [itkImageFilter] - [itkImageFilter] - [SinkComponent]
- All the nodes are identified by their Class names
- All Connections are identified by their Interface names
The overlord finds the Source and Sink Components and connects these to it's external pipeline (internal reader and writer filters, currently).
*/
namespace selx { namespace selx {
class ProcessObjectTest : public ::testing::Test { class itkImageFilterTest : public ::testing::Test {
public: public:
typedef Overlord::Pointer OverlordPointerType; typedef Overlord::Pointer OverlordPointerType;
typedef Blueprint::Pointer BlueprintPointerType; typedef Blueprint::Pointer BlueprintPointerType;
...@@ -17,13 +27,17 @@ public: ...@@ -17,13 +27,17 @@ public:
typedef Blueprint::ParameterValueType ParameterValueType; typedef Blueprint::ParameterValueType ParameterValueType;
virtual void SetUp() { virtual void SetUp() {
/** register all example components */
/** register all components used for this test */
ComponentFactory<ItkSmoothingRecursiveGaussianImageFilterComponent>::RegisterOneFactory(); ComponentFactory<ItkSmoothingRecursiveGaussianImageFilterComponent>::RegisterOneFactory();
ComponentFactory<ItkImageSinkComponent>::RegisterOneFactory(); ComponentFactory<ItkImageSinkComponent>::RegisterOneFactory();
ComponentFactory<ItkImageSourceComponent>::RegisterOneFactory(); ComponentFactory<ItkImageSourceComponent>::RegisterOneFactory();
/** make example blueprint configuration */ /** make example blueprint configuration */
blueprint = Blueprint::New(); blueprint = Blueprint::New();
/** the 2 itkImageFilter Components are ItkSmoothingRecursiveGaussianImageFilterComponent*/
ParameterMapType componentParameters; ParameterMapType componentParameters;
componentParameters["NameOfClass"] = ParameterValueType(1, "ItkSmoothingRecursiveGaussianImageFilterComponent"); componentParameters["NameOfClass"] = ParameterValueType(1, "ItkSmoothingRecursiveGaussianImageFilterComponent");
...@@ -38,14 +52,17 @@ public: ...@@ -38,14 +52,17 @@ public:
//TODO: check direction //TODO: check direction
blueprint->AddConnection(index0, index1, connectionParameters); blueprint->AddConnection(index0, index1, connectionParameters);
/** Add a description of the SourceComponent*/
ParameterMapType sourceComponentParameters; ParameterMapType sourceComponentParameters;
sourceComponentParameters["NameOfClass"] = ParameterValueType(1, "ItkImageSourceComponent"); sourceComponentParameters["NameOfClass"] = ParameterValueType(1, "ItkImageSourceComponent");
ComponentIndexType sourceIndex = blueprint->AddComponent(sourceComponentParameters); ComponentIndexType sourceIndex = blueprint->AddComponent(sourceComponentParameters);
/** Add a description of the SinkComponent*/
ParameterMapType sinkComponentParameters; ParameterMapType sinkComponentParameters;
sinkComponentParameters["NameOfClass"] = ParameterValueType(1, "ItkImageSinkComponent"); sinkComponentParameters["NameOfClass"] = ParameterValueType(1, "ItkImageSinkComponent");
ComponentIndexType sinkIndex = blueprint->AddComponent(sinkComponentParameters); ComponentIndexType sinkIndex = blueprint->AddComponent(sinkComponentParameters);
/** Connect Sink and Source to the itkImageFilter Components*/
blueprint->AddConnection(sourceIndex,index0, connectionParameters); // blueprint->AddConnection(sourceIndex,index0, connectionParameters); //
blueprint->AddConnection(index1, sinkIndex, connectionParameters); blueprint->AddConnection(index1, sinkIndex, connectionParameters);
} }
...@@ -58,7 +75,7 @@ public: ...@@ -58,7 +75,7 @@ public:
Overlord::Pointer overlord; Overlord::Pointer overlord;
}; };
TEST_F(ProcessObjectTest, Configure) TEST_F(itkImageFilterTest, Run)
{ {
overlord = Overlord::New(); overlord = Overlord::New();
overlord->SetBlueprint(blueprint); overlord->SetBlueprint(blueprint);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment