diff --git a/CMakeLists.txt b/CMakeLists.txt index 0c9eb0b2cd..a80ed6a09c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -78,7 +78,7 @@ endif() file(TO_CMAKE_PATH "${CMAKE_COMMAND}" CMAKE_COMMAND_NORM) project(simplnx - VERSION 1.2.6 + VERSION 1.2.7 DESCRIPTION "SIMPL Redesign" HOMEPAGE_URL "https://github.com/bluequartzsoftware/simplnx" LANGUAGES CXX @@ -209,10 +209,10 @@ endif() # Force HDF5 1.10 API target_compile_definitions(simplnx PUBLIC "H5_USE_110_API") -target_compile_options( simplnx PUBLIC - $<$: "-ffp-contract=off"> - ) - +target_compile_options(simplnx + PUBLIC + $<$:-ffp-contract=off> +) if(SIMPLNX_ENABLE_MULTICORE) target_compile_definitions(simplnx PUBLIC "SIMPLNX_ENABLE_MULTICORE") diff --git a/conda/meta.yaml b/conda/meta.yaml index 1d90c41f91..1f5e9d985f 100644 --- a/conda/meta.yaml +++ b/conda/meta.yaml @@ -1,5 +1,5 @@ {% set name = "simplnx" %} -{% set version = "1.2.6" %} +{% set version = "1.2.7" %} package: name: {{ name|lower }} diff --git a/conda/recipe.yaml b/conda/recipe.yaml index 8829fe62d0..889eff7cf5 100644 --- a/conda/recipe.yaml +++ b/conda/recipe.yaml @@ -1,5 +1,5 @@ context: - version: "1.2.6" + version: "1.2.7" name: simplnx package: diff --git a/pipelines/PorosityAnalysis.d3dpipeline b/pipelines/PorosityAnalysis.d3dpipeline index ec3d8ee1d3..6591173b37 100644 --- a/pipelines/PorosityAnalysis.d3dpipeline +++ b/pipelines/PorosityAnalysis.d3dpipeline @@ -5,8 +5,8 @@ "pipeline": [ { "args": { - "cell_data_name": "Optical Data", - "image_data_array_path": "ImageData", + "cell_attribute_matrix_name": "Optical Data", + "image_data_array_name": "ImageData", "image_geometry_path": "RoboMet.3D Image Stack", "image_transform_choice": 0, "input_file_list_info": { diff --git a/src/Plugins/ITKImageProcessing/CMakeLists.txt b/src/Plugins/ITKImageProcessing/CMakeLists.txt index aa446b5537..560f579e38 100644 --- a/src/Plugins/ITKImageProcessing/CMakeLists.txt +++ b/src/Plugins/ITKImageProcessing/CMakeLists.txt @@ -382,8 +382,8 @@ if(EXISTS "${DREAM3D_DATA_DIR}" AND SIMPLNX_DOWNLOAD_TEST_FILES) endif() download_test_data(DREAM3D_DATA_DIR ${DREAM3D_DATA_DIR} - ARCHIVE_NAME ITKMhaFileReaderTest_rev2.tar.gz - SHA512 82592ffb6904389da1475e9c57f0be724d29db22ba9c942fd02d08ce3f8c73dc39a245503e584e56ca4ea7554d63cf1db5fb46e6e426768020f1ca0542822d0a + ARCHIVE_NAME ITKMhaFileReaderTest_v3.tar.gz + SHA512 106bcf9cfb4b77e6feb9355d7df0d1772e59961961201d1efaf2288294b39b3642e25e88caea322be56bb7d1029cfccc5c7c3844e7bd1f25a0c9f6186a29415b ) download_test_data(DREAM3D_DATA_DIR ${DREAM3D_DATA_DIR} ARCHIVE_NAME Porosity_Image.tar.gz diff --git a/src/Plugins/ITKImageProcessing/docs/ITKMhaFileReader.md b/src/Plugins/ITKImageProcessing/docs/ITKMhaFileReader.md index ee6ed947d6..3315fe73aa 100644 --- a/src/Plugins/ITKImageProcessing/docs/ITKMhaFileReader.md +++ b/src/Plugins/ITKImageProcessing/docs/ITKMhaFileReader.md @@ -10,7 +10,25 @@ ITKImageProcessing (ITKImageProcessing) ## Description -Reads MHA images and their transformation matrices using ITK +Reads MHA images and the transformation matrix using ITK. Some select headers from the MHA file are read. If those headers are not available then the default values are used. + +- Number of Dimensions +- Center of Rotation (0,0,0 is the default) +- Offset (used at the origin for the created Image Geometr: 0,0,0 is the default) +- Transformation Matrix + +### Use of the Transformation Matrix Notes + +There is an option to use the transpose of the Transformation Matrix. This can be useful if the stored transformation matrix is not the correct active transformation. If the determinant of the transformation matrix is NOT 1.0 (or really close) AND the user has selected to transpose the matrix a preflight error will be thrown. Using the *transpose* of the transformation matrix **only** works if the transformation matrix purely represents a rotation: Other affine transforms are **NOT** allowed such as shear, scale and translation. + +#### Technical Discussion + +A 4x4 transformation matrix that involves only rotation (and no translation, scaling, or other transformations), the transpose of the matrix is equivalent to its inverse. This property is specific to orthogonal matrices, which are matrices where the rows and columns form a set of orthonormal vectors. In the context of 3D graphics and transformations, a rotation matrix is a type of orthogonal matrix. + +The key properties that make the transpose of a rotation matrix equivalent to its inverse are: + +- **Preservation of Dot Product**: The rotation does not change the dot product between vectors, preserving angles and lengths. +- **Orthonormal Rows and Columns**: The rows (and columns) of a rotation matrix are orthonormal, meaning they have unit length and are perpendicular to each other. This property ensures that multiplying the matrix by its transpose results in the identity matrix, indicating that the transpose is indeed the inverse. % Auto generated parameter table will be inserted here diff --git a/src/Plugins/ITKImageProcessing/pipelines/(02) Image Segmentation.d3dpipeline b/src/Plugins/ITKImageProcessing/pipelines/(02) Image Segmentation.d3dpipeline index 82d103c9ab..5a94f8b945 100644 --- a/src/Plugins/ITKImageProcessing/pipelines/(02) Image Segmentation.d3dpipeline +++ b/src/Plugins/ITKImageProcessing/pipelines/(02) Image Segmentation.d3dpipeline @@ -5,8 +5,8 @@ "pipeline": [ { "args": { - "cell_data_name": "Cell Data", - "image_data_array_path": "ImageData", + "cell_attribute_matrix_name": "Cell Data", + "image_data_array_name": "ImageData", "image_geometry_path": "ImageDataContainer", "image_transform_choice": 0, "input_file_list_info": { diff --git a/src/Plugins/ITKImageProcessing/pipelines/(03) Porosity Mesh Export.d3dpipeline b/src/Plugins/ITKImageProcessing/pipelines/(03) Porosity Mesh Export.d3dpipeline index f5fba88d0b..e053862119 100644 --- a/src/Plugins/ITKImageProcessing/pipelines/(03) Porosity Mesh Export.d3dpipeline +++ b/src/Plugins/ITKImageProcessing/pipelines/(03) Porosity Mesh Export.d3dpipeline @@ -5,8 +5,8 @@ "pipeline": [ { "args": { - "cell_data_name": "Cell Data", - "image_data_array_path": "ImageData", + "cell_attribute_matrix_name": "Cell Data", + "image_data_array_name": "ImageData", "image_geometry_path": "ImageDataContainer", "image_transform_choice": 0, "input_file_list_info": { diff --git a/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Common/ReadImageUtils.cpp b/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Common/ReadImageUtils.cpp index 392fc8f6fa..384cde0170 100644 --- a/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Common/ReadImageUtils.cpp +++ b/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Common/ReadImageUtils.cpp @@ -4,7 +4,8 @@ namespace cxItkImageReader { //------------------------------------------------------------------------------ -Result ReadImagePreflight(const std::string& fileName, DataPath imageGeomPath, std::string cellDataName, DataPath arrayPath, const ImageReaderOptions& imageReaderOptions) +Result ReadImagePreflight(const std::string& fileName, DataPath imageGeomPath, const std::string& cellDataName, const std::string& arrayName, + const ImageReaderOptions& imageReaderOptions) { OutputActions actions; @@ -73,7 +74,7 @@ Result ReadImagePreflight(const std::string& fileName, DataPath i actions.appendAction(std::make_unique(std::move(imageGeomPath), std::move(dims), origin.toContainer(), spacing.toContainer(), cellDataName)); - actions.appendAction(std::make_unique(*numericType, std::move(arrayDims), std::move(cDims), std::move(arrayPath))); + actions.appendAction(std::make_unique(*numericType, std::move(arrayDims), std::move(cDims), imageGeomPath.createChildPath(cellDataName).createChildPath(arrayName))); } catch(const itk::ExceptionObject& err) { diff --git a/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Common/ReadImageUtils.hpp b/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Common/ReadImageUtils.hpp index 154c7e44d4..0e776c734b 100644 --- a/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Common/ReadImageUtils.hpp +++ b/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Common/ReadImageUtils.hpp @@ -182,9 +182,10 @@ struct ImageReaderOptions * @param fileName * @param imageGeomPath * @param cellDataName - * @param arrayPath + * @param arrayName * @return */ -Result ReadImagePreflight(const std::string& fileName, DataPath imageGeomPath, std::string cellDataName, DataPath arrayPath, const ImageReaderOptions& imageReaderOptions); +Result ReadImagePreflight(const std::string& fileName, DataPath imageGeomPath, const std::string& cellDataName, const std::string& arrayName, + const ImageReaderOptions& imageReaderOptions); } // namespace cxItkImageReader diff --git a/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/Algorithms/ITKImportFijiMontage.cpp b/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/Algorithms/ITKImportFijiMontage.cpp index 14a93c7ec3..0b0f0ec9ba 100644 --- a/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/Algorithms/ITKImportFijiMontage.cpp +++ b/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/Algorithms/ITKImportFijiMontage.cpp @@ -183,7 +183,7 @@ class IOHandler Result<> outputResult = {}; auto* filterListPtr = Application::Instance()->getFilterList(); - auto imageImportFilter = ITKImageReader(); + // auto imageImportFilter = ITKImageReader(); for(const auto& bound : m_Cache.bounds) { diff --git a/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKImageReader.cpp b/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKImageReader.cpp index 278685b6c5..a902990c30 100644 --- a/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKImageReader.cpp +++ b/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKImageReader.cpp @@ -81,11 +81,11 @@ Parameters ITKImageReader::parameters() const FileSystemPathParameter::ExtensionsType{{".png"}, {".tiff"}, {".tif"}, {".bmp"}, {".jpeg"}, {".jpg"}, {".nrrd"}, {".mha"}}, FileSystemPathParameter::PathType::InputFile, false)); - params.insertSeparator(Parameters::Separator{"Created Cell Data"}); + params.insertSeparator(Parameters::Separator{"Created Data Objects"}); params.insert(std::make_unique(k_ImageGeometryPath_Key, "Created Image Geometry", "The path to the created Image Geometry", DataPath({"ImageDataContainer"}))); - params.insert(std::make_unique(k_CellDataName_Key, "Cell Data Name", "The name of the created cell attribute matrix", ImageGeom::k_CellDataName)); - params.insert(std::make_unique(k_ImageDataArrayPath_Key, "Created Image Data", "The path to the created image data array", - DataPath({"ImageDataContainer", ImageGeom::k_CellDataName, "ImageData"}))); + params.insert(std::make_unique(k_CellDataName_Key, "Created Cell Attribute Matrix", "The name of the created cell attribute matrix", ImageGeom::k_CellDataName)); + params.insert(std::make_unique(k_ImageDataArrayPath_Key, "Created Cell Data", + "The name of the created image data array. Will be stored in the created Cell Attribute Matrix", "ImageData")); return params; } @@ -102,13 +102,13 @@ IFilter::PreflightResult ITKImageReader::preflightImpl(const DataStructure& data { auto fileName = filterArgs.value(k_FileName_Key); auto imageGeomPath = filterArgs.value(k_ImageGeometryPath_Key); - auto cellDataName = filterArgs.value(k_CellDataName_Key); - auto imageDataArrayPath = filterArgs.value(k_ImageDataArrayPath_Key); + auto cellDataName = filterArgs.value(k_CellDataName_Key); + auto imageDataArrayName = filterArgs.value(k_ImageDataArrayPath_Key); auto shouldChangeOrigin = filterArgs.value(k_ChangeOrigin_Key); auto shouldCenterOrigin = filterArgs.value(k_CenterOrigin_Key); auto shouldChangeSpacing = filterArgs.value(k_ChangeSpacing_Key); - auto origin = filterArgs.value>(k_Origin_Key); - auto spacing = filterArgs.value>(k_Spacing_Key); + auto origin = filterArgs.value(k_Origin_Key); + auto spacing = filterArgs.value(k_Spacing_Key); std::string fileNameString = fileName.string(); @@ -120,7 +120,7 @@ IFilter::PreflightResult ITKImageReader::preflightImpl(const DataStructure& data imageReaderOptions.Origin = FloatVec3(static_cast(origin[0]), static_cast(origin[1]), static_cast(origin[2])); imageReaderOptions.Spacing = FloatVec3(static_cast(spacing[0]), static_cast(spacing[1]), static_cast(spacing[2])); - Result result = cxItkImageReader::ReadImagePreflight(fileNameString, imageGeomPath, cellDataName, imageDataArrayPath, imageReaderOptions); + Result result = cxItkImageReader::ReadImagePreflight(fileNameString, imageGeomPath, cellDataName, imageDataArrayName, imageReaderOptions); return {result}; } @@ -131,12 +131,15 @@ Result<> ITKImageReader::executeImpl(DataStructure& dataStructure, const Argumen { auto fileName = filterArgs.value(k_FileName_Key); auto imageGeometryPath = filterArgs.value(k_ImageGeometryPath_Key); - auto imageDataArrayPath = filterArgs.value(k_ImageDataArrayPath_Key); + auto cellDataName = filterArgs.value(k_CellDataName_Key); + auto imageDataArrayName = filterArgs.value(k_ImageDataArrayPath_Key); // auto shouldChangeOrigin = filterArgs.value(k_ChangeOrigin_Key); // auto shouldCenterOrigin = filterArgs.value(k_CenterOrigin_Key); // auto shouldChangeSpacing = filterArgs.value(k_ChangeSpacing_Key); - auto origin = filterArgs.value>(k_Origin_Key); - auto spacing = filterArgs.value>(k_Spacing_Key); + auto origin = filterArgs.value(k_Origin_Key); + auto spacing = filterArgs.value(k_Spacing_Key); + + DataPath imageDataArrayPath = imageGeometryPath.createChildPath(cellDataName).createChildPath(imageDataArrayName); const IDataArray* inputArrayPtr = dataStructure.getDataAs(imageDataArrayPath); if(!inputArrayPtr->getDataFormat().empty()) diff --git a/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKImageReader.hpp b/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKImageReader.hpp index 04071b219c..ebaf64ce4d 100644 --- a/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKImageReader.hpp +++ b/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKImageReader.hpp @@ -25,9 +25,9 @@ class ITKIMAGEPROCESSING_EXPORT ITKImageReader : public IFilter // Parameter Keys static inline constexpr StringLiteral k_FileName_Key = "file_name"; - static inline constexpr StringLiteral k_ImageGeometryPath_Key = "geometry_path"; - static inline constexpr StringLiteral k_ImageDataArrayPath_Key = "image_data_array_path"; - static inline constexpr StringLiteral k_CellDataName_Key = "cell_data_name"; + static inline constexpr StringLiteral k_ImageGeometryPath_Key = "created_geometry_path"; + static inline constexpr StringLiteral k_ImageDataArrayPath_Key = "image_data_array_name"; + static inline constexpr StringLiteral k_CellDataName_Key = "cell_attribute_matrix_name"; static inline constexpr StringLiteral k_LengthUnit_Key = "length_unit"; diff --git a/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKImportFijiMontageFilter.cpp b/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKImportFijiMontageFilter.cpp index 7d6737d123..d6c325ddf0 100644 --- a/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKImportFijiMontageFilter.cpp +++ b/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKImportFijiMontageFilter.cpp @@ -174,7 +174,7 @@ IFilter::PreflightResult ITKImportFijiMontageFilter::preflightImpl(const DataStr imageImportArgs.insertOrAssign(ITKImageReader::k_FileName_Key, std::make_any(bound.Filepath)); imageImportArgs.insertOrAssign(ITKImageReader::k_ImageGeometryPath_Key, std::make_any(imageDataProxy.getParent().getParent())); imageImportArgs.insertOrAssign(ITKImageReader::k_CellDataName_Key, std::make_any(imageDataProxy.getParent().getTargetName())); - imageImportArgs.insertOrAssign(ITKImageReader::k_ImageDataArrayPath_Key, std::make_any(imageDataProxy)); + imageImportArgs.insertOrAssign(ITKImageReader::k_ImageDataArrayPath_Key, std::make_any(imageDataProxy.getTargetName())); auto result = imageImportFilter.preflight(dataStructure, imageImportArgs, messageHandler, shouldCancel); if(result.outputActions.invalid()) diff --git a/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKImportImageStack.cpp b/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKImportImageStack.cpp index ca69c7b742..f93b1012a5 100644 --- a/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKImportImageStack.cpp +++ b/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKImportImageStack.cpp @@ -134,12 +134,12 @@ void FlipAboutXAxis(DataArray& dataArray, Vec3& dims) namespace cxITKImportImageStack { template -Result<> ReadImageStack(DataStructure& dataStructure, const DataPath& imageGeomPath, const std::string& cellDataName, const DataPath& imageDataPath, const std::vector& files, +Result<> ReadImageStack(DataStructure& dataStructure, const DataPath& imageGeomPath, const std::string& cellDataName, const std::string& imageArrayName, const std::vector& files, ChoicesParameter::ValueType transformType, bool convertToGrayscale, VectorFloat32Parameter::ValueType luminosityValues, const IFilter::MessageHandler& messageHandler, const std::atomic_bool& shouldCancel) { auto& imageGeom = dataStructure.getDataRefAs(imageGeomPath); - + DataPath imageDataPath = imageGeomPath.createChildPath(cellDataName).createChildPath(imageArrayName); SizeVec3 dims = imageGeom.getDimensions(); const usize tuplesPerSlice = dims[0] * dims[1]; @@ -174,7 +174,7 @@ Result<> ReadImageStack(DataStructure& dataStructure, const DataPath& imageGeomP Arguments args; args.insertOrAssign(ITKImageReader::k_ImageGeometryPath_Key, std::make_any(imageGeomPath)); args.insertOrAssign(ITKImageReader::k_CellDataName_Key, std::make_any(cellDataName)); - args.insertOrAssign(ITKImageReader::k_ImageDataArrayPath_Key, std::make_any(imageDataPath)); + args.insertOrAssign(ITKImageReader::k_ImageDataArrayPath_Key, std::make_any(imageArrayName)); args.insertOrAssign(ITKImageReader::k_FileName_Key, std::make_any(filePath)); auto executeResult = imageReader.execute(importedDataStructure, args); @@ -377,8 +377,8 @@ IFilter::PreflightResult ITKImportImageStack::preflightImpl(const DataStructure& // list and hope the rest are correct. Arguments imageReaderArgs; imageReaderArgs.insertOrAssign(ITKImageReader::k_ImageGeometryPath_Key, std::make_any(imageGeomPath)); - imageReaderArgs.insertOrAssign(ITKImageReader::k_CellDataName_Key, std::make_any(cellDataName)); - imageReaderArgs.insertOrAssign(ITKImageReader::k_ImageDataArrayPath_Key, std::make_any(imageDataPath)); + imageReaderArgs.insertOrAssign(ITKImageReader::k_CellDataName_Key, std::make_any(cellDataName)); + imageReaderArgs.insertOrAssign(ITKImageReader::k_ImageDataArrayPath_Key, std::make_any(pImageDataArrayNameValue)); imageReaderArgs.insertOrAssign(ITKImageReader::k_FileName_Key, std::make_any(files.at(0))); const ITKImageReader imageReader; @@ -458,7 +458,7 @@ Result<> ITKImportImageStack::executeImpl(DataStructure& dataStructure, const Ar auto convertToGrayScaleValue = filterArgs.value(k_ConvertToGrayScale_Key); auto colorWeightsValue = filterArgs.value(k_ColorWeights_Key); - const DataPath imageDataPath = imageGeomPath.createChildPath(cellDataName).createChildPath(imageDataName); + // const DataPath imageDataPath = imageGeomPath.createChildPath(cellDataName).createChildPath(imageDataName); std::vector files = inputFileListInfo.generate(); @@ -479,52 +479,52 @@ Result<> ITKImportImageStack::executeImpl(DataStructure& dataStructure, const Ar switch(*numericType) { case NumericType::uint8: { - readResult = cxITKImportImageStack::ReadImageStack(dataStructure, imageGeomPath, cellDataName, imageDataPath, files, imageTransformValue, convertToGrayScaleValue, colorWeightsValue, + readResult = cxITKImportImageStack::ReadImageStack(dataStructure, imageGeomPath, cellDataName, imageDataName, files, imageTransformValue, convertToGrayScaleValue, colorWeightsValue, messageHandler, shouldCancel); break; } case NumericType::int8: { - readResult = cxITKImportImageStack::ReadImageStack(dataStructure, imageGeomPath, cellDataName, imageDataPath, files, imageTransformValue, convertToGrayScaleValue, colorWeightsValue, + readResult = cxITKImportImageStack::ReadImageStack(dataStructure, imageGeomPath, cellDataName, imageDataName, files, imageTransformValue, convertToGrayScaleValue, colorWeightsValue, messageHandler, shouldCancel); break; } case NumericType::uint16: { - readResult = cxITKImportImageStack::ReadImageStack(dataStructure, imageGeomPath, cellDataName, imageDataPath, files, imageTransformValue, convertToGrayScaleValue, colorWeightsValue, + readResult = cxITKImportImageStack::ReadImageStack(dataStructure, imageGeomPath, cellDataName, imageDataName, files, imageTransformValue, convertToGrayScaleValue, colorWeightsValue, messageHandler, shouldCancel); break; } case NumericType::int16: { - readResult = cxITKImportImageStack::ReadImageStack(dataStructure, imageGeomPath, cellDataName, imageDataPath, files, imageTransformValue, convertToGrayScaleValue, colorWeightsValue, + readResult = cxITKImportImageStack::ReadImageStack(dataStructure, imageGeomPath, cellDataName, imageDataName, files, imageTransformValue, convertToGrayScaleValue, colorWeightsValue, messageHandler, shouldCancel); break; } case NumericType::uint32: { - readResult = cxITKImportImageStack::ReadImageStack(dataStructure, imageGeomPath, cellDataName, imageDataPath, files, imageTransformValue, convertToGrayScaleValue, colorWeightsValue, + readResult = cxITKImportImageStack::ReadImageStack(dataStructure, imageGeomPath, cellDataName, imageDataName, files, imageTransformValue, convertToGrayScaleValue, colorWeightsValue, messageHandler, shouldCancel); break; } case NumericType::int32: { - readResult = cxITKImportImageStack::ReadImageStack(dataStructure, imageGeomPath, cellDataName, imageDataPath, files, imageTransformValue, convertToGrayScaleValue, colorWeightsValue, + readResult = cxITKImportImageStack::ReadImageStack(dataStructure, imageGeomPath, cellDataName, imageDataName, files, imageTransformValue, convertToGrayScaleValue, colorWeightsValue, messageHandler, shouldCancel); break; } case NumericType::uint64: { - readResult = cxITKImportImageStack::ReadImageStack(dataStructure, imageGeomPath, cellDataName, imageDataPath, files, imageTransformValue, convertToGrayScaleValue, colorWeightsValue, + readResult = cxITKImportImageStack::ReadImageStack(dataStructure, imageGeomPath, cellDataName, imageDataName, files, imageTransformValue, convertToGrayScaleValue, colorWeightsValue, messageHandler, shouldCancel); break; } case NumericType::int64: { - readResult = cxITKImportImageStack::ReadImageStack(dataStructure, imageGeomPath, cellDataName, imageDataPath, files, imageTransformValue, convertToGrayScaleValue, colorWeightsValue, + readResult = cxITKImportImageStack::ReadImageStack(dataStructure, imageGeomPath, cellDataName, imageDataName, files, imageTransformValue, convertToGrayScaleValue, colorWeightsValue, messageHandler, shouldCancel); break; } case NumericType::float32: { - readResult = cxITKImportImageStack::ReadImageStack(dataStructure, imageGeomPath, cellDataName, imageDataPath, files, imageTransformValue, convertToGrayScaleValue, colorWeightsValue, + readResult = cxITKImportImageStack::ReadImageStack(dataStructure, imageGeomPath, cellDataName, imageDataName, files, imageTransformValue, convertToGrayScaleValue, colorWeightsValue, messageHandler, shouldCancel); break; } case NumericType::float64: { - readResult = cxITKImportImageStack::ReadImageStack(dataStructure, imageGeomPath, cellDataName, imageDataPath, files, imageTransformValue, convertToGrayScaleValue, colorWeightsValue, + readResult = cxITKImportImageStack::ReadImageStack(dataStructure, imageGeomPath, cellDataName, imageDataName, files, imageTransformValue, convertToGrayScaleValue, colorWeightsValue, messageHandler, shouldCancel); break; } diff --git a/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKImportImageStack.hpp b/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKImportImageStack.hpp index 7db20aa7c1..d884022606 100644 --- a/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKImportImageStack.hpp +++ b/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKImportImageStack.hpp @@ -28,8 +28,8 @@ class ITKIMAGEPROCESSING_EXPORT ITKImportImageStack : public IFilter static inline constexpr StringLiteral k_Origin_Key = "origin"; static inline constexpr StringLiteral k_Spacing_Key = "spacing"; static inline constexpr StringLiteral k_ImageGeometryPath_Key = "image_geometry_path"; - static inline constexpr StringLiteral k_ImageDataArrayPath_Key = "image_data_array_path"; - static inline constexpr StringLiteral k_CellDataName_Key = "cell_data_name"; + static inline constexpr StringLiteral k_ImageDataArrayPath_Key = "image_data_array_name"; + static inline constexpr StringLiteral k_CellDataName_Key = "cell_attribute_matrix_name"; static inline constexpr StringLiteral k_ImageTransformChoice_Key = "image_transform_choice"; static inline constexpr StringLiteral k_ConvertToGrayScale_Key = "convert_to_gray_scale"; static inline constexpr StringLiteral k_ColorWeights_Key = "color_weights"; diff --git a/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKMhaFileReader.cpp b/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKMhaFileReader.cpp index 5b7706381d..c6cafa57b8 100644 --- a/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKMhaFileReader.cpp +++ b/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKMhaFileReader.cpp @@ -1,9 +1,5 @@ #include "ITKMhaFileReader.hpp" -#include - -#include - #include "ITKImageProcessing/Filters/ITKImageReader.hpp" #include "simplnx/Core/Application.hpp" @@ -19,7 +15,13 @@ #include "simplnx/Parameters/FileSystemPathParameter.hpp" #include "simplnx/Parameters/GeometrySelectionParameter.hpp" #include "simplnx/Utilities/FilterUtilities.hpp" +#include "simplnx/Utilities/ImageRotationUtilities.hpp" + +#include +#include + +#include namespace fs = std::filesystem; using namespace nx::core; @@ -35,6 +37,8 @@ inline constexpr StringLiteral k_CellAttributeMatrixPathKey = "cell_attribute_ma inline constexpr StringLiteral k_TransformationTypeKey = "transformation_type"; inline constexpr StringLiteral k_ManualTransformationMatrixKey = "manual_transformation_matrix"; inline constexpr StringLiteral k_InterpolationTypeKey = "interpolation_type"; +inline constexpr StringLiteral k_TranslateGeometryToGlobalOrigin_Key = "translate_geometry_to_global_origin"; + const nx::core::ChoicesParameter::ValueType k_ManualTransformationMatrixIdx = 2ULL; const std::string k_NearestNeighborInterpolation("Nearest Neighbor"); @@ -44,19 +48,77 @@ const nx::core::ChoicesParameter::Choices k_InterpolationChoices = {k_NearestNei const nx::core::ChoicesParameter::ValueType k_NearestNeighborInterpolationIdx = 0ULL; const nx::core::ChoicesParameter::ValueType k_LinearInterpolationIdx = 1ULL; -Result> readTransformMatrix(const std::string& filePath) +struct MHAHeaderInfo { - std::array arr = {}; + ImageRotationUtilities::Matrix4fR TransformationMatrix; + std::array CenterOfRotation = {0.0f, 0.0f, 0.0f}; + std::array Origin = {0.0f, 0.0f, 0.0f}; + std::array Dimensions = {0UL, 0UL, 0UL}; + std::vector Errors; + std::vector Warnings; + std::vector PreflightUpdatedValues; +}; - const itk::MetaImageIO::Pointer metaImageIO = itk::MetaImageIO::New(); +/** + * @brief + * @param transformMatrix + * @return + */ +std::string generateTransformMatrixString(const ImageRotationUtilities::Matrix4fR& transformMatrix) +{ + std::string result; + + for(Eigen::Index r = 0; r < 4; r++) + { + result += "| "; + for(Eigen::Index c = 0; c < 4; c++) + { + result += std::to_string(transformMatrix(r, c)); + if(c < 3) + { + result += "\t "; + } + } + result += " |\n"; + } + + return result; +} + +/** + * @brief + * @param transformationMatrix + * @return + */ +DynamicTableParameter::ValueType convertEigenMatrix(const ImageRotationUtilities::Matrix4fR& transformMatrix) +{ + return DynamicTableInfo::TableDataType{{transformMatrix(0, 0), transformMatrix(0, 1), transformMatrix(0, 2), transformMatrix(0, 3)}, + {transformMatrix(1, 0), transformMatrix(1, 1), transformMatrix(1, 2), transformMatrix(1, 3)}, + {transformMatrix(2, 0), transformMatrix(2, 1), transformMatrix(2, 2), transformMatrix(2, 3)}, + {transformMatrix(3, 0), transformMatrix(3, 1), transformMatrix(3, 2), transformMatrix(3, 3)}}; +} + +/** + * @brief + * @param filePath + * @param transpose + * @return + */ +MHAHeaderInfo readMhaHeader(const std::string& filePath, bool transpose) +{ + MHAHeaderInfo headerInfo; + headerInfo.TransformationMatrix.fill(0.0F); + headerInfo.TransformationMatrix(3, 3) = 1.0f; + const itk::MetaImageIO::Pointer metaImageIO = itk::MetaImageIO::New(); try { metaImageIO->SetFileName(filePath); metaImageIO->ReadImageInformation(); } catch(itk::ExceptionObject& e) { - return {MakeErrorResult>(-5000, fmt::format("Exception caught while reading image: {}", e.what()))}; + headerInfo.Errors.push_back({-5000, fmt::format("Exception caught while reading image: {}", e.what())}); + return headerInfo; } /* @@ -80,79 +142,75 @@ Result> readTransformMatrix(const std::string& filePath) const int nDims = metaImagePtr->NDims(); if(nDims == 2) { - arr[0] = static_cast(metaImagePtr->TransformMatrix(0, 0)); - arr[1] = static_cast(metaImagePtr->TransformMatrix(0, 1)); - arr[2] = 0.0f; - arr[3] = 0.0f; - arr[4] = static_cast(metaImagePtr->TransformMatrix(1, 0)); - arr[5] = static_cast(metaImagePtr->TransformMatrix(1, 1)); - arr[6] = 0.0f; - arr[7] = 0.0f; - arr[8] = 0.0f; - arr[9] = 0.0f; - arr[10] = 1; - arr[11] = 0.0f; - arr[12] = 0.0f; - arr[13] = 0.0f; - arr[14] = 0.0f; - arr[15] = 1; + headerInfo.TransformationMatrix(0, 0) = static_cast(metaImagePtr->TransformMatrix(0, 0)); + headerInfo.TransformationMatrix(0, 1) = static_cast(metaImagePtr->TransformMatrix(0, 1)); + headerInfo.TransformationMatrix(1, 0) = static_cast(metaImagePtr->TransformMatrix(1, 0)); + headerInfo.TransformationMatrix(1, 1) = static_cast(metaImagePtr->TransformMatrix(1, 1)); + headerInfo.TransformationMatrix(2, 2) = 1.0f; } else if(nDims == 3) { - arr[0] = static_cast(metaImagePtr->TransformMatrix(0, 0)); - arr[1] = static_cast(metaImagePtr->TransformMatrix(0, 1)); - arr[2] = static_cast(metaImagePtr->TransformMatrix(0, 2)); - arr[3] = 0.0f; - arr[4] = static_cast(metaImagePtr->TransformMatrix(1, 0)); - arr[5] = static_cast(metaImagePtr->TransformMatrix(1, 1)); - arr[6] = static_cast(metaImagePtr->TransformMatrix(1, 2)); - arr[7] = 0.0f; - arr[8] = static_cast(metaImagePtr->TransformMatrix(2, 0)); - arr[9] = static_cast(metaImagePtr->TransformMatrix(2, 1)); - arr[10] = static_cast(metaImagePtr->TransformMatrix(2, 2)); - arr[11] = 0.0f; - arr[12] = 0.0f; - arr[13] = 0.0f; - arr[14] = 0.0f; - arr[15] = 1; + headerInfo.TransformationMatrix(0, 0) = static_cast(metaImagePtr->TransformMatrix(0, 0)); + headerInfo.TransformationMatrix(0, 1) = static_cast(metaImagePtr->TransformMatrix(0, 1)); + headerInfo.TransformationMatrix(0, 2) = static_cast(metaImagePtr->TransformMatrix(0, 2)); + headerInfo.TransformationMatrix(1, 0) = static_cast(metaImagePtr->TransformMatrix(1, 0)); + headerInfo.TransformationMatrix(1, 1) = static_cast(metaImagePtr->TransformMatrix(1, 1)); + headerInfo.TransformationMatrix(1, 2) = static_cast(metaImagePtr->TransformMatrix(1, 2)); + headerInfo.TransformationMatrix(2, 0) = static_cast(metaImagePtr->TransformMatrix(2, 0)); + headerInfo.TransformationMatrix(2, 1) = static_cast(metaImagePtr->TransformMatrix(2, 1)); + headerInfo.TransformationMatrix(2, 2) = static_cast(metaImagePtr->TransformMatrix(2, 2)); } else { - return {MakeErrorResult>( - -5001, fmt::format("Image data has an unsupported number of dimensions ({}). This filter only supports 2-dimensional and 3-dimensional image data.", nDims))}; + headerInfo.Errors.push_back({-5001, fmt::format("Image data has an unsupported number of dimensions ({}). This filter only supports 2-dimensional and 3-dimensional image data.", nDims)}); } - return {arr}; -} + headerInfo.CenterOfRotation[0] = static_cast(metaImagePtr->CenterOfRotation(static_cast(0))); + headerInfo.CenterOfRotation[1] = static_cast(metaImagePtr->CenterOfRotation(static_cast(1))); + headerInfo.CenterOfRotation[2] = static_cast(metaImagePtr->CenterOfRotation(static_cast(2))); -std::string generateTransformMatrixString(const std::array transformMatrix) -{ - std::string result; + headerInfo.Origin[0] = static_cast(metaImagePtr->Offset(static_cast(0))); + headerInfo.Origin[1] = static_cast(metaImagePtr->Offset(static_cast(1))); + headerInfo.Origin[2] = static_cast(metaImagePtr->Offset(static_cast(2))); - for(usize i = 0; i < transformMatrix.size(); ++i) + headerInfo.Dimensions[0] = static_cast(metaImagePtr->DimSize(static_cast(0))); + headerInfo.Dimensions[1] = static_cast(metaImagePtr->DimSize(static_cast(1))); + headerInfo.Dimensions[2] = static_cast(metaImagePtr->DimSize(static_cast(2))); + for(auto& dim : headerInfo.Dimensions) { - // Add a starting bracket at the beginning of each row - if(i % 4 == 0) + if(dim == 0) { - result += "["; + dim = 1; } + } - result += std::to_string(transformMatrix[i]); + // Generate all the PreflightUpdatedValues + headerInfo.PreflightUpdatedValues.push_back({"Image Dimensions (voxels): ", fmt::format("{}", fmt::join(headerInfo.Dimensions, ", "))}); + headerInfo.PreflightUpdatedValues.push_back({"Image Origin: ", fmt::format("{: > 8.8}", fmt::join(headerInfo.Origin, ", "))}); + headerInfo.PreflightUpdatedValues.push_back({"Image Center of Rotation: ", fmt::format("{: > 8.8}", fmt::join(headerInfo.CenterOfRotation, ", "))}); - // Add a closing bracket at the end of every 4 elements - if(i % 4 == 3) - { - result += "]\n"; - } - else + float det = headerInfo.TransformationMatrix.determinant(); + + if(transpose) + { + if(std::abs(1.0 - det) > 0.0001f) { - result += ", "; + headerInfo.Errors.push_back( + {-5002, + fmt::format("Transformation Matrix is NOT a pure rotation transform. A pure transpose will not work. De-select the option to transpose the matrix. Determinant of Transform matrix is {}", + det)}); } + headerInfo.TransformationMatrix.transposeInPlace(); } + headerInfo.PreflightUpdatedValues.push_back({"Transformation Matrix: ", generateTransformMatrixString(headerInfo.TransformationMatrix)}); + headerInfo.PreflightUpdatedValues.push_back({"Transform Matrix Determinant: ", fmt::format("{}", det)}); - return result; + return headerInfo; } +/** + * @brief + */ struct CopyImageDataFunctor { template @@ -201,7 +259,7 @@ std::string ITKMhaFileReader::humanName() const //------------------------------------------------------------------------------ std::vector ITKMhaFileReader::defaultTags() const { - return {className(), "io", "input", "read", "import", "image"}; + return {className(), "io", "input", "read", "import", "image", "ITK", "MHA"}; } //------------------------------------------------------------------------------ @@ -212,23 +270,30 @@ Parameters ITKMhaFileReader::parameters() const params.insertSeparator(Parameters::Separator{"Input Parameters"}); params.insert(std::make_unique(ITKImageReader::k_FileName_Key, "Input MHA File", "The input .mha file that will be read.", fs::path(""), FileSystemPathParameter::ExtensionsType{{".mha"}}, FileSystemPathParameter::PathType::InputFile, false)); - params.insertLinkableParameter( - std::make_unique(k_SaveImageTransformationAsArray, "Save Image Transformation As Array", - "When true, the transformation matrix found in the image's header metadata will be saved as a data array in the created image geometry.", false)); + params.insertLinkableParameter(std::make_unique(k_ApplyImageTransformation, "Apply Image Transformation To Geometry", "When true, the transformation matrix found in the image's header metadata will be applied to the created image geometry.", false)); params.insert(std::make_unique(k_InterpolationTypeKey, "Interpolation Type", "The type of interpolation algorithm that is used. 0=NearestNeighbor, 1=Linear", k_NearestNeighborInterpolationIdx, k_InterpolationChoices)); - params.insertSeparator(Parameters::Separator{"Created Data Structure Items"}); - params.insert( - std::make_unique(ITKImageReader::k_ImageGeometryPath_Key, "Created Image Geometry", "The path to the created Image Geometry", DataPath({"ImageDataContainer"}))); - params.insert(std::make_unique(ITKImageReader::k_CellDataName_Key, "Cell Data Name", "The name of the created cell attribute matrix", ImageGeom::k_CellDataName)); - params.insert(std::make_unique(ITKImageReader::k_ImageDataArrayPath_Key, "Created Image Data", "The path to the created image data array", - DataPath({"ImageDataContainer", ImageGeom::k_CellDataName, "ImageData"}))); + params.insertSeparator(Parameters::Separator{"Transformation Matrix Options"}); + params.insert(std::make_unique(k_TransposeTransformMatrix, "Transpose Stored Transformation Matrix", + "When true, the transformation matrix found in the image's header metadata will be transposed before use.", false)); + params.insertLinkableParameter( + std::make_unique(k_SaveImageTransformationAsArray, "Save Image Transformation As Array", + "When true, the transformation matrix found in the image's header metadata will be saved as a data array in the created image geometry.", false)); params.insert(std::make_unique(k_TransformationMatrixDataArrayPathKey, "Transformation Matrix", "The path to the transformation matrix data array", DataPath({"ImageDataContainer", "TransformationMatrix"}))); + params.insertSeparator(Parameters::Separator{"Created Image Data Objects"}); + params.insert( + std::make_unique(ITKImageReader::k_ImageGeometryPath_Key, "Created Image Geometry", "The path to the created Image Geometry", DataPath({"ImageDataContainer"}))); + + params.insert( + std::make_unique(ITKImageReader::k_CellDataName_Key, "Created Cell Attribute Matrix", "The name of the created cell attribute matrix", ImageGeom::k_CellDataName)); + params.insert(std::make_unique(ITKImageReader::k_ImageDataArrayPath_Key, "Created Cell Data", + "The name of the created image data array. Will be stored in the created Cell Attribute Matrix", "ImageData")); + params.linkParameters(k_SaveImageTransformationAsArray, k_TransformationMatrixDataArrayPathKey, true); params.linkParameters(k_ApplyImageTransformation, k_InterpolationTypeKey, true); @@ -248,12 +313,16 @@ IFilter::PreflightResult ITKMhaFileReader::preflightImpl(const DataStructure& da auto fileNamePath = filterArgs.value(ITKImageReader::k_FileName_Key); auto imageGeomPath = filterArgs.value(ITKImageReader::k_ImageGeometryPath_Key); auto cellDataName = filterArgs.value(ITKImageReader::k_CellDataName_Key); - auto imageDataArrayPath = filterArgs.value(ITKImageReader::k_ImageDataArrayPath_Key); + auto imageDataArrayName = filterArgs.value(ITKImageReader::k_ImageDataArrayPath_Key); auto saveImageTransformationAsArray = filterArgs.value(k_SaveImageTransformationAsArray); auto transformationMatrixDataArrayPath = filterArgs.value(k_TransformationMatrixDataArrayPathKey); auto applyImageTransformation = filterArgs.value(k_ApplyImageTransformation); + auto transposeTransform = filterArgs.value(k_TransposeTransformMatrix); auto interpolationType = filterArgs.value(k_InterpolationTypeKey); - IFilter::PreflightResult preflightResult; + + DataPath imageDataArrayPath = imageGeomPath.createChildPath(cellDataName).createChildPath(imageDataArrayName); + nx::core::Result resultOutputActions; + std::vector preflightUpdatedValues; { const ITKImageReader imageReaderFilter; @@ -261,53 +330,73 @@ IFilter::PreflightResult ITKMhaFileReader::preflightImpl(const DataStructure& da imageReaderArgs.insertOrAssign(ITKImageReader::k_FileName_Key, fileNamePath); imageReaderArgs.insertOrAssign(ITKImageReader::k_ImageGeometryPath_Key, imageGeomPath); imageReaderArgs.insertOrAssign(ITKImageReader::k_CellDataName_Key, cellDataName); - imageReaderArgs.insertOrAssign(ITKImageReader::k_ImageDataArrayPath_Key, imageDataArrayPath); - preflightResult = imageReaderFilter.preflight(dataStructure, imageReaderArgs, messageHandler, shouldCancel); + imageReaderArgs.insertOrAssign(ITKImageReader::k_ImageDataArrayPath_Key, imageDataArrayName); + IFilter::PreflightResult preflightResult = imageReaderFilter.preflight(dataStructure, imageReaderArgs, messageHandler, shouldCancel); if(preflightResult.outputActions.invalid()) { - return preflightResult; + resultOutputActions.m_Warnings.insert(resultOutputActions.m_Warnings.end(), preflightResult.outputActions.m_Warnings.begin(), preflightResult.outputActions.m_Warnings.end()); + resultOutputActions.errors().insert(resultOutputActions.errors().end(), preflightResult.outputActions.errors().begin(), preflightResult.outputActions.errors().end()); + return {resultOutputActions, preflightUpdatedValues}; } + preflightUpdatedValues = std::move(preflightResult.outputValues); + resultOutputActions = std::move(preflightResult.outputActions); } - if(applyImageTransformation || saveImageTransformationAsArray) + // Read the header information from the MHA file + MHAHeaderInfo headerInfo = readMhaHeader(fileNamePath.string(), transposeTransform); + // Transfer any warnings that were produced. + resultOutputActions.m_Warnings.insert(resultOutputActions.m_Warnings.begin(), headerInfo.Warnings.begin(), headerInfo.Warnings.end()); + // Append any Preflight updated values generated when reading the MHA Header + preflightUpdatedValues.insert(preflightUpdatedValues.end(), headerInfo.PreflightUpdatedValues.begin(), headerInfo.PreflightUpdatedValues.end()); + // Check for errors that happened during the MHA Header reading + if(!headerInfo.Errors.empty()) { - Result> transformMatrixResult = readTransformMatrix(fileNamePath.string()); - if(transformMatrixResult.invalid()) - { - auto voidResult = ConvertResult(std::move(transformMatrixResult)); - return {ConvertResultTo(std::move(voidResult), {})}; - } + // Return both the resultOutputActions and the preflightUpdatedValues via std::move() + return {{nonstd::make_unexpected(headerInfo.Errors), resultOutputActions.m_Warnings}, preflightUpdatedValues}; + } - std::array& transformMatrix = transformMatrixResult.value(); + // If the user wants to save the Transform Matrix as an Array + if(saveImageTransformationAsArray) + { + auto createArrayAction = std::make_unique(nx::core::DataType::float32, std::vector{1}, std::vector{16}, transformationMatrixDataArrayPath); + resultOutputActions.value().appendAction(std::move(createArrayAction)); + } + // If the user wants to apply the transform matrix to the incoming image + if(applyImageTransformation) + { auto* filterListPtr = Application::Instance()->getFilterList(); auto applyTransformationToGeometryFilter = filterListPtr->createFilter(k_ApplyTransformationToGeometryFilterHandle); if(applyTransformationToGeometryFilter == nullptr) { - return {MakeErrorResult(-5001, fmt::format("Error preflighting application of transformation to geometry - Unable to instantiate filter 'Apply Transformation To Geometry'."))}; + resultOutputActions.errors().push_back({-5001, fmt::format("Error preflighting application of transformation to geometry - Unable to instantiate filter 'Apply Transformation To Geometry'.")}); + return {resultOutputActions, preflightUpdatedValues}; } Arguments args; args.insertOrAssign(k_SelectedImageGeometryKey, std::make_any(DataPath{imageGeomPath})); args.insertOrAssign(k_CellAttributeMatrixPathKey, std::make_any(DataPath{imageGeomPath.createChildPath(cellDataName)})); args.insertOrAssign(k_TransformationTypeKey, std::make_any(k_ManualTransformationMatrixIdx)); - args.insertOrAssign(k_ManualTransformationMatrixKey, - std::make_any(DynamicTableInfo::TableDataType{{transformMatrix[0], transformMatrix[1], transformMatrix[2], transformMatrix[3]}, - {transformMatrix[4], transformMatrix[5], transformMatrix[6], transformMatrix[7]}, - {transformMatrix[8], transformMatrix[9], transformMatrix[10], transformMatrix[11]}, - {transformMatrix[12], transformMatrix[13], transformMatrix[14], transformMatrix[15]}})); + args.insertOrAssign(k_ManualTransformationMatrixKey, std::make_any(convertEigenMatrix(headerInfo.TransformationMatrix))); args.insertOrAssign(k_InterpolationTypeKey, std::make_any(interpolationType)); - preflightResult.outputValues.push_back({"Image Transformation Matrix", generateTransformMatrixString(transformMatrix)}); - - if(saveImageTransformationAsArray) + if(headerInfo.CenterOfRotation == std::array{0.0f, 0.0f, 0.0f}) { - auto createArrayAction = std::make_unique(nx::core::DataType::float32, std::vector{1}, std::vector{transformMatrix.size()}, transformationMatrixDataArrayPath); - preflightResult.outputActions.value().appendAction(std::move(createArrayAction)); + args.insertOrAssign(k_TranslateGeometryToGlobalOrigin_Key, std::make_any(true)); } + + // Preflight the filter + IFilter::PreflightResult applyTransResult = applyTransformationToGeometryFilter->preflight(dataStructure, args, messageHandler, shouldCancel); + // Copy over any preflight updated values + preflightUpdatedValues.insert(preflightUpdatedValues.end(), applyTransResult.outputValues.begin(), applyTransResult.outputValues.end()); + // Copy over any errors/warnings + + // preflightResult.outputActions.errors().insert( preflightResult.outputActions.errors().begin(), applyTransResult.outputActions.errors().begin(), applyTransResult.outputActions.errors().end()); + // preflightResult.outputActions.warnings().insert( preflightResult.outputActions.warnings().begin(), applyTransResult.outputActions.warnings().begin(), + // applyTransResult.outputActions.warnings().end()); } - return preflightResult; + return {resultOutputActions, preflightUpdatedValues}; } //------------------------------------------------------------------------------ @@ -317,11 +406,15 @@ Result<> ITKMhaFileReader::executeImpl(DataStructure& dataStructure, const Argum auto fileNamePath = filterArgs.value(ITKImageReader::k_FileName_Key); auto imageGeomPath = filterArgs.value(ITKImageReader::k_ImageGeometryPath_Key); auto cellDataName = filterArgs.value(ITKImageReader::k_CellDataName_Key); - auto imageDataArrayPath = filterArgs.value(ITKImageReader::k_ImageDataArrayPath_Key); + auto imageDataArrayName = filterArgs.value(ITKImageReader::k_ImageDataArrayPath_Key); auto saveImageTransformationAsArray = filterArgs.value(k_SaveImageTransformationAsArray); auto transformationMatrixDataArrayPath = filterArgs.value(k_TransformationMatrixDataArrayPathKey); auto applyImageTransformation = filterArgs.value(k_ApplyImageTransformation); auto interpolationType = filterArgs.value(k_InterpolationTypeKey); + auto transposeTransform = filterArgs.value(k_TransposeTransformMatrix); + + DataPath imageDataArrayPath = imageGeomPath.createChildPath(cellDataName).createChildPath(imageDataArrayName); + Result<> mainResult; // Execute the ImageFileReader filter @@ -333,7 +426,7 @@ Result<> ITKMhaFileReader::executeImpl(DataStructure& dataStructure, const Argum args.insertOrAssign(ITKImageReader::k_FileName_Key, fileNamePath); args.insertOrAssign(ITKImageReader::k_ImageGeometryPath_Key, imageGeomPath); args.insertOrAssign(ITKImageReader::k_CellDataName_Key, cellDataName); - args.insertOrAssign(ITKImageReader::k_ImageDataArrayPath_Key, imageDataArrayPath); + args.insertOrAssign(ITKImageReader::k_ImageDataArrayPath_Key, imageDataArrayName); auto executeResult = imageReaderFilter.execute(importedDataStructure, args, pipelineNode, messageHandler, shouldCancel); if(executeResult.result.invalid()) @@ -357,18 +450,19 @@ Result<> ITKMhaFileReader::executeImpl(DataStructure& dataStructure, const Argum if(applyImageTransformation || saveImageTransformationAsArray) { messageHandler(fmt::format("Reading transformation matrix from image file '{}'...", fileNamePath.string())); - Result> transformMatrixResult = readTransformMatrix(fileNamePath.string()); - if(transformMatrixResult.invalid()) + MHAHeaderInfo headerInfo = readMhaHeader(fileNamePath.string(), transposeTransform); + + if(!headerInfo.Errors.empty()) + { - return ConvertResult(std::move(transformMatrixResult)); + return {{nonstd::make_unexpected(headerInfo.Errors)}}; } - std::array transformMat = transformMatrixResult.value(); - if(saveImageTransformationAsArray) { Float32Array& transformationMatrixArray = dataStructure.getDataRefAs(transformationMatrixDataArrayPath); - std::copy(transformMat.begin(), transformMat.end(), transformationMatrixArray.begin()); + // Eigen 3.4 has STL iterators. + std::copy(headerInfo.TransformationMatrix.data(), headerInfo.TransformationMatrix.data() + 16, transformationMatrixArray.begin()); } if(applyImageTransformation) @@ -386,12 +480,12 @@ Result<> ITKMhaFileReader::executeImpl(DataStructure& dataStructure, const Argum args.insertOrAssign(k_SelectedImageGeometryKey, std::make_any(DataPath{imageGeomPath})); args.insertOrAssign(k_CellAttributeMatrixPathKey, std::make_any(DataPath{imageGeomPath.createChildPath(cellDataName)})); args.insertOrAssign(k_TransformationTypeKey, std::make_any(k_ManualTransformationMatrixIdx)); - args.insertOrAssign(k_ManualTransformationMatrixKey, - std::make_any(DynamicTableInfo::TableDataType{{transformMat[0], transformMat[1], transformMat[2], transformMat[3]}, - {transformMat[4], transformMat[5], transformMat[6], transformMat[7]}, - {transformMat[8], transformMat[9], transformMat[10], transformMat[11]}, - {transformMat[12], transformMat[13], transformMat[14], transformMat[15]}})); + args.insertOrAssign(k_ManualTransformationMatrixKey, std::make_any(convertEigenMatrix(headerInfo.TransformationMatrix))); args.insertOrAssign(k_InterpolationTypeKey, std::make_any(interpolationType)); + if(headerInfo.CenterOfRotation == std::array{0.0f, 0.0f, 0.0f}) + { + args.insertOrAssign(k_TranslateGeometryToGlobalOrigin_Key, std::make_any(true)); + } { const ExecuteResult result = applyTransformationToGeometryFilter->execute(dataStructure, args, pipelineNode, messageHandler, shouldCancel); diff --git a/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKMhaFileReader.hpp b/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKMhaFileReader.hpp index 7adba869f8..35ad4e1c0a 100644 --- a/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKMhaFileReader.hpp +++ b/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Filters/ITKMhaFileReader.hpp @@ -23,6 +23,7 @@ class ITKIMAGEPROCESSING_EXPORT ITKMhaFileReader : public IFilter static inline constexpr StringLiteral k_ApplyImageTransformation = "apply_image_transformation"; static inline constexpr StringLiteral k_SaveImageTransformationAsArray = "save_image_transformation"; static inline constexpr StringLiteral k_TransformationMatrixDataArrayPathKey = "transformation_matrix_data_array_path"; + static inline constexpr StringLiteral k_TransposeTransformMatrix = "transpose_transform_matrix"; /** * @brief Returns the name of the filter. diff --git a/src/Plugins/ITKImageProcessing/test/ITKAbsImageTest.cpp b/src/Plugins/ITKImageProcessing/test/ITKAbsImageTest.cpp index 551a224fdd..52d2600178 100644 --- a/src/Plugins/ITKImageProcessing/test/ITKAbsImageTest.cpp +++ b/src/Plugins/ITKImageProcessing/test/ITKAbsImageTest.cpp @@ -22,13 +22,13 @@ TEST_CASE("ITKImageProcessing::ITKAbsImageFilter(float)", "[ITKImageProcessing][ ITKAbsImage filter; const DataPath inputGeometryPath({ITKTestBase::k_ImageGeometryPath}); - const DataPath cellDataPath = inputGeometryPath.createChildPath(ITKTestBase::k_ImageCellDataPath); - const DataPath inputDataPath = cellDataPath.createChildPath(ITKTestBase::k_InputDataPath); + const DataPath cellDataPath = inputGeometryPath.createChildPath(ITKTestBase::k_ImageCellDataName); + const DataPath inputDataPath = cellDataPath.createChildPath(ITKTestBase::k_InputDataName); const DataObjectNameParameter::ValueType outputArrayName = ITKTestBase::k_OutputDataPath; { // Start Image Comparison Scope const fs::path inputFilePath = fs::path(unit_test::k_SourceDir.view()) / unit_test::k_DataDir.view() / "JSONFilters" / "Input/RA-Slice-Float.nrrd"; - Result<> imageReadResult = ITKTestBase::ReadImage(dataStructure, inputFilePath, inputGeometryPath, cellDataPath, inputDataPath); + Result<> imageReadResult = ITKTestBase::ReadImage(dataStructure, inputFilePath, inputGeometryPath, ITKTestBase::k_ImageCellDataName, ITKTestBase::k_InputDataName); SIMPLNX_RESULT_REQUIRE_VALID(imageReadResult) } // End Image Comparison Scope @@ -45,9 +45,9 @@ TEST_CASE("ITKImageProcessing::ITKAbsImageFilter(float)", "[ITKImageProcessing][ fs::path baselineFilePath = fs::path(nx::core::unit_test::k_DataDir.view()) / "JSONFilters/Baseline/BasicFilters_AbsImageFilter_float.nrrd"; DataPath baselineGeometryPath({ITKTestBase::k_BaselineGeometryPath}); - DataPath baseLineCellDataPath = baselineGeometryPath.createChildPath(ITKTestBase::k_ImageCellDataPath); + DataPath baseLineCellDataPath = baselineGeometryPath.createChildPath(ITKTestBase::k_ImageCellDataName); DataPath baselineDataPath = baseLineCellDataPath.createChildPath(ITKTestBase::k_BaselineDataPath); - Result<> readBaselineResult = ITKTestBase::ReadImage(dataStructure, baselineFilePath, baselineGeometryPath, baseLineCellDataPath, baselineDataPath); + Result<> readBaselineResult = ITKTestBase::ReadImage(dataStructure, baselineFilePath, baselineGeometryPath, ITKTestBase::k_ImageCellDataName, ITKTestBase::k_BaselineDataPath); Result<> compareResult = ITKTestBase::CompareImages(dataStructure, baselineGeometryPath, baselineDataPath, inputGeometryPath, cellDataPath.createChildPath(outputArrayName), 0.01); SIMPLNX_RESULT_REQUIRE_VALID(compareResult) } @@ -60,13 +60,13 @@ TEST_CASE("ITKImageProcessing::ITKAbsImageFilter(short)", "[ITKImageProcessing][ ITKAbsImage filter; const DataPath inputGeometryPath({ITKTestBase::k_ImageGeometryPath}); - const DataPath cellDataPath = inputGeometryPath.createChildPath(ITKTestBase::k_ImageCellDataPath); - const DataPath inputDataPath = cellDataPath.createChildPath(ITKTestBase::k_InputDataPath); + const DataPath cellDataPath = inputGeometryPath.createChildPath(ITKTestBase::k_ImageCellDataName); + const DataPath inputDataPath = cellDataPath.createChildPath(ITKTestBase::k_InputDataName); const DataObjectNameParameter::ValueType outputArrayName = ITKTestBase::k_OutputDataPath; { // Start Image Comparison Scope const fs::path inputFilePath = fs::path(unit_test::k_SourceDir.view()) / unit_test::k_DataDir.view() / "JSONFilters" / "Input/RA-Slice-Short.nrrd"; - Result<> imageReadResult = ITKTestBase::ReadImage(dataStructure, inputFilePath, inputGeometryPath, cellDataPath, inputDataPath); + Result<> imageReadResult = ITKTestBase::ReadImage(dataStructure, inputFilePath, inputGeometryPath, ITKTestBase::k_ImageCellDataName, ITKTestBase::k_InputDataName); SIMPLNX_RESULT_REQUIRE_VALID(imageReadResult) } // End Image Comparison Scope @@ -83,9 +83,9 @@ TEST_CASE("ITKImageProcessing::ITKAbsImageFilter(short)", "[ITKImageProcessing][ fs::path baselineFilePath = fs::path(nx::core::unit_test::k_DataDir.view()) / "JSONFilters/Baseline/BasicFilters_AbsImageFilter_short.nrrd"; DataPath baselineGeometryPath({ITKTestBase::k_BaselineGeometryPath}); - DataPath baseLineCellDataPath = baselineGeometryPath.createChildPath(ITKTestBase::k_ImageCellDataPath); + DataPath baseLineCellDataPath = baselineGeometryPath.createChildPath(ITKTestBase::k_ImageCellDataName); DataPath baselineDataPath = baseLineCellDataPath.createChildPath(ITKTestBase::k_BaselineDataPath); - Result<> readBaselineResult = ITKTestBase::ReadImage(dataStructure, baselineFilePath, baselineGeometryPath, baseLineCellDataPath, baselineDataPath); + Result<> readBaselineResult = ITKTestBase::ReadImage(dataStructure, baselineFilePath, baselineGeometryPath, ITKTestBase::k_ImageCellDataName, ITKTestBase::k_BaselineDataPath); Result<> compareResult = ITKTestBase::CompareImages(dataStructure, baselineGeometryPath, baselineDataPath, inputGeometryPath, cellDataPath.createChildPath(outputArrayName), 0.01); SIMPLNX_RESULT_REQUIRE_VALID(compareResult) } diff --git a/src/Plugins/ITKImageProcessing/test/ITKAcosImageTest.cpp b/src/Plugins/ITKImageProcessing/test/ITKAcosImageTest.cpp index 941fb8ca39..84c95316b6 100644 --- a/src/Plugins/ITKImageProcessing/test/ITKAcosImageTest.cpp +++ b/src/Plugins/ITKImageProcessing/test/ITKAcosImageTest.cpp @@ -21,13 +21,13 @@ TEST_CASE("ITKImageProcessing::ITKAcosImageFilter(defaults)", "[ITKImageProcessi ITKAcosImage filter; const DataPath inputGeometryPath({ITKTestBase::k_ImageGeometryPath}); - const DataPath cellDataPath = inputGeometryPath.createChildPath(ITKTestBase::k_ImageCellDataPath); - const DataPath inputDataPath = cellDataPath.createChildPath(ITKTestBase::k_InputDataPath); + const DataPath cellDataPath = inputGeometryPath.createChildPath(ITKTestBase::k_ImageCellDataName); + const DataPath inputDataPath = cellDataPath.createChildPath(ITKTestBase::k_InputDataName); const DataObjectNameParameter::ValueType outputArrayName = ITKTestBase::k_OutputDataPath; { // Start Image Comparison Scope const fs::path inputFilePath = fs::path(unit_test::k_SourceDir.view()) / unit_test::k_DataDir.view() / "JSONFilters" / "Input/Ramp-Zero-One-Float.nrrd"; - Result<> imageReadResult = ITKTestBase::ReadImage(dataStructure, inputFilePath, inputGeometryPath, cellDataPath, inputDataPath); + Result<> imageReadResult = ITKTestBase::ReadImage(dataStructure, inputFilePath, inputGeometryPath, ITKTestBase::k_ImageCellDataName, ITKTestBase::k_InputDataName); SIMPLNX_RESULT_REQUIRE_VALID(imageReadResult) } // End Image Comparison Scope @@ -44,9 +44,9 @@ TEST_CASE("ITKImageProcessing::ITKAcosImageFilter(defaults)", "[ITKImageProcessi fs::path baselineFilePath = fs::path(nx::core::unit_test::k_DataDir.view()) / "JSONFilters/Baseline/BasicFilters_AcosImageFilter_defaults.nrrd"; DataPath baselineGeometryPath({ITKTestBase::k_BaselineGeometryPath}); - DataPath baseLineCellDataPath = baselineGeometryPath.createChildPath(ITKTestBase::k_ImageCellDataPath); + DataPath baseLineCellDataPath = baselineGeometryPath.createChildPath(ITKTestBase::k_ImageCellDataName); DataPath baselineDataPath = baseLineCellDataPath.createChildPath(ITKTestBase::k_BaselineDataPath); - Result<> readBaselineResult = ITKTestBase::ReadImage(dataStructure, baselineFilePath, baselineGeometryPath, baseLineCellDataPath, baselineDataPath); + Result<> readBaselineResult = ITKTestBase::ReadImage(dataStructure, baselineFilePath, baselineGeometryPath, ITKTestBase::k_ImageCellDataName, ITKTestBase::k_BaselineDataPath); Result<> compareResult = ITKTestBase::CompareImages(dataStructure, baselineGeometryPath, baselineDataPath, inputGeometryPath, cellDataPath.createChildPath(outputArrayName), 0.01); SIMPLNX_RESULT_REQUIRE_VALID(compareResult) } diff --git a/src/Plugins/ITKImageProcessing/test/ITKAdaptiveHistogramEqualizationImageTest.cpp b/src/Plugins/ITKImageProcessing/test/ITKAdaptiveHistogramEqualizationImageTest.cpp index 9a9878bd32..ce391c06b2 100644 --- a/src/Plugins/ITKImageProcessing/test/ITKAdaptiveHistogramEqualizationImageTest.cpp +++ b/src/Plugins/ITKImageProcessing/test/ITKAdaptiveHistogramEqualizationImageTest.cpp @@ -65,7 +65,7 @@ DataPath ConvertColorToGrayScale(DataStructure& dataStructure, const DataPath& i auto executeResult = filter->execute(dataStructure, args); SIMPLNX_RESULT_REQUIRE_VALID(executeResult.result) - return inputGeometryPath.createChildPath(fmt::format("GrayScale_{}", ITKTestBase::k_InputDataPath)); + return inputGeometryPath.createChildPath(fmt::format("GrayScale_{}", ITKTestBase::k_InputDataName)); } } // namespace ITKImageProcessingUnitTest @@ -77,15 +77,15 @@ TEST_CASE("ITKImageProcessing::ITKAdaptiveHistogramEqualizationImageFilter(defau DataStructure dataStructure; const DataPath inputGeometryPath({ITKTestBase::k_ImageGeometryPath}); - const DataPath cellDataPath = inputGeometryPath.createChildPath(ITKTestBase::k_ImageCellDataPath); - DataPath inputDataPath = cellDataPath.createChildPath(ITKTestBase::k_InputDataPath); + const DataPath cellDataPath = inputGeometryPath.createChildPath(ITKTestBase::k_ImageCellDataName); + DataPath inputDataPath = cellDataPath.createChildPath(ITKTestBase::k_InputDataName); const DataObjectNameParameter::ValueType outputArrayName = ITKTestBase::k_OutputDataPath; // Read Input Image { const fs::path inputFilePath = fs::path(unit_test::k_DataDir.view()) / "JSONFilters" / "Input/sf4.png"; REQUIRE(fs::exists(inputFilePath)); - Result<> imageReadResult = ITKTestBase::ReadImage(dataStructure, inputFilePath, inputGeometryPath, cellDataPath, inputDataPath); + Result<> imageReadResult = ITKTestBase::ReadImage(dataStructure, inputFilePath, inputGeometryPath, ITKTestBase::k_ImageCellDataName, ITKTestBase::k_InputDataName); SIMPLNX_RESULT_REQUIRE_VALID(imageReadResult) } @@ -112,9 +112,9 @@ TEST_CASE("ITKImageProcessing::ITKAdaptiveHistogramEqualizationImageFilter(defau const fs::path baselineFilePath = fs::path(nx::core::unit_test::k_DataDir.view()) / "JSONFilters/Baseline/BasicFilters/ITKAdaptiveHistogramEqualizationFilterTest.png"; const DataPath baselineGeometryPath({ITKTestBase::k_BaselineGeometryPath}); - const DataPath baseLineCellDataPath = baselineGeometryPath.createChildPath(ITKTestBase::k_ImageCellDataPath); + const DataPath baseLineCellDataPath = baselineGeometryPath.createChildPath(ITKTestBase::k_ImageCellDataName); const DataPath baselineDataPath = baseLineCellDataPath.createChildPath(ITKTestBase::k_BaselineDataPath); - const Result<> readBaselineResult = ITKTestBase::ReadImage(dataStructure, baselineFilePath, baselineGeometryPath, baseLineCellDataPath, baselineDataPath); + const Result<> readBaselineResult = ITKTestBase::ReadImage(dataStructure, baselineFilePath, baselineGeometryPath, ITKTestBase::k_ImageCellDataName, ITKTestBase::k_BaselineDataPath); const Result<> compareResult = ITKTestBase::CompareImages(dataStructure, baselineGeometryPath, baselineDataPath, inputGeometryPath, cellDataPath.createChildPath(outputArrayName), 2e-3); // SIMPLNX_RESULT_REQUIRE_VALID(compareResult) } @@ -127,13 +127,13 @@ TEST_CASE("ITKImageProcessing::ITKAdaptiveHistogramEqualizationImageFilter(histo DataStructure dataStructure; const DataPath inputGeometryPath({ITKTestBase::k_ImageGeometryPath}); - const DataPath cellDataPath = inputGeometryPath.createChildPath(ITKTestBase::k_ImageCellDataPath); - DataPath inputDataPath = cellDataPath.createChildPath(ITKTestBase::k_InputDataPath); + const DataPath cellDataPath = inputGeometryPath.createChildPath(ITKTestBase::k_ImageCellDataName); + DataPath inputDataPath = cellDataPath.createChildPath(ITKTestBase::k_InputDataName); const DataObjectNameParameter::ValueType outputArrayName = ITKTestBase::k_OutputDataPath; { // Start Image Comparison Scope const fs::path inputFilePath = fs::path(unit_test::k_SourceDir.view()) / unit_test::k_DataDir.view() / "JSONFilters" / "Input/sf4.png"; - Result<> imageReadResult = ITKTestBase::ReadImage(dataStructure, inputFilePath, inputGeometryPath, cellDataPath, inputDataPath); + Result<> imageReadResult = ITKTestBase::ReadImage(dataStructure, inputFilePath, inputGeometryPath, ITKTestBase::k_ImageCellDataName, ITKTestBase::k_InputDataName); SIMPLNX_RESULT_REQUIRE_VALID(imageReadResult) } // End Image Comparison Scope @@ -160,9 +160,9 @@ TEST_CASE("ITKImageProcessing::ITKAdaptiveHistogramEqualizationImageFilter(histo const fs::path baselineFilePath = fs::path(nx::core::unit_test::k_DataDir.view()) / "JSONFilters/Baseline/BasicFilters/ITKAdaptiveHistogramEqualizationFilterTest2.png"; const DataPath baselineGeometryPath({ITKTestBase::k_BaselineGeometryPath}); - const DataPath baseLineCellDataPath = baselineGeometryPath.createChildPath(ITKTestBase::k_ImageCellDataPath); + const DataPath baseLineCellDataPath = baselineGeometryPath.createChildPath(ITKTestBase::k_ImageCellDataName); const DataPath baselineDataPath = baseLineCellDataPath.createChildPath(ITKTestBase::k_BaselineDataPath); - const Result<> readBaselineResult = ITKTestBase::ReadImage(dataStructure, baselineFilePath, baselineGeometryPath, baseLineCellDataPath, baselineDataPath); + const Result<> readBaselineResult = ITKTestBase::ReadImage(dataStructure, baselineFilePath, baselineGeometryPath, ITKTestBase::k_ImageCellDataName, ITKTestBase::k_BaselineDataPath); const Result<> compareResult = ITKTestBase::CompareImages(dataStructure, baselineGeometryPath, baselineDataPath, inputGeometryPath, cellDataPath.createChildPath(outputArrayName), 1e-5); SIMPLNX_RESULT_REQUIRE_VALID(compareResult) } diff --git a/src/Plugins/ITKImageProcessing/test/ITKAsinImageTest.cpp b/src/Plugins/ITKImageProcessing/test/ITKAsinImageTest.cpp index 1b76cd3ab8..54e6377d6b 100644 --- a/src/Plugins/ITKImageProcessing/test/ITKAsinImageTest.cpp +++ b/src/Plugins/ITKImageProcessing/test/ITKAsinImageTest.cpp @@ -21,13 +21,13 @@ TEST_CASE("ITKImageProcessing::ITKAsinImageFilter(defaults)", "[ITKImageProcessi ITKAsinImage filter; const DataPath inputGeometryPath({ITKTestBase::k_ImageGeometryPath}); - const DataPath cellDataPath = inputGeometryPath.createChildPath(ITKTestBase::k_ImageCellDataPath); - const DataPath inputDataPath = cellDataPath.createChildPath(ITKTestBase::k_InputDataPath); + const DataPath cellDataPath = inputGeometryPath.createChildPath(ITKTestBase::k_ImageCellDataName); + const DataPath inputDataPath = cellDataPath.createChildPath(ITKTestBase::k_InputDataName); const DataObjectNameParameter::ValueType outputArrayName = ITKTestBase::k_OutputDataPath; { // Start Image Comparison Scope const fs::path inputFilePath = fs::path(unit_test::k_SourceDir.view()) / unit_test::k_DataDir.view() / "JSONFilters" / "Input/Ramp-Zero-One-Float.nrrd"; - Result<> imageReadResult = ITKTestBase::ReadImage(dataStructure, inputFilePath, inputGeometryPath, cellDataPath, inputDataPath); + Result<> imageReadResult = ITKTestBase::ReadImage(dataStructure, inputFilePath, inputGeometryPath, ITKTestBase::k_ImageCellDataName, ITKTestBase::k_InputDataName); SIMPLNX_RESULT_REQUIRE_VALID(imageReadResult) } // End Image Comparison Scope @@ -44,9 +44,9 @@ TEST_CASE("ITKImageProcessing::ITKAsinImageFilter(defaults)", "[ITKImageProcessi fs::path baselineFilePath = fs::path(nx::core::unit_test::k_DataDir.view()) / "JSONFilters/Baseline/BasicFilters_AsinImageFilter_defaults.nrrd"; DataPath baselineGeometryPath({ITKTestBase::k_BaselineGeometryPath}); - DataPath baseLineCellDataPath = baselineGeometryPath.createChildPath(ITKTestBase::k_ImageCellDataPath); + DataPath baseLineCellDataPath = baselineGeometryPath.createChildPath(ITKTestBase::k_ImageCellDataName); DataPath baselineDataPath = baseLineCellDataPath.createChildPath(ITKTestBase::k_BaselineDataPath); - Result<> readBaselineResult = ITKTestBase::ReadImage(dataStructure, baselineFilePath, baselineGeometryPath, baseLineCellDataPath, baselineDataPath); + Result<> readBaselineResult = ITKTestBase::ReadImage(dataStructure, baselineFilePath, baselineGeometryPath, ITKTestBase::k_ImageCellDataName, ITKTestBase::k_BaselineDataPath); Result<> compareResult = ITKTestBase::CompareImages(dataStructure, baselineGeometryPath, baselineDataPath, inputGeometryPath, cellDataPath.createChildPath(outputArrayName), 0.01); SIMPLNX_RESULT_REQUIRE_VALID(compareResult) } diff --git a/src/Plugins/ITKImageProcessing/test/ITKAtanImageTest.cpp b/src/Plugins/ITKImageProcessing/test/ITKAtanImageTest.cpp index ecd608c448..ba97052905 100644 --- a/src/Plugins/ITKImageProcessing/test/ITKAtanImageTest.cpp +++ b/src/Plugins/ITKImageProcessing/test/ITKAtanImageTest.cpp @@ -21,13 +21,13 @@ TEST_CASE("ITKImageProcessing::ITKAtanImageFilter(defaults)", "[ITKImageProcessi ITKAtanImage filter; const DataPath inputGeometryPath({ITKTestBase::k_ImageGeometryPath}); - const DataPath cellDataPath = inputGeometryPath.createChildPath(ITKTestBase::k_ImageCellDataPath); - const DataPath inputDataPath = cellDataPath.createChildPath(ITKTestBase::k_InputDataPath); + const DataPath cellDataPath = inputGeometryPath.createChildPath(ITKTestBase::k_ImageCellDataName); + const DataPath inputDataPath = cellDataPath.createChildPath(ITKTestBase::k_InputDataName); const DataObjectNameParameter::ValueType outputArrayName = ITKTestBase::k_OutputDataPath; { // Start Image Comparison Scope const fs::path inputFilePath = fs::path(unit_test::k_SourceDir.view()) / unit_test::k_DataDir.view() / "JSONFilters" / "Input/Ramp-Zero-One-Float.nrrd"; - Result<> imageReadResult = ITKTestBase::ReadImage(dataStructure, inputFilePath, inputGeometryPath, cellDataPath, inputDataPath); + Result<> imageReadResult = ITKTestBase::ReadImage(dataStructure, inputFilePath, inputGeometryPath, ITKTestBase::k_ImageCellDataName, ITKTestBase::k_InputDataName); SIMPLNX_RESULT_REQUIRE_VALID(imageReadResult) } // End Image Comparison Scope @@ -44,9 +44,9 @@ TEST_CASE("ITKImageProcessing::ITKAtanImageFilter(defaults)", "[ITKImageProcessi fs::path baselineFilePath = fs::path(nx::core::unit_test::k_DataDir.view()) / "JSONFilters/Baseline/BasicFilters_AtanImageFilter_defaults.nrrd"; DataPath baselineGeometryPath({ITKTestBase::k_BaselineGeometryPath}); - DataPath baseLineCellDataPath = baselineGeometryPath.createChildPath(ITKTestBase::k_ImageCellDataPath); + DataPath baseLineCellDataPath = baselineGeometryPath.createChildPath(ITKTestBase::k_ImageCellDataName); DataPath baselineDataPath = baseLineCellDataPath.createChildPath(ITKTestBase::k_BaselineDataPath); - Result<> readBaselineResult = ITKTestBase::ReadImage(dataStructure, baselineFilePath, baselineGeometryPath, baseLineCellDataPath, baselineDataPath); + Result<> readBaselineResult = ITKTestBase::ReadImage(dataStructure, baselineFilePath, baselineGeometryPath, ITKTestBase::k_ImageCellDataName, ITKTestBase::k_BaselineDataPath); Result<> compareResult = ITKTestBase::CompareImages(dataStructure, baselineGeometryPath, baselineDataPath, inputGeometryPath, cellDataPath.createChildPath(outputArrayName), 0.01); SIMPLNX_RESULT_REQUIRE_VALID(compareResult) } diff --git a/src/Plugins/ITKImageProcessing/test/ITKBinaryContourImageTest.cpp b/src/Plugins/ITKImageProcessing/test/ITKBinaryContourImageTest.cpp index 7ef2591b03..2a0c275142 100644 --- a/src/Plugins/ITKImageProcessing/test/ITKBinaryContourImageTest.cpp +++ b/src/Plugins/ITKImageProcessing/test/ITKBinaryContourImageTest.cpp @@ -25,13 +25,13 @@ TEST_CASE("ITKImageProcessing::ITKBinaryContourImageFilter(default)", "[ITKImage ITKBinaryContourImage filter; const DataPath inputGeometryPath({ITKTestBase::k_ImageGeometryPath}); - const DataPath cellDataPath = inputGeometryPath.createChildPath(ITKTestBase::k_ImageCellDataPath); - const DataPath inputDataPath = cellDataPath.createChildPath(ITKTestBase::k_InputDataPath); + const DataPath cellDataPath = inputGeometryPath.createChildPath(ITKTestBase::k_ImageCellDataName); + const DataPath inputDataPath = cellDataPath.createChildPath(ITKTestBase::k_InputDataName); const DataObjectNameParameter::ValueType outputArrayName = ITKTestBase::k_OutputDataPath; { // Start Image Comparison Scope const fs::path inputFilePath = fs::path(unit_test::k_SourceDir.view()) / unit_test::k_DataDir.view() / "JSONFilters" / "Input/WhiteDots.png"; - Result<> imageReadResult = ITKTestBase::ReadImage(dataStructure, inputFilePath, inputGeometryPath, cellDataPath, inputDataPath); + Result<> imageReadResult = ITKTestBase::ReadImage(dataStructure, inputFilePath, inputGeometryPath, ITKTestBase::k_ImageCellDataName, ITKTestBase::k_InputDataName); SIMPLNX_RESULT_REQUIRE_VALID(imageReadResult) } // End Image Comparison Scope @@ -59,13 +59,13 @@ TEST_CASE("ITKImageProcessing::ITKBinaryContourImageFilter(custom)", "[ITKImageP ITKBinaryContourImage filter; const DataPath inputGeometryPath({ITKTestBase::k_ImageGeometryPath}); - const DataPath cellDataPath = inputGeometryPath.createChildPath(ITKTestBase::k_ImageCellDataPath); - const DataPath inputDataPath = cellDataPath.createChildPath(ITKTestBase::k_InputDataPath); + const DataPath cellDataPath = inputGeometryPath.createChildPath(ITKTestBase::k_ImageCellDataName); + const DataPath inputDataPath = cellDataPath.createChildPath(ITKTestBase::k_InputDataName); const DataObjectNameParameter::ValueType outputArrayName = ITKTestBase::k_OutputDataPath; { // Start Image Comparison Scope const fs::path inputFilePath = fs::path(unit_test::k_SourceDir.view()) / unit_test::k_DataDir.view() / "JSONFilters" / "Input/2th_cthead1.png"; - Result<> imageReadResult = ITKTestBase::ReadImage(dataStructure, inputFilePath, inputGeometryPath, cellDataPath, inputDataPath); + Result<> imageReadResult = ITKTestBase::ReadImage(dataStructure, inputFilePath, inputGeometryPath, ITKTestBase::k_ImageCellDataName, ITKTestBase::k_InputDataName); SIMPLNX_RESULT_REQUIRE_VALID(imageReadResult) } // End Image Comparison Scope diff --git a/src/Plugins/ITKImageProcessing/test/ITKBinaryDilateImageTest.cpp b/src/Plugins/ITKImageProcessing/test/ITKBinaryDilateImageTest.cpp index f1fcf58a88..a4c7596312 100644 --- a/src/Plugins/ITKImageProcessing/test/ITKBinaryDilateImageTest.cpp +++ b/src/Plugins/ITKImageProcessing/test/ITKBinaryDilateImageTest.cpp @@ -27,13 +27,13 @@ TEST_CASE("ITKImageProcessing::ITKBinaryDilateImageFilter(BinaryDilate)", "[ITKI const ITKBinaryDilateImage filter; const DataPath inputGeometryPath({ITKTestBase::k_ImageGeometryPath}); - const DataPath cellDataPath = inputGeometryPath.createChildPath(ITKTestBase::k_ImageCellDataPath); - const DataPath inputDataPath = cellDataPath.createChildPath(ITKTestBase::k_InputDataPath); + const DataPath cellDataPath = inputGeometryPath.createChildPath(ITKTestBase::k_ImageCellDataName); + const DataPath inputDataPath = cellDataPath.createChildPath(ITKTestBase::k_InputDataName); const DataObjectNameParameter::ValueType outputArrayName = ITKTestBase::k_OutputDataPath; { // Start Image Comparison Scope const fs::path inputFilePath = fs::path(unit_test::k_SourceDir.view()) / unit_test::k_DataDir.view() / "JSONFilters" / "Input/STAPLE1.png"; - Result<> imageReadResult = ITKTestBase::ReadImage(dataStructure, inputFilePath, inputGeometryPath, cellDataPath, inputDataPath); + Result<> imageReadResult = ITKTestBase::ReadImage(dataStructure, inputFilePath, inputGeometryPath, ITKTestBase::k_ImageCellDataName, ITKTestBase::k_InputDataName); SIMPLNX_RESULT_REQUIRE_VALID(imageReadResult) } // End Image Comparison Scope @@ -63,13 +63,13 @@ TEST_CASE("ITKImageProcessing::ITKBinaryDilateImageFilter(BinaryDilateVectorRadi const ITKBinaryDilateImage filter; const DataPath inputGeometryPath({ITKTestBase::k_ImageGeometryPath}); - const DataPath cellDataPath = inputGeometryPath.createChildPath(ITKTestBase::k_ImageCellDataPath); - const DataPath inputDataPath = cellDataPath.createChildPath(ITKTestBase::k_InputDataPath); + const DataPath cellDataPath = inputGeometryPath.createChildPath(ITKTestBase::k_ImageCellDataName); + const DataPath inputDataPath = cellDataPath.createChildPath(ITKTestBase::k_InputDataName); const DataObjectNameParameter::ValueType outputArrayName = ITKTestBase::k_OutputDataPath; { // Start Image Comparison Scope const fs::path inputFilePath = fs::path(unit_test::k_SourceDir.view()) / unit_test::k_DataDir.view() / "JSONFilters" / "Input/STAPLE1.png"; - Result<> imageReadResult = ITKTestBase::ReadImage(dataStructure, inputFilePath, inputGeometryPath, cellDataPath, inputDataPath); + Result<> imageReadResult = ITKTestBase::ReadImage(dataStructure, inputFilePath, inputGeometryPath, ITKTestBase::k_ImageCellDataName, ITKTestBase::k_InputDataName); SIMPLNX_RESULT_REQUIRE_VALID(imageReadResult) } // End Image Comparison Scope diff --git a/src/Plugins/ITKImageProcessing/test/ITKBinaryErodeImageTest.cpp b/src/Plugins/ITKImageProcessing/test/ITKBinaryErodeImageTest.cpp index 682822e657..2d45ecc7db 100644 --- a/src/Plugins/ITKImageProcessing/test/ITKBinaryErodeImageTest.cpp +++ b/src/Plugins/ITKImageProcessing/test/ITKBinaryErodeImageTest.cpp @@ -25,13 +25,13 @@ TEST_CASE("ITKImageProcessing::ITKBinaryErodeImageFilter(BinaryErode)", "[ITKIma const ITKBinaryErodeImage filter; const DataPath inputGeometryPath({ITKTestBase::k_ImageGeometryPath}); - const DataPath cellDataPath = inputGeometryPath.createChildPath(ITKTestBase::k_ImageCellDataPath); - const DataPath inputDataPath = cellDataPath.createChildPath(ITKTestBase::k_InputDataPath); + const DataPath cellDataPath = inputGeometryPath.createChildPath(ITKTestBase::k_ImageCellDataName); + const DataPath inputDataPath = cellDataPath.createChildPath(ITKTestBase::k_InputDataName); const DataObjectNameParameter::ValueType outputArrayName = ITKTestBase::k_OutputDataPath; { // Start Image Comparison Scope const fs::path inputFilePath = fs::path(unit_test::k_SourceDir.view()) / unit_test::k_DataDir.view() / "JSONFilters" / "Input/STAPLE1.png"; - Result<> imageReadResult = ITKTestBase::ReadImage(dataStructure, inputFilePath, inputGeometryPath, cellDataPath, inputDataPath); + Result<> imageReadResult = ITKTestBase::ReadImage(dataStructure, inputFilePath, inputGeometryPath, ITKTestBase::k_ImageCellDataName, ITKTestBase::k_InputDataName); SIMPLNX_RESULT_REQUIRE_VALID(imageReadResult) } // End Image Comparison Scope diff --git a/src/Plugins/ITKImageProcessing/test/ITKBinaryMorphologicalClosingImageTest.cpp b/src/Plugins/ITKImageProcessing/test/ITKBinaryMorphologicalClosingImageTest.cpp index 337ac65b1f..ef6838ad89 100644 --- a/src/Plugins/ITKImageProcessing/test/ITKBinaryMorphologicalClosingImageTest.cpp +++ b/src/Plugins/ITKImageProcessing/test/ITKBinaryMorphologicalClosingImageTest.cpp @@ -24,13 +24,13 @@ TEST_CASE("ITKImageProcessing::ITKBinaryMorphologicalClosingImageFilter(BinaryMo ITKBinaryMorphologicalClosingImage filter; const DataPath inputGeometryPath({ITKTestBase::k_ImageGeometryPath}); - const DataPath cellDataPath = inputGeometryPath.createChildPath(ITKTestBase::k_ImageCellDataPath); - const DataPath inputDataPath = cellDataPath.createChildPath(ITKTestBase::k_InputDataPath); + const DataPath cellDataPath = inputGeometryPath.createChildPath(ITKTestBase::k_ImageCellDataName); + const DataPath inputDataPath = cellDataPath.createChildPath(ITKTestBase::k_InputDataName); const DataObjectNameParameter::ValueType outputArrayName = ITKTestBase::k_OutputDataPath; { // Start Image Comparison Scope const fs::path inputFilePath = fs::path(unit_test::k_SourceDir.view()) / unit_test::k_DataDir.view() / "JSONFilters" / "Input/STAPLE1.png"; - Result<> imageReadResult = ITKTestBase::ReadImage(dataStructure, inputFilePath, inputGeometryPath, cellDataPath, inputDataPath); + Result<> imageReadResult = ITKTestBase::ReadImage(dataStructure, inputFilePath, inputGeometryPath, ITKTestBase::k_ImageCellDataName, ITKTestBase::k_InputDataName); SIMPLNX_RESULT_REQUIRE_VALID(imageReadResult) } // End Image Comparison Scope @@ -58,13 +58,13 @@ TEST_CASE("ITKImageProcessing::ITKBinaryMorphologicalClosingImageFilter(BinaryMo ITKBinaryMorphologicalClosingImage filter; const DataPath inputGeometryPath({ITKTestBase::k_ImageGeometryPath}); - const DataPath cellDataPath = inputGeometryPath.createChildPath(ITKTestBase::k_ImageCellDataPath); - const DataPath inputDataPath = cellDataPath.createChildPath(ITKTestBase::k_InputDataPath); + const DataPath cellDataPath = inputGeometryPath.createChildPath(ITKTestBase::k_ImageCellDataName); + const DataPath inputDataPath = cellDataPath.createChildPath(ITKTestBase::k_InputDataName); const DataObjectNameParameter::ValueType outputArrayName = ITKTestBase::k_OutputDataPath; { // Start Image Comparison Scope const fs::path inputFilePath = fs::path(unit_test::k_SourceDir.view()) / unit_test::k_DataDir.view() / "JSONFilters" / "Input/WhiteDots.png"; - Result<> imageReadResult = ITKTestBase::ReadImage(dataStructure, inputFilePath, inputGeometryPath, cellDataPath, inputDataPath); + Result<> imageReadResult = ITKTestBase::ReadImage(dataStructure, inputFilePath, inputGeometryPath, ITKTestBase::k_ImageCellDataName, ITKTestBase::k_InputDataName); SIMPLNX_RESULT_REQUIRE_VALID(imageReadResult) } // End Image Comparison Scope diff --git a/src/Plugins/ITKImageProcessing/test/ITKBinaryMorphologicalOpeningImageTest.cpp b/src/Plugins/ITKImageProcessing/test/ITKBinaryMorphologicalOpeningImageTest.cpp index edb0b9fbef..d84e456f00 100644 --- a/src/Plugins/ITKImageProcessing/test/ITKBinaryMorphologicalOpeningImageTest.cpp +++ b/src/Plugins/ITKImageProcessing/test/ITKBinaryMorphologicalOpeningImageTest.cpp @@ -24,13 +24,13 @@ TEST_CASE("ITKImageProcessing::ITKBinaryMorphologicalOpeningImageFilter(BinaryMo const ITKBinaryMorphologicalOpeningImage filter; const DataPath inputGeometryPath({ITKTestBase::k_ImageGeometryPath}); - const DataPath cellDataPath = inputGeometryPath.createChildPath(ITKTestBase::k_ImageCellDataPath); - const DataPath inputDataPath = cellDataPath.createChildPath(ITKTestBase::k_InputDataPath); + const DataPath cellDataPath = inputGeometryPath.createChildPath(ITKTestBase::k_ImageCellDataName); + const DataPath inputDataPath = cellDataPath.createChildPath(ITKTestBase::k_InputDataName); const DataObjectNameParameter::ValueType outputArrayName = ITKTestBase::k_OutputDataPath; { // Start Image Comparison Scope const fs::path inputFilePath = fs::path(unit_test::k_SourceDir.view()) / unit_test::k_DataDir.view() / "JSONFilters" / "Input/STAPLE1.png"; - Result<> imageReadResult = ITKTestBase::ReadImage(dataStructure, inputFilePath, inputGeometryPath, cellDataPath, inputDataPath); + Result<> imageReadResult = ITKTestBase::ReadImage(dataStructure, inputFilePath, inputGeometryPath, ITKTestBase::k_ImageCellDataName, ITKTestBase::k_InputDataName); SIMPLNX_RESULT_REQUIRE_VALID(imageReadResult) } // End Image Comparison Scope diff --git a/src/Plugins/ITKImageProcessing/test/ITKBinaryOpeningByReconstructionImageTest.cpp b/src/Plugins/ITKImageProcessing/test/ITKBinaryOpeningByReconstructionImageTest.cpp index 933aec2266..1955fb614d 100644 --- a/src/Plugins/ITKImageProcessing/test/ITKBinaryOpeningByReconstructionImageTest.cpp +++ b/src/Plugins/ITKImageProcessing/test/ITKBinaryOpeningByReconstructionImageTest.cpp @@ -26,13 +26,13 @@ TEST_CASE("ITKImageProcessing::ITKBinaryOpeningByReconstructionImageFilter(Binar const ITKBinaryOpeningByReconstructionImage filter; const DataPath inputGeometryPath({ITKTestBase::k_ImageGeometryPath}); - const DataPath cellDataPath = inputGeometryPath.createChildPath(ITKTestBase::k_ImageCellDataPath); - const DataPath inputDataPath = cellDataPath.createChildPath(ITKTestBase::k_InputDataPath); + const DataPath cellDataPath = inputGeometryPath.createChildPath(ITKTestBase::k_ImageCellDataName); + const DataPath inputDataPath = cellDataPath.createChildPath(ITKTestBase::k_InputDataName); const DataObjectNameParameter::ValueType outputArrayName = ITKTestBase::k_OutputDataPath; { // Start Image Comparison Scope const fs::path inputFilePath = fs::path(unit_test::k_SourceDir.view()) / unit_test::k_DataDir.view() / "JSONFilters" / "Input/2th_cthead1.png"; - Result<> imageReadResult = ITKTestBase::ReadImage(dataStructure, inputFilePath, inputGeometryPath, cellDataPath, inputDataPath); + Result<> imageReadResult = ITKTestBase::ReadImage(dataStructure, inputFilePath, inputGeometryPath, ITKTestBase::k_ImageCellDataName, ITKTestBase::k_InputDataName); SIMPLNX_RESULT_REQUIRE_VALID(imageReadResult) } // End Image Comparison Scope diff --git a/src/Plugins/ITKImageProcessing/test/ITKBinaryProjectionImageTest.cpp b/src/Plugins/ITKImageProcessing/test/ITKBinaryProjectionImageTest.cpp index 05822323ac..36b920868d 100644 --- a/src/Plugins/ITKImageProcessing/test/ITKBinaryProjectionImageTest.cpp +++ b/src/Plugins/ITKImageProcessing/test/ITKBinaryProjectionImageTest.cpp @@ -22,13 +22,13 @@ TEST_CASE("ITKImageProcessing::ITKBinaryProjectionImageFilter(defaults)", "[ITKI const ITKBinaryProjectionImage filter; const DataPath inputGeometryPath({ITKTestBase::k_ImageGeometryPath}); - const DataPath cellDataPath = inputGeometryPath.createChildPath(ITKTestBase::k_ImageCellDataPath); - const DataPath inputDataPath = cellDataPath.createChildPath(ITKTestBase::k_InputDataPath); + const DataPath cellDataPath = inputGeometryPath.createChildPath(ITKTestBase::k_ImageCellDataName); + const DataPath inputDataPath = cellDataPath.createChildPath(ITKTestBase::k_InputDataName); const DataObjectNameParameter::ValueType outputArrayName = ITKTestBase::k_OutputDataPath; { // Start Image Comparison Scope const fs::path inputFilePath = fs::path(unit_test::k_SourceDir.view()) / unit_test::k_DataDir.view() / "JSONFilters" / "Input/2th_cthead1.mha"; - Result<> imageReadResult = ITKTestBase::ReadImage(dataStructure, inputFilePath, inputGeometryPath, cellDataPath, inputDataPath); + Result<> imageReadResult = ITKTestBase::ReadImage(dataStructure, inputFilePath, inputGeometryPath, ITKTestBase::k_ImageCellDataName, ITKTestBase::k_InputDataName); SIMPLNX_RESULT_REQUIRE_VALID(imageReadResult) } // End Image Comparison Scope @@ -53,13 +53,13 @@ TEST_CASE("ITKImageProcessing::ITKBinaryProjectionImageFilter(another_dimension) const ITKBinaryProjectionImage filter; const DataPath inputGeometryPath({ITKTestBase::k_ImageGeometryPath}); - const DataPath cellDataPath = inputGeometryPath.createChildPath(ITKTestBase::k_ImageCellDataPath); - const DataPath inputDataPath = cellDataPath.createChildPath(ITKTestBase::k_InputDataPath); + const DataPath cellDataPath = inputGeometryPath.createChildPath(ITKTestBase::k_ImageCellDataName); + const DataPath inputDataPath = cellDataPath.createChildPath(ITKTestBase::k_InputDataName); const DataObjectNameParameter::ValueType outputArrayName = ITKTestBase::k_OutputDataPath; { // Start Image Comparison Scope const fs::path inputFilePath = fs::path(unit_test::k_SourceDir.view()) / unit_test::k_DataDir.view() / "JSONFilters" / "Input/WhiteDots.png"; - Result<> imageReadResult = ITKTestBase::ReadImage(dataStructure, inputFilePath, inputGeometryPath, cellDataPath, inputDataPath); + Result<> imageReadResult = ITKTestBase::ReadImage(dataStructure, inputFilePath, inputGeometryPath, ITKTestBase::k_ImageCellDataName, ITKTestBase::k_InputDataName); SIMPLNX_RESULT_REQUIRE_VALID(imageReadResult) } // End Image Comparison Scope diff --git a/src/Plugins/ITKImageProcessing/test/ITKBinaryThinningImageTest.cpp b/src/Plugins/ITKImageProcessing/test/ITKBinaryThinningImageTest.cpp index 8d82afba2f..66db1a78f1 100644 --- a/src/Plugins/ITKImageProcessing/test/ITKBinaryThinningImageTest.cpp +++ b/src/Plugins/ITKImageProcessing/test/ITKBinaryThinningImageTest.cpp @@ -21,13 +21,13 @@ TEST_CASE("ITKImageProcessing::ITKBinaryThinningImageFilter(BinaryThinning)", "[ const ITKBinaryThinningImage filter; const DataPath inputGeometryPath({ITKTestBase::k_ImageGeometryPath}); - const DataPath cellDataPath = inputGeometryPath.createChildPath(ITKTestBase::k_ImageCellDataPath); - const DataPath inputDataPath = cellDataPath.createChildPath(ITKTestBase::k_InputDataPath); + const DataPath cellDataPath = inputGeometryPath.createChildPath(ITKTestBase::k_ImageCellDataName); + const DataPath inputDataPath = cellDataPath.createChildPath(ITKTestBase::k_InputDataName); const DataObjectNameParameter::ValueType outputArrayName = ITKTestBase::k_OutputDataPath; { // Start Image Comparison Scope const fs::path inputFilePath = fs::path(unit_test::k_SourceDir.view()) / unit_test::k_DataDir.view() / "JSONFilters" / "Input/BlackDots.png"; - Result<> imageReadResult = ITKTestBase::ReadImage(dataStructure, inputFilePath, inputGeometryPath, cellDataPath, inputDataPath); + Result<> imageReadResult = ITKTestBase::ReadImage(dataStructure, inputFilePath, inputGeometryPath, ITKTestBase::k_ImageCellDataName, ITKTestBase::k_InputDataName); SIMPLNX_RESULT_REQUIRE_VALID(imageReadResult) } // End Image Comparison Scope diff --git a/src/Plugins/ITKImageProcessing/test/ITKBinaryThresholdImageTest.cpp b/src/Plugins/ITKImageProcessing/test/ITKBinaryThresholdImageTest.cpp index 7b20218f25..4958295653 100644 --- a/src/Plugins/ITKImageProcessing/test/ITKBinaryThresholdImageTest.cpp +++ b/src/Plugins/ITKImageProcessing/test/ITKBinaryThresholdImageTest.cpp @@ -20,12 +20,12 @@ TEST_CASE("ITKImageProcessing::ITKBinaryThresholdImageFilter(default)", "[ITKIma ITKBinaryThresholdImage filter; const DataPath inputGeometryPath({ITKTestBase::k_ImageGeometryPath}); - const DataPath cellDataPath = inputGeometryPath.createChildPath(ITKTestBase::k_ImageCellDataPath); - const DataPath inputDataPath = cellDataPath.createChildPath(ITKTestBase::k_InputDataPath); + const DataPath cellDataPath = inputGeometryPath.createChildPath(ITKTestBase::k_ImageCellDataName); + const DataPath inputDataPath = cellDataPath.createChildPath(ITKTestBase::k_InputDataName); const DataObjectNameParameter::ValueType outputArrayName = ITKTestBase::k_OutputDataPath; fs::path inputFilePath = fs::path(unit_test::k_SourceDir.view()) / unit_test::k_DataDir.view() / "JSONFilters" / "Input/RA-Short.nrrd"; - Result<> imageReadResult = ITKTestBase::ReadImage(dataStructure, inputFilePath, inputGeometryPath, cellDataPath, inputDataPath); + Result<> imageReadResult = ITKTestBase::ReadImage(dataStructure, inputFilePath, inputGeometryPath, ITKTestBase::k_ImageCellDataName, ITKTestBase::k_InputDataName); SIMPLNX_RESULT_REQUIRE_VALID(imageReadResult) Arguments args; @@ -49,12 +49,12 @@ TEST_CASE("ITKImageProcessing::ITKBinaryThresholdImageFilter(NarrowThreshold)", ITKBinaryThresholdImage filter; const DataPath inputGeometryPath({ITKTestBase::k_ImageGeometryPath}); - const DataPath cellDataPath = inputGeometryPath.createChildPath(ITKTestBase::k_ImageCellDataPath); - const DataPath inputDataPath = cellDataPath.createChildPath(ITKTestBase::k_InputDataPath); + const DataPath cellDataPath = inputGeometryPath.createChildPath(ITKTestBase::k_ImageCellDataName); + const DataPath inputDataPath = cellDataPath.createChildPath(ITKTestBase::k_InputDataName); const DataObjectNameParameter::ValueType outputArrayName = ITKTestBase::k_OutputDataPath; fs::path inputFilePath = fs::path(unit_test::k_SourceDir.view()) / unit_test::k_DataDir.view() / "JSONFilters" / "Input/RA-Short.nrrd"; - Result<> imageReadResult = ITKTestBase::ReadImage(dataStructure, inputFilePath, inputGeometryPath, cellDataPath, inputDataPath); + Result<> imageReadResult = ITKTestBase::ReadImage(dataStructure, inputFilePath, inputGeometryPath, ITKTestBase::k_ImageCellDataName, ITKTestBase::k_InputDataName); SIMPLNX_RESULT_REQUIRE_VALID(imageReadResult) Arguments args; diff --git a/src/Plugins/ITKImageProcessing/test/ITKBlackTopHatImageTest.cpp b/src/Plugins/ITKImageProcessing/test/ITKBlackTopHatImageTest.cpp index fcfe4494a3..896f921f0b 100644 --- a/src/Plugins/ITKImageProcessing/test/ITKBlackTopHatImageTest.cpp +++ b/src/Plugins/ITKImageProcessing/test/ITKBlackTopHatImageTest.cpp @@ -24,13 +24,13 @@ TEST_CASE("ITKImageProcessing::ITKBlackTopHatImageFilter(BlackTopHapErode)", "[I const ITKBlackTopHatImage filter; const DataPath inputGeometryPath({ITKTestBase::k_ImageGeometryPath}); - const DataPath cellDataPath = inputGeometryPath.createChildPath(ITKTestBase::k_ImageCellDataPath); - const DataPath inputDataPath = cellDataPath.createChildPath(ITKTestBase::k_InputDataPath); + const DataPath cellDataPath = inputGeometryPath.createChildPath(ITKTestBase::k_ImageCellDataName); + const DataPath inputDataPath = cellDataPath.createChildPath(ITKTestBase::k_InputDataName); const DataObjectNameParameter::ValueType outputArrayName = ITKTestBase::k_OutputDataPath; { // Start Image Comparison Scope const fs::path inputFilePath = fs::path(unit_test::k_SourceDir.view()) / unit_test::k_DataDir.view() / "JSONFilters" / "Input/STAPLE1.png"; - Result<> imageReadResult = ITKTestBase::ReadImage(dataStructure, inputFilePath, inputGeometryPath, cellDataPath, inputDataPath); + Result<> imageReadResult = ITKTestBase::ReadImage(dataStructure, inputFilePath, inputGeometryPath, ITKTestBase::k_ImageCellDataName, ITKTestBase::k_InputDataName); SIMPLNX_RESULT_REQUIRE_VALID(imageReadResult) } // End Image Comparison Scope diff --git a/src/Plugins/ITKImageProcessing/test/ITKClosingByReconstructionImageTest.cpp b/src/Plugins/ITKImageProcessing/test/ITKClosingByReconstructionImageTest.cpp index 084bd27853..66dfee9410 100644 --- a/src/Plugins/ITKImageProcessing/test/ITKClosingByReconstructionImageTest.cpp +++ b/src/Plugins/ITKImageProcessing/test/ITKClosingByReconstructionImageTest.cpp @@ -23,13 +23,13 @@ TEST_CASE("ITKImageProcessing::ITKClosingByReconstructionImageFilter(ClosingByRe ITKClosingByReconstructionImage filter; const DataPath inputGeometryPath({ITKTestBase::k_ImageGeometryPath}); - const DataPath cellDataPath = inputGeometryPath.createChildPath(ITKTestBase::k_ImageCellDataPath); - const DataPath inputDataPath = cellDataPath.createChildPath(ITKTestBase::k_InputDataPath); + const DataPath cellDataPath = inputGeometryPath.createChildPath(ITKTestBase::k_ImageCellDataName); + const DataPath inputDataPath = cellDataPath.createChildPath(ITKTestBase::k_InputDataName); const DataObjectNameParameter::ValueType outputArrayName = ITKTestBase::k_OutputDataPath; { // Start Image Comparison Scope const fs::path inputFilePath = fs::path(unit_test::k_SourceDir.view()) / unit_test::k_DataDir.view() / "JSONFilters" / "Input/STAPLE1.png"; - Result<> imageReadResult = ITKTestBase::ReadImage(dataStructure, inputFilePath, inputGeometryPath, cellDataPath, inputDataPath); + Result<> imageReadResult = ITKTestBase::ReadImage(dataStructure, inputFilePath, inputGeometryPath, ITKTestBase::k_ImageCellDataName, ITKTestBase::k_InputDataName); SIMPLNX_RESULT_REQUIRE_VALID(imageReadResult) } // End Image Comparison Scope diff --git a/src/Plugins/ITKImageProcessing/test/ITKCosImageTest.cpp b/src/Plugins/ITKImageProcessing/test/ITKCosImageTest.cpp index 841d91cfc6..2bafbcea25 100644 --- a/src/Plugins/ITKImageProcessing/test/ITKCosImageTest.cpp +++ b/src/Plugins/ITKImageProcessing/test/ITKCosImageTest.cpp @@ -19,13 +19,13 @@ TEST_CASE("ITKImageProcessing::ITKCosImageFilter(float)", "[ITKImageProcessing][ ITKCosImage filter; const DataPath inputGeometryPath({ITKTestBase::k_ImageGeometryPath}); - const DataPath cellDataPath = inputGeometryPath.createChildPath(ITKTestBase::k_ImageCellDataPath); - const DataPath inputDataPath = cellDataPath.createChildPath(ITKTestBase::k_InputDataPath); + const DataPath cellDataPath = inputGeometryPath.createChildPath(ITKTestBase::k_ImageCellDataName); + const DataPath inputDataPath = cellDataPath.createChildPath(ITKTestBase::k_InputDataName); const DataObjectNameParameter::ValueType outputArrayName = ITKTestBase::k_OutputDataPath; { // Start Image Comparison Scope const fs::path inputFilePath = fs::path(unit_test::k_SourceDir.view()) / unit_test::k_DataDir.view() / "JSONFilters" / "Input/RA-Slice-Float.nrrd"; - Result<> imageReadResult = ITKTestBase::ReadImage(dataStructure, inputFilePath, inputGeometryPath, cellDataPath, inputDataPath); + Result<> imageReadResult = ITKTestBase::ReadImage(dataStructure, inputFilePath, inputGeometryPath, ITKTestBase::k_ImageCellDataName, ITKTestBase::k_InputDataName); SIMPLNX_RESULT_REQUIRE_VALID(imageReadResult) } // End Image Comparison Scope @@ -42,9 +42,9 @@ TEST_CASE("ITKImageProcessing::ITKCosImageFilter(float)", "[ITKImageProcessing][ fs::path baselineFilePath = fs::path(nx::core::unit_test::k_DataDir.view()) / "JSONFilters/Baseline/BasicFilters_CosImageFilter_float.nrrd"; DataPath baselineGeometryPath({ITKTestBase::k_BaselineGeometryPath}); - DataPath baseLineCellDataPath = baselineGeometryPath.createChildPath(ITKTestBase::k_ImageCellDataPath); + DataPath baseLineCellDataPath = baselineGeometryPath.createChildPath(ITKTestBase::k_ImageCellDataName); DataPath baselineDataPath = baseLineCellDataPath.createChildPath(ITKTestBase::k_BaselineDataPath); - Result<> readBaselineResult = ITKTestBase::ReadImage(dataStructure, baselineFilePath, baselineGeometryPath, baseLineCellDataPath, baselineDataPath); + Result<> readBaselineResult = ITKTestBase::ReadImage(dataStructure, baselineFilePath, baselineGeometryPath, ITKTestBase::k_ImageCellDataName, ITKTestBase::k_BaselineDataPath); Result<> compareResult = ITKTestBase::CompareImages(dataStructure, baselineGeometryPath, baselineDataPath, inputGeometryPath, cellDataPath.createChildPath(outputArrayName), 0.01); SIMPLNX_RESULT_REQUIRE_VALID(compareResult) } @@ -55,13 +55,13 @@ TEST_CASE("ITKImageProcessing::ITKCosImageFilter(short)", "[ITKImageProcessing][ ITKCosImage filter; const DataPath inputGeometryPath({ITKTestBase::k_ImageGeometryPath}); - const DataPath cellDataPath = inputGeometryPath.createChildPath(ITKTestBase::k_ImageCellDataPath); - const DataPath inputDataPath = cellDataPath.createChildPath(ITKTestBase::k_InputDataPath); + const DataPath cellDataPath = inputGeometryPath.createChildPath(ITKTestBase::k_ImageCellDataName); + const DataPath inputDataPath = cellDataPath.createChildPath(ITKTestBase::k_InputDataName); const DataObjectNameParameter::ValueType outputArrayName = ITKTestBase::k_OutputDataPath; { // Start Image Comparison Scope const fs::path inputFilePath = fs::path(unit_test::k_SourceDir.view()) / unit_test::k_DataDir.view() / "JSONFilters" / "Input/RA-Slice-Short.nrrd"; - Result<> imageReadResult = ITKTestBase::ReadImage(dataStructure, inputFilePath, inputGeometryPath, cellDataPath, inputDataPath); + Result<> imageReadResult = ITKTestBase::ReadImage(dataStructure, inputFilePath, inputGeometryPath, ITKTestBase::k_ImageCellDataName, ITKTestBase::k_InputDataName); SIMPLNX_RESULT_REQUIRE_VALID(imageReadResult) } // End Image Comparison Scope @@ -78,9 +78,9 @@ TEST_CASE("ITKImageProcessing::ITKCosImageFilter(short)", "[ITKImageProcessing][ fs::path baselineFilePath = fs::path(nx::core::unit_test::k_DataDir.view()) / "JSONFilters/Baseline/BasicFilters_CosImageFilter_short.nrrd"; DataPath baselineGeometryPath({ITKTestBase::k_BaselineGeometryPath}); - DataPath baseLineCellDataPath = baselineGeometryPath.createChildPath(ITKTestBase::k_ImageCellDataPath); + DataPath baseLineCellDataPath = baselineGeometryPath.createChildPath(ITKTestBase::k_ImageCellDataName); DataPath baselineDataPath = baseLineCellDataPath.createChildPath(ITKTestBase::k_BaselineDataPath); - Result<> readBaselineResult = ITKTestBase::ReadImage(dataStructure, baselineFilePath, baselineGeometryPath, baseLineCellDataPath, baselineDataPath); + Result<> readBaselineResult = ITKTestBase::ReadImage(dataStructure, baselineFilePath, baselineGeometryPath, ITKTestBase::k_ImageCellDataName, ITKTestBase::k_BaselineDataPath); Result<> compareResult = ITKTestBase::CompareImages(dataStructure, baselineGeometryPath, baselineDataPath, inputGeometryPath, cellDataPath.createChildPath(outputArrayName), 0.01); SIMPLNX_RESULT_REQUIRE_VALID(compareResult) } diff --git a/src/Plugins/ITKImageProcessing/test/ITKDilateObjectMorphologyImageTest.cpp b/src/Plugins/ITKImageProcessing/test/ITKDilateObjectMorphologyImageTest.cpp index cb262734db..e33e775689 100644 --- a/src/Plugins/ITKImageProcessing/test/ITKDilateObjectMorphologyImageTest.cpp +++ b/src/Plugins/ITKImageProcessing/test/ITKDilateObjectMorphologyImageTest.cpp @@ -24,13 +24,13 @@ TEST_CASE("ITKImageProcessing::ITKDilateObjectMorphologyImageFilter(float)", "[I const ITKDilateObjectMorphologyImage filter; const DataPath inputGeometryPath({ITKTestBase::k_ImageGeometryPath}); - const DataPath cellDataPath = inputGeometryPath.createChildPath(ITKTestBase::k_ImageCellDataPath); - const DataPath inputDataPath = cellDataPath.createChildPath(ITKTestBase::k_InputDataPath); + const DataPath cellDataPath = inputGeometryPath.createChildPath(ITKTestBase::k_ImageCellDataName); + const DataPath inputDataPath = cellDataPath.createChildPath(ITKTestBase::k_InputDataName); const DataObjectNameParameter::ValueType outputArrayName = ITKTestBase::k_OutputDataPath; { // Start Image Comparison Scope const fs::path inputFilePath = fs::path(unit_test::k_SourceDir.view()) / unit_test::k_DataDir.view() / "JSONFilters" / "Input/RA-Slice-Float.nrrd"; - Result<> imageReadResult = ITKTestBase::ReadImage(dataStructure, inputFilePath, inputGeometryPath, cellDataPath, inputDataPath); + Result<> imageReadResult = ITKTestBase::ReadImage(dataStructure, inputFilePath, inputGeometryPath, ITKTestBase::k_ImageCellDataName, ITKTestBase::k_InputDataName); SIMPLNX_RESULT_REQUIRE_VALID(imageReadResult) } // End Image Comparison Scope @@ -49,9 +49,9 @@ TEST_CASE("ITKImageProcessing::ITKDilateObjectMorphologyImageFilter(float)", "[I const fs::path baselineFilePath = fs::path(nx::core::unit_test::k_DataDir.view()) / "JSONFilters/Baseline/BasicFilters_DilateObjectMorphologyImageFilter_float.nrrd"; const DataPath baselineGeometryPath({ITKTestBase::k_BaselineGeometryPath}); - const DataPath baseLineCellDataPath = baselineGeometryPath.createChildPath(ITKTestBase::k_ImageCellDataPath); + const DataPath baseLineCellDataPath = baselineGeometryPath.createChildPath(ITKTestBase::k_ImageCellDataName); const DataPath baselineDataPath = baseLineCellDataPath.createChildPath(ITKTestBase::k_BaselineDataPath); - const Result<> readBaselineResult = ITKTestBase::ReadImage(dataStructure, baselineFilePath, baselineGeometryPath, baseLineCellDataPath, baselineDataPath); + const Result<> readBaselineResult = ITKTestBase::ReadImage(dataStructure, baselineFilePath, baselineGeometryPath, ITKTestBase::k_ImageCellDataName, ITKTestBase::k_BaselineDataPath); Result<> compareResult = ITKTestBase::CompareImages(dataStructure, baselineGeometryPath, baselineDataPath, inputGeometryPath, cellDataPath.createChildPath(outputArrayName), 0.01); SIMPLNX_RESULT_REQUIRE_VALID(compareResult) } @@ -62,13 +62,13 @@ TEST_CASE("ITKImageProcessing::ITKDilateObjectMorphologyImageFilter(short)", "[I const ITKDilateObjectMorphologyImage filter; const DataPath inputGeometryPath({ITKTestBase::k_ImageGeometryPath}); - const DataPath cellDataPath = inputGeometryPath.createChildPath(ITKTestBase::k_ImageCellDataPath); - const DataPath inputDataPath = cellDataPath.createChildPath(ITKTestBase::k_InputDataPath); + const DataPath cellDataPath = inputGeometryPath.createChildPath(ITKTestBase::k_ImageCellDataName); + const DataPath inputDataPath = cellDataPath.createChildPath(ITKTestBase::k_InputDataName); const DataObjectNameParameter::ValueType outputArrayName = ITKTestBase::k_OutputDataPath; { // Start Image Comparison Scope const fs::path inputFilePath = fs::path(unit_test::k_SourceDir.view()) / unit_test::k_DataDir.view() / "JSONFilters" / "Input/RA-Slice-Short.nrrd"; - Result<> imageReadResult = ITKTestBase::ReadImage(dataStructure, inputFilePath, inputGeometryPath, cellDataPath, inputDataPath); + Result<> imageReadResult = ITKTestBase::ReadImage(dataStructure, inputFilePath, inputGeometryPath, ITKTestBase::k_ImageCellDataName, ITKTestBase::k_InputDataName); SIMPLNX_RESULT_REQUIRE_VALID(imageReadResult) } // End Image Comparison Scope @@ -87,9 +87,9 @@ TEST_CASE("ITKImageProcessing::ITKDilateObjectMorphologyImageFilter(short)", "[I const fs::path baselineFilePath = fs::path(nx::core::unit_test::k_DataDir.view()) / "JSONFilters/Baseline/BasicFilters_DilateObjectMorphologyImageFilter_short.nrrd"; const DataPath baselineGeometryPath({ITKTestBase::k_BaselineGeometryPath}); - const DataPath baseLineCellDataPath = baselineGeometryPath.createChildPath(ITKTestBase::k_ImageCellDataPath); + const DataPath baseLineCellDataPath = baselineGeometryPath.createChildPath(ITKTestBase::k_ImageCellDataName); const DataPath baselineDataPath = baseLineCellDataPath.createChildPath(ITKTestBase::k_BaselineDataPath); - const Result<> readBaselineResult = ITKTestBase::ReadImage(dataStructure, baselineFilePath, baselineGeometryPath, baseLineCellDataPath, baselineDataPath); + const Result<> readBaselineResult = ITKTestBase::ReadImage(dataStructure, baselineFilePath, baselineGeometryPath, ITKTestBase::k_ImageCellDataName, ITKTestBase::k_BaselineDataPath); Result<> compareResult = ITKTestBase::CompareImages(dataStructure, baselineGeometryPath, baselineDataPath, inputGeometryPath, cellDataPath.createChildPath(outputArrayName), 0.01); SIMPLNX_RESULT_REQUIRE_VALID(compareResult) } diff --git a/src/Plugins/ITKImageProcessing/test/ITKDiscreteGaussianImageTest.cpp b/src/Plugins/ITKImageProcessing/test/ITKDiscreteGaussianImageTest.cpp index 5ec6283a5e..b406362bb4 100644 --- a/src/Plugins/ITKImageProcessing/test/ITKDiscreteGaussianImageTest.cpp +++ b/src/Plugins/ITKImageProcessing/test/ITKDiscreteGaussianImageTest.cpp @@ -26,13 +26,13 @@ TEST_CASE("ITKImageProcessing::ITKDiscreteGaussianImageFilter(float)", "[ITKImag const ITKDiscreteGaussianImage filter; const DataPath inputGeometryPath({ITKTestBase::k_ImageGeometryPath}); - const DataPath cellDataPath = inputGeometryPath.createChildPath(ITKTestBase::k_ImageCellDataPath); - const DataPath inputDataPath = cellDataPath.createChildPath(ITKTestBase::k_InputDataPath); + const DataPath cellDataPath = inputGeometryPath.createChildPath(ITKTestBase::k_ImageCellDataName); + const DataPath inputDataPath = cellDataPath.createChildPath(ITKTestBase::k_InputDataName); const DataObjectNameParameter::ValueType outputArrayName = ITKTestBase::k_OutputDataPath; { // Start Image Comparison Scope const fs::path inputFilePath = fs::path(unit_test::k_SourceDir.view()) / unit_test::k_DataDir.view() / "JSONFilters" / "Input/RA-Float.nrrd"; - Result<> imageReadResult = ITKTestBase::ReadImage(dataStructure, inputFilePath, inputGeometryPath, cellDataPath, inputDataPath); + Result<> imageReadResult = ITKTestBase::ReadImage(dataStructure, inputFilePath, inputGeometryPath, ITKTestBase::k_ImageCellDataName, ITKTestBase::k_InputDataName); SIMPLNX_RESULT_REQUIRE_VALID(imageReadResult) } // End Image Comparison Scope @@ -49,9 +49,9 @@ TEST_CASE("ITKImageProcessing::ITKDiscreteGaussianImageFilter(float)", "[ITKImag const fs::path baselineFilePath = fs::path(nx::core::unit_test::k_DataDir.view()) / "JSONFilters/Baseline/BasicFilters_DiscreteGaussianImageFilter_float.nrrd"; const DataPath baselineGeometryPath({ITKTestBase::k_BaselineGeometryPath}); - const DataPath baseLineCellDataPath = baselineGeometryPath.createChildPath(ITKTestBase::k_ImageCellDataPath); + const DataPath baseLineCellDataPath = baselineGeometryPath.createChildPath(ITKTestBase::k_ImageCellDataName); const DataPath baselineDataPath = baseLineCellDataPath.createChildPath(ITKTestBase::k_BaselineDataPath); - const Result<> readBaselineResult = ITKTestBase::ReadImage(dataStructure, baselineFilePath, baselineGeometryPath, baseLineCellDataPath, baselineDataPath); + const Result<> readBaselineResult = ITKTestBase::ReadImage(dataStructure, baselineFilePath, baselineGeometryPath, ITKTestBase::k_ImageCellDataName, ITKTestBase::k_BaselineDataPath); Result<> compareResult = ITKTestBase::CompareImages(dataStructure, baselineGeometryPath, baselineDataPath, inputGeometryPath, cellDataPath.createChildPath(outputArrayName), 0.0001); SIMPLNX_RESULT_REQUIRE_VALID(compareResult) } @@ -64,13 +64,13 @@ TEST_CASE("ITKImageProcessing::ITKDiscreteGaussianImageFilter(short)", "[ITKImag const ITKDiscreteGaussianImage filter; const DataPath inputGeometryPath({ITKTestBase::k_ImageGeometryPath}); - const DataPath cellDataPath = inputGeometryPath.createChildPath(ITKTestBase::k_ImageCellDataPath); - const DataPath inputDataPath = cellDataPath.createChildPath(ITKTestBase::k_InputDataPath); + const DataPath cellDataPath = inputGeometryPath.createChildPath(ITKTestBase::k_ImageCellDataName); + const DataPath inputDataPath = cellDataPath.createChildPath(ITKTestBase::k_InputDataName); const DataObjectNameParameter::ValueType outputArrayName = ITKTestBase::k_OutputDataPath; { // Start Image Comparison Scope const fs::path inputFilePath = fs::path(unit_test::k_SourceDir.view()) / unit_test::k_DataDir.view() / "JSONFilters" / "Input/RA-Slice-Short.nrrd"; - Result<> imageReadResult = ITKTestBase::ReadImage(dataStructure, inputFilePath, inputGeometryPath, cellDataPath, inputDataPath); + Result<> imageReadResult = ITKTestBase::ReadImage(dataStructure, inputFilePath, inputGeometryPath, ITKTestBase::k_ImageCellDataName, ITKTestBase::k_InputDataName); SIMPLNX_RESULT_REQUIRE_VALID(imageReadResult) } // End Image Comparison Scope @@ -87,9 +87,9 @@ TEST_CASE("ITKImageProcessing::ITKDiscreteGaussianImageFilter(short)", "[ITKImag const fs::path baselineFilePath = fs::path(nx::core::unit_test::k_DataDir.view()) / "JSONFilters/Baseline/BasicFilters_DiscreteGaussianImageFilter_short.nrrd"; const DataPath baselineGeometryPath({ITKTestBase::k_BaselineGeometryPath}); - const DataPath baseLineCellDataPath = baselineGeometryPath.createChildPath(ITKTestBase::k_ImageCellDataPath); + const DataPath baseLineCellDataPath = baselineGeometryPath.createChildPath(ITKTestBase::k_ImageCellDataName); const DataPath baselineDataPath = baseLineCellDataPath.createChildPath(ITKTestBase::k_BaselineDataPath); - const Result<> readBaselineResult = ITKTestBase::ReadImage(dataStructure, baselineFilePath, baselineGeometryPath, baseLineCellDataPath, baselineDataPath); + const Result<> readBaselineResult = ITKTestBase::ReadImage(dataStructure, baselineFilePath, baselineGeometryPath, ITKTestBase::k_ImageCellDataName, ITKTestBase::k_BaselineDataPath); Result<> compareResult = ITKTestBase::CompareImages(dataStructure, baselineGeometryPath, baselineDataPath, inputGeometryPath, cellDataPath.createChildPath(outputArrayName), 1.0); SIMPLNX_RESULT_REQUIRE_VALID(compareResult) } @@ -102,13 +102,13 @@ TEST_CASE("ITKImageProcessing::ITKDiscreteGaussianImageFilter(bigG)", "[ITKImage const ITKDiscreteGaussianImage filter; const DataPath inputGeometryPath({ITKTestBase::k_ImageGeometryPath}); - const DataPath cellDataPath = inputGeometryPath.createChildPath(ITKTestBase::k_ImageCellDataPath); - const DataPath inputDataPath = cellDataPath.createChildPath(ITKTestBase::k_InputDataPath); + const DataPath cellDataPath = inputGeometryPath.createChildPath(ITKTestBase::k_ImageCellDataName); + const DataPath inputDataPath = cellDataPath.createChildPath(ITKTestBase::k_InputDataName); const DataObjectNameParameter::ValueType outputArrayName = ITKTestBase::k_OutputDataPath; { // Start Image Comparison Scope const fs::path inputFilePath = fs::path(unit_test::k_SourceDir.view()) / unit_test::k_DataDir.view() / "JSONFilters" / "Input/WhiteDots.png"; - Result<> imageReadResult = ITKTestBase::ReadImage(dataStructure, inputFilePath, inputGeometryPath, cellDataPath, inputDataPath); + Result<> imageReadResult = ITKTestBase::ReadImage(dataStructure, inputFilePath, inputGeometryPath, ITKTestBase::k_ImageCellDataName, ITKTestBase::k_InputDataName); SIMPLNX_RESULT_REQUIRE_VALID(imageReadResult) } // End Image Comparison Scope diff --git a/src/Plugins/ITKImageProcessing/test/ITKErodeObjectMorphologyImageTest.cpp b/src/Plugins/ITKImageProcessing/test/ITKErodeObjectMorphologyImageTest.cpp index a58430804e..e354d9d309 100644 --- a/src/Plugins/ITKImageProcessing/test/ITKErodeObjectMorphologyImageTest.cpp +++ b/src/Plugins/ITKImageProcessing/test/ITKErodeObjectMorphologyImageTest.cpp @@ -24,13 +24,13 @@ TEST_CASE("ITKImageProcessing::ITKErodeObjectMorphologyImageFilter(float)", "[IT const ITKErodeObjectMorphologyImage filter; const DataPath inputGeometryPath({ITKTestBase::k_ImageGeometryPath}); - const DataPath cellDataPath = inputGeometryPath.createChildPath(ITKTestBase::k_ImageCellDataPath); - const DataPath inputDataPath = cellDataPath.createChildPath(ITKTestBase::k_InputDataPath); + const DataPath cellDataPath = inputGeometryPath.createChildPath(ITKTestBase::k_ImageCellDataName); + const DataPath inputDataPath = cellDataPath.createChildPath(ITKTestBase::k_InputDataName); const DataObjectNameParameter::ValueType outputArrayName = ITKTestBase::k_OutputDataPath; { // Start Image Comparison Scope const fs::path inputFilePath = fs::path(unit_test::k_SourceDir.view()) / unit_test::k_DataDir.view() / "JSONFilters" / "Input/RA-Slice-Float.nrrd"; - Result<> imageReadResult = ITKTestBase::ReadImage(dataStructure, inputFilePath, inputGeometryPath, cellDataPath, inputDataPath); + Result<> imageReadResult = ITKTestBase::ReadImage(dataStructure, inputFilePath, inputGeometryPath, ITKTestBase::k_ImageCellDataName, ITKTestBase::k_InputDataName); SIMPLNX_RESULT_REQUIRE_VALID(imageReadResult) } // End Image Comparison Scope @@ -49,9 +49,9 @@ TEST_CASE("ITKImageProcessing::ITKErodeObjectMorphologyImageFilter(float)", "[IT const fs::path baselineFilePath = fs::path(nx::core::unit_test::k_DataDir.view()) / "JSONFilters/Baseline/BasicFilters_ErodeObjectMorphologyImageFilter_float.nrrd"; const DataPath baselineGeometryPath({ITKTestBase::k_BaselineGeometryPath}); - const DataPath baseLineCellDataPath = baselineGeometryPath.createChildPath(ITKTestBase::k_ImageCellDataPath); + const DataPath baseLineCellDataPath = baselineGeometryPath.createChildPath(ITKTestBase::k_ImageCellDataName); const DataPath baselineDataPath = baseLineCellDataPath.createChildPath(ITKTestBase::k_BaselineDataPath); - const Result<> readBaselineResult = ITKTestBase::ReadImage(dataStructure, baselineFilePath, baselineGeometryPath, baseLineCellDataPath, baselineDataPath); + const Result<> readBaselineResult = ITKTestBase::ReadImage(dataStructure, baselineFilePath, baselineGeometryPath, ITKTestBase::k_ImageCellDataName, ITKTestBase::k_BaselineDataPath); Result<> compareResult = ITKTestBase::CompareImages(dataStructure, baselineGeometryPath, baselineDataPath, inputGeometryPath, cellDataPath.createChildPath(outputArrayName), 0.01); SIMPLNX_RESULT_REQUIRE_VALID(compareResult) } @@ -62,13 +62,13 @@ TEST_CASE("ITKImageProcessing::ITKErodeObjectMorphologyImageFilter(short)", "[IT const ITKErodeObjectMorphologyImage filter; const DataPath inputGeometryPath({ITKTestBase::k_ImageGeometryPath}); - const DataPath cellDataPath = inputGeometryPath.createChildPath(ITKTestBase::k_ImageCellDataPath); - const DataPath inputDataPath = cellDataPath.createChildPath(ITKTestBase::k_InputDataPath); + const DataPath cellDataPath = inputGeometryPath.createChildPath(ITKTestBase::k_ImageCellDataName); + const DataPath inputDataPath = cellDataPath.createChildPath(ITKTestBase::k_InputDataName); const DataObjectNameParameter::ValueType outputArrayName = ITKTestBase::k_OutputDataPath; { // Start Image Comparison Scope const fs::path inputFilePath = fs::path(unit_test::k_SourceDir.view()) / unit_test::k_DataDir.view() / "JSONFilters" / "Input/RA-Slice-Short.nrrd"; - Result<> imageReadResult = ITKTestBase::ReadImage(dataStructure, inputFilePath, inputGeometryPath, cellDataPath, inputDataPath); + Result<> imageReadResult = ITKTestBase::ReadImage(dataStructure, inputFilePath, inputGeometryPath, ITKTestBase::k_ImageCellDataName, ITKTestBase::k_InputDataName); SIMPLNX_RESULT_REQUIRE_VALID(imageReadResult) } // End Image Comparison Scope @@ -87,9 +87,9 @@ TEST_CASE("ITKImageProcessing::ITKErodeObjectMorphologyImageFilter(short)", "[IT const fs::path baselineFilePath = fs::path(nx::core::unit_test::k_DataDir.view()) / "JSONFilters/Baseline/BasicFilters_ErodeObjectMorphologyImageFilter_short.nrrd"; const DataPath baselineGeometryPath({ITKTestBase::k_BaselineGeometryPath}); - const DataPath baseLineCellDataPath = baselineGeometryPath.createChildPath(ITKTestBase::k_ImageCellDataPath); + const DataPath baseLineCellDataPath = baselineGeometryPath.createChildPath(ITKTestBase::k_ImageCellDataName); const DataPath baselineDataPath = baseLineCellDataPath.createChildPath(ITKTestBase::k_BaselineDataPath); - const Result<> readBaselineResult = ITKTestBase::ReadImage(dataStructure, baselineFilePath, baselineGeometryPath, baseLineCellDataPath, baselineDataPath); + const Result<> readBaselineResult = ITKTestBase::ReadImage(dataStructure, baselineFilePath, baselineGeometryPath, ITKTestBase::k_ImageCellDataName, ITKTestBase::k_BaselineDataPath); Result<> compareResult = ITKTestBase::CompareImages(dataStructure, baselineGeometryPath, baselineDataPath, inputGeometryPath, cellDataPath.createChildPath(outputArrayName), 0.01); SIMPLNX_RESULT_REQUIRE_VALID(compareResult) } diff --git a/src/Plugins/ITKImageProcessing/test/ITKExpImageTest.cpp b/src/Plugins/ITKImageProcessing/test/ITKExpImageTest.cpp index c4e9c682bc..47805468cd 100644 --- a/src/Plugins/ITKImageProcessing/test/ITKExpImageTest.cpp +++ b/src/Plugins/ITKImageProcessing/test/ITKExpImageTest.cpp @@ -21,13 +21,13 @@ TEST_CASE("ITKImageProcessing::ITKExpImageFilter(defaults)", "[ITKImageProcessin const ITKExpImage filter; const DataPath inputGeometryPath({ITKTestBase::k_ImageGeometryPath}); - const DataPath cellDataPath = inputGeometryPath.createChildPath(ITKTestBase::k_ImageCellDataPath); - const DataPath inputDataPath = cellDataPath.createChildPath(ITKTestBase::k_InputDataPath); + const DataPath cellDataPath = inputGeometryPath.createChildPath(ITKTestBase::k_ImageCellDataName); + const DataPath inputDataPath = cellDataPath.createChildPath(ITKTestBase::k_InputDataName); const DataObjectNameParameter::ValueType outputArrayName = ITKTestBase::k_OutputDataPath; { // Start Image Comparison Scope const fs::path inputFilePath = fs::path(unit_test::k_SourceDir.view()) / unit_test::k_DataDir.view() / "JSONFilters" / "Input/Ramp-Zero-One-Float.nrrd"; - Result<> imageReadResult = ITKTestBase::ReadImage(dataStructure, inputFilePath, inputGeometryPath, cellDataPath, inputDataPath); + Result<> imageReadResult = ITKTestBase::ReadImage(dataStructure, inputFilePath, inputGeometryPath, ITKTestBase::k_ImageCellDataName, ITKTestBase::k_InputDataName); SIMPLNX_RESULT_REQUIRE_VALID(imageReadResult) } // End Image Comparison Scope @@ -44,9 +44,9 @@ TEST_CASE("ITKImageProcessing::ITKExpImageFilter(defaults)", "[ITKImageProcessin const fs::path baselineFilePath = fs::path(nx::core::unit_test::k_DataDir.view()) / "JSONFilters/Baseline/BasicFilters_ExpImageFilter_defaults.nrrd"; const DataPath baselineGeometryPath({ITKTestBase::k_BaselineGeometryPath}); - const DataPath baseLineCellDataPath = baselineGeometryPath.createChildPath(ITKTestBase::k_ImageCellDataPath); + const DataPath baseLineCellDataPath = baselineGeometryPath.createChildPath(ITKTestBase::k_ImageCellDataName); const DataPath baselineDataPath = baseLineCellDataPath.createChildPath(ITKTestBase::k_BaselineDataPath); - const Result<> readBaselineResult = ITKTestBase::ReadImage(dataStructure, baselineFilePath, baselineGeometryPath, baseLineCellDataPath, baselineDataPath); + const Result<> readBaselineResult = ITKTestBase::ReadImage(dataStructure, baselineFilePath, baselineGeometryPath, ITKTestBase::k_ImageCellDataName, ITKTestBase::k_BaselineDataPath); Result<> compareResult = ITKTestBase::CompareImages(dataStructure, baselineGeometryPath, baselineDataPath, inputGeometryPath, cellDataPath.createChildPath(outputArrayName), 0.01); SIMPLNX_RESULT_REQUIRE_VALID(compareResult) } diff --git a/src/Plugins/ITKImageProcessing/test/ITKExpNegativeImageTest.cpp b/src/Plugins/ITKImageProcessing/test/ITKExpNegativeImageTest.cpp index 3612845431..9cc4e45b96 100644 --- a/src/Plugins/ITKImageProcessing/test/ITKExpNegativeImageTest.cpp +++ b/src/Plugins/ITKImageProcessing/test/ITKExpNegativeImageTest.cpp @@ -21,13 +21,13 @@ TEST_CASE("ITKImageProcessing::ITKExpNegativeImageFilter(defaults)", "[ITKImageP const ITKExpNegativeImage filter; const DataPath inputGeometryPath({ITKTestBase::k_ImageGeometryPath}); - const DataPath cellDataPath = inputGeometryPath.createChildPath(ITKTestBase::k_ImageCellDataPath); - const DataPath inputDataPath = cellDataPath.createChildPath(ITKTestBase::k_InputDataPath); + const DataPath cellDataPath = inputGeometryPath.createChildPath(ITKTestBase::k_ImageCellDataName); + const DataPath inputDataPath = cellDataPath.createChildPath(ITKTestBase::k_InputDataName); const DataObjectNameParameter::ValueType outputArrayName = ITKTestBase::k_OutputDataPath; { // Start Image Comparison Scope const fs::path inputFilePath = fs::path(unit_test::k_SourceDir.view()) / unit_test::k_DataDir.view() / "JSONFilters" / "Input/Ramp-Zero-One-Float.nrrd"; - Result<> imageReadResult = ITKTestBase::ReadImage(dataStructure, inputFilePath, inputGeometryPath, cellDataPath, inputDataPath); + Result<> imageReadResult = ITKTestBase::ReadImage(dataStructure, inputFilePath, inputGeometryPath, ITKTestBase::k_ImageCellDataName, ITKTestBase::k_InputDataName); SIMPLNX_RESULT_REQUIRE_VALID(imageReadResult) } // End Image Comparison Scope @@ -44,9 +44,9 @@ TEST_CASE("ITKImageProcessing::ITKExpNegativeImageFilter(defaults)", "[ITKImageP const fs::path baselineFilePath = fs::path(nx::core::unit_test::k_DataDir.view()) / "JSONFilters/Baseline/BasicFilters_ExpNegativeImageFilter_defaults.nrrd"; const DataPath baselineGeometryPath({ITKTestBase::k_BaselineGeometryPath}); - const DataPath baseLineCellDataPath = baselineGeometryPath.createChildPath(ITKTestBase::k_ImageCellDataPath); + const DataPath baseLineCellDataPath = baselineGeometryPath.createChildPath(ITKTestBase::k_ImageCellDataName); const DataPath baselineDataPath = baseLineCellDataPath.createChildPath(ITKTestBase::k_BaselineDataPath); - const Result<> readBaselineResult = ITKTestBase::ReadImage(dataStructure, baselineFilePath, baselineGeometryPath, baseLineCellDataPath, baselineDataPath); + const Result<> readBaselineResult = ITKTestBase::ReadImage(dataStructure, baselineFilePath, baselineGeometryPath, ITKTestBase::k_ImageCellDataName, ITKTestBase::k_BaselineDataPath); Result<> compareResult = ITKTestBase::CompareImages(dataStructure, baselineGeometryPath, baselineDataPath, inputGeometryPath, cellDataPath.createChildPath(outputArrayName), 0.01); SIMPLNX_RESULT_REQUIRE_VALID(compareResult) } diff --git a/src/Plugins/ITKImageProcessing/test/ITKGradientMagnitudeImageTest.cpp b/src/Plugins/ITKImageProcessing/test/ITKGradientMagnitudeImageTest.cpp index 5cffcb9b6d..15ede3ea8b 100644 --- a/src/Plugins/ITKImageProcessing/test/ITKGradientMagnitudeImageTest.cpp +++ b/src/Plugins/ITKImageProcessing/test/ITKGradientMagnitudeImageTest.cpp @@ -20,12 +20,12 @@ TEST_CASE("ITKImageProcessing::ITKGradientMagnitudeImageFilter(default)", "[ITKI ITKGradientMagnitudeImage filter; const DataPath inputGeometryPath({ITKTestBase::k_ImageGeometryPath}); - const DataPath cellDataPath = inputGeometryPath.createChildPath(ITKTestBase::k_ImageCellDataPath); - const DataPath inputDataPath = cellDataPath.createChildPath(ITKTestBase::k_InputDataPath); + const DataPath cellDataPath = inputGeometryPath.createChildPath(ITKTestBase::k_ImageCellDataName); + const DataPath inputDataPath = cellDataPath.createChildPath(ITKTestBase::k_InputDataName); const DataObjectNameParameter::ValueType outputArrayName = ITKTestBase::k_OutputDataPath; fs::path inputFilePath = fs::path(unit_test::k_SourceDir.view()) / unit_test::k_DataDir.view() / "JSONFilters" / "Input/RA-Float.nrrd"; - Result<> imageReadResult = ITKTestBase::ReadImage(dataStructure, inputFilePath, inputGeometryPath, cellDataPath, inputDataPath); + Result<> imageReadResult = ITKTestBase::ReadImage(dataStructure, inputFilePath, inputGeometryPath, ITKTestBase::k_ImageCellDataName, ITKTestBase::k_InputDataName); SIMPLNX_RESULT_REQUIRE_VALID(imageReadResult) Arguments args; @@ -41,9 +41,9 @@ TEST_CASE("ITKImageProcessing::ITKGradientMagnitudeImageFilter(default)", "[ITKI fs::path baselineFilePath = fs::path(nx::core::unit_test::k_DataDir.view()) / "JSONFilters/Baseline/BasicFilters_GradientMagnitudeImageFilter_default.nrrd"; DataPath baselineGeometryPath({ITKTestBase::k_BaselineGeometryPath}); - DataPath baseLineCellDataPath = baselineGeometryPath.createChildPath(ITKTestBase::k_ImageCellDataPath); + DataPath baseLineCellDataPath = baselineGeometryPath.createChildPath(ITKTestBase::k_ImageCellDataName); DataPath baselineDataPath = baseLineCellDataPath.createChildPath(ITKTestBase::k_BaselineDataPath); - Result<> readBaselineResult = ITKTestBase::ReadImage(dataStructure, baselineFilePath, baselineGeometryPath, baseLineCellDataPath, baselineDataPath); + Result<> readBaselineResult = ITKTestBase::ReadImage(dataStructure, baselineFilePath, baselineGeometryPath, ITKTestBase::k_ImageCellDataName, ITKTestBase::k_BaselineDataPath); Result<> compareResult = ITKTestBase::CompareImages(dataStructure, baselineGeometryPath, baselineDataPath, inputGeometryPath, cellDataPath.createChildPath(outputArrayName), 1e-05); SIMPLNX_RESULT_REQUIRE_VALID(compareResult) } diff --git a/src/Plugins/ITKImageProcessing/test/ITKGrayscaleDilateImageTest.cpp b/src/Plugins/ITKImageProcessing/test/ITKGrayscaleDilateImageTest.cpp index 7141c4aae0..9fb1379a7f 100644 --- a/src/Plugins/ITKImageProcessing/test/ITKGrayscaleDilateImageTest.cpp +++ b/src/Plugins/ITKImageProcessing/test/ITKGrayscaleDilateImageTest.cpp @@ -23,13 +23,13 @@ TEST_CASE("ITKImageProcessing::ITKGrayscaleDilateImageFilter(GrayscaleDilate)", const ITKGrayscaleDilateImage filter; const DataPath inputGeometryPath({ITKTestBase::k_ImageGeometryPath}); - const DataPath cellDataPath = inputGeometryPath.createChildPath(ITKTestBase::k_ImageCellDataPath); - const DataPath inputDataPath = cellDataPath.createChildPath(ITKTestBase::k_InputDataPath); + const DataPath cellDataPath = inputGeometryPath.createChildPath(ITKTestBase::k_ImageCellDataName); + const DataPath inputDataPath = cellDataPath.createChildPath(ITKTestBase::k_InputDataName); const DataObjectNameParameter::ValueType outputArrayName = ITKTestBase::k_OutputDataPath; { // Start Image Comparison Scope const fs::path inputFilePath = fs::path(unit_test::k_SourceDir.view()) / unit_test::k_DataDir.view() / "JSONFilters" / "Input/STAPLE1.png"; - Result<> imageReadResult = ITKTestBase::ReadImage(dataStructure, inputFilePath, inputGeometryPath, cellDataPath, inputDataPath); + Result<> imageReadResult = ITKTestBase::ReadImage(dataStructure, inputFilePath, inputGeometryPath, ITKTestBase::k_ImageCellDataName, ITKTestBase::k_InputDataName); SIMPLNX_RESULT_REQUIRE_VALID(imageReadResult) } // End Image Comparison Scope diff --git a/src/Plugins/ITKImageProcessing/test/ITKGrayscaleErodeImageTest.cpp b/src/Plugins/ITKImageProcessing/test/ITKGrayscaleErodeImageTest.cpp index 2f13753f41..71f78a7a30 100644 --- a/src/Plugins/ITKImageProcessing/test/ITKGrayscaleErodeImageTest.cpp +++ b/src/Plugins/ITKImageProcessing/test/ITKGrayscaleErodeImageTest.cpp @@ -23,13 +23,13 @@ TEST_CASE("ITKImageProcessing::ITKGrayscaleErodeImageFilter(GrayscaleErode)", "[ const ITKGrayscaleErodeImage filter; const DataPath inputGeometryPath({ITKTestBase::k_ImageGeometryPath}); - const DataPath cellDataPath = inputGeometryPath.createChildPath(ITKTestBase::k_ImageCellDataPath); - const DataPath inputDataPath = cellDataPath.createChildPath(ITKTestBase::k_InputDataPath); + const DataPath cellDataPath = inputGeometryPath.createChildPath(ITKTestBase::k_ImageCellDataName); + const DataPath inputDataPath = cellDataPath.createChildPath(ITKTestBase::k_InputDataName); const DataObjectNameParameter::ValueType outputArrayName = ITKTestBase::k_OutputDataPath; { // Start Image Comparison Scope const fs::path inputFilePath = fs::path(unit_test::k_SourceDir.view()) / unit_test::k_DataDir.view() / "JSONFilters" / "Input/STAPLE1.png"; - Result<> imageReadResult = ITKTestBase::ReadImage(dataStructure, inputFilePath, inputGeometryPath, cellDataPath, inputDataPath); + Result<> imageReadResult = ITKTestBase::ReadImage(dataStructure, inputFilePath, inputGeometryPath, ITKTestBase::k_ImageCellDataName, ITKTestBase::k_InputDataName); SIMPLNX_RESULT_REQUIRE_VALID(imageReadResult) } // End Image Comparison Scope diff --git a/src/Plugins/ITKImageProcessing/test/ITKGrayscaleFillholeImageTest.cpp b/src/Plugins/ITKImageProcessing/test/ITKGrayscaleFillholeImageTest.cpp index a7afe520d0..178755dd3c 100644 --- a/src/Plugins/ITKImageProcessing/test/ITKGrayscaleFillholeImageTest.cpp +++ b/src/Plugins/ITKImageProcessing/test/ITKGrayscaleFillholeImageTest.cpp @@ -20,12 +20,12 @@ TEST_CASE("ITKImageProcessing::ITKGrayscaleFillholeImageFilter(GrayscaleFillhole ITKGrayscaleFillholeImage filter; const DataPath inputGeometryPath({ITKTestBase::k_ImageGeometryPath}); - const DataPath cellDataPath = inputGeometryPath.createChildPath(ITKTestBase::k_ImageCellDataPath); - const DataPath inputDataPath = cellDataPath.createChildPath(ITKTestBase::k_InputDataPath); + const DataPath cellDataPath = inputGeometryPath.createChildPath(ITKTestBase::k_ImageCellDataName); + const DataPath inputDataPath = cellDataPath.createChildPath(ITKTestBase::k_InputDataName); const DataObjectNameParameter::ValueType outputArrayName = ITKTestBase::k_OutputDataPath; fs::path inputFilePath = fs::path(unit_test::k_SourceDir.view()) / unit_test::k_DataDir.view() / "JSONFilters" / "Input/RA-Short.nrrd"; - Result<> imageReadResult = ITKTestBase::ReadImage(dataStructure, inputFilePath, inputGeometryPath, cellDataPath, inputDataPath); + Result<> imageReadResult = ITKTestBase::ReadImage(dataStructure, inputFilePath, inputGeometryPath, ITKTestBase::k_ImageCellDataName, ITKTestBase::k_InputDataName); SIMPLNX_RESULT_REQUIRE_VALID(imageReadResult) Arguments args; @@ -49,12 +49,12 @@ TEST_CASE("ITKImageProcessing::ITKGrayscaleFillholeImageFilter(GrayscaleFillhole ITKGrayscaleFillholeImage filter; const DataPath inputGeometryPath({ITKTestBase::k_ImageGeometryPath}); - const DataPath cellDataPath = inputGeometryPath.createChildPath(ITKTestBase::k_ImageCellDataPath); - const DataPath inputDataPath = cellDataPath.createChildPath(ITKTestBase::k_InputDataPath); + const DataPath cellDataPath = inputGeometryPath.createChildPath(ITKTestBase::k_ImageCellDataName); + const DataPath inputDataPath = cellDataPath.createChildPath(ITKTestBase::k_InputDataName); const DataObjectNameParameter::ValueType outputArrayName = ITKTestBase::k_OutputDataPath; fs::path inputFilePath = fs::path(unit_test::k_SourceDir.view()) / unit_test::k_DataDir.view() / "JSONFilters" / "Input/RA-Slice-Short.png"; - Result<> imageReadResult = ITKTestBase::ReadImage(dataStructure, inputFilePath, inputGeometryPath, cellDataPath, inputDataPath); + Result<> imageReadResult = ITKTestBase::ReadImage(dataStructure, inputFilePath, inputGeometryPath, ITKTestBase::k_ImageCellDataName, ITKTestBase::k_InputDataName); SIMPLNX_RESULT_REQUIRE_VALID(imageReadResult) Arguments args; diff --git a/src/Plugins/ITKImageProcessing/test/ITKGrayscaleGrindPeakImageTest.cpp b/src/Plugins/ITKImageProcessing/test/ITKGrayscaleGrindPeakImageTest.cpp index a5726ad222..c7fdcef7cc 100644 --- a/src/Plugins/ITKImageProcessing/test/ITKGrayscaleGrindPeakImageTest.cpp +++ b/src/Plugins/ITKImageProcessing/test/ITKGrayscaleGrindPeakImageTest.cpp @@ -22,13 +22,13 @@ TEST_CASE("ITKImageProcessing::ITKGrayscaleGrindPeakImageFilter(GrayscaleGrindPe const ITKGrayscaleGrindPeakImage filter; const DataPath inputGeometryPath({ITKTestBase::k_ImageGeometryPath}); - const DataPath cellDataPath = inputGeometryPath.createChildPath(ITKTestBase::k_ImageCellDataPath); - const DataPath inputDataPath = cellDataPath.createChildPath(ITKTestBase::k_InputDataPath); + const DataPath cellDataPath = inputGeometryPath.createChildPath(ITKTestBase::k_ImageCellDataName); + const DataPath inputDataPath = cellDataPath.createChildPath(ITKTestBase::k_InputDataName); const DataObjectNameParameter::ValueType outputArrayName = ITKTestBase::k_OutputDataPath; { // Start Image Comparison Scope const fs::path inputFilePath = fs::path(unit_test::k_SourceDir.view()) / unit_test::k_DataDir.view() / "JSONFilters" / "Input/RA-Short.nrrd"; - Result<> imageReadResult = ITKTestBase::ReadImage(dataStructure, inputFilePath, inputGeometryPath, cellDataPath, inputDataPath); + Result<> imageReadResult = ITKTestBase::ReadImage(dataStructure, inputFilePath, inputGeometryPath, ITKTestBase::k_ImageCellDataName, ITKTestBase::k_InputDataName); SIMPLNX_RESULT_REQUIRE_VALID(imageReadResult) } // End Image Comparison Scope @@ -53,13 +53,13 @@ TEST_CASE("ITKImageProcessing::ITKGrayscaleGrindPeakImageFilter(GrayscaleGrindPe const ITKGrayscaleGrindPeakImage filter; const DataPath inputGeometryPath({ITKTestBase::k_ImageGeometryPath}); - const DataPath cellDataPath = inputGeometryPath.createChildPath(ITKTestBase::k_ImageCellDataPath); - const DataPath inputDataPath = cellDataPath.createChildPath(ITKTestBase::k_InputDataPath); + const DataPath cellDataPath = inputGeometryPath.createChildPath(ITKTestBase::k_ImageCellDataName); + const DataPath inputDataPath = cellDataPath.createChildPath(ITKTestBase::k_InputDataName); const DataObjectNameParameter::ValueType outputArrayName = ITKTestBase::k_OutputDataPath; { // Start Image Comparison Scope const fs::path inputFilePath = fs::path(unit_test::k_SourceDir.view()) / unit_test::k_DataDir.view() / "JSONFilters" / "Input/RA-Slice-Short.png"; - Result<> imageReadResult = ITKTestBase::ReadImage(dataStructure, inputFilePath, inputGeometryPath, cellDataPath, inputDataPath); + Result<> imageReadResult = ITKTestBase::ReadImage(dataStructure, inputFilePath, inputGeometryPath, ITKTestBase::k_ImageCellDataName, ITKTestBase::k_InputDataName); SIMPLNX_RESULT_REQUIRE_VALID(imageReadResult) } // End Image Comparison Scope diff --git a/src/Plugins/ITKImageProcessing/test/ITKGrayscaleMorphologicalClosingImageTest.cpp b/src/Plugins/ITKImageProcessing/test/ITKGrayscaleMorphologicalClosingImageTest.cpp index 4701ab0b81..db1cba7994 100644 --- a/src/Plugins/ITKImageProcessing/test/ITKGrayscaleMorphologicalClosingImageTest.cpp +++ b/src/Plugins/ITKImageProcessing/test/ITKGrayscaleMorphologicalClosingImageTest.cpp @@ -25,13 +25,13 @@ TEST_CASE("ITKImageProcessing::ITKGrayscaleMorphologicalClosingImageFilter(Grays const ITKGrayscaleMorphologicalClosingImage filter; const DataPath inputGeometryPath({ITKTestBase::k_ImageGeometryPath}); - const DataPath cellDataPath = inputGeometryPath.createChildPath(ITKTestBase::k_ImageCellDataPath); - const DataPath inputDataPath = cellDataPath.createChildPath(ITKTestBase::k_InputDataPath); + const DataPath cellDataPath = inputGeometryPath.createChildPath(ITKTestBase::k_ImageCellDataName); + const DataPath inputDataPath = cellDataPath.createChildPath(ITKTestBase::k_InputDataName); const DataObjectNameParameter::ValueType outputArrayName = ITKTestBase::k_OutputDataPath; { // Start Image Comparison Scope const fs::path inputFilePath = fs::path(unit_test::k_SourceDir.view()) / unit_test::k_DataDir.view() / "JSONFilters" / "Input/STAPLE1.png"; - Result<> imageReadResult = ITKTestBase::ReadImage(dataStructure, inputFilePath, inputGeometryPath, cellDataPath, inputDataPath); + Result<> imageReadResult = ITKTestBase::ReadImage(dataStructure, inputFilePath, inputGeometryPath, ITKTestBase::k_ImageCellDataName, ITKTestBase::k_InputDataName); SIMPLNX_RESULT_REQUIRE_VALID(imageReadResult) } // End Image Comparison Scope diff --git a/src/Plugins/ITKImageProcessing/test/ITKGrayscaleMorphologicalOpeningImageTest.cpp b/src/Plugins/ITKImageProcessing/test/ITKGrayscaleMorphologicalOpeningImageTest.cpp index 9092a5dfc5..2c3f45704e 100644 --- a/src/Plugins/ITKImageProcessing/test/ITKGrayscaleMorphologicalOpeningImageTest.cpp +++ b/src/Plugins/ITKImageProcessing/test/ITKGrayscaleMorphologicalOpeningImageTest.cpp @@ -25,13 +25,13 @@ TEST_CASE("ITKImageProcessing::ITKGrayscaleMorphologicalOpeningImageFilter(Grays const ITKGrayscaleMorphologicalOpeningImage filter; const DataPath inputGeometryPath({ITKTestBase::k_ImageGeometryPath}); - const DataPath cellDataPath = inputGeometryPath.createChildPath(ITKTestBase::k_ImageCellDataPath); - const DataPath inputDataPath = cellDataPath.createChildPath(ITKTestBase::k_InputDataPath); + const DataPath cellDataPath = inputGeometryPath.createChildPath(ITKTestBase::k_ImageCellDataName); + const DataPath inputDataPath = cellDataPath.createChildPath(ITKTestBase::k_InputDataName); const DataObjectNameParameter::ValueType outputArrayName = ITKTestBase::k_OutputDataPath; { // Start Image Comparison Scope const fs::path inputFilePath = fs::path(unit_test::k_SourceDir.view()) / unit_test::k_DataDir.view() / "JSONFilters" / "Input/STAPLE1.png"; - Result<> imageReadResult = ITKTestBase::ReadImage(dataStructure, inputFilePath, inputGeometryPath, cellDataPath, inputDataPath); + Result<> imageReadResult = ITKTestBase::ReadImage(dataStructure, inputFilePath, inputGeometryPath, ITKTestBase::k_ImageCellDataName, ITKTestBase::k_InputDataName); SIMPLNX_RESULT_REQUIRE_VALID(imageReadResult) } // End Image Comparison Scope @@ -59,13 +59,13 @@ TEST_CASE("ITKImageProcessing::ITKGrayscaleMorphologicalOpeningImageFilter(Grays const ITKGrayscaleMorphologicalOpeningImage filter; const DataPath inputGeometryPath({ITKTestBase::k_ImageGeometryPath}); - const DataPath cellDataPath = inputGeometryPath.createChildPath(ITKTestBase::k_ImageCellDataPath); - const DataPath inputDataPath = cellDataPath.createChildPath(ITKTestBase::k_InputDataPath); + const DataPath cellDataPath = inputGeometryPath.createChildPath(ITKTestBase::k_ImageCellDataName); + const DataPath inputDataPath = cellDataPath.createChildPath(ITKTestBase::k_InputDataName); const DataObjectNameParameter::ValueType outputArrayName = ITKTestBase::k_OutputDataPath; { // Start Image Comparison Scope const fs::path inputFilePath = fs::path(unit_test::k_SourceDir.view()) / unit_test::k_DataDir.view() / "JSONFilters" / "Input/STAPLE1.png"; - Result<> imageReadResult = ITKTestBase::ReadImage(dataStructure, inputFilePath, inputGeometryPath, cellDataPath, inputDataPath); + Result<> imageReadResult = ITKTestBase::ReadImage(dataStructure, inputFilePath, inputGeometryPath, ITKTestBase::k_ImageCellDataName, ITKTestBase::k_InputDataName); SIMPLNX_RESULT_REQUIRE_VALID(imageReadResult) } // End Image Comparison Scope @@ -93,13 +93,13 @@ TEST_CASE("ITKImageProcessing::ITKGrayscaleMorphologicalOpeningImageFilter(Grays const ITKGrayscaleMorphologicalOpeningImage filter; const DataPath inputGeometryPath({ITKTestBase::k_ImageGeometryPath}); - const DataPath cellDataPath = inputGeometryPath.createChildPath(ITKTestBase::k_ImageCellDataPath); - const DataPath inputDataPath = cellDataPath.createChildPath(ITKTestBase::k_InputDataPath); + const DataPath cellDataPath = inputGeometryPath.createChildPath(ITKTestBase::k_ImageCellDataName); + const DataPath inputDataPath = cellDataPath.createChildPath(ITKTestBase::k_InputDataName); const DataObjectNameParameter::ValueType outputArrayName = ITKTestBase::k_OutputDataPath; { // Start Image Comparison Scope const fs::path inputFilePath = fs::path(unit_test::k_SourceDir.view()) / unit_test::k_DataDir.view() / "JSONFilters" / "Input/STAPLE1.png"; - Result<> imageReadResult = ITKTestBase::ReadImage(dataStructure, inputFilePath, inputGeometryPath, cellDataPath, inputDataPath); + Result<> imageReadResult = ITKTestBase::ReadImage(dataStructure, inputFilePath, inputGeometryPath, ITKTestBase::k_ImageCellDataName, ITKTestBase::k_InputDataName); SIMPLNX_RESULT_REQUIRE_VALID(imageReadResult) } // End Image Comparison Scope diff --git a/src/Plugins/ITKImageProcessing/test/ITKHConvexImageTest.cpp b/src/Plugins/ITKImageProcessing/test/ITKHConvexImageTest.cpp index b71e408993..4d41fdc958 100644 --- a/src/Plugins/ITKImageProcessing/test/ITKHConvexImageTest.cpp +++ b/src/Plugins/ITKImageProcessing/test/ITKHConvexImageTest.cpp @@ -23,13 +23,13 @@ TEST_CASE("ITKImageProcessing::ITKHConvexImageFilter(HConvex)", "[ITKImageProces const ITKHConvexImage filter; const DataPath inputGeometryPath({ITKTestBase::k_ImageGeometryPath}); - const DataPath cellDataPath = inputGeometryPath.createChildPath(ITKTestBase::k_ImageCellDataPath); - const DataPath inputDataPath = cellDataPath.createChildPath(ITKTestBase::k_InputDataPath); + const DataPath cellDataPath = inputGeometryPath.createChildPath(ITKTestBase::k_ImageCellDataName); + const DataPath inputDataPath = cellDataPath.createChildPath(ITKTestBase::k_InputDataName); const DataObjectNameParameter::ValueType outputArrayName = ITKTestBase::k_OutputDataPath; { // Start Image Comparison Scope const fs::path inputFilePath = fs::path(unit_test::k_SourceDir.view()) / unit_test::k_DataDir.view() / "JSONFilters" / "Input/RA-Short.nrrd"; - Result<> imageReadResult = ITKTestBase::ReadImage(dataStructure, inputFilePath, inputGeometryPath, cellDataPath, inputDataPath); + Result<> imageReadResult = ITKTestBase::ReadImage(dataStructure, inputFilePath, inputGeometryPath, ITKTestBase::k_ImageCellDataName, ITKTestBase::k_InputDataName); SIMPLNX_RESULT_REQUIRE_VALID(imageReadResult) } // End Image Comparison Scope diff --git a/src/Plugins/ITKImageProcessing/test/ITKHMaximaImageTest.cpp b/src/Plugins/ITKImageProcessing/test/ITKHMaximaImageTest.cpp index 0ae2472e0b..e730794b1f 100644 --- a/src/Plugins/ITKImageProcessing/test/ITKHMaximaImageTest.cpp +++ b/src/Plugins/ITKImageProcessing/test/ITKHMaximaImageTest.cpp @@ -22,13 +22,13 @@ TEST_CASE("ITKImageProcessing::ITKHMaximaImageFilter(HMaxima)", "[ITKImageProces const ITKHMaximaImage filter; const DataPath inputGeometryPath({ITKTestBase::k_ImageGeometryPath}); - const DataPath cellDataPath = inputGeometryPath.createChildPath(ITKTestBase::k_ImageCellDataPath); - const DataPath inputDataPath = cellDataPath.createChildPath(ITKTestBase::k_InputDataPath); + const DataPath cellDataPath = inputGeometryPath.createChildPath(ITKTestBase::k_ImageCellDataName); + const DataPath inputDataPath = cellDataPath.createChildPath(ITKTestBase::k_InputDataName); const DataObjectNameParameter::ValueType outputArrayName = ITKTestBase::k_OutputDataPath; { // Start Image Comparison Scope const fs::path inputFilePath = fs::path(unit_test::k_SourceDir.view()) / unit_test::k_DataDir.view() / "JSONFilters" / "Input/RA-Short.nrrd"; - Result<> imageReadResult = ITKTestBase::ReadImage(dataStructure, inputFilePath, inputGeometryPath, cellDataPath, inputDataPath); + Result<> imageReadResult = ITKTestBase::ReadImage(dataStructure, inputFilePath, inputGeometryPath, ITKTestBase::k_ImageCellDataName, ITKTestBase::k_InputDataName); SIMPLNX_RESULT_REQUIRE_VALID(imageReadResult) } // End Image Comparison Scope diff --git a/src/Plugins/ITKImageProcessing/test/ITKHMinimaImageTest.cpp b/src/Plugins/ITKImageProcessing/test/ITKHMinimaImageTest.cpp index aee95d8e0f..6af42b9223 100644 --- a/src/Plugins/ITKImageProcessing/test/ITKHMinimaImageTest.cpp +++ b/src/Plugins/ITKImageProcessing/test/ITKHMinimaImageTest.cpp @@ -23,13 +23,13 @@ TEST_CASE("ITKImageProcessing::ITKHMinimaImageFilter(HMinima)", "[ITKImageProces const ITKHMinimaImage filter; const DataPath inputGeometryPath({ITKTestBase::k_ImageGeometryPath}); - const DataPath cellDataPath = inputGeometryPath.createChildPath(ITKTestBase::k_ImageCellDataPath); - const DataPath inputDataPath = cellDataPath.createChildPath(ITKTestBase::k_InputDataPath); + const DataPath cellDataPath = inputGeometryPath.createChildPath(ITKTestBase::k_ImageCellDataName); + const DataPath inputDataPath = cellDataPath.createChildPath(ITKTestBase::k_InputDataName); const DataObjectNameParameter::ValueType outputArrayName = ITKTestBase::k_OutputDataPath; { // Start Image Comparison Scope const fs::path inputFilePath = fs::path(unit_test::k_SourceDir.view()) / unit_test::k_DataDir.view() / "JSONFilters" / "Input/RA-Short.nrrd"; - Result<> imageReadResult = ITKTestBase::ReadImage(dataStructure, inputFilePath, inputGeometryPath, cellDataPath, inputDataPath); + Result<> imageReadResult = ITKTestBase::ReadImage(dataStructure, inputFilePath, inputGeometryPath, ITKTestBase::k_ImageCellDataName, ITKTestBase::k_InputDataName); SIMPLNX_RESULT_REQUIRE_VALID(imageReadResult) } // End Image Comparison Scope diff --git a/src/Plugins/ITKImageProcessing/test/ITKImageReaderTest.cpp b/src/Plugins/ITKImageProcessing/test/ITKImageReaderTest.cpp index 1445ce85e8..c23e8d669d 100644 --- a/src/Plugins/ITKImageProcessing/test/ITKImageReaderTest.cpp +++ b/src/Plugins/ITKImageProcessing/test/ITKImageReaderTest.cpp @@ -2,10 +2,12 @@ #include "ITKImageProcessing/Filters/ITKImageReader.hpp" #include "ITKImageProcessing/ITKImageProcessing_test_dirs.hpp" +#include "ITKTestBase.hpp" #include "simplnx/DataStructure/DataArray.hpp" #include "simplnx/DataStructure/DataStore.hpp" #include "simplnx/DataStructure/Geometry/ImageGeom.hpp" +#include "simplnx/Parameters/DataObjectNameParameter.hpp" #include "simplnx/UnitTest/UnitTestCommon.hpp" #include @@ -20,12 +22,18 @@ TEST_CASE("ITKImageProcessing::ITKImageReader: Read PNG", "[ITKImageProcessing][ DataStructure dataStructure; Arguments args; - fs::path filePath = fs::path(unit_test::k_SourceDir.view()) / "test/data/PngTest.png"; - DataPath arrayPath{{"ImageGeom", "ImageArray"}}; - DataPath imagePath = arrayPath.getParent(); - args.insertOrAssign(ITKImageReader::k_FileName_Key, filePath); - args.insertOrAssign(ITKImageReader::k_ImageGeometryPath_Key, imagePath); - args.insertOrAssign(ITKImageReader::k_ImageDataArrayPath_Key, arrayPath); + fs::path inputFilePath = fs::path(unit_test::k_SourceDir.view()) / "test/data/PngTest.png"; + + const DataPath inputGeometryPath({ITKTestBase::k_ImageGeometryPath}); + const DataPath cellDataPath = inputGeometryPath.createChildPath(ITKTestBase::k_ImageCellDataName); + const DataPath inputDataPath = cellDataPath.createChildPath(ITKTestBase::k_InputDataName); + + args.insertOrAssign(ITKImageReader::k_FileName_Key, inputFilePath); + args.insertOrAssign(ITKImageReader::k_ImageGeometryPath_Key, inputGeometryPath); + args.insertOrAssign(ITKImageReader::k_CellDataName_Key, static_cast(ITKTestBase::k_ImageCellDataName)); + args.insertOrAssign(ITKImageReader::k_ImageDataArrayPath_Key, static_cast(ITKTestBase::k_InputDataName)); + args.insertOrAssign(ITKImageReader::k_ChangeOrigin_Key, false); + args.insertOrAssign(ITKImageReader::k_ChangeSpacing_Key, false); auto preflightResult = filter.preflight(dataStructure, args); SIMPLNX_RESULT_REQUIRE_VALID(preflightResult.outputActions) @@ -33,7 +41,7 @@ TEST_CASE("ITKImageProcessing::ITKImageReader: Read PNG", "[ITKImageProcessing][ auto executeResult = filter.execute(dataStructure, args); SIMPLNX_RESULT_REQUIRE_VALID(executeResult.result) - const auto* imageGeom = dataStructure.getDataAs(imagePath); + const auto* imageGeom = dataStructure.getDataAs(inputGeometryPath); REQUIRE(imageGeom != nullptr); SizeVec3 imageDims = imageGeom->getDimensions(); @@ -48,7 +56,7 @@ TEST_CASE("ITKImageProcessing::ITKImageReader: Read PNG", "[ITKImageProcessing][ const FloatVec3 expectedImageSpacing = {1.0f, 1.0f, 1.0f}; REQUIRE(imageSpacing == expectedImageSpacing); - const auto* dataArray = dataStructure.getDataAs>(arrayPath); + const auto* dataArray = dataStructure.getDataAs>(inputDataPath); REQUIRE(dataArray != nullptr); const auto& dataStore = dataArray->getIDataStoreRefAs>(); @@ -73,12 +81,15 @@ TEST_CASE("ITKImageProcessing::ITKImageReader: Override Origin", "[ITKImageProce std::vector k_Origin{-32.0, -32.0, 0.0}; std::vector k_Spacing{1.0, 1.0, 1.0}; - fs::path filePath = fs::path(unit_test::k_SourceDir.view()) / "test/data/PngTest.png"; - DataPath arrayPath{{"ImageGeom", "ImageArray"}}; - DataPath imagePath = arrayPath.getParent(); - args.insertOrAssign(ITKImageReader::k_FileName_Key, filePath); - args.insertOrAssign(ITKImageReader::k_ImageGeometryPath_Key, imagePath); - args.insertOrAssign(ITKImageReader::k_ImageDataArrayPath_Key, arrayPath); + fs::path inputFilePath = fs::path(unit_test::k_SourceDir.view()) / "test/data/PngTest.png"; + const DataPath inputGeometryPath({ITKTestBase::k_ImageGeometryPath}); + const DataPath cellDataPath = inputGeometryPath.createChildPath(ITKTestBase::k_ImageCellDataName); + const DataPath inputDataPath = cellDataPath.createChildPath(ITKTestBase::k_InputDataName); + + args.insertOrAssign(ITKImageReader::k_FileName_Key, inputFilePath); + args.insertOrAssign(ITKImageReader::k_ImageGeometryPath_Key, inputGeometryPath); + args.insertOrAssign(ITKImageReader::k_CellDataName_Key, static_cast(ITKTestBase::k_ImageCellDataName)); + args.insertOrAssign(ITKImageReader::k_ImageDataArrayPath_Key, static_cast(ITKTestBase::k_InputDataName)); args.insertOrAssign(ITKImageReader::k_ChangeOrigin_Key, true); args.insert(ITKImageReader::k_ChangeOrigin_Key, std::make_any(k_ChangeOrigin)); @@ -93,7 +104,7 @@ TEST_CASE("ITKImageProcessing::ITKImageReader: Override Origin", "[ITKImageProce auto executeResult = filter.execute(dataStructure, args); SIMPLNX_RESULT_REQUIRE_VALID(executeResult.result) - const auto* imageGeom = dataStructure.getDataAs(imagePath); + const auto* imageGeom = dataStructure.getDataAs(inputGeometryPath); REQUIRE(imageGeom != nullptr); SizeVec3 imageDims = imageGeom->getDimensions(); @@ -113,19 +124,21 @@ TEST_CASE("ITKImageProcessing::ITKImageReader: Centering Origin in Geometry", "[ DataStructure dataStructure; Arguments args; - bool k_ChangeOrigin = false; + bool k_ChangeOrigin = true; bool k_ChangeResolution = false; std::vector k_Origin{0.0, 0.0, 0.0}; std::vector k_Spacing{1.0, 1.0, 1.0}; - fs::path filePath = fs::path(unit_test::k_SourceDir.view()) / "test/data/PngTest.png"; - DataPath arrayPath{{"ImageGeom", "ImageArray"}}; - DataPath imagePath = arrayPath.getParent(); - args.insertOrAssign(ITKImageReader::k_FileName_Key, filePath); - args.insertOrAssign(ITKImageReader::k_ImageGeometryPath_Key, imagePath); - args.insertOrAssign(ITKImageReader::k_ImageDataArrayPath_Key, arrayPath); - args.insertOrAssign(ITKImageReader::k_ChangeOrigin_Key, true); + fs::path inputFilePath = fs::path(unit_test::k_SourceDir.view()) / "test/data/PngTest.png"; + const DataPath inputGeometryPath({ITKTestBase::k_ImageGeometryPath}); + const DataPath cellDataPath = inputGeometryPath.createChildPath(ITKTestBase::k_ImageCellDataName); + const DataPath inputDataPath = cellDataPath.createChildPath(ITKTestBase::k_InputDataName); + + args.insertOrAssign(ITKImageReader::k_FileName_Key, inputFilePath); + args.insertOrAssign(ITKImageReader::k_ImageGeometryPath_Key, inputGeometryPath); + args.insertOrAssign(ITKImageReader::k_CellDataName_Key, static_cast(ITKTestBase::k_ImageCellDataName)); + args.insertOrAssign(ITKImageReader::k_ImageDataArrayPath_Key, static_cast(ITKTestBase::k_InputDataName)); args.insert(ITKImageReader::k_ChangeOrigin_Key, std::make_any(k_ChangeOrigin)); args.insert(ITKImageReader::k_CenterOrigin_Key, std::make_any(true)); @@ -139,7 +152,7 @@ TEST_CASE("ITKImageProcessing::ITKImageReader: Centering Origin in Geometry", "[ auto executeResult = filter.execute(dataStructure, args); SIMPLNX_RESULT_REQUIRE_VALID(executeResult.result) - const auto* imageGeom = dataStructure.getDataAs(imagePath); + const auto* imageGeom = dataStructure.getDataAs(inputGeometryPath); REQUIRE(imageGeom != nullptr); SizeVec3 imageDims = imageGeom->getDimensions(); diff --git a/src/Plugins/ITKImageProcessing/test/ITKImportImageStackTest.cpp b/src/Plugins/ITKImageProcessing/test/ITKImportImageStackTest.cpp index 03e572971f..5df1dad3e7 100644 --- a/src/Plugins/ITKImageProcessing/test/ITKImportImageStackTest.cpp +++ b/src/Plugins/ITKImageProcessing/test/ITKImportImageStackTest.cpp @@ -118,7 +118,7 @@ void ReadInFlippedXYExemplars(DataStructure& dataStructure, const std::string& f fs::path filePath = k_ImageFlipStackDir / (filePrefix + "flip_x.tiff"); args.insertOrAssign(ITKImageReader::k_FileName_Key, filePath); args.insertOrAssign(ITKImageReader::k_ImageGeometryPath_Key, ::k_XFlipImageGeomPath); - args.insertOrAssign(ITKImageReader::k_ImageDataArrayPath_Key, ::k_XFlippedImageDataPath); + args.insertOrAssign(ITKImageReader::k_ImageDataArrayPath_Key, ::k_ImageDataName); auto preflightResult = filter.preflight(dataStructure, args); SIMPLNX_RESULT_REQUIRE_VALID(preflightResult.outputActions) @@ -133,7 +133,7 @@ void ReadInFlippedXYExemplars(DataStructure& dataStructure, const std::string& f fs::path filePath = k_ImageFlipStackDir / (filePrefix + "flip_y.tiff"); args.insertOrAssign(ITKImageReader::k_FileName_Key, filePath); args.insertOrAssign(ITKImageReader::k_ImageGeometryPath_Key, ::k_YFlipImageGeomPath); - args.insertOrAssign(ITKImageReader::k_ImageDataArrayPath_Key, ::k_YFlippedImageDataPath); + args.insertOrAssign(ITKImageReader::k_ImageDataArrayPath_Key, ::k_ImageDataName); auto preflightResult = filter.preflight(dataStructure, args); SIMPLNX_RESULT_REQUIRE_VALID(preflightResult.outputActions) diff --git a/src/Plugins/ITKImageProcessing/test/ITKIntensityWindowingImageTest.cpp b/src/Plugins/ITKImageProcessing/test/ITKIntensityWindowingImageTest.cpp index 0124382fbb..af5b42b7ed 100644 --- a/src/Plugins/ITKImageProcessing/test/ITKIntensityWindowingImageTest.cpp +++ b/src/Plugins/ITKImageProcessing/test/ITKIntensityWindowingImageTest.cpp @@ -22,13 +22,13 @@ TEST_CASE("ITKImageProcessing::ITKIntensityWindowingImageFilter(2d)", "[ITKImage const ITKIntensityWindowingImage filter; const DataPath inputGeometryPath({ITKTestBase::k_ImageGeometryPath}); - const DataPath cellDataPath = inputGeometryPath.createChildPath(ITKTestBase::k_ImageCellDataPath); - const DataPath inputDataPath = cellDataPath.createChildPath(ITKTestBase::k_InputDataPath); + const DataPath cellDataPath = inputGeometryPath.createChildPath(ITKTestBase::k_ImageCellDataName); + const DataPath inputDataPath = cellDataPath.createChildPath(ITKTestBase::k_InputDataName); const DataObjectNameParameter::ValueType outputArrayName = ITKTestBase::k_OutputDataPath; { // Start Image Comparison Scope const fs::path inputFilePath = fs::path(unit_test::k_SourceDir.view()) / unit_test::k_DataDir.view() / "JSONFilters" / "Input/STAPLE1.png"; - Result<> imageReadResult = ITKTestBase::ReadImage(dataStructure, inputFilePath, inputGeometryPath, cellDataPath, inputDataPath); + Result<> imageReadResult = ITKTestBase::ReadImage(dataStructure, inputFilePath, inputGeometryPath, ITKTestBase::k_ImageCellDataName, ITKTestBase::k_InputDataName); SIMPLNX_RESULT_REQUIRE_VALID(imageReadResult) } // End Image Comparison Scope @@ -53,13 +53,13 @@ TEST_CASE("ITKImageProcessing::ITKIntensityWindowingImageFilter(3dFloat)", "[ITK const ITKIntensityWindowingImage filter; const DataPath inputGeometryPath({ITKTestBase::k_ImageGeometryPath}); - const DataPath cellDataPath = inputGeometryPath.createChildPath(ITKTestBase::k_ImageCellDataPath); - const DataPath inputDataPath = cellDataPath.createChildPath(ITKTestBase::k_InputDataPath); + const DataPath cellDataPath = inputGeometryPath.createChildPath(ITKTestBase::k_ImageCellDataName); + const DataPath inputDataPath = cellDataPath.createChildPath(ITKTestBase::k_InputDataName); const DataObjectNameParameter::ValueType outputArrayName = ITKTestBase::k_OutputDataPath; { // Start Image Comparison Scope const fs::path inputFilePath = fs::path(unit_test::k_SourceDir.view()) / unit_test::k_DataDir.view() / "JSONFilters" / "Input/RA-Float.nrrd"; - Result<> imageReadResult = ITKTestBase::ReadImage(dataStructure, inputFilePath, inputGeometryPath, cellDataPath, inputDataPath); + Result<> imageReadResult = ITKTestBase::ReadImage(dataStructure, inputFilePath, inputGeometryPath, ITKTestBase::k_ImageCellDataName, ITKTestBase::k_InputDataName); SIMPLNX_RESULT_REQUIRE_VALID(imageReadResult) } // End Image Comparison Scope @@ -84,13 +84,13 @@ TEST_CASE("ITKImageProcessing::ITKIntensityWindowingImageFilter(3dShort)", "[ITK const ITKIntensityWindowingImage filter; const DataPath inputGeometryPath({ITKTestBase::k_ImageGeometryPath}); - const DataPath cellDataPath = inputGeometryPath.createChildPath(ITKTestBase::k_ImageCellDataPath); - const DataPath inputDataPath = cellDataPath.createChildPath(ITKTestBase::k_InputDataPath); + const DataPath cellDataPath = inputGeometryPath.createChildPath(ITKTestBase::k_ImageCellDataName); + const DataPath inputDataPath = cellDataPath.createChildPath(ITKTestBase::k_InputDataName); const DataObjectNameParameter::ValueType outputArrayName = ITKTestBase::k_OutputDataPath; { // Start Image Comparison Scope const fs::path inputFilePath = fs::path(unit_test::k_SourceDir.view()) / unit_test::k_DataDir.view() / "JSONFilters" / "Input/RA-Short.nrrd"; - Result<> imageReadResult = ITKTestBase::ReadImage(dataStructure, inputFilePath, inputGeometryPath, cellDataPath, inputDataPath); + Result<> imageReadResult = ITKTestBase::ReadImage(dataStructure, inputFilePath, inputGeometryPath, ITKTestBase::k_ImageCellDataName, ITKTestBase::k_InputDataName); SIMPLNX_RESULT_REQUIRE_VALID(imageReadResult) } // End Image Comparison Scope diff --git a/src/Plugins/ITKImageProcessing/test/ITKInvertIntensityImageTest.cpp b/src/Plugins/ITKImageProcessing/test/ITKInvertIntensityImageTest.cpp index 490c8f940e..efce49a40a 100644 --- a/src/Plugins/ITKImageProcessing/test/ITKInvertIntensityImageTest.cpp +++ b/src/Plugins/ITKImageProcessing/test/ITKInvertIntensityImageTest.cpp @@ -20,13 +20,13 @@ TEST_CASE("ITKImageProcessing::ITKInvertIntensityImageFilter(3d)", "[ITKImagePro ITKInvertIntensityImage filter; const DataPath inputGeometryPath({ITKTestBase::k_ImageGeometryPath}); - const DataPath cellDataPath = inputGeometryPath.createChildPath(ITKTestBase::k_ImageCellDataPath); - const DataPath inputDataPath = cellDataPath.createChildPath(ITKTestBase::k_InputDataPath); + const DataPath cellDataPath = inputGeometryPath.createChildPath(ITKTestBase::k_ImageCellDataName); + const DataPath inputDataPath = cellDataPath.createChildPath(ITKTestBase::k_InputDataName); const DataObjectNameParameter::ValueType outputArrayName = ITKTestBase::k_OutputDataPath; { // Start Image Comparison Scope const fs::path inputFilePath = fs::path(unit_test::k_SourceDir.view()) / unit_test::k_DataDir.view() / "JSONFilters" / "Input/RA-Short.nrrd"; - Result<> imageReadResult = ITKTestBase::ReadImage(dataStructure, inputFilePath, inputGeometryPath, cellDataPath, inputDataPath); + Result<> imageReadResult = ITKTestBase::ReadImage(dataStructure, inputFilePath, inputGeometryPath, ITKTestBase::k_ImageCellDataName, ITKTestBase::k_InputDataName); SIMPLNX_RESULT_REQUIRE_VALID(imageReadResult) } // End Image Comparison Scope diff --git a/src/Plugins/ITKImageProcessing/test/ITKLabelContourImageTest.cpp b/src/Plugins/ITKImageProcessing/test/ITKLabelContourImageTest.cpp index 68de70f8d2..24f8713079 100644 --- a/src/Plugins/ITKImageProcessing/test/ITKLabelContourImageTest.cpp +++ b/src/Plugins/ITKImageProcessing/test/ITKLabelContourImageTest.cpp @@ -23,13 +23,13 @@ TEST_CASE("ITKImageProcessing::ITKLabelContourImageFilter(default)", "[ITKImageP const ITKLabelContourImage filter; const DataPath inputGeometryPath({ITKTestBase::k_ImageGeometryPath}); - const DataPath cellDataPath = inputGeometryPath.createChildPath(ITKTestBase::k_ImageCellDataPath); - const DataPath inputDataPath = cellDataPath.createChildPath(ITKTestBase::k_InputDataPath); + const DataPath cellDataPath = inputGeometryPath.createChildPath(ITKTestBase::k_ImageCellDataName); + const DataPath inputDataPath = cellDataPath.createChildPath(ITKTestBase::k_InputDataName); const DataObjectNameParameter::ValueType outputArrayName = ITKTestBase::k_OutputDataPath; { // Start Image Comparison Scope const fs::path inputFilePath = fs::path(unit_test::k_SourceDir.view()) / unit_test::k_DataDir.view() / "JSONFilters" / "Input/2th_cthead1.png"; - Result<> imageReadResult = ITKTestBase::ReadImage(dataStructure, inputFilePath, inputGeometryPath, cellDataPath, inputDataPath); + Result<> imageReadResult = ITKTestBase::ReadImage(dataStructure, inputFilePath, inputGeometryPath, ITKTestBase::k_ImageCellDataName, ITKTestBase::k_InputDataName); SIMPLNX_RESULT_REQUIRE_VALID(imageReadResult) } // End Image Comparison Scope diff --git a/src/Plugins/ITKImageProcessing/test/ITKLog10ImageTest.cpp b/src/Plugins/ITKImageProcessing/test/ITKLog10ImageTest.cpp index be34eb3281..79f72a1faa 100644 --- a/src/Plugins/ITKImageProcessing/test/ITKLog10ImageTest.cpp +++ b/src/Plugins/ITKImageProcessing/test/ITKLog10ImageTest.cpp @@ -19,13 +19,13 @@ TEST_CASE("ITKImageProcessing::ITKLog10ImageFilter(defaults)", "[ITKImageProcess ITKLog10Image filter; const DataPath inputGeometryPath({ITKTestBase::k_ImageGeometryPath}); - const DataPath cellDataPath = inputGeometryPath.createChildPath(ITKTestBase::k_ImageCellDataPath); - const DataPath inputDataPath = cellDataPath.createChildPath(ITKTestBase::k_InputDataPath); + const DataPath cellDataPath = inputGeometryPath.createChildPath(ITKTestBase::k_ImageCellDataName); + const DataPath inputDataPath = cellDataPath.createChildPath(ITKTestBase::k_InputDataName); const DataObjectNameParameter::ValueType outputArrayName = ITKTestBase::k_OutputDataPath; { // Start Image Comparison Scope const fs::path inputFilePath = fs::path(unit_test::k_SourceDir.view()) / unit_test::k_DataDir.view() / "JSONFilters" / "Input/Ramp-Zero-One-Float.nrrd"; - Result<> imageReadResult = ITKTestBase::ReadImage(dataStructure, inputFilePath, inputGeometryPath, cellDataPath, inputDataPath); + Result<> imageReadResult = ITKTestBase::ReadImage(dataStructure, inputFilePath, inputGeometryPath, ITKTestBase::k_ImageCellDataName, ITKTestBase::k_InputDataName); SIMPLNX_RESULT_REQUIRE_VALID(imageReadResult) } // End Image Comparison Scope @@ -42,9 +42,9 @@ TEST_CASE("ITKImageProcessing::ITKLog10ImageFilter(defaults)", "[ITKImageProcess fs::path baselineFilePath = fs::path(nx::core::unit_test::k_DataDir.view()) / "JSONFilters/Baseline/BasicFilters_Log10ImageFilter_defaults.nrrd"; DataPath baselineGeometryPath({ITKTestBase::k_BaselineGeometryPath}); - DataPath baseLineCellDataPath = baselineGeometryPath.createChildPath(ITKTestBase::k_ImageCellDataPath); + DataPath baseLineCellDataPath = baselineGeometryPath.createChildPath(ITKTestBase::k_ImageCellDataName); DataPath baselineDataPath = baseLineCellDataPath.createChildPath(ITKTestBase::k_BaselineDataPath); - Result<> readBaselineResult = ITKTestBase::ReadImage(dataStructure, baselineFilePath, baselineGeometryPath, baseLineCellDataPath, baselineDataPath); + Result<> readBaselineResult = ITKTestBase::ReadImage(dataStructure, baselineFilePath, baselineGeometryPath, ITKTestBase::k_ImageCellDataName, ITKTestBase::k_BaselineDataPath); Result<> compareResult = ITKTestBase::CompareImages(dataStructure, baselineGeometryPath, baselineDataPath, inputGeometryPath, cellDataPath.createChildPath(outputArrayName), 0.01); SIMPLNX_RESULT_REQUIRE_VALID(compareResult) } diff --git a/src/Plugins/ITKImageProcessing/test/ITKLogImageTest.cpp b/src/Plugins/ITKImageProcessing/test/ITKLogImageTest.cpp index 5a6b809400..e930b43beb 100644 --- a/src/Plugins/ITKImageProcessing/test/ITKLogImageTest.cpp +++ b/src/Plugins/ITKImageProcessing/test/ITKLogImageTest.cpp @@ -19,13 +19,13 @@ TEST_CASE("ITKImageProcessing::ITKLogImageFilter(defaults)", "[ITKImageProcessin ITKLogImage filter; const DataPath inputGeometryPath({ITKTestBase::k_ImageGeometryPath}); - const DataPath cellDataPath = inputGeometryPath.createChildPath(ITKTestBase::k_ImageCellDataPath); - const DataPath inputDataPath = cellDataPath.createChildPath(ITKTestBase::k_InputDataPath); + const DataPath cellDataPath = inputGeometryPath.createChildPath(ITKTestBase::k_ImageCellDataName); + const DataPath inputDataPath = cellDataPath.createChildPath(ITKTestBase::k_InputDataName); const DataObjectNameParameter::ValueType outputArrayName = ITKTestBase::k_OutputDataPath; { // Start Image Comparison Scope const fs::path inputFilePath = fs::path(unit_test::k_SourceDir.view()) / unit_test::k_DataDir.view() / "JSONFilters" / "Input/Ramp-Zero-One-Float.nrrd"; - Result<> imageReadResult = ITKTestBase::ReadImage(dataStructure, inputFilePath, inputGeometryPath, cellDataPath, inputDataPath); + Result<> imageReadResult = ITKTestBase::ReadImage(dataStructure, inputFilePath, inputGeometryPath, ITKTestBase::k_ImageCellDataName, ITKTestBase::k_InputDataName); SIMPLNX_RESULT_REQUIRE_VALID(imageReadResult) } // End Image Comparison Scope @@ -42,9 +42,9 @@ TEST_CASE("ITKImageProcessing::ITKLogImageFilter(defaults)", "[ITKImageProcessin fs::path baselineFilePath = fs::path(nx::core::unit_test::k_DataDir.view()) / "JSONFilters/Baseline/BasicFilters_LogImageFilter_defaults.nrrd"; DataPath baselineGeometryPath({ITKTestBase::k_BaselineGeometryPath}); - DataPath baseLineCellDataPath = baselineGeometryPath.createChildPath(ITKTestBase::k_ImageCellDataPath); + DataPath baseLineCellDataPath = baselineGeometryPath.createChildPath(ITKTestBase::k_ImageCellDataName); DataPath baselineDataPath = baseLineCellDataPath.createChildPath(ITKTestBase::k_BaselineDataPath); - Result<> readBaselineResult = ITKTestBase::ReadImage(dataStructure, baselineFilePath, baselineGeometryPath, baseLineCellDataPath, baselineDataPath); + Result<> readBaselineResult = ITKTestBase::ReadImage(dataStructure, baselineFilePath, baselineGeometryPath, ITKTestBase::k_ImageCellDataName, ITKTestBase::k_BaselineDataPath); Result<> compareResult = ITKTestBase::CompareImages(dataStructure, baselineGeometryPath, baselineDataPath, inputGeometryPath, cellDataPath.createChildPath(outputArrayName), 0.01); SIMPLNX_RESULT_REQUIRE_VALID(compareResult) } diff --git a/src/Plugins/ITKImageProcessing/test/ITKMaskImageTest.cpp b/src/Plugins/ITKImageProcessing/test/ITKMaskImageTest.cpp index a45b0adb2b..ac2490117d 100644 --- a/src/Plugins/ITKImageProcessing/test/ITKMaskImageTest.cpp +++ b/src/Plugins/ITKImageProcessing/test/ITKMaskImageTest.cpp @@ -20,20 +20,20 @@ TEST_CASE("ITKImageProcessing::ITKMaskImageFilter(2d)", "[ITKImageProcessing][IT ITKMaskImage filter; const DataPath inputGeometryPath({ITKTestBase::k_ImageGeometryPath}); - const DataPath cellDataPath = inputGeometryPath.createChildPath(ITKTestBase::k_ImageCellDataPath); - const DataPath inputDataPath = cellDataPath.createChildPath(ITKTestBase::k_InputDataPath); + const DataPath cellDataPath = inputGeometryPath.createChildPath(ITKTestBase::k_ImageCellDataName); + const DataPath inputDataPath = cellDataPath.createChildPath(ITKTestBase::k_InputDataName); const DataObjectNameParameter::ValueType outputArrayName = ITKTestBase::k_OutputDataPath; DataPath maskGeometryPath({ITKTestBase::k_MaskGeometryPath}); - DataPath maskCellDataPath = maskGeometryPath.createChildPath(ITKTestBase::k_ImageCellDataPath); + DataPath maskCellDataPath = maskGeometryPath.createChildPath(ITKTestBase::k_ImageCellDataName); DataPath maskDataPath = maskCellDataPath.createChildPath(ITKTestBase::k_MaskDataPath); fs::path inputFilePath = fs::path(unit_test::k_SourceDir.view()) / unit_test::k_DataDir.view() / "JSONFilters" / "Input/STAPLE1.png"; - Result<> imageReadResult = ITKTestBase::ReadImage(dataStructure, inputFilePath, inputGeometryPath, cellDataPath, inputDataPath); + Result<> imageReadResult = ITKTestBase::ReadImage(dataStructure, inputFilePath, inputGeometryPath, ITKTestBase::k_ImageCellDataName, ITKTestBase::k_InputDataName); SIMPLNX_RESULT_REQUIRE_VALID(imageReadResult) fs::path maskInputFilePath = fs::path(unit_test::k_SourceDir.view()) / unit_test::k_DataDir.view() / "JSONFilters" / "Input/STAPLE2.png"; - Result<> maskImageReadResult = ITKTestBase::ReadImage(dataStructure, maskInputFilePath, maskGeometryPath, maskCellDataPath, maskDataPath); + Result<> maskImageReadResult = ITKTestBase::ReadImage(dataStructure, maskInputFilePath, maskGeometryPath, ITKTestBase::k_ImageCellDataName, ITKTestBase::k_MaskDataPath); SIMPLNX_RESULT_REQUIRE_VALID(maskImageReadResult); const auto& inputGeom = dataStructure.getDataRefAs(inputGeometryPath); @@ -63,20 +63,20 @@ TEST_CASE("ITKImageProcessing::ITKMaskImageFilter(cthead1)", "[ITKImageProcessin ITKMaskImage filter; const DataPath inputGeometryPath({ITKTestBase::k_ImageGeometryPath}); - const DataPath cellDataPath = inputGeometryPath.createChildPath(ITKTestBase::k_ImageCellDataPath); - const DataPath inputDataPath = cellDataPath.createChildPath(ITKTestBase::k_InputDataPath); + const DataPath cellDataPath = inputGeometryPath.createChildPath(ITKTestBase::k_ImageCellDataName); + const DataPath inputDataPath = cellDataPath.createChildPath(ITKTestBase::k_InputDataName); const DataObjectNameParameter::ValueType outputArrayName = ITKTestBase::k_OutputDataPath; DataPath maskGeometryPath({ITKTestBase::k_MaskGeometryPath}); - DataPath maskCellDataPath = maskGeometryPath.createChildPath(ITKTestBase::k_ImageCellDataPath); + DataPath maskCellDataPath = maskGeometryPath.createChildPath(ITKTestBase::k_ImageCellDataName); DataPath maskDataPath = maskCellDataPath.createChildPath(ITKTestBase::k_MaskDataPath); fs::path inputFilePath = fs::path(unit_test::k_SourceDir.view()) / unit_test::k_DataDir.view() / "JSONFilters" / "Input/cthead1-Float.mha"; - Result<> imageReadResult = ITKTestBase::ReadImage(dataStructure, inputFilePath, inputGeometryPath, cellDataPath, inputDataPath); + Result<> imageReadResult = ITKTestBase::ReadImage(dataStructure, inputFilePath, inputGeometryPath, ITKTestBase::k_ImageCellDataName, ITKTestBase::k_InputDataName); SIMPLNX_RESULT_REQUIRE_VALID(imageReadResult) fs::path maskInputFilePath = fs::path(unit_test::k_SourceDir.view()) / unit_test::k_DataDir.view() / "JSONFilters" / "Input/cthead1-mask.png"; - Result<> maskImageReadResult = ITKTestBase::ReadImage(dataStructure, maskInputFilePath, maskGeometryPath, maskCellDataPath, maskDataPath); + Result<> maskImageReadResult = ITKTestBase::ReadImage(dataStructure, maskInputFilePath, maskGeometryPath, ITKTestBase::k_ImageCellDataName, ITKTestBase::k_MaskDataPath); SIMPLNX_RESULT_REQUIRE_VALID(maskImageReadResult); const auto& inputGeom = dataStructure.getDataRefAs(inputGeometryPath); @@ -106,20 +106,20 @@ TEST_CASE("ITKImageProcessing::ITKMaskImageFilter(rgb)", "[ITKImageProcessing][I ITKMaskImage filter; const DataPath inputGeometryPath({ITKTestBase::k_ImageGeometryPath}); - const DataPath cellDataPath = inputGeometryPath.createChildPath(ITKTestBase::k_ImageCellDataPath); - const DataPath inputDataPath = cellDataPath.createChildPath(ITKTestBase::k_InputDataPath); + const DataPath cellDataPath = inputGeometryPath.createChildPath(ITKTestBase::k_ImageCellDataName); + const DataPath inputDataPath = cellDataPath.createChildPath(ITKTestBase::k_InputDataName); const DataObjectNameParameter::ValueType outputArrayName = ITKTestBase::k_OutputDataPath; DataPath maskGeometryPath({ITKTestBase::k_MaskGeometryPath}); - DataPath maskCellDataPath = maskGeometryPath.createChildPath(ITKTestBase::k_ImageCellDataPath); + DataPath maskCellDataPath = maskGeometryPath.createChildPath(ITKTestBase::k_ImageCellDataName); DataPath maskDataPath = maskCellDataPath.createChildPath(ITKTestBase::k_MaskDataPath); fs::path inputFilePath = fs::path(unit_test::k_SourceDir.view()) / unit_test::k_DataDir.view() / "JSONFilters" / "Input/VM1111Shrink-RGB.png"; - Result<> imageReadResult = ITKTestBase::ReadImage(dataStructure, inputFilePath, inputGeometryPath, cellDataPath, inputDataPath); + Result<> imageReadResult = ITKTestBase::ReadImage(dataStructure, inputFilePath, inputGeometryPath, ITKTestBase::k_ImageCellDataName, ITKTestBase::k_InputDataName); SIMPLNX_RESULT_REQUIRE_VALID(imageReadResult) fs::path maskInputFilePath = fs::path(unit_test::k_SourceDir.view()) / unit_test::k_DataDir.view() / "JSONFilters" / "Input/VM1111Shrink-mask.png"; - Result<> maskImageReadResult = ITKTestBase::ReadImage(dataStructure, maskInputFilePath, maskGeometryPath, maskCellDataPath, maskDataPath); + Result<> maskImageReadResult = ITKTestBase::ReadImage(dataStructure, maskInputFilePath, maskGeometryPath, ITKTestBase::k_ImageCellDataName, ITKTestBase::k_MaskDataPath); SIMPLNX_RESULT_REQUIRE_VALID(maskImageReadResult); const auto& inputGeom = dataStructure.getDataRefAs(inputGeometryPath); @@ -152,15 +152,15 @@ TEST_CASE("ITKMaskImageFilter(cthead1_maskvalue)", "[ITKImageProcessing][ITKMask ITKMaskImage filter; const DataPath inputGeometryPath({ITKTestBase::k_ImageGeometryPath}); - DataPath inputDataPath = inputGeometryPath.createChildPath(ITKTestBase::k_InputDataPath); - DataPath cellDataPath = inputGeometryPath.createChildPath(ITKTestBase::k_ImageCellDataPath); + DataPath inputDataPath = inputGeometryPath.createChildPath(ITKTestBase::k_InputDataName); + DataPath cellDataPath = inputGeometryPath.createChildPath(ITKTestBase::k_ImageCellDataName); DataPath outputDataPath = cellDataPath.createChildPath(ITKTestBase::k_OutputDataPath); DataPath maskGeometryPath({ITKTestBase::k_MaskGeometryPath}); DataPath maskDataPath = maskGeometryPath.createChildPath(ITKTestBase::k_MaskDataPath); fs::path inputFilePath = fs::path(unit_test::k_SourceDir.view()) / unit_test::k_DataDir.view() / "JSONFilters" / "Input/cthead1.png"; - Result<> imageReadResult = ITKTestBase::ReadImage(dataStructure, inputFilePath, inputGeometryPath, cellDataPath, inputDataPath); + Result<> imageReadResult = ITKTestBase::ReadImage(dataStructure, inputFilePath, inputGeometryPath, ITKTestBase::k_ImageCellDataName, ITKTestBase::k_InputDataName); SIMPLNX_RESULT_REQUIRE_VALID(imageReadResult) fs::path maskInputFilePath = fs::path(unit_test::k_SourceDir.view()) / unit_test::k_DataDir.view() / "JSONFilters" / "Input/2th_cthead1.mha"; diff --git a/src/Plugins/ITKImageProcessing/test/ITKMedianImageTest.cpp b/src/Plugins/ITKImageProcessing/test/ITKMedianImageTest.cpp index 75b6f28963..deb5303468 100644 --- a/src/Plugins/ITKImageProcessing/test/ITKMedianImageTest.cpp +++ b/src/Plugins/ITKImageProcessing/test/ITKMedianImageTest.cpp @@ -27,13 +27,13 @@ TEST_CASE("ITKImageProcessing::ITKMedianImageFilter(defaults)", "[ITKImageProces ITKMedianImage filter; const DataPath inputGeometryPath({ITKTestBase::k_ImageGeometryPath}); - const DataPath cellDataPath = inputGeometryPath.createChildPath(ITKTestBase::k_ImageCellDataPath); - const DataPath inputDataPath = cellDataPath.createChildPath(ITKTestBase::k_InputDataPath); + const DataPath cellDataPath = inputGeometryPath.createChildPath(ITKTestBase::k_ImageCellDataName); + const DataPath inputDataPath = cellDataPath.createChildPath(ITKTestBase::k_InputDataName); const DataObjectNameParameter::ValueType outputArrayName = ITKTestBase::k_OutputDataPath; // fs::path inputFilePath = fs::path(unit_test::k_SourceDir.view()) / unit_test::k_DataDir.view() / "JSONFilters" / "Input/VM1111Shrink-RGBFloat.nrrd"; fs::path inputFilePath = fs::path(unit_test::k_SourceDir.view()) / unit_test::k_DataDir.view() / "JSONFilters" / "Input/RA-Short.nrrd"; - Result<> imageReadResult = ITKTestBase::ReadImage(dataStructure, inputFilePath, inputGeometryPath, cellDataPath, inputDataPath); + Result<> imageReadResult = ITKTestBase::ReadImage(dataStructure, inputFilePath, inputGeometryPath, ITKTestBase::k_ImageCellDataName, ITKTestBase::k_InputDataName); SIMPLNX_RESULT_REQUIRE_VALID(imageReadResult) Arguments args; @@ -58,13 +58,13 @@ TEST_CASE("ITKImageProcessing::ITKMedianImageFilter(by23)", "[ITKImageProcessing ITKMedianImage filter; const DataPath inputGeometryPath({ITKTestBase::k_ImageGeometryPath}); - const DataPath cellDataPath = inputGeometryPath.createChildPath(ITKTestBase::k_ImageCellDataPath); - const DataPath inputDataPath = cellDataPath.createChildPath(ITKTestBase::k_InputDataPath); + const DataPath cellDataPath = inputGeometryPath.createChildPath(ITKTestBase::k_ImageCellDataName); + const DataPath inputDataPath = cellDataPath.createChildPath(ITKTestBase::k_InputDataName); const DataObjectNameParameter::ValueType outputArrayName = ITKTestBase::k_OutputDataPath; // fs::path inputFilePath = fs::path(unit_test::k_SourceDir.view()) / unit_test::k_DataDir.view() / "JSONFilters" / "Input/VM1111Shrink-RGB.png"; fs::path inputFilePath = fs::path(unit_test::k_SourceDir.view()) / unit_test::k_DataDir.view() / "JSONFilters" / "Input/RA-Short.nrrd"; - Result<> imageReadResult = ITKTestBase::ReadImage(dataStructure, inputFilePath, inputGeometryPath, cellDataPath, inputDataPath); + Result<> imageReadResult = ITKTestBase::ReadImage(dataStructure, inputFilePath, inputGeometryPath, ITKTestBase::k_ImageCellDataName, ITKTestBase::k_InputDataName); SIMPLNX_RESULT_REQUIRE_VALID(imageReadResult) Arguments args; diff --git a/src/Plugins/ITKImageProcessing/test/ITKMhaFileReaderTest.cpp b/src/Plugins/ITKImageProcessing/test/ITKMhaFileReaderTest.cpp index 90605b9930..110efd08fc 100644 --- a/src/Plugins/ITKImageProcessing/test/ITKMhaFileReaderTest.cpp +++ b/src/Plugins/ITKImageProcessing/test/ITKMhaFileReaderTest.cpp @@ -14,23 +14,23 @@ using namespace nx::core; TEST_CASE("ITKImageProcessing::ITKMhaFileReader: Read 2D & 3D Image Data", "[ITKImageProcessing][ITKMhaFileReader]") { - const nx::core::UnitTest::TestFileSentinel testDataSentinel(nx::core::unit_test::k_CMakeExecutable, nx::core::unit_test::k_TestFilesDir, "ITKMhaFileReaderTest_rev2.tar.gz", "ITKMhaFileReaderTest"); + const nx::core::UnitTest::TestFileSentinel testDataSentinel(nx::core::unit_test::k_CMakeExecutable, nx::core::unit_test::k_TestFilesDir, "ITKMhaFileReaderTest_v3.tar.gz", "ITKMhaFileReaderTest_v3"); // Load plugins (this is needed because ITKMhaFileReader needs access to the SimplnxCore plugin) Application::GetOrCreateInstance()->loadPlugins(unit_test::k_BuildDir.view(), true); // Test reading 2D & 3D image data - const fs::path exemplaryFilePath = fs::path(unit_test::k_TestFilesDir.view()) / "ITKMhaFileReaderTest/ExemplarySmallIN100.dream3d"; + const fs::path exemplaryFilePath = fs::path(unit_test::k_TestFilesDir.view()) / "ITKMhaFileReaderTest_v3/ExemplarySmallIN100.dream3d"; fs::path filePath; std::string exemplaryGeomName; SECTION("Test 2D Image Data") { - filePath = fs::path(unit_test::k_TestFilesDir.view()) / "ITKMhaFileReaderTest/SmallIN100_073.mha"; + filePath = fs::path(unit_test::k_TestFilesDir.view()) / "ITKMhaFileReaderTest_v3/SmallIN100_073.mha"; exemplaryGeomName = "ExemplarySmallIN100_073"; } SECTION("Test 3D Image Data") { - filePath = fs::path(unit_test::k_TestFilesDir.view()) / "ITKMhaFileReaderTest/SmallIN100.mha"; + filePath = fs::path(unit_test::k_TestFilesDir.view()) / "ITKMhaFileReaderTest_v3/SmallIN100.mha"; exemplaryGeomName = "ExemplarySmallIN100"; } @@ -39,8 +39,8 @@ TEST_CASE("ITKImageProcessing::ITKMhaFileReader: Read 2D & 3D Image Data", "[ITK Arguments args; const std::string geomName = "ImageGeom"; - const std::string amName = "CellData"; - const std::string arrName = "ImageArray"; + const std::string amName = "Cell Data"; + const std::string arrName = "ImageData"; const std::string tMatrixName = "TransformationMatrix"; const DataPath geomPath{{geomName}}; const DataPath arrayPath{{geomName, amName, arrName}}; @@ -56,7 +56,7 @@ TEST_CASE("ITKImageProcessing::ITKMhaFileReader: Read 2D & 3D Image Data", "[ITK args.insertOrAssign(ITKImageReader::k_FileName_Key, filePath); args.insertOrAssign(ITKImageReader::k_ImageGeometryPath_Key, geomPath); args.insertOrAssign(ITKImageReader::k_CellDataName_Key, amName); - args.insertOrAssign(ITKImageReader::k_ImageDataArrayPath_Key, arrayPath); + args.insertOrAssign(ITKImageReader::k_ImageDataArrayPath_Key, arrName); args.insertOrAssign(ITKMhaFileReader::k_ApplyImageTransformation, true); args.insertOrAssign(ITKMhaFileReader::k_SaveImageTransformationAsArray, true); args.insertOrAssign(ITKMhaFileReader::k_TransformationMatrixDataArrayPathKey, tMatrixPath); @@ -74,6 +74,10 @@ TEST_CASE("ITKImageProcessing::ITKMhaFileReader: Read 2D & 3D Image Data", "[ITK REQUIRE(exemplaryImageGeomPtr != nullptr); REQUIRE(imageGeomPtr->getDimensions() == exemplaryImageGeomPtr->getDimensions()); + + auto calcOrigin = imageGeomPtr->getOrigin(); + auto exemplarOrigin = exemplaryImageGeomPtr->getOrigin(); + REQUIRE(imageGeomPtr->getOrigin() == exemplaryImageGeomPtr->getOrigin()); REQUIRE(imageGeomPtr->getSpacing() == exemplaryImageGeomPtr->getSpacing()); diff --git a/src/Plugins/ITKImageProcessing/test/ITKMorphologicalGradientImageTest.cpp b/src/Plugins/ITKImageProcessing/test/ITKMorphologicalGradientImageTest.cpp index d96d328268..e53d2571ca 100644 --- a/src/Plugins/ITKImageProcessing/test/ITKMorphologicalGradientImageTest.cpp +++ b/src/Plugins/ITKImageProcessing/test/ITKMorphologicalGradientImageTest.cpp @@ -23,13 +23,13 @@ TEST_CASE("ITKImageProcessing::ITKMorphologicalGradientImageFilter(Morphological const ITKMorphologicalGradientImage filter; const DataPath inputGeometryPath({ITKTestBase::k_ImageGeometryPath}); - const DataPath cellDataPath = inputGeometryPath.createChildPath(ITKTestBase::k_ImageCellDataPath); - const DataPath inputDataPath = cellDataPath.createChildPath(ITKTestBase::k_InputDataPath); + const DataPath cellDataPath = inputGeometryPath.createChildPath(ITKTestBase::k_ImageCellDataName); + const DataPath inputDataPath = cellDataPath.createChildPath(ITKTestBase::k_InputDataName); const DataObjectNameParameter::ValueType outputArrayName = ITKTestBase::k_OutputDataPath; { // Start Image Comparison Scope const fs::path inputFilePath = fs::path(unit_test::k_SourceDir.view()) / unit_test::k_DataDir.view() / "JSONFilters" / "Input/STAPLE1.png"; - Result<> imageReadResult = ITKTestBase::ReadImage(dataStructure, inputFilePath, inputGeometryPath, cellDataPath, inputDataPath); + Result<> imageReadResult = ITKTestBase::ReadImage(dataStructure, inputFilePath, inputGeometryPath, ITKTestBase::k_ImageCellDataName, ITKTestBase::k_InputDataName); SIMPLNX_RESULT_REQUIRE_VALID(imageReadResult) } // End Image Comparison Scope diff --git a/src/Plugins/ITKImageProcessing/test/ITKMorphologicalWatershedImageTest.cpp b/src/Plugins/ITKImageProcessing/test/ITKMorphologicalWatershedImageTest.cpp index 22a2ff564f..e9b786e7e5 100644 --- a/src/Plugins/ITKImageProcessing/test/ITKMorphologicalWatershedImageTest.cpp +++ b/src/Plugins/ITKImageProcessing/test/ITKMorphologicalWatershedImageTest.cpp @@ -21,13 +21,13 @@ TEST_CASE("ITKImageProcessing::ITKMorphologicalWatershedImageFilter(defaults)", ITKMorphologicalWatershedImage filter; const DataPath inputGeometryPath({ITKTestBase::k_ImageGeometryPath}); - const DataPath cellDataPath = inputGeometryPath.createChildPath(ITKTestBase::k_ImageCellDataPath); - const DataPath inputDataPath = cellDataPath.createChildPath(ITKTestBase::k_InputDataPath); + const DataPath cellDataPath = inputGeometryPath.createChildPath(ITKTestBase::k_ImageCellDataName); + const DataPath inputDataPath = cellDataPath.createChildPath(ITKTestBase::k_InputDataName); const DataObjectNameParameter::ValueType outputArrayName = ITKTestBase::k_OutputDataPath; { // Start Image Comparison Scope const fs::path inputFilePath = fs::path(unit_test::k_SourceDir.view()) / unit_test::k_DataDir.view() / "JSONFilters" / "Input/cthead1-grad-mag.nrrd"; - Result<> imageReadResult = ITKTestBase::ReadImage(dataStructure, inputFilePath, inputGeometryPath, cellDataPath, inputDataPath); + Result<> imageReadResult = ITKTestBase::ReadImage(dataStructure, inputFilePath, inputGeometryPath, ITKTestBase::k_ImageCellDataName, ITKTestBase::k_InputDataName); SIMPLNX_RESULT_REQUIRE_VALID(imageReadResult) } // End Image Comparison Scope @@ -52,13 +52,13 @@ TEST_CASE("ITKImageProcessing::ITKMorphologicalWatershedImageFilter(level_1)", " ITKMorphologicalWatershedImage filter; const DataPath inputGeometryPath({ITKTestBase::k_ImageGeometryPath}); - const DataPath cellDataPath = inputGeometryPath.createChildPath(ITKTestBase::k_ImageCellDataPath); - const DataPath inputDataPath = cellDataPath.createChildPath(ITKTestBase::k_InputDataPath); + const DataPath cellDataPath = inputGeometryPath.createChildPath(ITKTestBase::k_ImageCellDataName); + const DataPath inputDataPath = cellDataPath.createChildPath(ITKTestBase::k_InputDataName); const DataObjectNameParameter::ValueType outputArrayName = ITKTestBase::k_OutputDataPath; { // Start Image Comparison Scope const fs::path inputFilePath = fs::path(unit_test::k_SourceDir.view()) / unit_test::k_DataDir.view() / "JSONFilters" / "Input/cthead1-grad-mag.nrrd"; - Result<> imageReadResult = ITKTestBase::ReadImage(dataStructure, inputFilePath, inputGeometryPath, cellDataPath, inputDataPath); + Result<> imageReadResult = ITKTestBase::ReadImage(dataStructure, inputFilePath, inputGeometryPath, ITKTestBase::k_ImageCellDataName, ITKTestBase::k_InputDataName); SIMPLNX_RESULT_REQUIRE_VALID(imageReadResult) } // End Image Comparison Scope diff --git a/src/Plugins/ITKImageProcessing/test/ITKNormalizeImageTest.cpp b/src/Plugins/ITKImageProcessing/test/ITKNormalizeImageTest.cpp index 251de43fe5..2385fb0cee 100644 --- a/src/Plugins/ITKImageProcessing/test/ITKNormalizeImageTest.cpp +++ b/src/Plugins/ITKImageProcessing/test/ITKNormalizeImageTest.cpp @@ -19,12 +19,12 @@ TEST_CASE("ITKImageProcessing::ITKNormalizeImageFilter(defaults)", "[ITKImagePro ITKNormalizeImage filter; const DataPath inputGeometryPath({ITKTestBase::k_ImageGeometryPath}); - const DataPath cellDataPath = inputGeometryPath.createChildPath(ITKTestBase::k_ImageCellDataPath); - const DataPath inputDataPath = cellDataPath.createChildPath(ITKTestBase::k_InputDataPath); + const DataPath cellDataPath = inputGeometryPath.createChildPath(ITKTestBase::k_ImageCellDataName); + const DataPath inputDataPath = cellDataPath.createChildPath(ITKTestBase::k_InputDataName); const DataObjectNameParameter::ValueType outputArrayName = ITKTestBase::k_OutputDataPath; fs::path inputFilePath = fs::path(unit_test::k_SourceDir.view()) / unit_test::k_DataDir.view() / "JSONFilters" / "Input/Ramp-Up-Short.nrrd"; - Result<> imageReadResult = ITKTestBase::ReadImage(dataStructure, inputFilePath, inputGeometryPath, cellDataPath, inputDataPath); + Result<> imageReadResult = ITKTestBase::ReadImage(dataStructure, inputFilePath, inputGeometryPath, ITKTestBase::k_ImageCellDataName, ITKTestBase::k_InputDataName); SIMPLNX_RESULT_REQUIRE_VALID(imageReadResult) Arguments args; @@ -40,9 +40,9 @@ TEST_CASE("ITKImageProcessing::ITKNormalizeImageFilter(defaults)", "[ITKImagePro fs::path baselineFilePath = fs::path(nx::core::unit_test::k_DataDir.view()) / "JSONFilters/Baseline/BasicFilters_NormalizeImageFilter_defaults.nrrd"; DataPath baselineGeometryPath({ITKTestBase::k_BaselineGeometryPath}); - DataPath baseLineCellDataPath = baselineGeometryPath.createChildPath(ITKTestBase::k_ImageCellDataPath); + DataPath baseLineCellDataPath = baselineGeometryPath.createChildPath(ITKTestBase::k_ImageCellDataName); DataPath baselineDataPath = baseLineCellDataPath.createChildPath(ITKTestBase::k_BaselineDataPath); - Result<> readBaselineResult = ITKTestBase::ReadImage(dataStructure, baselineFilePath, baselineGeometryPath, baseLineCellDataPath, baselineDataPath); + Result<> readBaselineResult = ITKTestBase::ReadImage(dataStructure, baselineFilePath, baselineGeometryPath, ITKTestBase::k_ImageCellDataName, ITKTestBase::k_BaselineDataPath); Result<> compareResult = ITKTestBase::CompareImages(dataStructure, baselineGeometryPath, baselineDataPath, inputGeometryPath, cellDataPath.createChildPath(outputArrayName), 0.0001); SIMPLNX_RESULT_REQUIRE_VALID(compareResult) @@ -57,12 +57,12 @@ TEST_CASE("ITKImageProcessing::ITKNormalizeImageFilter(vector)", "[.][ITKImagePr ITKNormalizeImage filter; const DataPath inputGeometryPath({ITKTestBase::k_ImageGeometryPath}); - const DataPath cellDataPath = inputGeometryPath.createChildPath(ITKTestBase::k_ImageCellDataPath); - const DataPath inputDataPath = cellDataPath.createChildPath(ITKTestBase::k_InputDataPath); + const DataPath cellDataPath = inputGeometryPath.createChildPath(ITKTestBase::k_ImageCellDataName); + const DataPath inputDataPath = cellDataPath.createChildPath(ITKTestBase::k_InputDataName); const DataObjectNameParameter::ValueType outputArrayName = ITKTestBase::k_OutputDataPath; fs::path inputFilePath = fs::path(unit_test::k_SourceDir.view()) / unit_test::k_DataDir.view() / "JSONFilters" / "Input/VM1111Shrink-RGB.png"; - Result<> imageReadResult = ITKTestBase::ReadImage(dataStructure, inputFilePath, inputGeometryPath, cellDataPath, inputDataPath); + Result<> imageReadResult = ITKTestBase::ReadImage(dataStructure, inputFilePath, inputGeometryPath, ITKTestBase::k_ImageCellDataName, ITKTestBase::k_InputDataName); SIMPLNX_RESULT_REQUIRE_VALID(imageReadResult) Arguments args; @@ -78,9 +78,9 @@ TEST_CASE("ITKImageProcessing::ITKNormalizeImageFilter(vector)", "[.][ITKImagePr fs::path baselineFilePath = fs::path(nx::core::unit_test::k_DataDir.view()) / "JSONFilters/Baseline/BasicFilters_NormalizeImageFilter_vector.nrrd"; DataPath baselineGeometryPath({ITKTestBase::k_BaselineGeometryPath}); - DataPath baseLineCellDataPath = baselineGeometryPath.createChildPath(ITKTestBase::k_ImageCellDataPath); + DataPath baseLineCellDataPath = baselineGeometryPath.createChildPath(ITKTestBase::k_ImageCellDataName); DataPath baselineDataPath = baseLineCellDataPath.createChildPath(ITKTestBase::k_BaselineDataPath); - Result<> readBaselineResult = ITKTestBase::ReadImage(dataStructure, baselineFilePath, baselineGeometryPath, baseLineCellDataPath, baselineDataPath); + Result<> readBaselineResult = ITKTestBase::ReadImage(dataStructure, baselineFilePath, baselineGeometryPath, ITKTestBase::k_ImageCellDataName, ITKTestBase::k_BaselineDataPath); Result<> compareResult = ITKTestBase::CompareImages(dataStructure, baselineGeometryPath, baselineDataPath, inputGeometryPath, cellDataPath.createChildPath(outputArrayName), 0.0001); SIMPLNX_RESULT_REQUIRE_VALID(compareResult) } diff --git a/src/Plugins/ITKImageProcessing/test/ITKNotImageTest.cpp b/src/Plugins/ITKImageProcessing/test/ITKNotImageTest.cpp index 5c783582fa..818a55e7dc 100644 --- a/src/Plugins/ITKImageProcessing/test/ITKNotImageTest.cpp +++ b/src/Plugins/ITKImageProcessing/test/ITKNotImageTest.cpp @@ -21,13 +21,13 @@ TEST_CASE("ITKImageProcessing::ITKNotImageFilter(defaults)", "[ITKImageProcessin const ITKNotImage filter; const DataPath inputGeometryPath({ITKTestBase::k_ImageGeometryPath}); - const DataPath cellDataPath = inputGeometryPath.createChildPath(ITKTestBase::k_ImageCellDataPath); - const DataPath inputDataPath = cellDataPath.createChildPath(ITKTestBase::k_InputDataPath); + const DataPath cellDataPath = inputGeometryPath.createChildPath(ITKTestBase::k_ImageCellDataName); + const DataPath inputDataPath = cellDataPath.createChildPath(ITKTestBase::k_InputDataName); const DataObjectNameParameter::ValueType outputArrayName = ITKTestBase::k_OutputDataPath; { // Start Image Comparison Scope const fs::path inputFilePath = fs::path(unit_test::k_SourceDir.view()) / unit_test::k_DataDir.view() / "JSONFilters" / "Input/STAPLE1.png"; - Result<> imageReadResult = ITKTestBase::ReadImage(dataStructure, inputFilePath, inputGeometryPath, cellDataPath, inputDataPath); + Result<> imageReadResult = ITKTestBase::ReadImage(dataStructure, inputFilePath, inputGeometryPath, ITKTestBase::k_ImageCellDataName, ITKTestBase::k_InputDataName); SIMPLNX_RESULT_REQUIRE_VALID(imageReadResult) } // End Image Comparison Scope diff --git a/src/Plugins/ITKImageProcessing/test/ITKOpeningByReconstructionImageTest.cpp b/src/Plugins/ITKImageProcessing/test/ITKOpeningByReconstructionImageTest.cpp index d2fd58ecca..51d6afb7b6 100644 --- a/src/Plugins/ITKImageProcessing/test/ITKOpeningByReconstructionImageTest.cpp +++ b/src/Plugins/ITKImageProcessing/test/ITKOpeningByReconstructionImageTest.cpp @@ -23,13 +23,13 @@ TEST_CASE("ITKImageProcessing::ITKOpeningByReconstructionImageFilter(OpeningByRe ITKOpeningByReconstructionImage filter; const DataPath inputGeometryPath({ITKTestBase::k_ImageGeometryPath}); - const DataPath cellDataPath = inputGeometryPath.createChildPath(ITKTestBase::k_ImageCellDataPath); - const DataPath inputDataPath = cellDataPath.createChildPath(ITKTestBase::k_InputDataPath); + const DataPath cellDataPath = inputGeometryPath.createChildPath(ITKTestBase::k_ImageCellDataName); + const DataPath inputDataPath = cellDataPath.createChildPath(ITKTestBase::k_InputDataName); const DataObjectNameParameter::ValueType outputArrayName = ITKTestBase::k_OutputDataPath; { // Start Image Comparison Scope const fs::path inputFilePath = fs::path(unit_test::k_SourceDir.view()) / unit_test::k_DataDir.view() / "JSONFilters" / "Input/STAPLE1.png"; - Result<> imageReadResult = ITKTestBase::ReadImage(dataStructure, inputFilePath, inputGeometryPath, cellDataPath, inputDataPath); + Result<> imageReadResult = ITKTestBase::ReadImage(dataStructure, inputFilePath, inputGeometryPath, ITKTestBase::k_ImageCellDataName, ITKTestBase::k_InputDataName); SIMPLNX_RESULT_REQUIRE_VALID(imageReadResult) } // End Image Comparison Scope diff --git a/src/Plugins/ITKImageProcessing/test/ITKOtsuMultipleThresholdsImageTest.cpp b/src/Plugins/ITKImageProcessing/test/ITKOtsuMultipleThresholdsImageTest.cpp index ac422da4f1..f535ec0ec4 100644 --- a/src/Plugins/ITKImageProcessing/test/ITKOtsuMultipleThresholdsImageTest.cpp +++ b/src/Plugins/ITKImageProcessing/test/ITKOtsuMultipleThresholdsImageTest.cpp @@ -21,12 +21,12 @@ TEST_CASE("ITKImageProcessing::ITKOtsuMultipleThresholdsImageFilter(default)", " ITKOtsuMultipleThresholdsImage filter; const DataPath inputGeometryPath({ITKTestBase::k_ImageGeometryPath}); - const DataPath cellDataPath = inputGeometryPath.createChildPath(ITKTestBase::k_ImageCellDataPath); - const DataPath inputDataPath = cellDataPath.createChildPath(ITKTestBase::k_InputDataPath); + const DataPath cellDataPath = inputGeometryPath.createChildPath(ITKTestBase::k_ImageCellDataName); + const DataPath inputDataPath = cellDataPath.createChildPath(ITKTestBase::k_InputDataName); const DataObjectNameParameter::ValueType outputArrayName = ITKTestBase::k_OutputDataPath; fs::path inputFilePath = fs::path(unit_test::k_SourceDir.view()) / unit_test::k_DataDir.view() / "JSONFilters" / "Input/RA-Short.nrrd"; - Result<> imageReadResult = ITKTestBase::ReadImage(dataStructure, inputFilePath, inputGeometryPath, cellDataPath, inputDataPath); + Result<> imageReadResult = ITKTestBase::ReadImage(dataStructure, inputFilePath, inputGeometryPath, ITKTestBase::k_ImageCellDataName, ITKTestBase::k_InputDataName); SIMPLNX_RESULT_REQUIRE_VALID(imageReadResult) Arguments args; @@ -50,12 +50,12 @@ TEST_CASE("ITKImageProcessing::ITKOtsuMultipleThresholdsImageFilter(two_on_float ITKOtsuMultipleThresholdsImage filter; const DataPath inputGeometryPath({ITKTestBase::k_ImageGeometryPath}); - const DataPath cellDataPath = inputGeometryPath.createChildPath(ITKTestBase::k_ImageCellDataPath); - const DataPath inputDataPath = cellDataPath.createChildPath(ITKTestBase::k_InputDataPath); + const DataPath cellDataPath = inputGeometryPath.createChildPath(ITKTestBase::k_ImageCellDataName); + const DataPath inputDataPath = cellDataPath.createChildPath(ITKTestBase::k_InputDataName); const DataObjectNameParameter::ValueType outputArrayName = ITKTestBase::k_OutputDataPath; fs::path inputFilePath = fs::path(unit_test::k_SourceDir.view()) / unit_test::k_DataDir.view() / "JSONFilters" / "Input/Ramp-Zero-One-Float.nrrd"; - Result<> imageReadResult = ITKTestBase::ReadImage(dataStructure, inputFilePath, inputGeometryPath, cellDataPath, inputDataPath); + Result<> imageReadResult = ITKTestBase::ReadImage(dataStructure, inputFilePath, inputGeometryPath, ITKTestBase::k_ImageCellDataName, ITKTestBase::k_InputDataName); SIMPLNX_RESULT_REQUIRE_VALID(imageReadResult) Arguments args; @@ -81,12 +81,12 @@ TEST_CASE("ITKImageProcessing::ITKOtsuMultipleThresholdsImageFilter(three_on)", ITKOtsuMultipleThresholdsImage filter; const DataPath inputGeometryPath({ITKTestBase::k_ImageGeometryPath}); - const DataPath cellDataPath = inputGeometryPath.createChildPath(ITKTestBase::k_ImageCellDataPath); - const DataPath inputDataPath = cellDataPath.createChildPath(ITKTestBase::k_InputDataPath); + const DataPath cellDataPath = inputGeometryPath.createChildPath(ITKTestBase::k_ImageCellDataName); + const DataPath inputDataPath = cellDataPath.createChildPath(ITKTestBase::k_InputDataName); const DataObjectNameParameter::ValueType outputArrayName = ITKTestBase::k_OutputDataPath; fs::path inputFilePath = fs::path(unit_test::k_SourceDir.view()) / unit_test::k_DataDir.view() / "JSONFilters" / "Input/cthead1.png"; - Result<> imageReadResult = ITKTestBase::ReadImage(dataStructure, inputFilePath, inputGeometryPath, cellDataPath, inputDataPath); + Result<> imageReadResult = ITKTestBase::ReadImage(dataStructure, inputFilePath, inputGeometryPath, ITKTestBase::k_ImageCellDataName, ITKTestBase::k_InputDataName); SIMPLNX_RESULT_REQUIRE_VALID(imageReadResult) Arguments args; @@ -113,12 +113,12 @@ TEST_CASE("ITKImageProcessing::ITKOtsuMultipleThresholdsImageFilter(valley_empha ITKOtsuMultipleThresholdsImage filter; const DataPath inputGeometryPath({ITKTestBase::k_ImageGeometryPath}); - const DataPath cellDataPath = inputGeometryPath.createChildPath(ITKTestBase::k_ImageCellDataPath); - const DataPath inputDataPath = cellDataPath.createChildPath(ITKTestBase::k_InputDataPath); + const DataPath cellDataPath = inputGeometryPath.createChildPath(ITKTestBase::k_ImageCellDataName); + const DataPath inputDataPath = cellDataPath.createChildPath(ITKTestBase::k_InputDataName); const DataObjectNameParameter::ValueType outputArrayName = ITKTestBase::k_OutputDataPath; fs::path inputFilePath = fs::path(unit_test::k_SourceDir.view()) / unit_test::k_DataDir.view() / "JSONFilters" / "Input/cthead1.png"; - Result<> imageReadResult = ITKTestBase::ReadImage(dataStructure, inputFilePath, inputGeometryPath, cellDataPath, inputDataPath); + Result<> imageReadResult = ITKTestBase::ReadImage(dataStructure, inputFilePath, inputGeometryPath, ITKTestBase::k_ImageCellDataName, ITKTestBase::k_InputDataName); SIMPLNX_RESULT_REQUIRE_VALID(imageReadResult) Arguments args; diff --git a/src/Plugins/ITKImageProcessing/test/ITKRelabelComponentImageTest.cpp b/src/Plugins/ITKImageProcessing/test/ITKRelabelComponentImageTest.cpp index 26af37ba5b..1aff7df806 100644 --- a/src/Plugins/ITKImageProcessing/test/ITKRelabelComponentImageTest.cpp +++ b/src/Plugins/ITKImageProcessing/test/ITKRelabelComponentImageTest.cpp @@ -23,13 +23,13 @@ TEST_CASE("ITKImageProcessing::ITKRelabelComponentImageFilter(default)", "[ITKIm const ITKRelabelComponentImage filter; const DataPath inputGeometryPath({ITKTestBase::k_ImageGeometryPath}); - const DataPath cellDataPath = inputGeometryPath.createChildPath(ITKTestBase::k_ImageCellDataPath); - const DataPath inputDataPath = cellDataPath.createChildPath(ITKTestBase::k_InputDataPath); + const DataPath cellDataPath = inputGeometryPath.createChildPath(ITKTestBase::k_ImageCellDataName); + const DataPath inputDataPath = cellDataPath.createChildPath(ITKTestBase::k_InputDataName); const DataObjectNameParameter::ValueType outputArrayName = ITKTestBase::k_OutputDataPath; { // Start Image Comparison Scope const fs::path inputFilePath = fs::path(unit_test::k_SourceDir.view()) / unit_test::k_DataDir.view() / "JSONFilters" / "Input/2th_cthead1.png"; - Result<> imageReadResult = ITKTestBase::ReadImage(dataStructure, inputFilePath, inputGeometryPath, cellDataPath, inputDataPath); + Result<> imageReadResult = ITKTestBase::ReadImage(dataStructure, inputFilePath, inputGeometryPath, ITKTestBase::k_ImageCellDataName, ITKTestBase::k_InputDataName); SIMPLNX_RESULT_REQUIRE_VALID(imageReadResult) } // End Image Comparison Scope @@ -54,13 +54,13 @@ TEST_CASE("ITKImageProcessing::ITKRelabelComponentImageFilter(no_sorting)", "[IT const ITKRelabelComponentImage filter; const DataPath inputGeometryPath({ITKTestBase::k_ImageGeometryPath}); - const DataPath cellDataPath = inputGeometryPath.createChildPath(ITKTestBase::k_ImageCellDataPath); - const DataPath inputDataPath = cellDataPath.createChildPath(ITKTestBase::k_InputDataPath); + const DataPath cellDataPath = inputGeometryPath.createChildPath(ITKTestBase::k_ImageCellDataName); + const DataPath inputDataPath = cellDataPath.createChildPath(ITKTestBase::k_InputDataName); const DataObjectNameParameter::ValueType outputArrayName = ITKTestBase::k_OutputDataPath; { // Start Image Comparison Scope const fs::path inputFilePath = fs::path(unit_test::k_SourceDir.view()) / unit_test::k_DataDir.view() / "JSONFilters" / "Input/simple-label-d.png"; - Result<> imageReadResult = ITKTestBase::ReadImage(dataStructure, inputFilePath, inputGeometryPath, cellDataPath, inputDataPath); + Result<> imageReadResult = ITKTestBase::ReadImage(dataStructure, inputFilePath, inputGeometryPath, ITKTestBase::k_ImageCellDataName, ITKTestBase::k_InputDataName); SIMPLNX_RESULT_REQUIRE_VALID(imageReadResult) } // End Image Comparison Scope @@ -86,13 +86,13 @@ TEST_CASE("ITKImageProcessing::ITKRelabelComponentImageFilter(no_sorting2)", "[I const ITKRelabelComponentImage filter; const DataPath inputGeometryPath({ITKTestBase::k_ImageGeometryPath}); - const DataPath cellDataPath = inputGeometryPath.createChildPath(ITKTestBase::k_ImageCellDataPath); - const DataPath inputDataPath = cellDataPath.createChildPath(ITKTestBase::k_InputDataPath); + const DataPath cellDataPath = inputGeometryPath.createChildPath(ITKTestBase::k_ImageCellDataName); + const DataPath inputDataPath = cellDataPath.createChildPath(ITKTestBase::k_InputDataName); const DataObjectNameParameter::ValueType outputArrayName = ITKTestBase::k_OutputDataPath; { // Start Image Comparison Scope const fs::path inputFilePath = fs::path(unit_test::k_SourceDir.view()) / unit_test::k_DataDir.view() / "JSONFilters" / "Input/simple-label-d.png"; - Result<> imageReadResult = ITKTestBase::ReadImage(dataStructure, inputFilePath, inputGeometryPath, cellDataPath, inputDataPath); + Result<> imageReadResult = ITKTestBase::ReadImage(dataStructure, inputFilePath, inputGeometryPath, ITKTestBase::k_ImageCellDataName, ITKTestBase::k_InputDataName); SIMPLNX_RESULT_REQUIRE_VALID(imageReadResult) } // End Image Comparison Scope diff --git a/src/Plugins/ITKImageProcessing/test/ITKRescaleIntensityImageTest.cpp b/src/Plugins/ITKImageProcessing/test/ITKRescaleIntensityImageTest.cpp index 48cef04da4..8eff28fcbb 100644 --- a/src/Plugins/ITKImageProcessing/test/ITKRescaleIntensityImageTest.cpp +++ b/src/Plugins/ITKImageProcessing/test/ITKRescaleIntensityImageTest.cpp @@ -22,13 +22,13 @@ TEST_CASE("ITKImageProcessing::ITKRescaleIntensityImageFilter(3d)", "[ITKImagePr const ITKRescaleIntensityImage filter; const DataPath inputGeometryPath({ITKTestBase::k_ImageGeometryPath}); - const DataPath cellDataPath = inputGeometryPath.createChildPath(ITKTestBase::k_ImageCellDataPath); - const DataPath inputDataPath = cellDataPath.createChildPath(ITKTestBase::k_InputDataPath); + const DataPath cellDataPath = inputGeometryPath.createChildPath(ITKTestBase::k_ImageCellDataName); + const DataPath inputDataPath = cellDataPath.createChildPath(ITKTestBase::k_InputDataName); const DataObjectNameParameter::ValueType outputArrayName = ITKTestBase::k_OutputDataPath; { // Start Image Comparison Scope const fs::path inputFilePath = fs::path(unit_test::k_SourceDir.view()) / unit_test::k_DataDir.view() / "JSONFilters" / "Input/RA-Float.nrrd"; - Result<> imageReadResult = ITKTestBase::ReadImage(dataStructure, inputFilePath, inputGeometryPath, cellDataPath, inputDataPath); + Result<> imageReadResult = ITKTestBase::ReadImage(dataStructure, inputFilePath, inputGeometryPath, ITKTestBase::k_ImageCellDataName, ITKTestBase::k_InputDataName); SIMPLNX_RESULT_REQUIRE_VALID(imageReadResult) } // End Image Comparison Scope @@ -45,9 +45,9 @@ TEST_CASE("ITKImageProcessing::ITKRescaleIntensityImageFilter(3d)", "[ITKImagePr const fs::path baselineFilePath = fs::path(nx::core::unit_test::k_DataDir.view()) / "JSONFilters/Baseline/BasicFilters_RescaleIntensityImageFilter_3d.nrrd"; const DataPath baselineGeometryPath({ITKTestBase::k_BaselineGeometryPath}); - const DataPath baseLineCellDataPath = baselineGeometryPath.createChildPath(ITKTestBase::k_ImageCellDataPath); + const DataPath baseLineCellDataPath = baselineGeometryPath.createChildPath(ITKTestBase::k_ImageCellDataName); const DataPath baselineDataPath = baseLineCellDataPath.createChildPath(ITKTestBase::k_BaselineDataPath); - const Result<> readBaselineResult = ITKTestBase::ReadImage(dataStructure, baselineFilePath, baselineGeometryPath, baseLineCellDataPath, baselineDataPath); + const Result<> readBaselineResult = ITKTestBase::ReadImage(dataStructure, baselineFilePath, baselineGeometryPath, ITKTestBase::k_ImageCellDataName, ITKTestBase::k_BaselineDataPath); Result<> compareResult = ITKTestBase::CompareImages(dataStructure, baselineGeometryPath, baselineDataPath, inputGeometryPath, cellDataPath.createChildPath(outputArrayName), 1e-8); SIMPLNX_RESULT_REQUIRE_VALID(compareResult) } diff --git a/src/Plugins/ITKImageProcessing/test/ITKSigmoidImageTest.cpp b/src/Plugins/ITKImageProcessing/test/ITKSigmoidImageTest.cpp index 486aed8c0b..4920d0e081 100644 --- a/src/Plugins/ITKImageProcessing/test/ITKSigmoidImageTest.cpp +++ b/src/Plugins/ITKImageProcessing/test/ITKSigmoidImageTest.cpp @@ -22,13 +22,13 @@ TEST_CASE("ITKImageProcessing::ITKSigmoidImageFilter(defaults)", "[ITKImageProce const ITKSigmoidImage filter; const DataPath inputGeometryPath({ITKTestBase::k_ImageGeometryPath}); - const DataPath cellDataPath = inputGeometryPath.createChildPath(ITKTestBase::k_ImageCellDataPath); - const DataPath inputDataPath = cellDataPath.createChildPath(ITKTestBase::k_InputDataPath); + const DataPath cellDataPath = inputGeometryPath.createChildPath(ITKTestBase::k_ImageCellDataName); + const DataPath inputDataPath = cellDataPath.createChildPath(ITKTestBase::k_InputDataName); const DataObjectNameParameter::ValueType outputArrayName = ITKTestBase::k_OutputDataPath; { // Start Image Comparison Scope const fs::path inputFilePath = fs::path(unit_test::k_SourceDir.view()) / unit_test::k_DataDir.view() / "JSONFilters" / "Input/Ramp-Zero-One-Float.nrrd"; - Result<> imageReadResult = ITKTestBase::ReadImage(dataStructure, inputFilePath, inputGeometryPath, cellDataPath, inputDataPath); + Result<> imageReadResult = ITKTestBase::ReadImage(dataStructure, inputFilePath, inputGeometryPath, ITKTestBase::k_ImageCellDataName, ITKTestBase::k_InputDataName); SIMPLNX_RESULT_REQUIRE_VALID(imageReadResult) } // End Image Comparison Scope diff --git a/src/Plugins/ITKImageProcessing/test/ITKSignedMaurerDistanceMapImageTest.cpp b/src/Plugins/ITKImageProcessing/test/ITKSignedMaurerDistanceMapImageTest.cpp index 3e117357a4..b1cd7c7d78 100644 --- a/src/Plugins/ITKImageProcessing/test/ITKSignedMaurerDistanceMapImageTest.cpp +++ b/src/Plugins/ITKImageProcessing/test/ITKSignedMaurerDistanceMapImageTest.cpp @@ -20,13 +20,13 @@ TEST_CASE("ITKImageProcessing::ITKSignedMaurerDistanceMapImageFilter(default)", ITKSignedMaurerDistanceMapImage filter; const DataPath inputGeometryPath({ITKTestBase::k_ImageGeometryPath}); - const DataPath cellDataPath = inputGeometryPath.createChildPath(ITKTestBase::k_ImageCellDataPath); - const DataPath inputDataPath = cellDataPath.createChildPath(ITKTestBase::k_InputDataPath); + const DataPath cellDataPath = inputGeometryPath.createChildPath(ITKTestBase::k_ImageCellDataName); + const DataPath inputDataPath = cellDataPath.createChildPath(ITKTestBase::k_InputDataName); const DataObjectNameParameter::ValueType outputArrayName = ITKTestBase::k_OutputDataPath; { // Start Image Comparison Scope const fs::path inputFilePath = fs::path(unit_test::k_SourceDir.view()) / unit_test::k_DataDir.view() / "JSONFilters" / "Input/2th_cthead1.png"; - Result<> imageReadResult = ITKTestBase::ReadImage(dataStructure, inputFilePath, inputGeometryPath, cellDataPath, inputDataPath); + Result<> imageReadResult = ITKTestBase::ReadImage(dataStructure, inputFilePath, inputGeometryPath, ITKTestBase::k_ImageCellDataName, ITKTestBase::k_InputDataName); SIMPLNX_RESULT_REQUIRE_VALID(imageReadResult) } // End Image Comparison Scope @@ -43,9 +43,9 @@ TEST_CASE("ITKImageProcessing::ITKSignedMaurerDistanceMapImageFilter(default)", fs::path baselineFilePath = fs::path(nx::core::unit_test::k_DataDir.view()) / "JSONFilters/Baseline/BasicFilters_SignedMaurerDistanceMapImageFilter_default.nrrd"; DataPath baselineGeometryPath({ITKTestBase::k_BaselineGeometryPath}); - DataPath baseLineCellDataPath = baselineGeometryPath.createChildPath(ITKTestBase::k_ImageCellDataPath); + DataPath baseLineCellDataPath = baselineGeometryPath.createChildPath(ITKTestBase::k_ImageCellDataName); DataPath baselineDataPath = baseLineCellDataPath.createChildPath(ITKTestBase::k_BaselineDataPath); - Result<> readBaselineResult = ITKTestBase::ReadImage(dataStructure, baselineFilePath, baselineGeometryPath, baseLineCellDataPath, baselineDataPath); + Result<> readBaselineResult = ITKTestBase::ReadImage(dataStructure, baselineFilePath, baselineGeometryPath, ITKTestBase::k_ImageCellDataName, ITKTestBase::k_BaselineDataPath); Result<> compareResult = ITKTestBase::CompareImages(dataStructure, baselineGeometryPath, baselineDataPath, inputGeometryPath, cellDataPath.createChildPath(outputArrayName), 0.01); SIMPLNX_RESULT_REQUIRE_VALID(compareResult) } diff --git a/src/Plugins/ITKImageProcessing/test/ITKSinImageTest.cpp b/src/Plugins/ITKImageProcessing/test/ITKSinImageTest.cpp index ebd479ffc6..ebf44a1ae3 100644 --- a/src/Plugins/ITKImageProcessing/test/ITKSinImageTest.cpp +++ b/src/Plugins/ITKImageProcessing/test/ITKSinImageTest.cpp @@ -19,13 +19,13 @@ TEST_CASE("ITKImageProcessing::ITKSinImageFilter(defaults)", "[ITKImageProcessin ITKSinImage filter; const DataPath inputGeometryPath({ITKTestBase::k_ImageGeometryPath}); - const DataPath cellDataPath = inputGeometryPath.createChildPath(ITKTestBase::k_ImageCellDataPath); - const DataPath inputDataPath = cellDataPath.createChildPath(ITKTestBase::k_InputDataPath); + const DataPath cellDataPath = inputGeometryPath.createChildPath(ITKTestBase::k_ImageCellDataName); + const DataPath inputDataPath = cellDataPath.createChildPath(ITKTestBase::k_InputDataName); const DataObjectNameParameter::ValueType outputArrayName = ITKTestBase::k_OutputDataPath; { // Start Image Comparison Scope const fs::path inputFilePath = fs::path(unit_test::k_SourceDir.view()) / unit_test::k_DataDir.view() / "JSONFilters" / "Input/Ramp-Zero-One-Float.nrrd"; - Result<> imageReadResult = ITKTestBase::ReadImage(dataStructure, inputFilePath, inputGeometryPath, cellDataPath, inputDataPath); + Result<> imageReadResult = ITKTestBase::ReadImage(dataStructure, inputFilePath, inputGeometryPath, ITKTestBase::k_ImageCellDataName, ITKTestBase::k_InputDataName); SIMPLNX_RESULT_REQUIRE_VALID(imageReadResult) } // End Image Comparison Scope @@ -42,9 +42,9 @@ TEST_CASE("ITKImageProcessing::ITKSinImageFilter(defaults)", "[ITKImageProcessin fs::path baselineFilePath = fs::path(nx::core::unit_test::k_DataDir.view()) / "JSONFilters/Baseline/BasicFilters_SinImageFilter_defaults.nrrd"; DataPath baselineGeometryPath({ITKTestBase::k_BaselineGeometryPath}); - DataPath baseLineCellDataPath = baselineGeometryPath.createChildPath(ITKTestBase::k_ImageCellDataPath); + DataPath baseLineCellDataPath = baselineGeometryPath.createChildPath(ITKTestBase::k_ImageCellDataName); DataPath baselineDataPath = baseLineCellDataPath.createChildPath(ITKTestBase::k_BaselineDataPath); - Result<> readBaselineResult = ITKTestBase::ReadImage(dataStructure, baselineFilePath, baselineGeometryPath, baseLineCellDataPath, baselineDataPath); + Result<> readBaselineResult = ITKTestBase::ReadImage(dataStructure, baselineFilePath, baselineGeometryPath, ITKTestBase::k_ImageCellDataName, ITKTestBase::k_BaselineDataPath); Result<> compareResult = ITKTestBase::CompareImages(dataStructure, baselineGeometryPath, baselineDataPath, inputGeometryPath, cellDataPath.createChildPath(outputArrayName), 0.01); SIMPLNX_RESULT_REQUIRE_VALID(compareResult) } diff --git a/src/Plugins/ITKImageProcessing/test/ITKSqrtImageTest.cpp b/src/Plugins/ITKImageProcessing/test/ITKSqrtImageTest.cpp index 7882acc33c..936f071ffa 100644 --- a/src/Plugins/ITKImageProcessing/test/ITKSqrtImageTest.cpp +++ b/src/Plugins/ITKImageProcessing/test/ITKSqrtImageTest.cpp @@ -19,13 +19,13 @@ TEST_CASE("ITKImageProcessing::ITKSqrtImageFilter(defaults)", "[ITKImageProcessi ITKSqrtImage filter; const DataPath inputGeometryPath({ITKTestBase::k_ImageGeometryPath}); - const DataPath cellDataPath = inputGeometryPath.createChildPath(ITKTestBase::k_ImageCellDataPath); - const DataPath inputDataPath = cellDataPath.createChildPath(ITKTestBase::k_InputDataPath); + const DataPath cellDataPath = inputGeometryPath.createChildPath(ITKTestBase::k_ImageCellDataName); + const DataPath inputDataPath = cellDataPath.createChildPath(ITKTestBase::k_InputDataName); const DataObjectNameParameter::ValueType outputArrayName = ITKTestBase::k_OutputDataPath; { // Start Image Comparison Scope const fs::path inputFilePath = fs::path(unit_test::k_SourceDir.view()) / unit_test::k_DataDir.view() / "JSONFilters" / "Input/Ramp-Zero-One-Float.nrrd"; - Result<> imageReadResult = ITKTestBase::ReadImage(dataStructure, inputFilePath, inputGeometryPath, cellDataPath, inputDataPath); + Result<> imageReadResult = ITKTestBase::ReadImage(dataStructure, inputFilePath, inputGeometryPath, ITKTestBase::k_ImageCellDataName, ITKTestBase::k_InputDataName); SIMPLNX_RESULT_REQUIRE_VALID(imageReadResult) } // End Image Comparison Scope @@ -42,9 +42,9 @@ TEST_CASE("ITKImageProcessing::ITKSqrtImageFilter(defaults)", "[ITKImageProcessi fs::path baselineFilePath = fs::path(nx::core::unit_test::k_DataDir.view()) / "JSONFilters/Baseline/BasicFilters_SqrtImageFilter_defaults.nrrd"; DataPath baselineGeometryPath({ITKTestBase::k_BaselineGeometryPath}); - DataPath baseLineCellDataPath = baselineGeometryPath.createChildPath(ITKTestBase::k_ImageCellDataPath); + DataPath baseLineCellDataPath = baselineGeometryPath.createChildPath(ITKTestBase::k_ImageCellDataName); DataPath baselineDataPath = baseLineCellDataPath.createChildPath(ITKTestBase::k_BaselineDataPath); - Result<> readBaselineResult = ITKTestBase::ReadImage(dataStructure, baselineFilePath, baselineGeometryPath, baseLineCellDataPath, baselineDataPath); + Result<> readBaselineResult = ITKTestBase::ReadImage(dataStructure, baselineFilePath, baselineGeometryPath, ITKTestBase::k_ImageCellDataName, ITKTestBase::k_BaselineDataPath); Result<> compareResult = ITKTestBase::CompareImages(dataStructure, baselineGeometryPath, baselineDataPath, inputGeometryPath, cellDataPath.createChildPath(outputArrayName), 0.01); SIMPLNX_RESULT_REQUIRE_VALID(compareResult) } diff --git a/src/Plugins/ITKImageProcessing/test/ITKSquareImageTest.cpp b/src/Plugins/ITKImageProcessing/test/ITKSquareImageTest.cpp index 223fae4777..9acd55d18a 100644 --- a/src/Plugins/ITKImageProcessing/test/ITKSquareImageTest.cpp +++ b/src/Plugins/ITKImageProcessing/test/ITKSquareImageTest.cpp @@ -21,13 +21,13 @@ TEST_CASE("ITKImageProcessing::ITKSquareImageFilter(defaults)", "[ITKImageProces const ITKSquareImage filter; const DataPath inputGeometryPath({ITKTestBase::k_ImageGeometryPath}); - const DataPath cellDataPath = inputGeometryPath.createChildPath(ITKTestBase::k_ImageCellDataPath); - const DataPath inputDataPath = cellDataPath.createChildPath(ITKTestBase::k_InputDataPath); + const DataPath cellDataPath = inputGeometryPath.createChildPath(ITKTestBase::k_ImageCellDataName); + const DataPath inputDataPath = cellDataPath.createChildPath(ITKTestBase::k_InputDataName); const DataObjectNameParameter::ValueType outputArrayName = ITKTestBase::k_OutputDataPath; { // Start Image Comparison Scope const fs::path inputFilePath = fs::path(unit_test::k_SourceDir.view()) / unit_test::k_DataDir.view() / "JSONFilters" / "Input/Ramp-Zero-One-Float.nrrd"; - Result<> imageReadResult = ITKTestBase::ReadImage(dataStructure, inputFilePath, inputGeometryPath, cellDataPath, inputDataPath); + Result<> imageReadResult = ITKTestBase::ReadImage(dataStructure, inputFilePath, inputGeometryPath, ITKTestBase::k_ImageCellDataName, ITKTestBase::k_InputDataName); SIMPLNX_RESULT_REQUIRE_VALID(imageReadResult) } // End Image Comparison Scope diff --git a/src/Plugins/ITKImageProcessing/test/ITKTanImageTest.cpp b/src/Plugins/ITKImageProcessing/test/ITKTanImageTest.cpp index b652cbb88a..c8d9568cbc 100644 --- a/src/Plugins/ITKImageProcessing/test/ITKTanImageTest.cpp +++ b/src/Plugins/ITKImageProcessing/test/ITKTanImageTest.cpp @@ -20,13 +20,13 @@ TEST_CASE("ITKImageProcessing::ITKTanImageFilter(defaults)", "[ITKImageProcessin ITKTanImage filter; const DataPath inputGeometryPath({ITKTestBase::k_ImageGeometryPath}); - const DataPath cellDataPath = inputGeometryPath.createChildPath(ITKTestBase::k_ImageCellDataPath); - const DataPath inputDataPath = cellDataPath.createChildPath(ITKTestBase::k_InputDataPath); + const DataPath cellDataPath = inputGeometryPath.createChildPath(ITKTestBase::k_ImageCellDataName); + const DataPath inputDataPath = cellDataPath.createChildPath(ITKTestBase::k_InputDataName); const DataObjectNameParameter::ValueType outputArrayName = ITKTestBase::k_OutputDataPath; { // Start Image Comparison Scope const fs::path inputFilePath = fs::path(unit_test::k_SourceDir.view()) / unit_test::k_DataDir.view() / "JSONFilters" / "Input/Ramp-Zero-One-Float.nrrd"; - Result<> imageReadResult = ITKTestBase::ReadImage(dataStructure, inputFilePath, inputGeometryPath, cellDataPath, inputDataPath); + Result<> imageReadResult = ITKTestBase::ReadImage(dataStructure, inputFilePath, inputGeometryPath, ITKTestBase::k_ImageCellDataName, ITKTestBase::k_InputDataName); SIMPLNX_RESULT_REQUIRE_VALID(imageReadResult) } // End Image Comparison Scope @@ -43,9 +43,9 @@ TEST_CASE("ITKImageProcessing::ITKTanImageFilter(defaults)", "[ITKImageProcessin fs::path baselineFilePath = fs::path(nx::core::unit_test::k_DataDir.view()) / "JSONFilters/Baseline/BasicFilters_TanImageFilter_defaults.nrrd"; DataPath baselineGeometryPath({ITKTestBase::k_BaselineGeometryPath}); - DataPath baseLineCellDataPath = baselineGeometryPath.createChildPath(ITKTestBase::k_ImageCellDataPath); + DataPath baseLineCellDataPath = baselineGeometryPath.createChildPath(ITKTestBase::k_ImageCellDataName); DataPath baselineDataPath = baseLineCellDataPath.createChildPath(ITKTestBase::k_BaselineDataPath); - Result<> readBaselineResult = ITKTestBase::ReadImage(dataStructure, baselineFilePath, baselineGeometryPath, baseLineCellDataPath, baselineDataPath); + Result<> readBaselineResult = ITKTestBase::ReadImage(dataStructure, baselineFilePath, baselineGeometryPath, ITKTestBase::k_ImageCellDataName, ITKTestBase::k_BaselineDataPath); Result<> compareResult = ITKTestBase::CompareImages(dataStructure, baselineGeometryPath, baselineDataPath, inputGeometryPath, cellDataPath.createChildPath(outputArrayName), 0.01); SIMPLNX_RESULT_REQUIRE_VALID(compareResult) } diff --git a/src/Plugins/ITKImageProcessing/test/ITKTestBase.cpp b/src/Plugins/ITKImageProcessing/test/ITKTestBase.cpp index 5d4c819ae7..eba7a02381 100644 --- a/src/Plugins/ITKImageProcessing/test/ITKTestBase.cpp +++ b/src/Plugins/ITKImageProcessing/test/ITKTestBase.cpp @@ -165,14 +165,14 @@ std::string ComputeMd5Hash(DataStructure& dataStructure, const DataPath& outputD } //------------------------------------------------------------------------------ -Result<> ReadImage(DataStructure& dataStructure, const fs::path& filePath, const DataPath& geometryPath, const DataPath& cellDataPath, const DataPath& imagePath) +Result<> ReadImage(DataStructure& dataStructure, const fs::path& filePath, const DataPath& geometryPath, const std::string& cellAttrMatName, const std::string& imageArrayName) { ITKImageReader filter; Arguments args; args.insertOrAssign(ITKImageReader::k_FileName_Key, filePath); args.insertOrAssign(ITKImageReader::k_ImageGeometryPath_Key, geometryPath); - args.insertOrAssign(ITKImageReader::k_CellDataName_Key, cellDataPath.getTargetName()); - args.insertOrAssign(ITKImageReader::k_ImageDataArrayPath_Key, imagePath); + args.insertOrAssign(ITKImageReader::k_CellDataName_Key, cellAttrMatName); + args.insertOrAssign(ITKImageReader::k_ImageDataArrayPath_Key, imageArrayName); args.insertOrAssign(ITKImageReader::k_ChangeOrigin_Key, false); args.insertOrAssign(ITKImageReader::k_ChangeSpacing_Key, false); auto executeResult = filter.execute(dataStructure, args); diff --git a/src/Plugins/ITKImageProcessing/test/ITKTestBase.hpp b/src/Plugins/ITKImageProcessing/test/ITKTestBase.hpp index 6898ad683f..f9433b7b9a 100644 --- a/src/Plugins/ITKImageProcessing/test/ITKTestBase.hpp +++ b/src/Plugins/ITKImageProcessing/test/ITKTestBase.hpp @@ -21,16 +21,16 @@ namespace nx::core namespace ITKTestBase { inline constexpr StringLiteral k_ImageGeometryPath = "[ImageGeometry]"; -inline constexpr StringLiteral k_ImageCellDataPath = "Cell Data"; +inline constexpr StringLiteral k_ImageCellDataName = "Cell Data"; inline constexpr StringLiteral k_MaskGeometryPath = "[MaskGeometry]"; inline constexpr StringLiteral k_BaselineGeometryPath = "[BaselineGeometry]"; -inline constexpr StringLiteral k_InputDataPath = "Input"; +inline constexpr StringLiteral k_InputDataName = "Input"; inline constexpr StringLiteral k_OutputDataPath = "Output"; inline constexpr StringLiteral k_MaskDataPath = "Mask"; inline constexpr StringLiteral k_BaselineDataPath = "Baseline"; -Result<> ReadImage(DataStructure& dataStructure, const fs::path& filePath, const DataPath& geometryPath, const DataPath& cellDataPath, const DataPath& imagePath); +Result<> ReadImage(DataStructure& dataStructure, const fs::path& filePath, const DataPath& geometryPath, const std::string& cellAttrMatName, const std::string& imageArrayName); Result<> WriteImage(DataStructure& dataStructure, const fs::path& filePath, const DataPath& geometryPath, const DataPath& imagePath); diff --git a/src/Plugins/ITKImageProcessing/test/ITKThresholdImageTest.cpp b/src/Plugins/ITKImageProcessing/test/ITKThresholdImageTest.cpp index 5fee80ecc0..22a327a41e 100644 --- a/src/Plugins/ITKImageProcessing/test/ITKThresholdImageTest.cpp +++ b/src/Plugins/ITKImageProcessing/test/ITKThresholdImageTest.cpp @@ -22,13 +22,13 @@ TEST_CASE("ITKImageProcessing::ITKThresholdImageFilter(Default)", "[ITKImageProc const ITKThresholdImage filter; const DataPath inputGeometryPath({ITKTestBase::k_ImageGeometryPath}); - const DataPath cellDataPath = inputGeometryPath.createChildPath(ITKTestBase::k_ImageCellDataPath); - const DataPath inputDataPath = cellDataPath.createChildPath(ITKTestBase::k_InputDataPath); + const DataPath cellDataPath = inputGeometryPath.createChildPath(ITKTestBase::k_ImageCellDataName); + const DataPath inputDataPath = cellDataPath.createChildPath(ITKTestBase::k_InputDataName); const DataObjectNameParameter::ValueType outputArrayName = ITKTestBase::k_OutputDataPath; { // Start Image Comparison Scope const fs::path inputFilePath = fs::path(unit_test::k_SourceDir.view()) / unit_test::k_DataDir.view() / "JSONFilters" / "Input/RA-Short.nrrd"; - Result<> imageReadResult = ITKTestBase::ReadImage(dataStructure, inputFilePath, inputGeometryPath, cellDataPath, inputDataPath); + Result<> imageReadResult = ITKTestBase::ReadImage(dataStructure, inputFilePath, inputGeometryPath, ITKTestBase::k_ImageCellDataName, ITKTestBase::k_InputDataName); SIMPLNX_RESULT_REQUIRE_VALID(imageReadResult) } // End Image Comparison Scope @@ -53,13 +53,13 @@ TEST_CASE("ITKImageProcessing::ITKThresholdImageFilter(Threshold1)", "[ITKImageP const ITKThresholdImage filter; const DataPath inputGeometryPath({ITKTestBase::k_ImageGeometryPath}); - const DataPath cellDataPath = inputGeometryPath.createChildPath(ITKTestBase::k_ImageCellDataPath); - const DataPath inputDataPath = cellDataPath.createChildPath(ITKTestBase::k_InputDataPath); + const DataPath cellDataPath = inputGeometryPath.createChildPath(ITKTestBase::k_ImageCellDataName); + const DataPath inputDataPath = cellDataPath.createChildPath(ITKTestBase::k_InputDataName); const DataObjectNameParameter::ValueType outputArrayName = ITKTestBase::k_OutputDataPath; { // Start Image Comparison Scope const fs::path inputFilePath = fs::path(unit_test::k_SourceDir.view()) / unit_test::k_DataDir.view() / "JSONFilters" / "Input/RA-Slice-Short.png"; - Result<> imageReadResult = ITKTestBase::ReadImage(dataStructure, inputFilePath, inputGeometryPath, cellDataPath, inputDataPath); + Result<> imageReadResult = ITKTestBase::ReadImage(dataStructure, inputFilePath, inputGeometryPath, ITKTestBase::k_ImageCellDataName, ITKTestBase::k_InputDataName); SIMPLNX_RESULT_REQUIRE_VALID(imageReadResult) } // End Image Comparison Scope @@ -86,13 +86,13 @@ TEST_CASE("ITKImageProcessing::ITKThresholdImageFilter(Threshold2)", "[ITKImageP const ITKThresholdImage filter; const DataPath inputGeometryPath({ITKTestBase::k_ImageGeometryPath}); - const DataPath cellDataPath = inputGeometryPath.createChildPath(ITKTestBase::k_ImageCellDataPath); - const DataPath inputDataPath = cellDataPath.createChildPath(ITKTestBase::k_InputDataPath); + const DataPath cellDataPath = inputGeometryPath.createChildPath(ITKTestBase::k_ImageCellDataName); + const DataPath inputDataPath = cellDataPath.createChildPath(ITKTestBase::k_InputDataName); const DataObjectNameParameter::ValueType outputArrayName = ITKTestBase::k_OutputDataPath; { // Start Image Comparison Scope const fs::path inputFilePath = fs::path(unit_test::k_SourceDir.view()) / unit_test::k_DataDir.view() / "JSONFilters" / "Input/RA-Slice-Short.png"; - Result<> imageReadResult = ITKTestBase::ReadImage(dataStructure, inputFilePath, inputGeometryPath, cellDataPath, inputDataPath); + Result<> imageReadResult = ITKTestBase::ReadImage(dataStructure, inputFilePath, inputGeometryPath, ITKTestBase::k_ImageCellDataName, ITKTestBase::k_InputDataName); SIMPLNX_RESULT_REQUIRE_VALID(imageReadResult) } // End Image Comparison Scope diff --git a/src/Plugins/ITKImageProcessing/test/ITKValuedRegionalMaximaImageTest.cpp b/src/Plugins/ITKImageProcessing/test/ITKValuedRegionalMaximaImageTest.cpp index 86a843b69d..46d5b6c706 100644 --- a/src/Plugins/ITKImageProcessing/test/ITKValuedRegionalMaximaImageTest.cpp +++ b/src/Plugins/ITKImageProcessing/test/ITKValuedRegionalMaximaImageTest.cpp @@ -22,13 +22,13 @@ TEST_CASE("ITKImageProcessing::ITKValuedRegionalMaximaImageFilter(defaults)", "[ const ITKValuedRegionalMaximaImage filter; const DataPath inputGeometryPath({ITKTestBase::k_ImageGeometryPath}); - const DataPath cellDataPath = inputGeometryPath.createChildPath(ITKTestBase::k_ImageCellDataPath); - const DataPath inputDataPath = cellDataPath.createChildPath(ITKTestBase::k_InputDataPath); + const DataPath cellDataPath = inputGeometryPath.createChildPath(ITKTestBase::k_ImageCellDataName); + const DataPath inputDataPath = cellDataPath.createChildPath(ITKTestBase::k_InputDataName); const DataObjectNameParameter::ValueType outputArrayName = ITKTestBase::k_OutputDataPath; { // Start Image Comparison Scope const fs::path inputFilePath = fs::path(unit_test::k_SourceDir.view()) / unit_test::k_DataDir.view() / "JSONFilters" / "Input/cthead1.png"; - Result<> imageReadResult = ITKTestBase::ReadImage(dataStructure, inputFilePath, inputGeometryPath, cellDataPath, inputDataPath); + Result<> imageReadResult = ITKTestBase::ReadImage(dataStructure, inputFilePath, inputGeometryPath, ITKTestBase::k_ImageCellDataName, ITKTestBase::k_InputDataName); SIMPLNX_RESULT_REQUIRE_VALID(imageReadResult) } // End Image Comparison Scope diff --git a/src/Plugins/ITKImageProcessing/test/ITKValuedRegionalMinimaImageTest.cpp b/src/Plugins/ITKImageProcessing/test/ITKValuedRegionalMinimaImageTest.cpp index be935d85d0..3cbc374055 100644 --- a/src/Plugins/ITKImageProcessing/test/ITKValuedRegionalMinimaImageTest.cpp +++ b/src/Plugins/ITKImageProcessing/test/ITKValuedRegionalMinimaImageTest.cpp @@ -22,13 +22,13 @@ TEST_CASE("ITKImageProcessing::ITKValuedRegionalMinimaImageFilter(defaults)", "[ const ITKValuedRegionalMinimaImage filter; const DataPath inputGeometryPath({ITKTestBase::k_ImageGeometryPath}); - const DataPath cellDataPath = inputGeometryPath.createChildPath(ITKTestBase::k_ImageCellDataPath); - const DataPath inputDataPath = cellDataPath.createChildPath(ITKTestBase::k_InputDataPath); + const DataPath cellDataPath = inputGeometryPath.createChildPath(ITKTestBase::k_ImageCellDataName); + const DataPath inputDataPath = cellDataPath.createChildPath(ITKTestBase::k_InputDataName); const DataObjectNameParameter::ValueType outputArrayName = ITKTestBase::k_OutputDataPath; { // Start Image Comparison Scope const fs::path inputFilePath = fs::path(unit_test::k_SourceDir.view()) / unit_test::k_DataDir.view() / "JSONFilters" / "Input/cthead1.png"; - Result<> imageReadResult = ITKTestBase::ReadImage(dataStructure, inputFilePath, inputGeometryPath, cellDataPath, inputDataPath); + Result<> imageReadResult = ITKTestBase::ReadImage(dataStructure, inputFilePath, inputGeometryPath, ITKTestBase::k_ImageCellDataName, ITKTestBase::k_InputDataName); SIMPLNX_RESULT_REQUIRE_VALID(imageReadResult) } // End Image Comparison Scope diff --git a/src/Plugins/ITKImageProcessing/test/ITKWhiteTopHatImageTest.cpp b/src/Plugins/ITKImageProcessing/test/ITKWhiteTopHatImageTest.cpp index f28f0aed81..ce96233003 100644 --- a/src/Plugins/ITKImageProcessing/test/ITKWhiteTopHatImageTest.cpp +++ b/src/Plugins/ITKImageProcessing/test/ITKWhiteTopHatImageTest.cpp @@ -24,13 +24,13 @@ TEST_CASE("ITKImageProcessing::ITKWhiteTopHatImageFilter(WhiteTopHatErode)", "[I const ITKWhiteTopHatImage filter; const DataPath inputGeometryPath({ITKTestBase::k_ImageGeometryPath}); - const DataPath cellDataPath = inputGeometryPath.createChildPath(ITKTestBase::k_ImageCellDataPath); - const DataPath inputDataPath = cellDataPath.createChildPath(ITKTestBase::k_InputDataPath); + const DataPath cellDataPath = inputGeometryPath.createChildPath(ITKTestBase::k_ImageCellDataName); + const DataPath inputDataPath = cellDataPath.createChildPath(ITKTestBase::k_InputDataName); const DataObjectNameParameter::ValueType outputArrayName = ITKTestBase::k_OutputDataPath; { // Start Image Comparison Scope const fs::path inputFilePath = fs::path(unit_test::k_SourceDir.view()) / unit_test::k_DataDir.view() / "JSONFilters" / "Input/STAPLE1.png"; - Result<> imageReadResult = ITKTestBase::ReadImage(dataStructure, inputFilePath, inputGeometryPath, cellDataPath, inputDataPath); + Result<> imageReadResult = ITKTestBase::ReadImage(dataStructure, inputFilePath, inputGeometryPath, ITKTestBase::k_ImageCellDataName, ITKTestBase::k_InputDataName); SIMPLNX_RESULT_REQUIRE_VALID(imageReadResult) } // End Image Comparison Scope diff --git a/src/Plugins/ITKImageProcessing/tools/itk_filter_generator.py b/src/Plugins/ITKImageProcessing/tools/itk_filter_generator.py index 6b4bc31c3f..369c54a433 100644 --- a/src/Plugins/ITKImageProcessing/tools/itk_filter_generator.py +++ b/src/Plugins/ITKImageProcessing/tools/itk_filter_generator.py @@ -864,14 +864,14 @@ def get_test_case(filter_data: FilterData, test: TestData) -> List[str]: lines.append(' DataStructure dataStructure;\n') lines.append(f' const {filter_data.filter_name} filter;\n\n') lines.append(' const DataPath inputGeometryPath({ITKTestBase::k_ImageGeometryPath});\n') - lines.append(' const DataPath cellDataPath = inputGeometryPath.createChildPath(ITKTestBase::k_ImageCellDataPath);\n') - lines.append(' const DataPath inputDataPath = cellDataPath.createChildPath(ITKTestBase::k_InputDataPath);\n') + lines.append(' const DataPath cellDataPath = inputGeometryPath.createChildPath(ITKTestBase::k_ImageCellDataName);\n') + lines.append(' const DataPath inputDataPath = cellDataPath.createChildPath(ITKTestBase::k_InputDataName);\n') lines.append(' const DataObjectNameParameter::ValueType outputArrayName = ITKTestBase::k_OutputDataPath;\n\n') for input_str in test.inputs: lines.append(' { // Start Image Comparison Scope\n') lines.append(f' const fs::path inputFilePath = fs::path(unit_test::k_SourceDir.view()) / unit_test::k_DataDir.view() / \"JSONFilters\" / \"{input_str}\";\n') - lines.append(f' Result<> imageReadResult = ITKTestBase::ReadImage(dataStructure, inputFilePath, inputGeometryPath, cellDataPath, inputDataPath);\n') + lines.append(f' Result<> imageReadResult = ITKTestBase::ReadImage(dataStructure, inputFilePath, inputGeometryPath, ITKTestBase::k_ImageCellDataName, ITKTestBase::k_InputDataName);\n') lines.append(' SIMPLNX_RESULT_REQUIRE_VALID(imageReadResult)\n') lines.append(' } // End Image Comparison Scope\n\n') @@ -895,9 +895,9 @@ def get_test_case(filter_data: FilterData, test: TestData) -> List[str]: if not test.md5hash: lines.append(f' const fs::path baselineFilePath = fs::path(nx::core::unit_test::k_DataDir.view()) / \"JSONFilters/Baseline/BasicFilters_{filter_data.name}_{test.tag}.nrrd\";\n') lines.append(' const DataPath baselineGeometryPath({ITKTestBase::k_BaselineGeometryPath});\n') - lines.append(' const DataPath baseLineCellDataPath = baselineGeometryPath.createChildPath(ITKTestBase::k_ImageCellDataPath);\n') + lines.append(' const DataPath baseLineCellDataPath = baselineGeometryPath.createChildPath(ITKTestBase::k_ImageCellDataName);\n') lines.append(' const DataPath baselineDataPath = baseLineCellDataPath.createChildPath(ITKTestBase::k_BaselineDataPath);\n') - lines.append(' const Result<> readBaselineResult = ITKTestBase::ReadImage(dataStructure, baselineFilePath, baselineGeometryPath, baseLineCellDataPath, baselineDataPath);\n') + lines.append(' const Result<> readBaselineResult = ITKTestBase::ReadImage(dataStructure, baselineFilePath, baselineGeometryPath, ITKTestBase::k_ImageCellDataName, ITKTestBase::k_BaselineDataPath);\n') tolerance_str = f', {test.tolerance}' if test.tolerance else '' lines.append(f' Result<> compareResult = ITKTestBase::CompareImages(dataStructure, baselineGeometryPath, baselineDataPath, inputGeometryPath, cellDataPath.createChildPath(outputArrayName){tolerance_str});\n') lines.append(' SIMPLNX_RESULT_REQUIRE_VALID(compareResult)\n') diff --git a/src/Plugins/SimplnxCore/pipelines/ResamplePorosityImage.d3dpipeline b/src/Plugins/SimplnxCore/pipelines/ResamplePorosityImage.d3dpipeline index f11a3c7e24..07e2ae6f50 100644 --- a/src/Plugins/SimplnxCore/pipelines/ResamplePorosityImage.d3dpipeline +++ b/src/Plugins/SimplnxCore/pipelines/ResamplePorosityImage.d3dpipeline @@ -5,8 +5,8 @@ "pipeline": [ { "args": { - "cell_data_name": "Cell Data", - "image_data_array_path": "ImageData", + "cell_attribute_matrix_name": "Cell Data", + "image_data_array_name": "ImageData", "image_geometry_path": "Porosity_Image", "image_transform_choice": 0, "input_file_list_info": { diff --git a/src/Plugins/SimplnxCore/pipelines/SurfaceNets_Demo.d3dpipeline b/src/Plugins/SimplnxCore/pipelines/SurfaceNets_Demo.d3dpipeline index d99ba0faf1..1014716cf6 100644 --- a/src/Plugins/SimplnxCore/pipelines/SurfaceNets_Demo.d3dpipeline +++ b/src/Plugins/SimplnxCore/pipelines/SurfaceNets_Demo.d3dpipeline @@ -5,8 +5,8 @@ "pipeline": [ { "args": { - "cell_data_name": "Optical Data", - "image_data_array_path": "ImageData", + "cell_attribute_matrix_name": "Optical Data", + "image_data_array_name": "ImageData", "image_geometry_path": "RoboMet.3D Image Stack", "image_transform_choice": 0, "input_file_list_info": { diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/ApplyTransformationToGeometry.cpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/ApplyTransformationToGeometry.cpp index 666f957c2c..101be20193 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/ApplyTransformationToGeometry.cpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/ApplyTransformationToGeometry.cpp @@ -99,15 +99,18 @@ Result<> ApplyTransformationToGeometry::applyImageGeometryTransformation() const auto* srcDataArrayPtr = m_DataStructure.getDataAs(srcCelLDataAMPath.createChildPath(srcDataObject->getName())); auto* destDataArrayPtr = m_DataStructure.getDataAs(destCellDataAMPath.createChildPath(srcDataObject->getName())); - m_MessageHandler(fmt::format("Applying Transform || Copying Data Array {}", srcDataObject->getName())); if(m_InputValues->InterpolationSelection == k_NearestNeighborInterpolationIdx) { + m_MessageHandler(fmt::format("Applying Transform || Nearest Neighbor Interpolation {}", srcDataObject->getName())); + ExecuteParallelFunction(srcDataArrayPtr->getDataType(), taskRunner, srcDataArrayPtr, destDataArrayPtr, rotateArgs, m_TransformationMatrix, false, &filterProgressCallback); } else if(m_InputValues->InterpolationSelection == k_LinearInterpolationIdx) { + m_MessageHandler(fmt::format("Applying Transform || Trilinear Interpolation {}", srcDataObject->getName())); + ExecuteParallelFunction(srcDataArrayPtr->getDataType(), taskRunner, srcDataArrayPtr, destDataArrayPtr, rotateArgs, m_TransformationMatrix, &filterProgressCallback); } diff --git a/src/Plugins/SimplnxCore/test/MultiThresholdObjectsTest.cpp b/src/Plugins/SimplnxCore/test/MultiThresholdObjectsTest.cpp index ef6e2ccd1d..4bbf3e3e8d 100644 --- a/src/Plugins/SimplnxCore/test/MultiThresholdObjectsTest.cpp +++ b/src/Plugins/SimplnxCore/test/MultiThresholdObjectsTest.cpp @@ -15,12 +15,12 @@ const std::string k_TestArrayFloatName = "TestArrayFloat"; const std::string k_TestArrayIntName = "TestArrayInt"; const std::string k_ThresholdArrayName = "ThresholdArray"; -const DataPath k_ImageCellDataPath({k_ImageGeometry, k_CellData}); -const DataPath k_TestArrayFloatPath = k_ImageCellDataPath.createChildPath(k_TestArrayFloatName); -const DataPath k_TestArrayIntPath = k_ImageCellDataPath.createChildPath(k_TestArrayIntName); -const DataPath k_ThresholdArrayPath = k_ImageCellDataPath.createChildPath(k_ThresholdArrayName); +const DataPath k_ImageCellDataName({k_ImageGeometry, k_CellData}); +const DataPath k_TestArrayFloatPath = k_ImageCellDataName.createChildPath(k_TestArrayFloatName); +const DataPath k_TestArrayIntPath = k_ImageCellDataName.createChildPath(k_TestArrayIntName); +const DataPath k_ThresholdArrayPath = k_ImageCellDataName.createChildPath(k_ThresholdArrayName); -const DataPath k_MultiComponentArrayPath = k_ImageCellDataPath.createChildPath("MultiComponentArray"); +const DataPath k_MultiComponentArrayPath = k_ImageCellDataName.createChildPath("MultiComponentArray"); const DataPath k_MismatchingTuplesArrayPath({"MismatchingTuplesArray"}); DataStructure CreateTestDataStructure() diff --git a/src/simplnx/Common/Result.hpp b/src/simplnx/Common/Result.hpp index 10427c489c..a2b15a7deb 100644 --- a/src/simplnx/Common/Result.hpp +++ b/src/simplnx/Common/Result.hpp @@ -163,7 +163,7 @@ Result ConvertResultTo(Result<>&& fromResult, T&& value) } else { - // Plase errors from 'result' into outputActions + // Place errors from 'result' into outputActions convertedResult.m_Expected = nonstd::make_unexpected(std::move(fromResult.errors())); } // Always move the warnings AFTER the other check above... diff --git a/src/simplnx/Filter/IFilter.cpp b/src/simplnx/Filter/IFilter.cpp index 45d1fc6698..6b76ed0b13 100644 --- a/src/simplnx/Filter/IFilter.cpp +++ b/src/simplnx/Filter/IFilter.cpp @@ -101,7 +101,8 @@ Result<> ValidateParameter(std::string_view name, const AnyParameter& parameter, acceptedTypesStr << " " << acceptedType.name() << std::endl; } throw std::invalid_argument(fmt::format("A mismatch between the argument types for a parameter was detected. This can happen if the improper type is specified when creating a parameter " - "argument.\n Filter='{}'\n Parameter Name:'{}'\n Argument Name='{}'\n Argument Type: '{}'.\n The accepted types for this parameter are:\n", + "argument or if this filter is being called from another filter where the other filter is NOT using the correct parameter type.\n Filter='{}'\n " + "Parameter Name:'{}'\n Argument Name='{}'\n Argument Type: '{}'.\n The accepted types for this parameter are:\n", filter.humanName(), parameter->humanName(), name, arg.type().name(), acceptedTypesStr.str())); } diff --git a/src/simplnx/Utilities/ImageRotationUtilities.cpp b/src/simplnx/Utilities/ImageRotationUtilities.cpp index fb320e03de..712fbac877 100644 --- a/src/simplnx/Utilities/ImageRotationUtilities.cpp +++ b/src/simplnx/Utilities/ImageRotationUtilities.cpp @@ -92,9 +92,22 @@ ImageRotationUtilities::RotateArgs CreateRotationArgs(const ImageGeom& imageGeom const float yResNew = DetermineSpacing(spacing, yAxisNew); const float zResNew = DetermineSpacing(spacing, zAxisNew); - const IGeometry::MeshIndexType xpNew = static_cast(std::nearbyint((minMaxCoords[1] - minMaxCoords[0]) / xResNew)); - const IGeometry::MeshIndexType ypNew = static_cast(std::nearbyint((minMaxCoords[3] - minMaxCoords[2]) / yResNew)); - const IGeometry::MeshIndexType zpNew = static_cast(std::nearbyint((minMaxCoords[5] - minMaxCoords[4]) / zResNew)); + IGeometry::MeshIndexType xpNew = static_cast(std::nearbyint((minMaxCoords[1] - minMaxCoords[0]) / xResNew)); + IGeometry::MeshIndexType ypNew = static_cast(std::nearbyint((minMaxCoords[3] - minMaxCoords[2]) / yResNew)); + IGeometry::MeshIndexType zpNew = static_cast(std::nearbyint((minMaxCoords[5] - minMaxCoords[4]) / zResNew)); + + if(xpNew == 0) + { + xpNew = static_cast(1); + } + if(ypNew == 0) + { + ypNew = static_cast(1); + } + if(zpNew == 0) + { + zpNew = static_cast(1); + } ImageRotationUtilities::RotateArgs params; diff --git a/wrapping/python/examples/pipelines/ITKImageProcessing/02_Image_Segmentation.py b/wrapping/python/examples/pipelines/ITKImageProcessing/02_Image_Segmentation.py index 40e617aa2c..c74431bd0d 100644 --- a/wrapping/python/examples/pipelines/ITKImageProcessing/02_Image_Segmentation.py +++ b/wrapping/python/examples/pipelines/ITKImageProcessing/02_Image_Segmentation.py @@ -28,8 +28,8 @@ # Execute Filter with Parameters result = nx_filter.execute( data_structure=data_structure, - cell_data_name="Cell Data", - image_data_array_path="ImageData", + cell_attribute_matrix_name="Cell Data", + image_data_array_name="ImageData", image_geometry_path=nx.DataPath("ImageDataContainer"), image_transform_choice=0, input_file_list_info=generated_file_list_value, diff --git a/wrapping/python/examples/pipelines/ITKImageProcessing/03_Porosity_Mesh_Export.py b/wrapping/python/examples/pipelines/ITKImageProcessing/03_Porosity_Mesh_Export.py index 575ed35e19..1ede7be86d 100644 --- a/wrapping/python/examples/pipelines/ITKImageProcessing/03_Porosity_Mesh_Export.py +++ b/wrapping/python/examples/pipelines/ITKImageProcessing/03_Porosity_Mesh_Export.py @@ -29,8 +29,8 @@ # Execute Filter with Parameters result = nx_filter.execute( data_structure=data_structure, - cell_data_name="Cell Data", - image_data_array_path="ImageData", + cell_attribute_matrix_name="Cell Data", + image_data_array_name="ImageData", image_geometry_path=nx.DataPath("ImageDataContainer"), image_transform_choice=0, input_file_list_info=generated_file_list_value, diff --git a/wrapping/python/examples/pipelines/Simplnx/ResamplePorosityImage.py b/wrapping/python/examples/pipelines/Simplnx/ResamplePorosityImage.py index 41d7127145..32958a755f 100644 --- a/wrapping/python/examples/pipelines/Simplnx/ResamplePorosityImage.py +++ b/wrapping/python/examples/pipelines/Simplnx/ResamplePorosityImage.py @@ -28,8 +28,8 @@ # Execute Filter with Parameters result = nx_filter.execute( data_structure=data_structure, - cell_data_name="Cell Data", - image_data_array_path="ImageData", + cell_attribute_matrix_name="Cell Data", + image_data_array_name="ImageData", image_geometry_path=nx.DataPath("Porosity_Image"), image_transform_choice=0, input_file_list_info=generated_file_list_value, diff --git a/wrapping/python/examples/pipelines/Simplnx/SurfaceNets_Demo.py b/wrapping/python/examples/pipelines/Simplnx/SurfaceNets_Demo.py index 0cec901983..b40b39e6df 100644 --- a/wrapping/python/examples/pipelines/Simplnx/SurfaceNets_Demo.py +++ b/wrapping/python/examples/pipelines/Simplnx/SurfaceNets_Demo.py @@ -28,8 +28,8 @@ # Execute Filter with Parameters result = nx_filter.execute( data_structure=data_structure, - cell_data_name="Optical Data", - image_data_array_path="Image Data", + cell_attribute_matrix_name="Optical Data", + image_data_array_name="Image Data", image_geometry_path=nx.DataPath("RoboMet.3D Image Stack"), image_transform_choice=0, input_file_list_info=generated_file_list_value, diff --git a/wrapping/python/examples/scripts/basic_arrays.py b/wrapping/python/examples/scripts/basic_arrays.py index 3161f8a133..3685c68c7a 100644 --- a/wrapping/python/examples/scripts/basic_arrays.py +++ b/wrapping/python/examples/scripts/basic_arrays.py @@ -94,9 +94,6 @@ name_change = data_path.with_name("NEW NAME") print(f'name_change: {name_change}' ) - -quit() - # Create a Data Structure data_structure = nx.DataStructure() @@ -227,3 +224,10 @@ print(f'data_structure.size: {data_structure.size}') +print(f'Removing Data Array') +result = nx.DeleteData.execute(data_structure=data_structure, + removed_data_path=[nx.DataPath("Group/1D Array")]) +nxtest.check_filter_result(nx.WriteDREAM3DFilter, result) +# This will generate the hierarchy as an ASCI Formatted string. +hierarchy_as_str = data_structure.hierarchy_to_str() +print(hierarchy_as_str) diff --git a/wrapping/python/examples/scripts/generated_file_list.py b/wrapping/python/examples/scripts/generated_file_list.py index f8b02e2fc3..fb015389e8 100644 --- a/wrapping/python/examples/scripts/generated_file_list.py +++ b/wrapping/python/examples/scripts/generated_file_list.py @@ -66,10 +66,10 @@ generated_file_list_value.padding_digits = 2 result = nxitk.ITKImportImageStack.execute(data_structure=data_structure, - cell_data_name="Cell Data", - image_data_array_path="Image Data", - image_geometry_path=nx.DataPath(["Image Stack"]), - image_transform_choice=0, + cell_attribute_matrix_name="Cell Data", + image_data_array_name="Image Data", + image_geometry_path=nx.DataPath(["Image Stack"]), + image_transform_choice=0, input_file_list_info=generated_file_list_value, origin=[0., 0., 0.], spacing=[1., 1.,1.])