Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,14 @@ option(SIMPLNX_DOWNLOAD_TEST_FILES "Download the test files" ON)
# ------------------------------------------------------------------------------
option(SIMPLNX_WRITE_TEST_OUTPUT "Write unit test output files" OFF)

# ------------------------------------------------------------------------------
# Controls which algorithm paths are exercised by dual-dispatch unit tests.
# 0 (Both) - tests run with forceOoc=false AND forceOoc=true (default)
# 1 (OocOnly) - tests run with forceOoc=true only (use for OOC builds)
# 2 (InCoreOnly) - tests run with forceOoc=false only (quick validation)
# ------------------------------------------------------------------------------
set(SIMPLNX_TEST_ALGORITHM_PATH "0" CACHE STRING "Algorithm paths to test: 0=Both, 1=OocOnly, 2=InCoreOnly")

# ------------------------------------------------------------------------------
# Is the SimplnxCore Plugin enabled [DEFAULT=ON]
# ------------------------------------------------------------------------------
Expand Down Expand Up @@ -255,6 +263,7 @@ if(SIMPLNX_ENABLE_MULTICORE)
target_link_libraries(simplnx PUBLIC TBB::tbb)
endif()


target_link_libraries(simplnx
PUBLIC
fmt::fmt
Expand Down Expand Up @@ -458,6 +467,7 @@ set(SIMPLNX_HDRS
${SIMPLNX_SOURCE_DIR}/DataStructure/DynamicListArray.hpp
${SIMPLNX_SOURCE_DIR}/DataStructure/EmptyDataStore.hpp
${SIMPLNX_SOURCE_DIR}/DataStructure/EmptyListStore.hpp
${SIMPLNX_SOURCE_DIR}/DataStructure/EmptyStringStore.hpp
${SIMPLNX_SOURCE_DIR}/DataStructure/IArray.hpp
${SIMPLNX_SOURCE_DIR}/DataStructure/IDataArray.hpp
${SIMPLNX_SOURCE_DIR}/DataStructure/IDataStore.hpp
Expand Down Expand Up @@ -539,6 +549,7 @@ set(SIMPLNX_HDRS
${SIMPLNX_SOURCE_DIR}/Utilities/DataGroupUtilities.hpp
${SIMPLNX_SOURCE_DIR}/Utilities/DataObjectUtilities.hpp
${SIMPLNX_SOURCE_DIR}/Utilities/DataStoreUtilities.hpp
${SIMPLNX_SOURCE_DIR}/Utilities/AlgorithmDispatch.hpp
${SIMPLNX_SOURCE_DIR}/Utilities/FilePathGenerator.hpp
${SIMPLNX_SOURCE_DIR}/Utilities/ColorTableUtilities.hpp
${SIMPLNX_SOURCE_DIR}/Utilities/FileUtilities.hpp
Expand Down
1 change: 1 addition & 0 deletions cmake/Plugin.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -383,6 +383,7 @@ function(create_simplnx_plugin_unit_test)
target_compile_definitions(${UNIT_TEST_TARGET}
PRIVATE
SIMPLNX_BUILD_DIR="$<TARGET_FILE_DIR:simplnx_test>"
SIMPLNX_TEST_ALGORITHM_PATH=${SIMPLNX_TEST_ALGORITHM_PATH}
)

target_compile_options(${UNIT_TEST_TARGET}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -855,7 +855,7 @@ Result<OutputActions> DataCheck(const DataStructure& dataStructure, const DataPa
const auto& inputArray = dataStructure.getDataRefAs<IDataArray>(inputArrayPath);
const auto& inputDataStore = inputArray.getIDataStoreRef();

if(!inputArray.getDataFormat().empty())
if(inputArray.getStoreType() == IDataStore::StoreType::OutOfCore)
{
return MakeErrorResult<OutputActions>(Constants::k_OutOfCoreDataNotSupported,
fmt::format("Input Array '{}' utilizes out-of-core data. This is not supported within ITK filters.", inputArrayPath.toString()));
Expand All @@ -877,7 +877,7 @@ Result<detail::ITKFilterFunctorResult_t<FilterCreationFunctorT>> Execute(DataStr

using ResultT = detail::ITKFilterFunctorResult_t<FilterCreationFunctorT>;

if(!inputArray.getDataFormat().empty())
if(inputArray.getStoreType() == IDataStore::StoreType::OutOfCore)
{
return MakeErrorResult(Constants::k_OutOfCoreDataNotSupported, fmt::format("Input Array '{}' utilizes out-of-core data. This is not supported within ITK filters.", inputArrayPath.toString()));
}
Expand Down
44 changes: 2 additions & 42 deletions src/Plugins/ITKImageProcessing/test/ITKTestBase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ std::string ComputeMD5HashTyped(const IDataArray& outputDataArray)
usize arraySize = dataArray.getSize();

MD5 md5;
if(outputDataArray.getDataFormat().empty())
if(outputDataArray.getIDataStoreRef().getStoreType() != IDataStore::StoreType::OutOfCore)
{
const T* dataPtr = dataArray.template getIDataStoreRefAs<DataStore<T>>().data();
md5.update(reinterpret_cast<const uint8*>(dataPtr), arraySize * sizeof(T));
Expand Down Expand Up @@ -135,47 +135,7 @@ namespace ITKTestBase
bool IsArrayInMemory(DataStructure& dataStructure, const DataPath& outputDataPath)
{
const auto& outputDataArray = dataStructure.getDataRefAs<IDataArray>(outputDataPath);
DataType outputDataType = outputDataArray.getDataType();

switch(outputDataType)
{
case DataType::float32: {
return dynamic_cast<const DataArray<float32>&>(outputDataArray).getDataFormat().empty();
}
case DataType::float64: {
return dynamic_cast<const DataArray<float64>&>(outputDataArray).getDataFormat().empty();
}
case DataType::int8: {
return dynamic_cast<const DataArray<int8>&>(outputDataArray).getDataFormat().empty();
}
case DataType::uint8: {
return dynamic_cast<const DataArray<uint8>&>(outputDataArray).getDataFormat().empty();
}
case DataType::int16: {
return dynamic_cast<const DataArray<int16>&>(outputDataArray).getDataFormat().empty();
}
case DataType::uint16: {
return dynamic_cast<const DataArray<uint16>&>(outputDataArray).getDataFormat().empty();
}
case DataType::int32: {
return dynamic_cast<const DataArray<int32>&>(outputDataArray).getDataFormat().empty();
}
case DataType::uint32: {
return dynamic_cast<const DataArray<uint32>&>(outputDataArray).getDataFormat().empty();
}
case DataType::int64: {
return dynamic_cast<const DataArray<int64>&>(outputDataArray).getDataFormat().empty();
}
case DataType::uint64: {
return dynamic_cast<const DataArray<uint64>&>(outputDataArray).getDataFormat().empty();
}
case DataType::boolean: {
[[fallthrough]];
}
default: {
return {};
}
}
return outputDataArray.getIDataStoreRef().getStoreType() != IDataStore::StoreType::OutOfCore;
}
//------------------------------------------------------------------------------
std::string ComputeMd5Hash(DataStructure& dataStructure, const DataPath& outputDataPath)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,8 @@ IFilter::PreflightResult ComputeFZQuaternionsFilter::preflightImpl(const DataStr

nx::core::Result<OutputActions> resultOutputActions;

auto createArrayAction = std::make_unique<CreateArrayAction>(nx::core::DataType::float32, quatArray.getDataStore()->getTupleShape(), quatArray.getDataStore()->getComponentShape(),
pFZQuatsArrayPathValue, CreateArrayAction::k_DefaultDataFormat, "0.0");
auto createArrayAction =
std::make_unique<CreateArrayAction>(nx::core::DataType::float32, quatArray.getDataStore()->getTupleShape(), quatArray.getDataStore()->getComponentShape(), pFZQuatsArrayPathValue, "", "0.0");
resultOutputActions.value().appendAction(std::move(createArrayAction));

// Return both the resultOutputActions and the preflightUpdatedValues via std::move()
Expand Down
6 changes: 2 additions & 4 deletions src/Plugins/OrientationAnalysis/test/ComputeIPFColorsTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,7 @@ TEST_CASE("OrientationAnalysis::ComputeIPFColors", "[OrientationAnalysis][Comput
// This test file was produced by SIMPL/DREAM3D. our results should match theirs
auto exemplarFilePath = fs::path(fmt::format("{}/so3_cubic_high_ipf_001.dream3d", unit_test::k_TestFilesDir));
REQUIRE(fs::exists(exemplarFilePath));
auto result = DREAM3D::ImportDataStructureFromFile(exemplarFilePath, false);
REQUIRE(result.valid());
dataStructure = result.value();
dataStructure = UnitTest::LoadDataStructure(exemplarFilePath);
}

// Instantiate the filter, a DataStructure object and an Arguments Object
Expand Down Expand Up @@ -113,7 +111,7 @@ TEST_CASE("OrientationAnalysis::ComputeIPFColors", "[OrientationAnalysis][Comput
SIMPLNX_RESULT_REQUIRE_VALID(executeResult.result);
{
// Write out the DataStructure for later viewing/debugging
auto fileWriter = nx::core::HDF5::FileIO::WriteFile(std::filesystem::path(fmt::format("{}/ComputeIPFColors_Test.dream3d", unit_test::k_BinaryTestOutputDir)));
auto fileWriter = nx::core::HDF5::FileIO::WriteFile(fs::path(fmt::format("{}/ComputeIPFColors_Test.dream3d", unit_test::k_BinaryTestOutputDir)));
auto resultH5 = HDF5::DataStructureWriter::WriteFile(dataStructure, fileWriter);
SIMPLNX_RESULT_REQUIRE_VALID(resultH5);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ TEST_CASE("OrientationAnalysis::RodriguesConvertorFilter", "[OrientationAnalysis
(*exemplarData)[9] = 0.573462F;
(*exemplarData)[10] = 0.655386F;
(*exemplarData)[11] = 12.2066F;
(*exemplarData)[12] = 0.517892F;
(*exemplarData)[13] = 0.575435F;
(*exemplarData)[14] = 0.632979F;
(*exemplarData)[15] = 17.37815F;
{
// Instantiate the filter, a DataStructure object and an Arguments Object
const RodriguesConvertorFilter filter;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#include "ComputeArrayStatistics.hpp"

#include "simplnx/DataStructure/AttributeMatrix.hpp"
#include "simplnx/DataStructure/IDataStore.hpp"
#include "simplnx/Utilities/DataArrayUtilities.hpp"
#include "simplnx/Utilities/FilterUtilities.hpp"
#include "simplnx/Utilities/HistogramUtilities.hpp"
Expand Down Expand Up @@ -31,7 +32,7 @@ bool CheckArraysInMemory(const nx::core::IParallelAlgorithm::AlgorithmArrays& ar
continue;
}

if(!arrayPtr->getIDataStoreRef().getDataFormat().empty())
if(arrayPtr->getIDataStoreRef().getStoreType() == nx::core::IDataStore::StoreType::OutOfCore)
{
return false;
}
Expand Down
Loading
Loading