From 491c58140513f591be857521fe40d9d0f449c061 Mon Sep 17 00:00:00 2001 From: Michael Jackson Date: Thu, 25 Jan 2024 20:00:19 -0500 Subject: [PATCH] Update test files Signed-off-by: Michael Jackson --- .../Filters/Algorithms/WritePoleFigure.cpp | 4 +-- .../OrientationAnalysis/test/CMakeLists.txt | 2 +- .../test/WritePoleFigureTest.cpp | 28 +++++++++---------- .../Algorithms/WriteAbaqusHexahedron.cpp | 6 ++-- 4 files changed, 20 insertions(+), 20 deletions(-) diff --git a/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/Algorithms/WritePoleFigure.cpp b/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/Algorithms/WritePoleFigure.cpp index 385e3bd70a..a52f2f0b8b 100644 --- a/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/Algorithms/WritePoleFigure.cpp +++ b/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/Algorithms/WritePoleFigure.cpp @@ -670,7 +670,7 @@ Result<> WritePoleFigure::operator()() tupleShape[1] = pageHeight; tupleShape[2] = pageWidth; // Create an output array to hold the RGB formatted color image - auto imageArrayPath = cellAttrMatPath.createChildPath(fmt::format("{}Phase_{}", m_InputValues->ImagePrefix, phase)); + auto imageArrayPath = cellAttrMatPath.createChildPath(fmt::format("PoleFigure_Phase_{}", phase)); auto arrayCreationResult = nx::core::CreateArray(m_DataStructure, tupleShape, {3ULL}, imageArrayPath, IDataAction::Mode::Execute); if(arrayCreationResult.invalid()) { @@ -692,7 +692,7 @@ Result<> WritePoleFigure::operator()() // Write out the full RGBA data if(m_InputValues->WriteImageToDisk) { - const std::string filename = fmt::format("{}/{}Phase_{}.tiff", m_InputValues->OutputPath.string(), m_InputValues->ImagePrefix, phase); + const std::string filename = fmt::format("{}/{}_Phase_{}.tiff", m_InputValues->OutputPath.string(), m_InputValues->ImagePrefix, phase); auto result = TiffWriter::WriteImage(filename, pageWidth, pageHeight, 4, rgbaCanvasImage.data()); if(result.first < 0) { diff --git a/src/Plugins/OrientationAnalysis/test/CMakeLists.txt b/src/Plugins/OrientationAnalysis/test/CMakeLists.txt index 1be70b2eb4..abd451aa71 100644 --- a/src/Plugins/OrientationAnalysis/test/CMakeLists.txt +++ b/src/Plugins/OrientationAnalysis/test/CMakeLists.txt @@ -123,7 +123,7 @@ if(EXISTS "${DREAM3D_DATA_DIR}" AND SIMPLNX_DOWNLOAD_TEST_FILES) download_test_data(DREAM3D_DATA_DIR ${DREAM3D_DATA_DIR} ARCHIVE_NAME 6_6_ebsd_segment_features.tar.gz SHA512 acbb493a0668e0115ac49d4fedbbf7600759b9a66deb5d1004c2749a61d2bad2fcc60344bf72b2aeda5c8c098f458949dd1f8d58cb21682fa1393dfb7d0a1b84) download_test_data(DREAM3D_DATA_DIR ${DREAM3D_DATA_DIR} ARCHIVE_NAME 6_6_find_gbcd_metric_based.tar.gz SHA512 46032c758acc982eccaff38c3252a4f063b6ff5dc9ba3f33ed7f123c6f10771e1a2bdcbff8aab0fae7c91c03bb6025f49f0edbb085b3946b93b87980d31e4543) download_test_data(DREAM3D_DATA_DIR ${DREAM3D_DATA_DIR} ARCHIVE_NAME 6_6_stats_test.tar.gz SHA512 cb1d1c004ab5a3cb29cc10f7b6c291dd5819e57e303242b8162cd0b268dea24b1d3e5e3811ec4f5ee216179b6eb6b81c76ee7d37b7c49e83c6ab336147b4b14e) - download_test_data(DREAM3D_DATA_DIR ${DREAM3D_DATA_DIR} ARCHIVE_NAME PoleFigure_Exemplars.tar.gz SHA512 7c90c69020a4fd4de10da81c1bc87499f5aededca57f3fc1aae3c60aad344cab1bdad2927d957a8d5848aca599028a9ade532dabc784f099bce2de39f61060e9) + download_test_data(DREAM3D_DATA_DIR ${DREAM3D_DATA_DIR} ARCHIVE_NAME PoleFigure_Exemplars_v2.tar.gz SHA512 d325ab4cf16d3755c283f25e6ec8a5195cdc188e79a418dbd95016d22350ace2ba9593339ef4294c5a0482a3864ac909dc7ac38a81d882328d2eb823a5091b27) download_test_data(DREAM3D_DATA_DIR ${DREAM3D_DATA_DIR} ARCHIVE_NAME Small_IN100_Ang_Files.tar.gz SHA512 79e9f6948d4e8e06187e11216a67596fa786ffd2700e51f594ad014090383eb8bcc003e14de2e88082aa9ae512cc4fc9cee22c80066fc54f38c3ebc75267eb5b) download_test_data(DREAM3D_DATA_DIR ${DREAM3D_DATA_DIR} ARCHIVE_NAME Small_IN100_dream3d.tar.gz SHA512 6dd8a3412532bdc7481f7781c7087b4477c6a1efbe6b214f997dad30c53c59714a751be522f084b98065fe75100c74df901bb8af2f512ef47344d8f7941575cf) download_test_data(DREAM3D_DATA_DIR ${DREAM3D_DATA_DIR} ARCHIVE_NAME Small_IN100_h5ebsd.tar.gz SHA512 31e606285ea9e8235dcb5f608fd2b252a5ab1492abd975e5ec33a21d083aa9720fe16fb8f752742c140f40e963d692f1a46256b9d36e96b1b09796c1e4ea3db9) diff --git a/src/Plugins/OrientationAnalysis/test/WritePoleFigureTest.cpp b/src/Plugins/OrientationAnalysis/test/WritePoleFigureTest.cpp index 76e48687f7..37f0cb7e4f 100644 --- a/src/Plugins/OrientationAnalysis/test/WritePoleFigureTest.cpp +++ b/src/Plugins/OrientationAnalysis/test/WritePoleFigureTest.cpp @@ -27,10 +27,10 @@ TEST_CASE("OrientationAnalysis::WritePoleFigureFilter-1", "[OrientationAnalysis] { Application::GetOrCreateInstance()->loadPlugins(unit_test::k_BuildDir.view(), true); - const nx::core::UnitTest::TestFileSentinel testDataSentinel(nx::core::unit_test::k_CMakeExecutable, nx::core::unit_test::k_TestFilesDir, "PoleFigure_Exemplars.tar.gz", "PoleFigure_Exemplars"); + const nx::core::UnitTest::TestFileSentinel testDataSentinel(nx::core::unit_test::k_CMakeExecutable, nx::core::unit_test::k_TestFilesDir, "PoleFigure_Exemplars_v2.tar.gz", "PoleFigure_Exemplars_v2"); // Read the Small IN100 Data set - auto baseDataFilePath = fs::path(fmt::format("{}/PoleFigure_Exemplars/fw-ar-IF1-aptr12-corr.dream3d", unit_test::k_TestFilesDir)); + auto baseDataFilePath = fs::path(fmt::format("{}/PoleFigure_Exemplars_v2/fw-ar-IF1-aptr12-corr.dream3d", unit_test::k_TestFilesDir)); DataStructure dataStructure = UnitTest::LoadDataStructure(baseDataFilePath); // Instantiate the filter, a DataStructure object and an Arguments Object @@ -51,8 +51,8 @@ TEST_CASE("OrientationAnalysis::WritePoleFigureFilter-1", "[OrientationAnalysis] args.insertOrAssign(WritePoleFigureFilter::k_UseMask_Key, std::make_any(false)); args.insertOrAssign(WritePoleFigureFilter::k_ImageGeometryPath_Key, std::make_any(DataPath({"fw-ar-IF1-aptr12-corr Discrete Pole Figure [CALCULATED]"}))); - DataPath calculatedImageData({"fw-ar-IF1-aptr12-corr Discrete Pole Figure [CALCULATED]", "CellData", fmt::format("{}Phase_{}", k_ImagePrefix, 1)}); - DataPath exemplarImageData({"fw-ar-IF1-aptr12-corr Discrete Pole Figure", "CellData", "Image"}); + DataPath calculatedImageData({"fw-ar-IF1-aptr12-corr Discrete Pole Figure [CALCULATED]", "CellData", fmt::format("PoleFigure_Phase_{}", 1)}); + DataPath exemplarImageData({"fw-ar-IF1-aptr12-corr Discrete Pole Figure", "CellData", "PoleFigure_Phase_1"}); args.insertOrAssign(WritePoleFigureFilter::k_CellEulerAnglesArrayPath_Key, std::make_any(DataPath({"fw-ar-IF1-aptr12-corr", "Cell Data", "EulerAngles"}))); args.insertOrAssign(WritePoleFigureFilter::k_CellPhasesArrayPath_Key, std::make_any(DataPath({"fw-ar-IF1-aptr12-corr", "Cell Data", "Phases"}))); @@ -67,9 +67,9 @@ TEST_CASE("OrientationAnalysis::WritePoleFigureFilter-1", "[OrientationAnalysis] // Execute the filter and check the result auto executeResult = filter.execute(dataStructure, args); SIMPLNX_RESULT_REQUIRE_VALID(executeResult.result); -#ifdef SIMPLNX_WRITE_TEST_OUTPUT + // #ifdef SIMPLNX_WRITE_TEST_OUTPUT WriteTestDataStructure(dataStructure, fmt::format("{}/write_pole_figure-1.dream3d", unit_test::k_BinaryTestOutputDir)); -#endif + // #endif CompareArrays(dataStructure, exemplarImageData, calculatedImageData); } @@ -78,10 +78,10 @@ TEST_CASE("OrientationAnalysis::WritePoleFigureFilter-2", "[OrientationAnalysis] { Application::GetOrCreateInstance()->loadPlugins(unit_test::k_BuildDir.view(), true); - const nx::core::UnitTest::TestFileSentinel testDataSentinel(nx::core::unit_test::k_CMakeExecutable, nx::core::unit_test::k_TestFilesDir, "PoleFigure_Exemplars.tar.gz", "PoleFigure_Exemplars"); + const nx::core::UnitTest::TestFileSentinel testDataSentinel(nx::core::unit_test::k_CMakeExecutable, nx::core::unit_test::k_TestFilesDir, "PoleFigure_Exemplars_v2.tar.gz", "PoleFigure_Exemplars_v2"); // Read the Small IN100 Data set - auto baseDataFilePath = fs::path(fmt::format("{}/PoleFigure_Exemplars/fw-ar-IF1-aptr12-corr.dream3d", unit_test::k_TestFilesDir)); + auto baseDataFilePath = fs::path(fmt::format("{}/PoleFigure_Exemplars_v2/fw-ar-IF1-aptr12-corr.dream3d", unit_test::k_TestFilesDir)); DataStructure dataStructure = UnitTest::LoadDataStructure(baseDataFilePath); // Instantiate the filter, a DataStructure object and an Arguments Object @@ -102,8 +102,8 @@ TEST_CASE("OrientationAnalysis::WritePoleFigureFilter-2", "[OrientationAnalysis] args.insertOrAssign(WritePoleFigureFilter::k_UseMask_Key, std::make_any(true)); args.insertOrAssign(WritePoleFigureFilter::k_ImageGeometryPath_Key, std::make_any(DataPath({"fw-ar-IF1-aptr12-corr Discrete Pole Figure Masked [CALCULATED]"}))); - DataPath calculatedImageData({"fw-ar-IF1-aptr12-corr Discrete Pole Figure Masked [CALCULATED]", "CellData", fmt::format("{}Phase_{}", k_ImagePrefix, 1)}); - DataPath exemplarImageData({"fw-ar-IF1-aptr12-corr Discrete Pole Figure Masked", "CellData", "Image"}); + DataPath calculatedImageData({"fw-ar-IF1-aptr12-corr Discrete Pole Figure Masked [CALCULATED]", "CellData", fmt::format("PoleFigure_Phase_{}", 1)}); + DataPath exemplarImageData({"fw-ar-IF1-aptr12-corr Discrete Pole Figure Masked", "CellData", "PoleFigure_Phase_1"}); args.insertOrAssign(WritePoleFigureFilter::k_CellEulerAnglesArrayPath_Key, std::make_any(DataPath({"fw-ar-IF1-aptr12-corr", "Cell Data", "EulerAngles"}))); args.insertOrAssign(WritePoleFigureFilter::k_CellPhasesArrayPath_Key, std::make_any(DataPath({"fw-ar-IF1-aptr12-corr", "Cell Data", "Phases"}))); @@ -130,10 +130,10 @@ TEST_CASE("OrientationAnalysis::WritePoleFigureFilter-3", "[OrientationAnalysis] { Application::GetOrCreateInstance()->loadPlugins(unit_test::k_BuildDir.view(), true); - const nx::core::UnitTest::TestFileSentinel testDataSentinel(nx::core::unit_test::k_CMakeExecutable, nx::core::unit_test::k_TestFilesDir, "PoleFigure_Exemplars.tar.gz", "PoleFigure_Exemplars"); + const nx::core::UnitTest::TestFileSentinel testDataSentinel(nx::core::unit_test::k_CMakeExecutable, nx::core::unit_test::k_TestFilesDir, "PoleFigure_Exemplars_v2.tar.gz", "PoleFigure_Exemplars_v2"); // Read the Small IN100 Data set - auto baseDataFilePath = fs::path(fmt::format("{}/PoleFigure_Exemplars/fw-ar-IF1-aptr12-corr.dream3d", unit_test::k_TestFilesDir)); + auto baseDataFilePath = fs::path(fmt::format("{}/PoleFigure_Exemplars_v2/fw-ar-IF1-aptr12-corr.dream3d", unit_test::k_TestFilesDir)); DataStructure dataStructure = UnitTest::LoadDataStructure(baseDataFilePath); // Instantiate the filter, a DataStructure object and an Arguments Object @@ -154,8 +154,8 @@ TEST_CASE("OrientationAnalysis::WritePoleFigureFilter-3", "[OrientationAnalysis] args.insertOrAssign(WritePoleFigureFilter::k_UseMask_Key, std::make_any(true)); args.insertOrAssign(WritePoleFigureFilter::k_ImageGeometryPath_Key, std::make_any(DataPath({"fw-ar-IF1-aptr12-corr Discrete Pole Figure Masked Color [CALCULATED]"}))); - DataPath calculatedImageData({"fw-ar-IF1-aptr12-corr Discrete Pole Figure Masked Color [CALCULATED]", "CellData", fmt::format("{}Phase_{}", k_ImagePrefix, 1)}); - DataPath exemplarImageData({"fw-ar-IF1-aptr12-corr Discrete Pole Figure Masked Color", "CellData", "Image"}); + DataPath calculatedImageData({"fw-ar-IF1-aptr12-corr Discrete Pole Figure Masked Color [CALCULATED]", "CellData", fmt::format("PoleFigure_Phase_{}", 1)}); + DataPath exemplarImageData({"fw-ar-IF1-aptr12-corr Discrete Pole Figure Masked Color", "CellData", "PoleFigure_Phase_1"}); args.insertOrAssign(WritePoleFigureFilter::k_CellEulerAnglesArrayPath_Key, std::make_any(DataPath({"fw-ar-IF1-aptr12-corr", "Cell Data", "EulerAngles"}))); args.insertOrAssign(WritePoleFigureFilter::k_CellPhasesArrayPath_Key, std::make_any(DataPath({"fw-ar-IF1-aptr12-corr", "Cell Data", "Phases"}))); diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/WriteAbaqusHexahedron.cpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/WriteAbaqusHexahedron.cpp index ecaf8c8bbf..6b3e499838 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/WriteAbaqusHexahedron.cpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/WriteAbaqusHexahedron.cpp @@ -96,7 +96,7 @@ int32 writeNodes(WriteAbaqusHexahedron* filter, const std::string& fileName, usi int64 milliDiff = std::chrono::duration_cast(now - initialTime).count(); if(milliDiff > 1000) { - std::string percentage = "Writing Nodes (File 1/5) " + StringUtilities::number(static_cast((float32)(nodeIndex) / (float32)(totalPoints)*100)) + "% Completed "; + std::string percentage = "Writing Nodes (File 1/5) " + StringUtilities::number(static_cast((float32)(nodeIndex) / (float32)(totalPoints) * 100)) + "% Completed "; float32 timeDiff = ((float32)nodeIndex / (float32)(milliDiff)); int64 estimatedTime = (float32)(totalPoints - nodeIndex) / timeDiff; std::string timeRemaining = " || Est. Time Remain: " + format_duration(std::chrono::milliseconds(estimatedTime)); @@ -160,7 +160,7 @@ int32 writeElems(WriteAbaqusHexahedron* filter, const std::string& fileName, con int64 milliDiff = std::chrono::duration_cast(now - initialTime).count(); if(milliDiff > 1000) { - std::string percentage = "Writing Elements (File 2/5) " + StringUtilities::number(static_cast((float32)(index) / (float32)(totalPoints)*100)) + "% Completed "; + std::string percentage = "Writing Elements (File 2/5) " + StringUtilities::number(static_cast((float32)(index) / (float32)(totalPoints) * 100)) + "% Completed "; float32 timeDiff = ((float32)index / (float32)(milliDiff)); int64 estimatedTime = (float32)(totalPoints - index) / timeDiff; std::string timeRemaining = " || Est. Time Remain: " + format_duration(std::chrono::milliseconds(estimatedTime)); @@ -240,7 +240,7 @@ int32 writeElset(WriteAbaqusHexahedron* filter, const std::string& fileName, siz int64 milliDiff = std::chrono::duration_cast(now - initialTime).count(); if(milliDiff > 1000) { - std::string percentage = "Writing Element Sets (File 4/5) " + StringUtilities::number(static_cast((float32)(voxelId) / (float32)(maxGrainId)*100)) + "% Completed "; + std::string percentage = "Writing Element Sets (File 4/5) " + StringUtilities::number(static_cast((float32)(voxelId) / (float32)(maxGrainId) * 100)) + "% Completed "; float32 timeDiff = ((float32)voxelId / (float32)(milliDiff)); auto estimatedTime = static_cast((float32)(maxGrainId - voxelId) / timeDiff); std::string timeRemaining = " || Est. Time Remain: " + format_duration(std::chrono::milliseconds(estimatedTime));