diff --git a/Testing/Unit/CMakeLists.txt b/Testing/Unit/CMakeLists.txt index bbb61081d68c94aca6010e6cccb8dc996d787707..93f35c58d08c650d6f90eb5f873d6cd501f35d8b 100644 --- a/Testing/Unit/CMakeLists.txt +++ b/Testing/Unit/CMakeLists.txt @@ -10,7 +10,7 @@ set( ElastixUnitTestFilenames elxComponentFactoryTest.cxx elxComponentInterfaceTest.cxx elxOverlordTest.cxx - elxProcessObjectComponentTest.cxx + elxitkImageFilterTest.cxx ) # --------------------------------------------------------------------- diff --git a/Testing/Unit/elxProcessObjectComponentTest.cxx b/Testing/Unit/elxitkImageFilterTest.cxx similarity index 79% rename from Testing/Unit/elxProcessObjectComponentTest.cxx rename to Testing/Unit/elxitkImageFilterTest.cxx index b4a20f04e5a795b2e0d8828aed4631baae7af6f2..d6367582342474455c8a0c8733777cbb2b687032 100644 --- a/Testing/Unit/elxProcessObjectComponentTest.cxx +++ b/Testing/Unit/elxitkImageFilterTest.cxx @@ -5,9 +5,19 @@ #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 { -class ProcessObjectTest : public ::testing::Test { + class itkImageFilterTest : public ::testing::Test { public: typedef Overlord::Pointer OverlordPointerType; typedef Blueprint::Pointer BlueprintPointerType; @@ -17,13 +27,17 @@ public: typedef Blueprint::ParameterValueType ParameterValueType; virtual void SetUp() { - /** register all example components */ + + + /** register all components used for this test */ ComponentFactory<ItkSmoothingRecursiveGaussianImageFilterComponent>::RegisterOneFactory(); ComponentFactory<ItkImageSinkComponent>::RegisterOneFactory(); ComponentFactory<ItkImageSourceComponent>::RegisterOneFactory(); /** make example blueprint configuration */ blueprint = Blueprint::New(); + + /** the 2 itkImageFilter Components are ItkSmoothingRecursiveGaussianImageFilterComponent*/ ParameterMapType componentParameters; componentParameters["NameOfClass"] = ParameterValueType(1, "ItkSmoothingRecursiveGaussianImageFilterComponent"); @@ -38,14 +52,17 @@ public: //TODO: check direction blueprint->AddConnection(index0, index1, connectionParameters); + /** Add a description of the SourceComponent*/ ParameterMapType sourceComponentParameters; sourceComponentParameters["NameOfClass"] = ParameterValueType(1, "ItkImageSourceComponent"); ComponentIndexType sourceIndex = blueprint->AddComponent(sourceComponentParameters); + /** Add a description of the SinkComponent*/ ParameterMapType sinkComponentParameters; sinkComponentParameters["NameOfClass"] = ParameterValueType(1, "ItkImageSinkComponent"); ComponentIndexType sinkIndex = blueprint->AddComponent(sinkComponentParameters); + /** Connect Sink and Source to the itkImageFilter Components*/ blueprint->AddConnection(sourceIndex,index0, connectionParameters); // blueprint->AddConnection(index1, sinkIndex, connectionParameters); } @@ -58,7 +75,7 @@ public: Overlord::Pointer overlord; }; -TEST_F(ProcessObjectTest, Configure) + TEST_F(itkImageFilterTest, Run) { overlord = Overlord::New(); overlord->SetBlueprint(blueprint);