From fc99e7a10e7afe43150846e307b82d0faf984f6c Mon Sep 17 00:00:00 2001 From: Michael Jackson Date: Thu, 15 Feb 2024 11:45:44 -0500 Subject: [PATCH] Update to latest API changes Signed-off-by: Michael Jackson --- .../OrientationAnalysis/CMakeLists.txt | 7 +-- .../Filters/Algorithms/ReadH5OinaData.cpp | 15 +++---- .../Filters/Algorithms/ReadH5OinaData.hpp | 11 +++-- .../Filters/ReadH5OinaDataFilter.cpp | 45 +++++++++---------- .../Filters/ReadH5OinaDataFilter.hpp | 10 ++--- .../utilities/ReadH5Data.hpp | 2 +- vcpkg-configuration.json | 2 + 7 files changed, 43 insertions(+), 49 deletions(-) diff --git a/src/Plugins/OrientationAnalysis/CMakeLists.txt b/src/Plugins/OrientationAnalysis/CMakeLists.txt index 894a5e83d8..18dc235712 100644 --- a/src/Plugins/OrientationAnalysis/CMakeLists.txt +++ b/src/Plugins/OrientationAnalysis/CMakeLists.txt @@ -1,12 +1,9 @@ # ------------------------------------------------------------------------------ # Required EbsdLib and H5Support # ------------------------------------------------------------------------------ -#find_package(H5Support REQUIRED) +find_package(H5Support REQUIRED) -#find_package(EbsdLib REQUIRED) - -add_subdirectory(${complex_SOURCE_DIR}/../H5Support ${complex_BINARY_DIR}/H5Support) -add_subdirectory(${complex_SOURCE_DIR}/../EbsdLib ${complex_BINARY_DIR}/EbsdLib) +find_package(EbsdLib REQUIRED) # ------------------------------------------------------------------------------ # EbsdLib needs install rules for creating packages diff --git a/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/Algorithms/ReadH5OinaData.cpp b/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/Algorithms/ReadH5OinaData.cpp index eaadc1df46..eea49afc13 100644 --- a/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/Algorithms/ReadH5OinaData.cpp +++ b/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/Algorithms/ReadH5OinaData.cpp @@ -1,15 +1,15 @@ #include "ReadH5OinaData.hpp" -#include "complex/DataStructure/DataArray.hpp" -#include "complex/DataStructure/Geometry/ImageGeom.hpp" +#include "simplnx/DataStructure/DataArray.hpp" +#include "simplnx/DataStructure/Geometry/ImageGeom.hpp" -using namespace complex; +using namespace nx::core; namespace { template -void copyRawData(const ImportH5DataInputValues* m_InputValues, size_t totalPoints, DataStructure& m_DataStructure, H5OINAReader& m_Reader, const std::string& name, usize offset) +void copyRawData(const ReadH5DataInputValues* m_InputValues, size_t totalPoints, DataStructure& m_DataStructure, H5OINAReader& m_Reader, const std::string& name, usize offset) { using ArrayType = DataArray; auto& dataRef = m_DataStructure.getDataRefAs(m_InputValues->CellAttributeMatrixPath.createChildPath(name)); @@ -21,7 +21,7 @@ void copyRawData(const ImportH5DataInputValues* m_InputValues, size_t totalPoint } template -void convertHexEulerAngle(const ImportH5DataInputValues* m_InputValues, size_t totalPoints, DataStructure& m_DataStructure) +void convertHexEulerAngle(const ReadH5DataInputValues* m_InputValues, size_t totalPoints, DataStructure& m_DataStructure) { using ArrayType = DataArray; @@ -49,8 +49,8 @@ void convertHexEulerAngle(const ImportH5DataInputValues* m_InputValues, size_t t } // namespace // ----------------------------------------------------------------------------- -ReadH5OinaData::ReadH5OinaData(DataStructure& dataStructure, const IFilter::MessageHandler& mesgHandler, const std::atomic_bool& shouldCancel, ImportH5DataInputValues* inputValues) -: ImportH5Data(dataStructure, mesgHandler, shouldCancel, inputValues) +ReadH5OinaData::ReadH5OinaData(DataStructure& dataStructure, const IFilter::MessageHandler& mesgHandler, const std::atomic_bool& shouldCancel, ReadH5DataInputValues* inputValues) +: ReadH5Data(dataStructure, mesgHandler, shouldCancel, inputValues) { } @@ -106,7 +106,6 @@ Result<> ReadH5OinaData::copyRawEbsdData(int index) } } - if(m_InputValues->ReadPatternData) { const uint16* patternDataPtr = m_Reader->getPatternData(); diff --git a/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/Algorithms/ReadH5OinaData.hpp b/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/Algorithms/ReadH5OinaData.hpp index d770fdc061..55a185fe9d 100644 --- a/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/Algorithms/ReadH5OinaData.hpp +++ b/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/Algorithms/ReadH5OinaData.hpp @@ -1,9 +1,9 @@ #pragma once #include "OrientationAnalysis/OrientationAnalysis_export.hpp" -#include "OrientationAnalysis/utilities/ImportH5Data.hpp" +#include "OrientationAnalysis/utilities/ReadH5Data.hpp" -namespace complex +namespace nx::core { /** @@ -12,10 +12,10 @@ namespace complex * intermediate .h5ebsd file. */ -class ORIENTATIONANALYSIS_EXPORT ReadH5OinaData : public ImportH5Data +class ORIENTATIONANALYSIS_EXPORT ReadH5OinaData : public ReadH5Data { public: - ReadH5OinaData(DataStructure& dataStructure, const IFilter::MessageHandler& mesgHandler, const std::atomic_bool& shouldCancel, ImportH5DataInputValues* inputValues); + ReadH5OinaData(DataStructure& dataStructure, const IFilter::MessageHandler& mesgHandler, const std::atomic_bool& shouldCancel, ReadH5DataInputValues* inputValues); ~ReadH5OinaData() noexcept override; ReadH5OinaData(const ReadH5OinaData&) = delete; @@ -26,7 +26,6 @@ class ORIENTATIONANALYSIS_EXPORT ReadH5OinaData : public ImportH5Data operator()(); Result<> copyRawEbsdData(int index) override; - }; -} // namespace complex +} // namespace nx::core diff --git a/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/ReadH5OinaDataFilter.cpp b/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/ReadH5OinaDataFilter.cpp index ddc188dad3..080a7b5518 100644 --- a/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/ReadH5OinaDataFilter.cpp +++ b/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/ReadH5OinaDataFilter.cpp @@ -3,18 +3,18 @@ #include "OrientationAnalysis/Filters/Algorithms/ReadH5OinaData.hpp" #include "OrientationAnalysis/Parameters/OEMEbsdScanSelectionParameter.h" -#include "complex/DataStructure/DataPath.hpp" -#include "complex/DataStructure/Geometry/ImageGeom.hpp" -#include "complex/Filter/Actions/CreateArrayAction.hpp" -#include "complex/Filter/Actions/CreateAttributeMatrixAction.hpp" -#include "complex/Filter/Actions/CreateImageGeometryAction.hpp" -#include "complex/Filter/Actions/CreateStringArrayAction.hpp" -#include "complex/Parameters/BoolParameter.hpp" -#include "complex/Parameters/DataGroupCreationParameter.hpp" -#include "complex/Parameters/DataObjectNameParameter.hpp" -#include "complex/Parameters/FileSystemPathParameter.hpp" -#include "complex/Parameters/NumberParameter.hpp" -#include "complex/Parameters/VectorParameter.hpp" +#include "simplnx/DataStructure/DataPath.hpp" +#include "simplnx/DataStructure/Geometry/ImageGeom.hpp" +#include "simplnx/Filter/Actions/CreateArrayAction.hpp" +#include "simplnx/Filter/Actions/CreateAttributeMatrixAction.hpp" +#include "simplnx/Filter/Actions/CreateImageGeometryAction.hpp" +#include "simplnx/Filter/Actions/CreateStringArrayAction.hpp" +#include "simplnx/Parameters/BoolParameter.hpp" +#include "simplnx/Parameters/DataGroupCreationParameter.hpp" +#include "simplnx/Parameters/DataObjectNameParameter.hpp" +#include "simplnx/Parameters/FileSystemPathParameter.hpp" +#include "simplnx/Parameters/NumberParameter.hpp" +#include "simplnx/Parameters/VectorParameter.hpp" #include "EbsdLib/IO/HKL/CtfFields.h" #include "EbsdLib/IO/HKL/H5OINAReader.h" @@ -22,9 +22,9 @@ #include namespace fs = std::filesystem; -using namespace complex; +using namespace nx::core; -namespace complex +namespace nx::core { //------------------------------------------------------------------------------ std::string ReadH5OinaDataFilter::name() const @@ -66,12 +66,10 @@ Parameters ReadH5OinaDataFilter::parameters() const params.insert(std::make_unique(k_SelectedScanNames_Key, "Scan Names", "The name of the scan in the .h5oina file. Oxford can store multiple scans in a single file", OEMEbsdScanSelectionParameter::ValueType{}, /* OEMEbsdScanSelectionParameter::AllowedManufacturers{EbsdLib::OEM::EDAX}, */ - OEMEbsdScanSelectionParameter::EbsdReaderType::H5Oina, - OEMEbsdScanSelectionParameter::ExtensionsType{".h5oina"})); + OEMEbsdScanSelectionParameter::EbsdReaderType::H5Oina, OEMEbsdScanSelectionParameter::ExtensionsType{".h5oina"})); params.insert(std::make_unique(k_EdaxHexagonalAlignment_Key, "Convert Hexagonal X-Axis to EDAX Standard", "Whether or not to convert a Hexagonal phase to the EDAX standard for x-axis alignment", true)); - params.insert(std::make_unique(k_ConvertPhaseToInt32_Key, "Convert Phase Data to In32", - "Native Phases data value is uint8. Convert to Int32 for better filter compatibility", true)); + params.insert(std::make_unique(k_ConvertPhaseToInt32_Key, "Convert Phase Data to Int32", "Native Phases data value is uint8. Convert to Int32 for better filter compatibility", true)); params.insert(std::make_unique(k_ZSpacing_Key, "Z Spacing (Microns)", "The spacing in microns between each layer.", 1.0f)); params.insert(std::make_unique(k_Origin_Key, "Origin", "The origin of the volume", std::vector{0.0F, 0.0F, 0.0F}, std::vector{"x", "y", "z"})); params.insert(std::make_unique(k_ReadPatternData_Key, "Import Pattern Data", "Whether or not to import the pattern data", false)); @@ -94,7 +92,7 @@ IFilter::UniquePointer ReadH5OinaDataFilter::clone() const //------------------------------------------------------------------------------ IFilter::PreflightResult ReadH5OinaDataFilter::preflightImpl(const DataStructure& dataStructure, const Arguments& filterArgs, const MessageHandler& messageHandler, - const std::atomic_bool& shouldCancel) const + const std::atomic_bool& shouldCancel) const { auto pSelectedScanNamesValue = filterArgs.value(k_SelectedScanNames_Key); auto pZSpacingValue = filterArgs.value(k_ZSpacing_Key); @@ -105,12 +103,11 @@ IFilter::PreflightResult ReadH5OinaDataFilter::preflightImpl(const DataStructure auto pCellEnsembleAttributeMatrixNameValue = filterArgs.value(k_CellEnsembleAttributeMatrixName_Key); auto pConvertPhaseData = filterArgs.value(k_ConvertPhaseToInt32_Key); - DataPath cellEnsembleAMPath = pImageGeometryNameValue.createChildPath(pCellEnsembleAttributeMatrixNameValue); DataPath cellAMPath = pImageGeometryNameValue.createChildPath(pCellAttributeMatrixNameValue); PreflightResult preflightResult; - complex::Result resultOutputActions; + nx::core::Result resultOutputActions; std::vector preflightUpdatedValues; if(pZSpacingValue <= 0) @@ -198,9 +195,9 @@ IFilter::PreflightResult ReadH5OinaDataFilter::preflightImpl(const DataStructure //------------------------------------------------------------------------------ Result<> ReadH5OinaDataFilter::executeImpl(DataStructure& dataStructure, const Arguments& filterArgs, const PipelineFilter* pipelineNode, const MessageHandler& messageHandler, - const std::atomic_bool& shouldCancel) const + const std::atomic_bool& shouldCancel) const { - ImportH5DataInputValues inputValues; + ReadH5DataInputValues inputValues; inputValues.SelectedScanNames = filterArgs.value(k_SelectedScanNames_Key); inputValues.ReadPatternData = filterArgs.value(k_ReadPatternData_Key); @@ -212,4 +209,4 @@ Result<> ReadH5OinaDataFilter::executeImpl(DataStructure& dataStructure, const A return ReadH5OinaData(dataStructure, messageHandler, shouldCancel, &inputValues)(); } -} // namespace complex +} // namespace nx::core diff --git a/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/ReadH5OinaDataFilter.hpp b/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/ReadH5OinaDataFilter.hpp index fe870c8181..092f665a5e 100644 --- a/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/ReadH5OinaDataFilter.hpp +++ b/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/ReadH5OinaDataFilter.hpp @@ -2,10 +2,10 @@ #include "OrientationAnalysis/OrientationAnalysis_export.hpp" -#include "complex/Filter/FilterTraits.hpp" -#include "complex/Filter/IFilter.hpp" +#include "simplnx/Filter/FilterTraits.hpp" +#include "simplnx/Filter/IFilter.hpp" -namespace complex +namespace nx::core { /** * @class ReadH5OinaDataFilter @@ -99,7 +99,7 @@ class ORIENTATIONANALYSIS_EXPORT ReadH5OinaDataFilter : public IFilter */ Result<> executeImpl(DataStructure& data, const Arguments& filterArgs, const PipelineFilter* pipelineNode, const MessageHandler& messageHandler, const std::atomic_bool& shouldCancel) const override; }; -} // namespace complex +} // namespace nx::core -COMPLEX_DEF_FILTER_TRAITS(complex, ReadH5OinaDataFilter, "fad3d47f-f1e1-4429-bc65-5e021be62ba0"); +SIMPLNX_DEF_FILTER_TRAITS(nx::core, ReadH5OinaDataFilter, "fad3d47f-f1e1-4429-bc65-5e021be62ba0"); /* LEGACY UUID FOR THIS FILTER 3ff4701b-3a0c-52e3-910a-fa927aa6584c */ diff --git a/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/utilities/ReadH5Data.hpp b/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/utilities/ReadH5Data.hpp index 8c4496489d..01574e602e 100644 --- a/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/utilities/ReadH5Data.hpp +++ b/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/utilities/ReadH5Data.hpp @@ -9,8 +9,8 @@ #include "simplnx/Filter/IFilter.hpp" #include "EbsdLib/IO/BrukerNano/H5EspritReader.h" -#include "EbsdLib/IO/TSL/H5OIMReader.h" #include "EbsdLib/IO/HKL/H5OINAReader.h" +#include "EbsdLib/IO/TSL/H5OIMReader.h" namespace nx::core { diff --git a/vcpkg-configuration.json b/vcpkg-configuration.json index be32717c8d..377ee0f0bb 100644 --- a/vcpkg-configuration.json +++ b/vcpkg-configuration.json @@ -12,9 +12,11 @@ "blosc", "boost-mp11", "catch2", + "ebsdlib", "eigen3", "expected-lite", "fmt", + "h5support", "hdf5", "lz4", "itk",