Skip to content

Commit 148ebe4

Browse files
committed
ENH: SIMPL Backwards Compatibility Test Redesign
The original backwards compatibility test was a single 1,100-line monolithic test file (BackwardsCompatibilityTest.cpp) that validated SIMPL 6.5/6.6 pipeline conversion for all filters at once. It relied on two large hand-maintained data structures: - k_ParamMap (~500 lines) — a global map of parameter type UUIDs to expected exemplar values, with custom std::any comparator lambdas for each parameter type - k_KeyIgnoreMap (~180 lines) — a manual list of NX-only parameter keys per filter that the test had to skip The core maintenance problem: whenever a developer added a new parameter to any filter, they had to also update k_KeyIgnoreMap with that parameter's key, or the centralized test would fail. This was unintuitive, error-prone, and completely disconnected from the filter being changed. The ignore list grew with every filter enhancement and provided no signal about what it was actually protecting.
1 parent 85491be commit 148ebe4

684 files changed

Lines changed: 23944 additions & 186 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

SIMPLMapInventory.md

Lines changed: 240 additions & 0 deletions
Large diffs are not rendered by default.

generate_backwards_compat_tests.py

Lines changed: 945 additions & 0 deletions
Large diffs are not rendered by default.

src/Plugins/ITKImageProcessing/test/ITKAbsImageTest.cpp

Lines changed: 46 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,14 @@
55
#include "ITKImageProcessing/ITKImageProcessing_test_dirs.hpp"
66
#include "ITKTestBase.hpp"
77

8+
#include "simplnx/Core/Application.hpp"
89
#include "simplnx/Parameters/DataObjectNameParameter.hpp"
10+
#include "simplnx/Pipeline/Pipeline.hpp"
11+
#include "simplnx/Pipeline/PipelineFilter.hpp"
912
#include "simplnx/UnitTest/UnitTestCommon.hpp"
1013

1114
#include <filesystem>
15+
#include <fstream>
1216
namespace fs = std::filesystem;
1317

1418
using namespace nx::core;
@@ -26,7 +30,7 @@ TEST_CASE("ITKImageProcessing::ITKAbsImageFilter(float)", "[ITKImageProcessing][
2630
const DataObjectNameParameter::ValueType outputArrayName = ITKTestBase::k_OutputDataPath;
2731

2832
{ // Start Image Comparison Scope
29-
const fs::path inputFilePath = fs::path(unit_test::k_SourceDir.view()) / unit_test::k_DataDir.view() / "JSONFilters" / "Input/RA-Slice-Float.nrrd";
33+
const fs::path inputFilePath = fs::path(nx::core::unit_test::k_SourceDir.view()) / unit_test::k_DataDir.view() / "JSONFilters" / "Input/RA-Slice-Float.nrrd";
3034
Result<> imageReadResult = ITKTestBase::ReadImage(dataStructure, inputFilePath, inputGeometryPath, ITKTestBase::k_ImageCellDataName, ITKTestBase::k_InputDataName);
3135
SIMPLNX_RESULT_REQUIRE_VALID(imageReadResult)
3236
} // End Image Comparison Scope
@@ -64,7 +68,7 @@ TEST_CASE("ITKImageProcessing::ITKAbsImageFilter(short)", "[ITKImageProcessing][
6468
const DataObjectNameParameter::ValueType outputArrayName = ITKTestBase::k_OutputDataPath;
6569

6670
{ // Start Image Comparison Scope
67-
const fs::path inputFilePath = fs::path(unit_test::k_SourceDir.view()) / unit_test::k_DataDir.view() / "JSONFilters" / "Input/RA-Slice-Short.nrrd";
71+
const fs::path inputFilePath = fs::path(nx::core::unit_test::k_SourceDir.view()) / unit_test::k_DataDir.view() / "JSONFilters" / "Input/RA-Slice-Short.nrrd";
6872
Result<> imageReadResult = ITKTestBase::ReadImage(dataStructure, inputFilePath, inputGeometryPath, ITKTestBase::k_ImageCellDataName, ITKTestBase::k_InputDataName);
6973
SIMPLNX_RESULT_REQUIRE_VALID(imageReadResult)
7074
} // End Image Comparison Scope
@@ -90,3 +94,43 @@ TEST_CASE("ITKImageProcessing::ITKAbsImageFilter(short)", "[ITKImageProcessing][
9094

9195
UnitTest::CheckArraysInheritTupleDims(dataStructure);
9296
}
97+
98+
TEST_CASE("ITKImageProcessing::ITKAbsImageFilter: SIMPL Backwards Compatibility", "[ITKImageProcessing][ITKAbsImageFilter][BackwardsCompatibility]")
99+
{
100+
auto app = Application::GetOrCreateInstance();
101+
UnitTest::LoadPlugins();
102+
auto filterList = app->getFilterList();
103+
104+
const fs::path conversionDir = fs::path(nx::core::unit_test::k_SourceDir.view()) / "test" / "simpl_conversion";
105+
106+
const std::vector<std::pair<std::string, fs::path>> fixtures = {
107+
{"SIMPL 6.5 (UUID)", conversionDir / "6_5" / "ITKAbsImageFilter.json"},
108+
{"SIMPL 6.4 (Filter_Name)", conversionDir / "6_4" / "ITKAbsImageFilter.json"},
109+
};
110+
111+
for(const auto& [label, fixturePath] : fixtures)
112+
{
113+
DYNAMIC_SECTION(label)
114+
{
115+
auto pipelineResult = Pipeline::FromSIMPLFile(fixturePath, filterList);
116+
REQUIRE(pipelineResult.valid());
117+
118+
auto& pipeline = pipelineResult.value();
119+
REQUIRE(pipeline.size() == 1);
120+
121+
auto* pipelineFilter = dynamic_cast<PipelineFilter*>(pipeline.at(0));
122+
REQUIRE(pipelineFilter != nullptr);
123+
124+
const IFilter* filter = pipelineFilter->getFilter();
125+
REQUIRE(filter != nullptr);
126+
REQUIRE(filter->uuid() == FilterTraits<ITKAbsImageFilter>::uuid);
127+
128+
CHECK(pipelineFilter->getComments().empty());
129+
130+
const Arguments args = pipelineFilter->getArguments();
131+
CHECK(args.value<DataPath>(ITKAbsImageFilter::k_InputImageGeomPath_Key) == DataPath({"DataContainer"}));
132+
CHECK(args.value<DataPath>(ITKAbsImageFilter::k_InputImageDataPath_Key) == DataPath({"DataContainer", "CellData", "TestArray"}));
133+
CHECK(args.value<std::string>(ITKAbsImageFilter::k_OutputImageArrayName_Key) == "TestName");
134+
}
135+
}
136+
}

src/Plugins/ITKImageProcessing/test/ITKAcosImageTest.cpp

Lines changed: 45 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,14 @@
55
#include "ITKImageProcessing/ITKImageProcessing_test_dirs.hpp"
66
#include "ITKTestBase.hpp"
77

8+
#include "simplnx/Core/Application.hpp"
89
#include "simplnx/Parameters/DataObjectNameParameter.hpp"
10+
#include "simplnx/Pipeline/Pipeline.hpp"
11+
#include "simplnx/Pipeline/PipelineFilter.hpp"
912
#include "simplnx/UnitTest/UnitTestCommon.hpp"
1013

1114
#include <filesystem>
15+
#include <fstream>
1216
namespace fs = std::filesystem;
1317

1418
using namespace nx::core;
@@ -26,7 +30,7 @@ TEST_CASE("ITKImageProcessing::ITKAcosImageFilter(defaults)", "[ITKImageProcessi
2630
const DataObjectNameParameter::ValueType outputArrayName = ITKTestBase::k_OutputDataPath;
2731

2832
{ // Start Image Comparison Scope
29-
const fs::path inputFilePath = fs::path(unit_test::k_SourceDir.view()) / unit_test::k_DataDir.view() / "JSONFilters" / "Input/Ramp-Zero-One-Float.nrrd";
33+
const fs::path inputFilePath = fs::path(nx::core::unit_test::k_SourceDir.view()) / unit_test::k_DataDir.view() / "JSONFilters" / "Input/Ramp-Zero-One-Float.nrrd";
3034
Result<> imageReadResult = ITKTestBase::ReadImage(dataStructure, inputFilePath, inputGeometryPath, ITKTestBase::k_ImageCellDataName, ITKTestBase::k_InputDataName);
3135
SIMPLNX_RESULT_REQUIRE_VALID(imageReadResult)
3236
} // End Image Comparison Scope
@@ -52,3 +56,43 @@ TEST_CASE("ITKImageProcessing::ITKAcosImageFilter(defaults)", "[ITKImageProcessi
5256

5357
UnitTest::CheckArraysInheritTupleDims(dataStructure);
5458
}
59+
60+
TEST_CASE("ITKImageProcessing::ITKAcosImageFilter: SIMPL Backwards Compatibility", "[ITKImageProcessing][ITKAcosImageFilter][BackwardsCompatibility]")
61+
{
62+
auto app = Application::GetOrCreateInstance();
63+
UnitTest::LoadPlugins();
64+
auto filterList = app->getFilterList();
65+
66+
const fs::path conversionDir = fs::path(nx::core::unit_test::k_SourceDir.view()) / "test" / "simpl_conversion";
67+
68+
const std::vector<std::pair<std::string, fs::path>> fixtures = {
69+
{"SIMPL 6.5 (UUID)", conversionDir / "6_5" / "ITKAcosImageFilter.json"},
70+
{"SIMPL 6.4 (Filter_Name)", conversionDir / "6_4" / "ITKAcosImageFilter.json"},
71+
};
72+
73+
for(const auto& [label, fixturePath] : fixtures)
74+
{
75+
DYNAMIC_SECTION(label)
76+
{
77+
auto pipelineResult = Pipeline::FromSIMPLFile(fixturePath, filterList);
78+
REQUIRE(pipelineResult.valid());
79+
80+
auto& pipeline = pipelineResult.value();
81+
REQUIRE(pipeline.size() == 1);
82+
83+
auto* pipelineFilter = dynamic_cast<PipelineFilter*>(pipeline.at(0));
84+
REQUIRE(pipelineFilter != nullptr);
85+
86+
const IFilter* filter = pipelineFilter->getFilter();
87+
REQUIRE(filter != nullptr);
88+
REQUIRE(filter->uuid() == FilterTraits<ITKAcosImageFilter>::uuid);
89+
90+
CHECK(pipelineFilter->getComments().empty());
91+
92+
const Arguments args = pipelineFilter->getArguments();
93+
CHECK(args.value<DataPath>(ITKAcosImageFilter::k_InputImageGeomPath_Key) == DataPath({"DataContainer"}));
94+
CHECK(args.value<DataPath>(ITKAcosImageFilter::k_InputImageDataPath_Key) == DataPath({"DataContainer", "CellData", "TestArray"}));
95+
CHECK(args.value<std::string>(ITKAcosImageFilter::k_OutputImageArrayName_Key) == "TestName");
96+
}
97+
}
98+
}

src/Plugins/ITKImageProcessing/test/ITKAdaptiveHistogramEqualizationImageTest.cpp

Lines changed: 48 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
#include <catch2/catch.hpp>
2+
#include <filesystem>
3+
#include <fstream>
24

35
#include "simplnx/Core/Application.hpp"
46
#include "simplnx/DataStructure/IO/HDF5/DataStructureWriter.hpp"
@@ -11,6 +13,8 @@
1113
#include "simplnx/Parameters/NumberParameter.hpp"
1214
#include "simplnx/Parameters/StringParameter.hpp"
1315
#include "simplnx/Parameters/VectorParameter.hpp"
16+
#include "simplnx/Pipeline/Pipeline.hpp"
17+
#include "simplnx/Pipeline/PipelineFilter.hpp"
1418
#include "simplnx/UnitTest/UnitTestCommon.hpp"
1519
#include "simplnx/Utilities/Parsing/HDF5/IO/FileIO.hpp"
1620

@@ -135,7 +139,7 @@ TEST_CASE("ITKImageProcessing::ITKAdaptiveHistogramEqualizationImageFilter(histo
135139
const DataObjectNameParameter::ValueType outputArrayName = ITKTestBase::k_OutputDataPath;
136140

137141
{ // Start Image Comparison Scope
138-
const fs::path inputFilePath = fs::path(unit_test::k_SourceDir.view()) / unit_test::k_DataDir.view() / "JSONFilters" / "Input/sf4.png";
142+
const fs::path inputFilePath = fs::path(nx::core::unit_test::k_SourceDir.view()) / unit_test::k_DataDir.view() / "JSONFilters" / "Input/sf4.png";
139143
Result<> imageReadResult = ITKTestBase::ReadImage(dataStructure, inputFilePath, inputGeometryPath, ITKTestBase::k_ImageCellDataName, ITKTestBase::k_InputDataName);
140144
SIMPLNX_RESULT_REQUIRE_VALID(imageReadResult)
141145
} // End Image Comparison Scope
@@ -178,3 +182,46 @@ TEST_CASE("ITKImageProcessing::ITKAdaptiveHistogramEqualizationImageFilter(histo
178182

179183
UnitTest::CheckArraysInheritTupleDims(dataStructure);
180184
}
185+
186+
TEST_CASE("ITKImageProcessing::ITKAdaptiveHistogramEqualizationImageFilter: SIMPL Backwards Compatibility", "[ITKImageProcessing][ITKAdaptiveHistogramEqualizationImageFilter][BackwardsCompatibility]")
187+
{
188+
auto app = Application::GetOrCreateInstance();
189+
UnitTest::LoadPlugins();
190+
auto filterList = app->getFilterList();
191+
192+
const fs::path conversionDir = fs::path(nx::core::unit_test::k_SourceDir.view()) / "test" / "simpl_conversion";
193+
194+
const std::vector<std::pair<std::string, fs::path>> fixtures = {
195+
{"SIMPL 6.5 (UUID)", conversionDir / "6_5" / "ITKAdaptiveHistogramEqualizationImageFilter.json"},
196+
{"SIMPL 6.4 (Filter_Name)", conversionDir / "6_4" / "ITKAdaptiveHistogramEqualizationImageFilter.json"},
197+
};
198+
199+
for(const auto& [label, fixturePath] : fixtures)
200+
{
201+
DYNAMIC_SECTION(label)
202+
{
203+
auto pipelineResult = Pipeline::FromSIMPLFile(fixturePath, filterList);
204+
REQUIRE(pipelineResult.valid());
205+
206+
auto& pipeline = pipelineResult.value();
207+
REQUIRE(pipeline.size() == 1);
208+
209+
auto* pipelineFilter = dynamic_cast<PipelineFilter*>(pipeline.at(0));
210+
REQUIRE(pipelineFilter != nullptr);
211+
212+
const IFilter* filter = pipelineFilter->getFilter();
213+
REQUIRE(filter != nullptr);
214+
REQUIRE(filter->uuid() == FilterTraits<ITKAdaptiveHistogramEqualizationImageFilter>::uuid);
215+
216+
CHECK(pipelineFilter->getComments().empty());
217+
218+
const Arguments args = pipelineFilter->getArguments();
219+
// Complex type (UInt32Vec3FilterParameterConverter) - verified by successful pipeline loading
220+
CHECK(args.value<float32>(ITKAdaptiveHistogramEqualizationImageFilter::k_Alpha_Key) == 2.5f);
221+
CHECK(args.value<float32>(ITKAdaptiveHistogramEqualizationImageFilter::k_Beta_Key) == 2.5f);
222+
CHECK(args.value<DataPath>(ITKAdaptiveHistogramEqualizationImageFilter::k_InputImageGeomPath_Key) == DataPath({"DataContainer"}));
223+
CHECK(args.value<DataPath>(ITKAdaptiveHistogramEqualizationImageFilter::k_InputImageDataPath_Key) == DataPath({"DataContainer", "CellData", "TestArray"}));
224+
CHECK(args.value<std::string>(ITKAdaptiveHistogramEqualizationImageFilter::k_OutputImageArrayName_Key) == "TestName");
225+
}
226+
}
227+
}

src/Plugins/ITKImageProcessing/test/ITKApproximateSignedDistanceMapImageTest.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ TEST_CASE("ITKImageProcessing::ITKApproximateSignedDistanceMapImageFilter(defaul
2727
const DataObjectNameParameter::ValueType outputArrayName = ITKTestBase::k_OutputDataPath;
2828

2929
{ // Start Image Comparison Scope
30-
const fs::path inputFilePath = fs::path(unit_test::k_SourceDir.view()) / unit_test::k_DataDir.view() / "JSONFilters" / "Input/2th_cthead1.png";
30+
const fs::path inputFilePath = fs::path(nx::core::unit_test::k_SourceDir.view()) / unit_test::k_DataDir.view() / "JSONFilters" / "Input/2th_cthead1.png";
3131
Result<> imageReadResult = ITKTestBase::ReadImage(dataStructure, inputFilePath, inputGeometryPath, ITKTestBase::k_ImageCellDataName, ITKTestBase::k_InputDataName);
3232
SIMPLNX_RESULT_REQUIRE_VALID(imageReadResult)
3333
} // End Image Comparison Scope
@@ -65,7 +65,7 @@ TEST_CASE("ITKImageProcessing::ITKApproximateSignedDistanceMapImageFilter(modifi
6565
const DataObjectNameParameter::ValueType outputArrayName = ITKTestBase::k_OutputDataPath;
6666

6767
{ // Start Image Comparison Scope
68-
const fs::path inputFilePath = fs::path(unit_test::k_SourceDir.view()) / unit_test::k_DataDir.view() / "JSONFilters" / "Input/2th_cthead1.png";
68+
const fs::path inputFilePath = fs::path(nx::core::unit_test::k_SourceDir.view()) / unit_test::k_DataDir.view() / "JSONFilters" / "Input/2th_cthead1.png";
6969
Result<> imageReadResult = ITKTestBase::ReadImage(dataStructure, inputFilePath, inputGeometryPath, ITKTestBase::k_ImageCellDataName, ITKTestBase::k_InputDataName);
7070
SIMPLNX_RESULT_REQUIRE_VALID(imageReadResult)
7171
} // End Image Comparison Scope

src/Plugins/ITKImageProcessing/test/ITKAsinImageTest.cpp

Lines changed: 45 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,14 @@
55
#include "ITKImageProcessing/ITKImageProcessing_test_dirs.hpp"
66
#include "ITKTestBase.hpp"
77

8+
#include "simplnx/Core/Application.hpp"
89
#include "simplnx/Parameters/DataObjectNameParameter.hpp"
10+
#include "simplnx/Pipeline/Pipeline.hpp"
11+
#include "simplnx/Pipeline/PipelineFilter.hpp"
912
#include "simplnx/UnitTest/UnitTestCommon.hpp"
1013

1114
#include <filesystem>
15+
#include <fstream>
1216
namespace fs = std::filesystem;
1317

1418
using namespace nx::core;
@@ -26,7 +30,7 @@ TEST_CASE("ITKImageProcessing::ITKAsinImageFilter(defaults)", "[ITKImageProcessi
2630
const DataObjectNameParameter::ValueType outputArrayName = ITKTestBase::k_OutputDataPath;
2731

2832
{ // Start Image Comparison Scope
29-
const fs::path inputFilePath = fs::path(unit_test::k_SourceDir.view()) / unit_test::k_DataDir.view() / "JSONFilters" / "Input/Ramp-Zero-One-Float.nrrd";
33+
const fs::path inputFilePath = fs::path(nx::core::unit_test::k_SourceDir.view()) / unit_test::k_DataDir.view() / "JSONFilters" / "Input/Ramp-Zero-One-Float.nrrd";
3034
Result<> imageReadResult = ITKTestBase::ReadImage(dataStructure, inputFilePath, inputGeometryPath, ITKTestBase::k_ImageCellDataName, ITKTestBase::k_InputDataName);
3135
SIMPLNX_RESULT_REQUIRE_VALID(imageReadResult)
3236
} // End Image Comparison Scope
@@ -52,3 +56,43 @@ TEST_CASE("ITKImageProcessing::ITKAsinImageFilter(defaults)", "[ITKImageProcessi
5256

5357
UnitTest::CheckArraysInheritTupleDims(dataStructure);
5458
}
59+
60+
TEST_CASE("ITKImageProcessing::ITKAsinImageFilter: SIMPL Backwards Compatibility", "[ITKImageProcessing][ITKAsinImageFilter][BackwardsCompatibility]")
61+
{
62+
auto app = Application::GetOrCreateInstance();
63+
UnitTest::LoadPlugins();
64+
auto filterList = app->getFilterList();
65+
66+
const fs::path conversionDir = fs::path(nx::core::unit_test::k_SourceDir.view()) / "test" / "simpl_conversion";
67+
68+
const std::vector<std::pair<std::string, fs::path>> fixtures = {
69+
{"SIMPL 6.5 (UUID)", conversionDir / "6_5" / "ITKAsinImageFilter.json"},
70+
{"SIMPL 6.4 (Filter_Name)", conversionDir / "6_4" / "ITKAsinImageFilter.json"},
71+
};
72+
73+
for(const auto& [label, fixturePath] : fixtures)
74+
{
75+
DYNAMIC_SECTION(label)
76+
{
77+
auto pipelineResult = Pipeline::FromSIMPLFile(fixturePath, filterList);
78+
REQUIRE(pipelineResult.valid());
79+
80+
auto& pipeline = pipelineResult.value();
81+
REQUIRE(pipeline.size() == 1);
82+
83+
auto* pipelineFilter = dynamic_cast<PipelineFilter*>(pipeline.at(0));
84+
REQUIRE(pipelineFilter != nullptr);
85+
86+
const IFilter* filter = pipelineFilter->getFilter();
87+
REQUIRE(filter != nullptr);
88+
REQUIRE(filter->uuid() == FilterTraits<ITKAsinImageFilter>::uuid);
89+
90+
CHECK(pipelineFilter->getComments().empty());
91+
92+
const Arguments args = pipelineFilter->getArguments();
93+
CHECK(args.value<DataPath>(ITKAsinImageFilter::k_InputImageGeomPath_Key) == DataPath({"DataContainer"}));
94+
CHECK(args.value<DataPath>(ITKAsinImageFilter::k_InputImageDataPath_Key) == DataPath({"DataContainer", "CellData", "TestArray"}));
95+
CHECK(args.value<std::string>(ITKAsinImageFilter::k_OutputImageArrayName_Key) == "TestName");
96+
}
97+
}
98+
}

src/Plugins/ITKImageProcessing/test/ITKAtanImageTest.cpp

Lines changed: 45 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,14 @@
55
#include "ITKImageProcessing/ITKImageProcessing_test_dirs.hpp"
66
#include "ITKTestBase.hpp"
77

8+
#include "simplnx/Core/Application.hpp"
89
#include "simplnx/Parameters/DataObjectNameParameter.hpp"
10+
#include "simplnx/Pipeline/Pipeline.hpp"
11+
#include "simplnx/Pipeline/PipelineFilter.hpp"
912
#include "simplnx/UnitTest/UnitTestCommon.hpp"
1013

1114
#include <filesystem>
15+
#include <fstream>
1216
namespace fs = std::filesystem;
1317

1418
using namespace nx::core;
@@ -26,7 +30,7 @@ TEST_CASE("ITKImageProcessing::ITKAtanImageFilter(defaults)", "[ITKImageProcessi
2630
const DataObjectNameParameter::ValueType outputArrayName = ITKTestBase::k_OutputDataPath;
2731

2832
{ // Start Image Comparison Scope
29-
const fs::path inputFilePath = fs::path(unit_test::k_SourceDir.view()) / unit_test::k_DataDir.view() / "JSONFilters" / "Input/Ramp-Zero-One-Float.nrrd";
33+
const fs::path inputFilePath = fs::path(nx::core::unit_test::k_SourceDir.view()) / unit_test::k_DataDir.view() / "JSONFilters" / "Input/Ramp-Zero-One-Float.nrrd";
3034
Result<> imageReadResult = ITKTestBase::ReadImage(dataStructure, inputFilePath, inputGeometryPath, ITKTestBase::k_ImageCellDataName, ITKTestBase::k_InputDataName);
3135
SIMPLNX_RESULT_REQUIRE_VALID(imageReadResult)
3236
} // End Image Comparison Scope
@@ -52,3 +56,43 @@ TEST_CASE("ITKImageProcessing::ITKAtanImageFilter(defaults)", "[ITKImageProcessi
5256

5357
UnitTest::CheckArraysInheritTupleDims(dataStructure);
5458
}
59+
60+
TEST_CASE("ITKImageProcessing::ITKAtanImageFilter: SIMPL Backwards Compatibility", "[ITKImageProcessing][ITKAtanImageFilter][BackwardsCompatibility]")
61+
{
62+
auto app = Application::GetOrCreateInstance();
63+
UnitTest::LoadPlugins();
64+
auto filterList = app->getFilterList();
65+
66+
const fs::path conversionDir = fs::path(nx::core::unit_test::k_SourceDir.view()) / "test" / "simpl_conversion";
67+
68+
const std::vector<std::pair<std::string, fs::path>> fixtures = {
69+
{"SIMPL 6.5 (UUID)", conversionDir / "6_5" / "ITKAtanImageFilter.json"},
70+
{"SIMPL 6.4 (Filter_Name)", conversionDir / "6_4" / "ITKAtanImageFilter.json"},
71+
};
72+
73+
for(const auto& [label, fixturePath] : fixtures)
74+
{
75+
DYNAMIC_SECTION(label)
76+
{
77+
auto pipelineResult = Pipeline::FromSIMPLFile(fixturePath, filterList);
78+
REQUIRE(pipelineResult.valid());
79+
80+
auto& pipeline = pipelineResult.value();
81+
REQUIRE(pipeline.size() == 1);
82+
83+
auto* pipelineFilter = dynamic_cast<PipelineFilter*>(pipeline.at(0));
84+
REQUIRE(pipelineFilter != nullptr);
85+
86+
const IFilter* filter = pipelineFilter->getFilter();
87+
REQUIRE(filter != nullptr);
88+
REQUIRE(filter->uuid() == FilterTraits<ITKAtanImageFilter>::uuid);
89+
90+
CHECK(pipelineFilter->getComments().empty());
91+
92+
const Arguments args = pipelineFilter->getArguments();
93+
CHECK(args.value<DataPath>(ITKAtanImageFilter::k_InputImageGeomPath_Key) == DataPath({"DataContainer"}));
94+
CHECK(args.value<DataPath>(ITKAtanImageFilter::k_InputImageDataPath_Key) == DataPath({"DataContainer", "CellData", "TestArray"}));
95+
CHECK(args.value<std::string>(ITKAtanImageFilter::k_OutputImageArrayName_Key) == "TestName");
96+
}
97+
}
98+
}

0 commit comments

Comments
 (0)