diff --git a/CMakeLists.txt b/CMakeLists.txt index 2954cd8524..f181afdf81 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -278,7 +278,7 @@ set(CoreParameters DynamicTableParameter EnsembleInfoParameter FileSystemPathParameter - ComputeColorTableParameter + CreateColorMapParameter GeneratedFileListParameter GeometrySelectionParameter DataStoreFormatParameter diff --git a/scripts/simpl_filters.json b/scripts/simpl_filters.json index e043edde6a..14cf9fce10 100644 --- a/scripts/simpl_filters.json +++ b/scripts/simpl_filters.json @@ -12299,11 +12299,11 @@ "uuid": "{8ec1fc8e-6484-5412-a898-8079986c0a26}" }, { - "name": "ComputeColorTable", + "name": "CreateColorMap", "parameters": [ { "name": "SelectedPresetName", - "type": "ComputeColorTableFilterParameter" + "type": "CreateColorMapFilterParameter" }, { "name": "SelectedDataArrayPath", diff --git a/src/Plugins/OrientationAnalysis/pipelines/EBSD_Hexagonal_Data_Analysis.d3dpipeline b/src/Plugins/OrientationAnalysis/pipelines/EBSD_Hexagonal_Data_Analysis.d3dpipeline index 96df2ef909..d83d701f2d 100644 --- a/src/Plugins/OrientationAnalysis/pipelines/EBSD_Hexagonal_Data_Analysis.d3dpipeline +++ b/src/Plugins/OrientationAnalysis/pipelines/EBSD_Hexagonal_Data_Analysis.d3dpipeline @@ -277,7 +277,7 @@ }, "comments": "", "filter": { - "name": "nx::core::ComputeColorTableFilter", + "name": "nx::core::CreateColorMapFilter", "uuid": "d1731177-4d70-41c0-9334-566a0b482796" }, "isDisabled": false diff --git a/src/Plugins/SimplnxCore/CMakeLists.txt b/src/Plugins/SimplnxCore/CMakeLists.txt index 2179a0f50f..125cdba7aa 100644 --- a/src/Plugins/SimplnxCore/CMakeLists.txt +++ b/src/Plugins/SimplnxCore/CMakeLists.txt @@ -73,7 +73,7 @@ set(FilterList ComputeBoundaryElementFractionsFilter ComputeTriangleGeomSizesFilter FlyingEdges3DFilter - ComputeColorTableFilter + CreateColorMapFilter IdentifySampleFilter InitializeDataFilter InitializeImageGeomCellDataFilter @@ -178,7 +178,7 @@ set(AlgorithmList FindNRingNeighbors ComputeTriangleGeomSizes FlyingEdges3D - ComputeColorTable + CreateColorMap LabelTriangleGeometry LaplacianSmoothing NearestPointFuseRegularGrids diff --git a/src/Plugins/SimplnxCore/docs/ComputeColorTableFilter.md b/src/Plugins/SimplnxCore/docs/CreateColorMapFilter.md similarity index 99% rename from src/Plugins/SimplnxCore/docs/ComputeColorTableFilter.md rename to src/Plugins/SimplnxCore/docs/CreateColorMapFilter.md index 60f54bc44d..b0813fdc2b 100644 --- a/src/Plugins/SimplnxCore/docs/ComputeColorTableFilter.md +++ b/src/Plugins/SimplnxCore/docs/CreateColorMapFilter.md @@ -1,4 +1,4 @@ -# Compute Color Table +# Create Color Map ## Description diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/ComputeColorTable.cpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/CreateColorMap.cpp similarity index 83% rename from src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/ComputeColorTable.cpp rename to src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/CreateColorMap.cpp index 546086b4f6..4ab4226dca 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/ComputeColorTable.cpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/CreateColorMap.cpp @@ -1,4 +1,4 @@ -#include "ComputeColorTable.hpp" +#include "CreateColorMap.hpp" #include "simplnx/DataStructure/DataArray.hpp" #include "simplnx/DataStructure/DataGroup.hpp" @@ -33,15 +33,15 @@ usize findRightBinIndex(float32 nValue, const std::vector& binPoints) } /** - * @brief The ComputeColorTableImpl class implements a threaded algorithm that computes the RGB values + * @brief The CreateColorMapImpl class implements a threaded algorithm that computes the RGB values * for each element in a given array of data */ template -class ComputeColorTableImpl +class CreateColorMapImpl { public: - ComputeColorTableImpl(const DataArray& arrayPtr, const std::vector& binPoints, const std::vector& controlPoints, int numControlColors, UInt8Array& colorArray, - const nx::core::IDataArray* goodVoxels, const std::vector& invalidColor) + CreateColorMapImpl(const DataArray& arrayPtr, const std::vector& binPoints, const std::vector& controlPoints, int numControlColors, UInt8Array& colorArray, + const nx::core::IDataArray* goodVoxels, const std::vector& invalidColor) : m_ArrayPtr(arrayPtr) , m_BinPoints(binPoints) , m_NumControlColors(numControlColors) @@ -64,12 +64,12 @@ class ComputeColorTableImpl } } } - virtual ~ComputeColorTableImpl() = default; + virtual ~CreateColorMapImpl() = default; - ComputeColorTableImpl(const ComputeColorTableImpl&) = default; - ComputeColorTableImpl(ComputeColorTableImpl&&) noexcept = delete; - ComputeColorTableImpl& operator=(const ComputeColorTableImpl&) = delete; - ComputeColorTableImpl& operator=(ComputeColorTableImpl&&) noexcept = delete; + CreateColorMapImpl(const CreateColorMapImpl&) = default; + CreateColorMapImpl(CreateColorMapImpl&&) noexcept = delete; + CreateColorMapImpl& operator=(const CreateColorMapImpl&) = delete; + CreateColorMapImpl& operator=(CreateColorMapImpl&&) noexcept = delete; template void convert(size_t start, size_t end) const @@ -174,7 +174,7 @@ class ComputeColorTableImpl struct GenerateColorArrayFunctor { template - Result<> operator()(DataStructure& dataStructure, const ComputeColorTableInputValues* inputValues, const std::vector& controlPoints) + Result<> operator()(DataStructure& dataStructure, const CreateColorMapInputValues* inputValues, const std::vector& controlPoints) { // Control Points is a flattened 2D array with an unknown tuple count and a component size of 4 const usize numControlColors = controlPoints.size() / k_ControlPointCompSize; @@ -211,14 +211,14 @@ struct GenerateColorArrayFunctor ParallelDataAlgorithm dataAlg; dataAlg.setRange(0, arrayRef.getNumberOfTuples()); - dataAlg.execute(ComputeColorTableImpl(arrayRef, binPoints, controlPoints, numControlColors, colorArray, goodVoxelsArray, inputValues->InvalidColor)); + dataAlg.execute(CreateColorMapImpl(arrayRef, binPoints, controlPoints, numControlColors, colorArray, goodVoxelsArray, inputValues->InvalidColor)); return {}; } }; } // namespace // ----------------------------------------------------------------------------- -ComputeColorTable::ComputeColorTable(DataStructure& dataStructure, const IFilter::MessageHandler& msgHandler, const std::atomic_bool& shouldCancel, ComputeColorTableInputValues* inputValues) +CreateColorMap::CreateColorMap(DataStructure& dataStructure, const IFilter::MessageHandler& msgHandler, const std::atomic_bool& shouldCancel, CreateColorMapInputValues* inputValues) : m_DataStructure(dataStructure) , m_InputValues(inputValues) , m_ShouldCancel(shouldCancel) @@ -227,16 +227,16 @@ ComputeColorTable::ComputeColorTable(DataStructure& dataStructure, const IFilter } // ----------------------------------------------------------------------------- -ComputeColorTable::~ComputeColorTable() noexcept = default; +CreateColorMap::~CreateColorMap() noexcept = default; // ----------------------------------------------------------------------------- -const std::atomic_bool& ComputeColorTable::getCancel() +const std::atomic_bool& CreateColorMap::getCancel() { return m_ShouldCancel; } // ----------------------------------------------------------------------------- -Result<> ComputeColorTable::operator()() +Result<> CreateColorMap::operator()() { const IDataArray& selectedIDataArray = m_DataStructure.getDataRefAs(m_InputValues->SelectedDataArrayPath); diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/ComputeColorTable.hpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/CreateColorMap.hpp similarity index 50% rename from src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/ComputeColorTable.hpp rename to src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/CreateColorMap.hpp index b6644dd9a9..774933ea6d 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/ComputeColorTable.hpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/CreateColorMap.hpp @@ -8,7 +8,7 @@ namespace nx::core { -struct SIMPLNXCORE_EXPORT ComputeColorTableInputValues +struct SIMPLNXCORE_EXPORT CreateColorMapInputValues { std::string PresetName; DataPath SelectedDataArrayPath; @@ -18,16 +18,16 @@ struct SIMPLNXCORE_EXPORT ComputeColorTableInputValues std::vector InvalidColor; }; -class SIMPLNXCORE_EXPORT ComputeColorTable +class SIMPLNXCORE_EXPORT CreateColorMap { public: - ComputeColorTable(DataStructure& dataStructure, const IFilter::MessageHandler& msgHandler, const std::atomic_bool& shouldCancel, ComputeColorTableInputValues* inputValues); - ~ComputeColorTable() noexcept; + CreateColorMap(DataStructure& dataStructure, const IFilter::MessageHandler& msgHandler, const std::atomic_bool& shouldCancel, CreateColorMapInputValues* inputValues); + ~CreateColorMap() noexcept; - ComputeColorTable(const ComputeColorTable&) = delete; - ComputeColorTable(ComputeColorTable&&) noexcept = delete; - ComputeColorTable& operator=(const ComputeColorTable&) = delete; - ComputeColorTable& operator=(ComputeColorTable&&) noexcept = delete; + CreateColorMap(const CreateColorMap&) = delete; + CreateColorMap(CreateColorMap&&) noexcept = delete; + CreateColorMap& operator=(const CreateColorMap&) = delete; + CreateColorMap& operator=(CreateColorMap&&) noexcept = delete; Result<> operator()(); @@ -35,7 +35,7 @@ class SIMPLNXCORE_EXPORT ComputeColorTable private: DataStructure& m_DataStructure; - const ComputeColorTableInputValues* m_InputValues = nullptr; + const CreateColorMapInputValues* m_InputValues = nullptr; const std::atomic_bool& m_ShouldCancel; const IFilter::MessageHandler& m_MessageHandler; }; diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ComputeColorTableFilter.cpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/CreateColorMapFilter.cpp similarity index 76% rename from src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ComputeColorTableFilter.cpp rename to src/Plugins/SimplnxCore/src/SimplnxCore/Filters/CreateColorMapFilter.cpp index fe6f5c3380..141512c195 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ComputeColorTableFilter.cpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/CreateColorMapFilter.cpp @@ -1,6 +1,6 @@ -#include "ComputeColorTableFilter.hpp" +#include "CreateColorMapFilter.hpp" -#include "Algorithms/ComputeColorTable.hpp" +#include "Algorithms/CreateColorMap.hpp" #include "simplnx/DataStructure/DataArray.hpp" #include "simplnx/DataStructure/DataPath.hpp" @@ -13,7 +13,7 @@ #include "simplnx/Utilities/ColorTableUtilities.hpp" #include "simplnx/Utilities/SIMPLConversion.hpp" -#include "simplnx/Parameters/ComputeColorTableParameter.hpp" +#include "simplnx/Parameters/CreateColorMapParameter.hpp" #include "simplnx/Parameters/VectorParameter.hpp" using namespace nx::core; @@ -31,44 +31,44 @@ inline constexpr int32 k_MissingOrIncorrectGoodVoxelsArray = -72443; namespace nx::core { //------------------------------------------------------------------------------ -std::string ComputeColorTableFilter::name() const +std::string CreateColorMapFilter::name() const { - return FilterTraits::name.str(); + return FilterTraits::name.str(); } //------------------------------------------------------------------------------ -std::string ComputeColorTableFilter::className() const +std::string CreateColorMapFilter::className() const { - return FilterTraits::className; + return FilterTraits::className; } //------------------------------------------------------------------------------ -Uuid ComputeColorTableFilter::uuid() const +Uuid CreateColorMapFilter::uuid() const { - return FilterTraits::uuid; + return FilterTraits::uuid; } //------------------------------------------------------------------------------ -std::string ComputeColorTableFilter::humanName() const +std::string CreateColorMapFilter::humanName() const { - return "Generate Color Table"; + return "Create Color Map"; } //------------------------------------------------------------------------------ -std::vector ComputeColorTableFilter::defaultTags() const +std::vector CreateColorMapFilter::defaultTags() const { - return {className(), "Core", "Image"}; + return {className(), "Core", "Image", "Color Table", "Generate"}; } //------------------------------------------------------------------------------ -Parameters ComputeColorTableFilter::parameters() const +Parameters CreateColorMapFilter::parameters() const { Parameters params; // Create the parameter descriptors that are needed for this filter params.insertSeparator(Parameters::Separator{"Input Parameter(s)"}); - params.insert(std::make_unique(k_SelectedPreset_Key, "Select Preset...", "Select a preset color scheme to apply to the created array", - ColorTableUtilities::GetDefaultRGBPresetName())); + params.insert(std::make_unique(k_SelectedPreset_Key, "Select Preset...", "Select a preset color scheme to apply to the created array", + ColorTableUtilities::GetDefaultRGBPresetName())); params.insertSeparator(Parameters::Separator{"Input Data Objects"}); params.insert(std::make_unique(k_SelectedDataArrayPath_Key, "Data Array", "The complete path to the data array from which to create the rgb array by applying the selected preset color scheme", DataPath{}, @@ -92,14 +92,14 @@ Parameters ComputeColorTableFilter::parameters() const } //------------------------------------------------------------------------------ -IFilter::UniquePointer ComputeColorTableFilter::clone() const +IFilter::UniquePointer CreateColorMapFilter::clone() const { - return std::make_unique(); + return std::make_unique(); } //------------------------------------------------------------------------------ -IFilter::PreflightResult ComputeColorTableFilter::preflightImpl(const DataStructure& dataStructure, const Arguments& filterArgs, const MessageHandler& messageHandler, - const std::atomic_bool& shouldCancel) const +IFilter::PreflightResult CreateColorMapFilter::preflightImpl(const DataStructure& dataStructure, const Arguments& filterArgs, const MessageHandler& messageHandler, + const std::atomic_bool& shouldCancel) const { auto pSelectedDataArrayPathValue = filterArgs.value(k_SelectedDataArrayPath_Key); auto pRgbArrayPathValue = pSelectedDataArrayPathValue.replaceName(filterArgs.value(k_RgbArrayPath_Key)); @@ -147,19 +147,19 @@ IFilter::PreflightResult ComputeColorTableFilter::preflightImpl(const DataStruct } //------------------------------------------------------------------------------ -Result<> ComputeColorTableFilter::executeImpl(DataStructure& dataStructure, const Arguments& filterArgs, const PipelineFilter* pipelineNode, const MessageHandler& messageHandler, - const std::atomic_bool& shouldCancel) const +Result<> CreateColorMapFilter::executeImpl(DataStructure& dataStructure, const Arguments& filterArgs, const PipelineFilter* pipelineNode, const MessageHandler& messageHandler, + const std::atomic_bool& shouldCancel) const { - ComputeColorTableInputValues inputValues; + CreateColorMapInputValues inputValues; - inputValues.PresetName = filterArgs.value(k_SelectedPreset_Key); + inputValues.PresetName = filterArgs.value(k_SelectedPreset_Key); inputValues.SelectedDataArrayPath = filterArgs.value(k_SelectedDataArrayPath_Key); inputValues.RgbArrayPath = inputValues.SelectedDataArrayPath.replaceName(filterArgs.value(k_RgbArrayPath_Key)); inputValues.UseMask = filterArgs.value(k_UseMask_Key); inputValues.MaskArrayPath = filterArgs.value(k_MaskArrayPath_Key); inputValues.InvalidColor = filterArgs.value>(k_InvalidColorValue_Key); - return ComputeColorTable(dataStructure, messageHandler, shouldCancel, &inputValues)(); + return CreateColorMap(dataStructure, messageHandler, shouldCancel, &inputValues)(); } namespace @@ -173,14 +173,14 @@ constexpr StringLiteral k_RgbArrayNameKey = "RgbArrayName"; } // namespace SIMPL } // namespace -Result ComputeColorTableFilter::FromSIMPLJson(const nlohmann::json& json) +Result CreateColorMapFilter::FromSIMPLJson(const nlohmann::json& json) { - Arguments args = ComputeColorTableFilter().getDefaultArguments(); + Arguments args = CreateColorMapFilter().getDefaultArguments(); std::vector> results; - results.push_back(SIMPLConversion::Convert2Parameters(args, json, SIMPL::k_SelectedPresetNameKey, SIMPL::k_SelectedPresetControlPointsKey, - k_SelectedPreset_Key)); + results.push_back(SIMPLConversion::Convert2Parameters(args, json, SIMPL::k_SelectedPresetNameKey, SIMPL::k_SelectedPresetControlPointsKey, + k_SelectedPreset_Key)); results.push_back(SIMPLConversion::ConvertParameter(args, json, SIMPL::k_SelectedDataArrayPathKey, k_SelectedDataArrayPath_Key)); results.push_back(SIMPLConversion::ConvertParameter(args, json, SIMPL::k_RgbArrayNameKey, k_RgbArrayPath_Key)); diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ComputeColorTableFilter.hpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/CreateColorMapFilter.hpp similarity index 85% rename from src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ComputeColorTableFilter.hpp rename to src/Plugins/SimplnxCore/src/SimplnxCore/Filters/CreateColorMapFilter.hpp index 3a188d4b56..6bb2b71b3e 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ComputeColorTableFilter.hpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/CreateColorMapFilter.hpp @@ -8,22 +8,22 @@ namespace nx::core { /** - * @class ComputeColorTableFilter + * @class CreateColorMapFilter * @brief This filter generates a color table array for a given 1-component input array. * Each element of the input array is normalized and converted to a color based on where * the value falls in the spectrum of the selected color preset. */ -class SIMPLNXCORE_EXPORT ComputeColorTableFilter : public IFilter +class SIMPLNXCORE_EXPORT CreateColorMapFilter : public IFilter { public: - ComputeColorTableFilter() = default; - ~ComputeColorTableFilter() noexcept override = default; + CreateColorMapFilter() = default; + ~CreateColorMapFilter() noexcept override = default; - ComputeColorTableFilter(const ComputeColorTableFilter&) = delete; - ComputeColorTableFilter(ComputeColorTableFilter&&) noexcept = delete; + CreateColorMapFilter(const CreateColorMapFilter&) = delete; + CreateColorMapFilter(CreateColorMapFilter&&) noexcept = delete; - ComputeColorTableFilter& operator=(const ComputeColorTableFilter&) = delete; - ComputeColorTableFilter& operator=(ComputeColorTableFilter&&) noexcept = delete; + CreateColorMapFilter& operator=(const CreateColorMapFilter&) = delete; + CreateColorMapFilter& operator=(CreateColorMapFilter&&) noexcept = delete; // Parameter Keys static inline constexpr StringLiteral k_SelectedPreset_Key = "selected_preset"; @@ -107,4 +107,4 @@ class SIMPLNXCORE_EXPORT ComputeColorTableFilter : public IFilter }; } // namespace nx::core -SIMPLNX_DEF_FILTER_TRAITS(nx::core, ComputeColorTableFilter, "d1731177-4d70-41c0-9334-566a0b482796"); +SIMPLNX_DEF_FILTER_TRAITS(nx::core, CreateColorMapFilter, "d1731177-4d70-41c0-9334-566a0b482796"); diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/SimplnxCoreLegacyUUIDMapping.hpp b/src/Plugins/SimplnxCore/src/SimplnxCore/SimplnxCoreLegacyUUIDMapping.hpp index 6d064a52b0..c2102ff461 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/SimplnxCoreLegacyUUIDMapping.hpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/SimplnxCoreLegacyUUIDMapping.hpp @@ -56,7 +56,7 @@ #include "SimplnxCore/Filters/ComputeSurfaceAreaToVolumeFilter.hpp" #include "SimplnxCore/Filters/ComputeSurfaceFeaturesFilter.hpp" #include "SimplnxCore/Filters/ComputeVolumeFractionsFilter.hpp" -#include "SimplnxCore/Filters/ComputeColorTableFilter.hpp" +#include "SimplnxCore/Filters/CreateColorMapFilter.hpp" #include "SimplnxCore/Filters/IdentifySampleFilter.hpp" #include "SimplnxCore/Filters/ReadBinaryCTNorthstarFilter.hpp" #include "SimplnxCore/Filters/ReadCSVFileFilter.hpp" @@ -171,7 +171,7 @@ namespace nx::core {nx::core::Uuid::FromString("5d586366-6b59-566e-8de1-57aa9ae8a91c").value(), {nx::core::FilterTraits::uuid, &ComputeSurfaceAreaToVolumeFilter::FromSIMPLJson}}, // ComputeSurfaceAreaToVolume {nx::core::Uuid::FromString("d2b0ae3d-686a-5dc0-a844-66bc0dc8f3cb").value(), {nx::core::FilterTraits::uuid, &ComputeSurfaceFeaturesFilter::FromSIMPLJson}}, // ComputeSurfaceFeaturesFilter {nx::core::Uuid::FromString("68246a67-7f32-5c80-815a-bec82008d7bc").value(), {nx::core::FilterTraits::uuid, &ComputeVolumeFractionsFilter::FromSIMPLJson}}, // ComputeVolumeFractions - {nx::core::Uuid::FromString("0d0a6535-6565-51c5-a3fc-fbc00008606d").value(), {nx::core::FilterTraits::uuid, &ComputeColorTableFilter::FromSIMPLJson}}, // ComputeColorTable + {nx::core::Uuid::FromString("0d0a6535-6565-51c5-a3fc-fbc00008606d").value(), {nx::core::FilterTraits::uuid, &CreateColorMapFilter::FromSIMPLJson}}, // CreateColorMap {nx::core::Uuid::FromString("0e8c0818-a3fb-57d4-a5c8-7cb8ae54a40a").value(), {nx::core::FilterTraits::uuid, &IdentifySampleFilter::FromSIMPLJson}}, // IdentifySampleFilter {nx::core::Uuid::FromString("f2259481-5011-5f22-9fcb-c92fb6f8be10").value(), {nx::core::FilterTraits::uuid, &ReadBinaryCTNorthstarFilter::FromSIMPLJson}}, // ImportBinaryCTNorthstarFilter {nx::core::Uuid::FromString("bdb978bc-96bf-5498-972c-b509c38b8d50").value(), {nx::core::FilterTraits::uuid, &ReadCSVFileFilter::FromSIMPLJson}}, // ReadASCIIData diff --git a/src/Plugins/SimplnxCore/test/CMakeLists.txt b/src/Plugins/SimplnxCore/test/CMakeLists.txt index 43084bc78c..4fec1758ae 100644 --- a/src/Plugins/SimplnxCore/test/CMakeLists.txt +++ b/src/Plugins/SimplnxCore/test/CMakeLists.txt @@ -74,7 +74,7 @@ set(${PLUGIN_NAME}UnitTest_SRCS ComputeBoundaryElementFractionsTest.cpp ComputeTriangleGeomSizesTest.cpp FlyingEdges3DTest.cpp - ComputeColorTableTest.cpp + CreateColorMapTest.cpp IdentifySampleTest.cpp ImageGeomTest.cpp InitializeDataTest.cpp diff --git a/src/Plugins/SimplnxCore/test/ComputeColorTableTest.cpp b/src/Plugins/SimplnxCore/test/CreateColorMapTest.cpp similarity index 77% rename from src/Plugins/SimplnxCore/test/ComputeColorTableTest.cpp rename to src/Plugins/SimplnxCore/test/CreateColorMapTest.cpp index f7864fa1c6..868e1455e8 100644 --- a/src/Plugins/SimplnxCore/test/ComputeColorTableTest.cpp +++ b/src/Plugins/SimplnxCore/test/CreateColorMapTest.cpp @@ -1,6 +1,6 @@ #include -#include "SimplnxCore/Filters/ComputeColorTableFilter.hpp" +#include "SimplnxCore/Filters/CreateColorMapFilter.hpp" #include "SimplnxCore/Filters/ReadTextDataArrayFilter.hpp" #include "SimplnxCore/SimplnxCore_test_dirs.hpp" @@ -68,7 +68,7 @@ std::map ReadPresets() } } // namespace -TEST_CASE("SimplnxCore::ComputeColorTableFilter: Valid filter execution") +TEST_CASE("SimplnxCore::CreateColorMapFilter: Valid filter execution") { const nx::core::UnitTest::TestFileSentinel testDataSentinel(nx::core::unit_test::k_CMakeExecutable, nx::core::unit_test::k_TestFilesDir, "generate_color_table_test.tar.gz", "generate_color_table_test"); @@ -93,104 +93,104 @@ TEST_CASE("SimplnxCore::ComputeColorTableFilter: Valid filter execution") } // Apply Preset - const ComputeColorTableFilter filter; + const CreateColorMapFilter filter; Arguments args; fs::path presetFilePath; SECTION(k_BlackBlueWhitePresetName) { REQUIRE(!presetsMap[k_BlackBlueWhitePresetName].empty()); - args.insertOrAssign(ComputeColorTableFilter::k_SelectedPreset_Key, std::make_any(k_BlackBlueWhitePresetName)); + args.insertOrAssign(CreateColorMapFilter::k_SelectedPreset_Key, std::make_any(k_BlackBlueWhitePresetName)); presetFilePath = k_BlackBlueWhitePresetPath; } SECTION(k_BlackOrangeWhitePresetName) { REQUIRE(!presetsMap[k_BlackOrangeWhitePresetName].empty()); - args.insertOrAssign(ComputeColorTableFilter::k_SelectedPreset_Key, std::make_any(k_BlackOrangeWhitePresetName)); + args.insertOrAssign(CreateColorMapFilter::k_SelectedPreset_Key, std::make_any(k_BlackOrangeWhitePresetName)); presetFilePath = k_BlackOrangeWhitePresetPath; } SECTION(k_BlackBodyRadiationPresetName) { REQUIRE(!presetsMap[k_BlackBodyRadiationPresetName].empty()); - args.insertOrAssign(ComputeColorTableFilter::k_SelectedPreset_Key, std::make_any(k_BlackBodyRadiationPresetName)); + args.insertOrAssign(CreateColorMapFilter::k_SelectedPreset_Key, std::make_any(k_BlackBodyRadiationPresetName)); presetFilePath = k_BlackBodyRadiationPresetPath; } SECTION(k_BlueToYellowPresetName) { REQUIRE(!presetsMap[k_BlueToYellowPresetName].empty()); - args.insertOrAssign(ComputeColorTableFilter::k_SelectedPreset_Key, std::make_any(k_BlueToYellowPresetName)); + args.insertOrAssign(CreateColorMapFilter::k_SelectedPreset_Key, std::make_any(k_BlueToYellowPresetName)); presetFilePath = k_BlueToYellowPresetPath; } SECTION(k_ColdAndHotPresetName) { REQUIRE(!presetsMap[k_ColdAndHotPresetName].empty()); - args.insertOrAssign(ComputeColorTableFilter::k_SelectedPreset_Key, std::make_any(k_ColdAndHotPresetName)); + args.insertOrAssign(CreateColorMapFilter::k_SelectedPreset_Key, std::make_any(k_ColdAndHotPresetName)); presetFilePath = k_ColdAndHotPresetPath; } SECTION(k_GrayscalePresetName) { REQUIRE(!presetsMap[k_GrayscalePresetName].empty()); - args.insertOrAssign(ComputeColorTableFilter::k_SelectedPreset_Key, std::make_any(k_GrayscalePresetName)); + args.insertOrAssign(CreateColorMapFilter::k_SelectedPreset_Key, std::make_any(k_GrayscalePresetName)); presetFilePath = k_GrayscalePresetPath; } SECTION(k_HazePresetName) { REQUIRE(!presetsMap[k_HazePresetName].empty()); - args.insertOrAssign(ComputeColorTableFilter::k_SelectedPreset_Key, std::make_any(k_HazePresetName)); + args.insertOrAssign(CreateColorMapFilter::k_SelectedPreset_Key, std::make_any(k_HazePresetName)); presetFilePath = k_HazePresetPath; } SECTION(k_HSVPresetName) { REQUIRE(!presetsMap[k_HSVPresetName].empty()); - args.insertOrAssign(ComputeColorTableFilter::k_SelectedPreset_Key, std::make_any(k_HSVPresetName)); + args.insertOrAssign(CreateColorMapFilter::k_SelectedPreset_Key, std::make_any(k_HSVPresetName)); presetFilePath = k_HSVPresetPath; } SECTION(k_JetPresetName) { REQUIRE(!presetsMap[k_JetPresetName].empty()); - args.insertOrAssign(ComputeColorTableFilter::k_SelectedPreset_Key, std::make_any(k_JetPresetName)); + args.insertOrAssign(CreateColorMapFilter::k_SelectedPreset_Key, std::make_any(k_JetPresetName)); presetFilePath = k_JetPresetPath; } SECTION(k_RainbowBlendedBlackPresetName) { REQUIRE(!presetsMap[k_RainbowBlendedBlackPresetName].empty()); - args.insertOrAssign(ComputeColorTableFilter::k_SelectedPreset_Key, std::make_any(k_RainbowBlendedBlackPresetName)); + args.insertOrAssign(CreateColorMapFilter::k_SelectedPreset_Key, std::make_any(k_RainbowBlendedBlackPresetName)); presetFilePath = k_RainbowBlendedBlackPresetPath; } SECTION(k_RainbowBlendedGreyPresetName) { REQUIRE(!presetsMap[k_RainbowBlendedGreyPresetName].empty()); - args.insertOrAssign(ComputeColorTableFilter::k_SelectedPreset_Key, std::make_any(k_RainbowBlendedGreyPresetName)); + args.insertOrAssign(CreateColorMapFilter::k_SelectedPreset_Key, std::make_any(k_RainbowBlendedGreyPresetName)); presetFilePath = k_RainbowBlendedGreyPresetPath; } SECTION(k_RainbowBlendedWhitePresetName) { REQUIRE(!presetsMap[k_RainbowBlendedWhitePresetName].empty()); - args.insertOrAssign(ComputeColorTableFilter::k_SelectedPreset_Key, std::make_any(k_RainbowBlendedWhitePresetName)); + args.insertOrAssign(CreateColorMapFilter::k_SelectedPreset_Key, std::make_any(k_RainbowBlendedWhitePresetName)); presetFilePath = k_RainbowBlendedWhitePresetPath; } SECTION(k_RainbowDesaturatedPresetName) { REQUIRE(!presetsMap[k_RainbowDesaturatedPresetName].empty()); - args.insertOrAssign(ComputeColorTableFilter::k_SelectedPreset_Key, std::make_any(k_RainbowDesaturatedPresetName)); + args.insertOrAssign(CreateColorMapFilter::k_SelectedPreset_Key, std::make_any(k_RainbowDesaturatedPresetName)); presetFilePath = k_RainbowDesaturatedPresetPath; } SECTION(k_RainbowPresetName) { REQUIRE(!presetsMap[k_RainbowPresetName].empty()); - args.insertOrAssign(ComputeColorTableFilter::k_SelectedPreset_Key, std::make_any(k_RainbowPresetName)); + args.insertOrAssign(CreateColorMapFilter::k_SelectedPreset_Key, std::make_any(k_RainbowPresetName)); presetFilePath = k_RainbowPresetPath; } SECTION(k_XRayPresetName) { REQUIRE(!presetsMap[k_XRayPresetName].empty()); - args.insertOrAssign(ComputeColorTableFilter::k_SelectedPreset_Key, std::make_any(k_XRayPresetName)); + args.insertOrAssign(CreateColorMapFilter::k_SelectedPreset_Key, std::make_any(k_XRayPresetName)); presetFilePath = k_XRayPresetPath; } { - args.insertOrAssign(ComputeColorTableFilter::k_SelectedDataArrayPath_Key, std::make_any(DataPath{{Constants::k_Confidence_Index.str()}})); - args.insertOrAssign(ComputeColorTableFilter::k_RgbArrayPath_Key, std::make_any("CI_RGB")); + args.insertOrAssign(CreateColorMapFilter::k_SelectedDataArrayPath_Key, std::make_any(DataPath{{Constants::k_Confidence_Index.str()}})); + args.insertOrAssign(CreateColorMapFilter::k_RgbArrayPath_Key, std::make_any("CI_RGB")); IFilter::ExecuteResult executeResult = filter.execute(dataStructure, args); SIMPLNX_RESULT_REQUIRE_VALID(executeResult.result) diff --git a/src/Plugins/SimplnxCore/wrapping/python/simplnxpy.cpp b/src/Plugins/SimplnxCore/wrapping/python/simplnxpy.cpp index 8836456254..82cf168840 100644 --- a/src/Plugins/SimplnxCore/wrapping/python/simplnxpy.cpp +++ b/src/Plugins/SimplnxCore/wrapping/python/simplnxpy.cpp @@ -55,7 +55,7 @@ #include #include #include -#include +#include #include #include #include @@ -1033,7 +1033,7 @@ PYBIND11_MODULE(simplnx, mod) auto dynamicTableParameter = SIMPLNX_PY_BIND_PARAMETER(mod, DynamicTableParameter); auto ensembleInfoParameter = SIMPLNX_PY_BIND_PARAMETER(mod, EnsembleInfoParameter); auto fileSystemPathParameter = SIMPLNX_PY_BIND_PARAMETER(mod, FileSystemPathParameter); - auto computeColorTableParameter = SIMPLNX_PY_BIND_PARAMETER(mod, ComputeColorTableParameter); + auto computeColorTableParameter = SIMPLNX_PY_BIND_PARAMETER(mod, CreateColorMapParameter); auto generatedFileListParameter = SIMPLNX_PY_BIND_PARAMETER(mod, GeneratedFileListParameter); auto geometrySelectionParameter = SIMPLNX_PY_BIND_PARAMETER(mod, GeometrySelectionParameter); auto importTextDataParameter = SIMPLNX_PY_BIND_PARAMETER(mod, ReadCSVFileParameter); @@ -1429,7 +1429,7 @@ PYBIND11_MODULE(simplnx, mod) internals->addConversion(); internals->addConversion(); internals->addConversion(); - internals->addConversion(); + internals->addConversion(); internals->addConversion(); internals->addConversion(); internals->addConversion(); diff --git a/src/simplnx/Parameters/ComputeColorTableParameter.cpp b/src/simplnx/Parameters/ComputeColorTableParameter.cpp deleted file mode 100644 index 255d3e826b..0000000000 --- a/src/simplnx/Parameters/ComputeColorTableParameter.cpp +++ /dev/null @@ -1,65 +0,0 @@ -#include "ComputeColorTableParameter.hpp" - -#include "simplnx/Common/Any.hpp" -#include "simplnx/util/ColorTable.hpp" - -#include -#include - -namespace nx::core -{ -ComputeColorTableParameter::ComputeColorTableParameter(const std::string& name, const std::string& humanName, const std::string& helpText, const ValueType& defaultValue) -: ValueParameter(name, humanName, helpText) -, m_DefaultValue(defaultValue) -{ -} - -Uuid ComputeColorTableParameter::uuid() const -{ - return ParameterTraits::uuid; -} - -IParameter::AcceptedTypes ComputeColorTableParameter::acceptedTypes() const -{ - return {typeid(ValueType)}; -} - -nlohmann::json ComputeColorTableParameter::toJson(const std::any& value) const -{ - const auto& nameStr = GetAnyRef(value); - nlohmann::json json = nameStr; - return json; -} - -Result ComputeColorTableParameter::fromJson(const nlohmann::json& json) const -{ - static constexpr StringLiteral prefix = "FilterParameter 'ComputeColorTableParameter' JSON Error: "; - if(!json.empty() && !json.is_string()) - { - return MakeErrorResult(-2, fmt::format("{}JSON value for key '{}' is not an object", prefix, name())); - } - - return {{std::make_any(json.get())}}; -} - -IParameter::UniquePointer ComputeColorTableParameter::clone() const -{ - return std::make_unique(name(), humanName(), helpText(), m_DefaultValue); -} - -std::any ComputeColorTableParameter::defaultValue() const -{ - return defaultJson(); -} - -typename ComputeColorTableParameter::ValueType ComputeColorTableParameter::defaultJson() const -{ - return m_DefaultValue; -} - -Result<> ComputeColorTableParameter::validate(const std::any& value) const -{ - [[maybe_unused]] const auto& json = GetAnyRef(value); - return {}; -} -} // namespace nx::core diff --git a/src/simplnx/Parameters/CreateColorMapParameter.cpp b/src/simplnx/Parameters/CreateColorMapParameter.cpp new file mode 100644 index 0000000000..283d9603f6 --- /dev/null +++ b/src/simplnx/Parameters/CreateColorMapParameter.cpp @@ -0,0 +1,65 @@ +#include "CreateColorMapParameter.hpp" + +#include "simplnx/Common/Any.hpp" +#include "simplnx/util/ColorTable.hpp" + +#include +#include + +namespace nx::core +{ +CreateColorMapParameter::CreateColorMapParameter(const std::string& name, const std::string& humanName, const std::string& helpText, const ValueType& defaultValue) +: ValueParameter(name, humanName, helpText) +, m_DefaultValue(defaultValue) +{ +} + +Uuid CreateColorMapParameter::uuid() const +{ + return ParameterTraits::uuid; +} + +IParameter::AcceptedTypes CreateColorMapParameter::acceptedTypes() const +{ + return {typeid(ValueType)}; +} + +nlohmann::json CreateColorMapParameter::toJson(const std::any& value) const +{ + const auto& nameStr = GetAnyRef(value); + nlohmann::json json = nameStr; + return json; +} + +Result CreateColorMapParameter::fromJson(const nlohmann::json& json) const +{ + static constexpr StringLiteral prefix = "FilterParameter 'CreateColorMapParameter' JSON Error: "; + if(!json.empty() && !json.is_string()) + { + return MakeErrorResult(-2, fmt::format("{}JSON value for key '{}' is not an object", prefix, name())); + } + + return {{std::make_any(json.get())}}; +} + +IParameter::UniquePointer CreateColorMapParameter::clone() const +{ + return std::make_unique(name(), humanName(), helpText(), m_DefaultValue); +} + +std::any CreateColorMapParameter::defaultValue() const +{ + return defaultJson(); +} + +typename CreateColorMapParameter::ValueType CreateColorMapParameter::defaultJson() const +{ + return m_DefaultValue; +} + +Result<> CreateColorMapParameter::validate(const std::any& value) const +{ + [[maybe_unused]] const auto& json = GetAnyRef(value); + return {}; +} +} // namespace nx::core diff --git a/src/simplnx/Parameters/ComputeColorTableParameter.hpp b/src/simplnx/Parameters/CreateColorMapParameter.hpp similarity index 57% rename from src/simplnx/Parameters/ComputeColorTableParameter.hpp rename to src/simplnx/Parameters/CreateColorMapParameter.hpp index 0fd62832ed..670fc4bdd1 100644 --- a/src/simplnx/Parameters/ComputeColorTableParameter.hpp +++ b/src/simplnx/Parameters/CreateColorMapParameter.hpp @@ -12,22 +12,22 @@ namespace nx::core { /** * @brief This FilterParameter represents a color preset, and works specifically - * with the ComputeColorTable filter. The data is held in an nlohmann::json object. + * with the CreateColorMap filter. The data is held in an nlohmann::json object. */ -class SIMPLNX_EXPORT ComputeColorTableParameter : public ValueParameter +class SIMPLNX_EXPORT CreateColorMapParameter : public ValueParameter { public: using ValueType = std::string; - ComputeColorTableParameter() = delete; - ComputeColorTableParameter(const std::string& name, const std::string& humanName, const std::string& helpText, const ValueType& defaultValue); - ~ComputeColorTableParameter() override = default; + CreateColorMapParameter() = delete; + CreateColorMapParameter(const std::string& name, const std::string& humanName, const std::string& helpText, const ValueType& defaultValue); + ~CreateColorMapParameter() override = default; - ComputeColorTableParameter(const ComputeColorTableParameter&) = delete; - ComputeColorTableParameter(ComputeColorTableParameter&&) noexcept = delete; + CreateColorMapParameter(const CreateColorMapParameter&) = delete; + CreateColorMapParameter(CreateColorMapParameter&&) noexcept = delete; - ComputeColorTableParameter& operator=(const ComputeColorTableParameter&) = delete; - ComputeColorTableParameter& operator=(ComputeColorTableParameter&&) noexcept = delete; + CreateColorMapParameter& operator=(const CreateColorMapParameter&) = delete; + CreateColorMapParameter& operator=(CreateColorMapParameter&&) noexcept = delete; /** * @brief @@ -83,4 +83,4 @@ class SIMPLNX_EXPORT ComputeColorTableParameter : public ValueParameter }; } // namespace nx::core -SIMPLNX_DEF_PARAMETER_TRAITS(nx::core::ComputeColorTableParameter, "7b0e5b25-564e-4797-b154-4324ef276bf0"); +SIMPLNX_DEF_PARAMETER_TRAITS(nx::core::CreateColorMapParameter, "7b0e5b25-564e-4797-b154-4324ef276bf0"); diff --git a/src/simplnx/Utilities/SIMPLConversion.hpp b/src/simplnx/Utilities/SIMPLConversion.hpp index b7e6a41ef7..325522f0b7 100644 --- a/src/simplnx/Utilities/SIMPLConversion.hpp +++ b/src/simplnx/Utilities/SIMPLConversion.hpp @@ -11,7 +11,7 @@ #include "simplnx/Parameters/BoolParameter.hpp" #include "simplnx/Parameters/CalculatorParameter.hpp" #include "simplnx/Parameters/ChoicesParameter.hpp" -#include "simplnx/Parameters/ComputeColorTableParameter.hpp" +#include "simplnx/Parameters/CreateColorMapParameter.hpp" #include "simplnx/Parameters/DataGroupCreationParameter.hpp" #include "simplnx/Parameters/DataGroupSelectionParameter.hpp" #include "simplnx/Parameters/DataObjectNameParameter.hpp" @@ -1676,9 +1676,9 @@ struct EnsembleInfoFilterParameterConverter } }; -struct ComputeColorTableFilterParameterConverter +struct CreateColorMapFilterParameterConverter { - using ParameterType = ComputeColorTableParameter; + using ParameterType = CreateColorMapParameter; using ValueType = ParameterType::ValueType; static constexpr StringLiteral k_SelectedPresetKey = "SelectedPresetName"; @@ -1689,11 +1689,11 @@ struct ComputeColorTableFilterParameterConverter { if(!json1.is_string()) { - return MakeErrorResult(-2, fmt::format("ComputeColorTableFilterParameterConverter json1 '{}' is not a string", json2.dump())); + return MakeErrorResult(-2, fmt::format("CreateColorMapFilterParameterConverter json1 '{}' is not a string", json2.dump())); } if(!json2.is_array()) { - return MakeErrorResult(-1, fmt::format("ComputeColorTableFilterParameterConverter json2 '{}' is not an array", json1.dump())); + return MakeErrorResult(-1, fmt::format("CreateColorMapFilterParameterConverter json2 '{}' is not an array", json1.dump())); } auto presetName = json1.get(); diff --git a/test/FilterValidationTest.cpp b/test/FilterValidationTest.cpp index e897f73298..13635ea3ae 100644 --- a/test/FilterValidationTest.cpp +++ b/test/FilterValidationTest.cpp @@ -45,7 +45,7 @@ void GenerateParameterList() ADD_PARAMETER_TRAIT(simplnx.DataTypeParameter, "d31358d5-3253-4c69-aff0-eb98618f851b") ADD_PARAMETER_TRAIT(simplnx.EnsembleInfoParameter, "10d3924f-b4c9-4e06-9225-ce11ec8dff89") ADD_PARAMETER_TRAIT(simplnx.ArrayThresholdsParameter, "e93251bc-cdad-44c2-9332-58fe26aedfbe") - ADD_PARAMETER_TRAIT(simplnx.ComputeColorTableParameter, "7b0e5b25-564e-4797-b154-4324ef276bf0") + ADD_PARAMETER_TRAIT(simplnx.CreateColorMapParameter, "7b0e5b25-564e-4797-b154-4324ef276bf0") ADD_PARAMETER_TRAIT(simplnx.DataObjectNameParameter, "fbc89375-3ca4-4eb2-8257-aad9bf8e1c94") ADD_PARAMETER_TRAIT(simplnx.NeighborListSelectionParameter, "ab0b7a7f-f9ab-4e6f-99b5-610e7b69fc5b") ADD_PARAMETER_TRAIT(simplnx.ChoicesParameter, "ee4d5ce2-9582-48fa-b182-8a766ce0feff") diff --git a/wrapping/python/docs/generate_sphinx_docs.cpp b/wrapping/python/docs/generate_sphinx_docs.cpp index 63c2866ab0..ba8e2995bd 100644 --- a/wrapping/python/docs/generate_sphinx_docs.cpp +++ b/wrapping/python/docs/generate_sphinx_docs.cpp @@ -52,7 +52,7 @@ void GenerateParameterList() ADD_PARAMETER_TRAIT(simplnx.DataTypeParameter, "d31358d5-3253-4c69-aff0-eb98618f851b") ADD_PARAMETER_TRAIT(simplnx.EnsembleInfoParameter, "10d3924f-b4c9-4e06-9225-ce11ec8dff89") ADD_PARAMETER_TRAIT(simplnx.ArrayThresholdsParameter, "e93251bc-cdad-44c2-9332-58fe26aedfbe") - ADD_PARAMETER_TRAIT(simplnx.ComputeColorTableParameter, "7b0e5b25-564e-4797-b154-4324ef276bf0") + ADD_PARAMETER_TRAIT(simplnx.CreateColorMapParameter, "7b0e5b25-564e-4797-b154-4324ef276bf0") ADD_PARAMETER_TRAIT(simplnx.DataObjectNameParameter, "fbc89375-3ca4-4eb2-8257-aad9bf8e1c94") ADD_PARAMETER_TRAIT(simplnx.NeighborListSelectionParameter, "ab0b7a7f-f9ab-4e6f-99b5-610e7b69fc5b") ADD_PARAMETER_TRAIT(simplnx.ChoicesParameter, "ee4d5ce2-9582-48fa-b182-8a766ce0feff") diff --git a/wrapping/python/docs/source/Developer_API.rst b/wrapping/python/docs/source/Developer_API.rst index 65bd3f2403..b1938784aa 100644 --- a/wrapping/python/docs/source/Developer_API.rst +++ b/wrapping/python/docs/source/Developer_API.rst @@ -937,21 +937,21 @@ General Parameters params.insert(nx.FileSystemPathParameter('output_dir', 'Output Directory', 'Example output directory help text', 'Output Data', set(), nx.FileSystemPathParameter.PathType.OutputDir)) params.insert(nx.FileSystemPathParameter('output_file', 'Output File', 'Example output file help text', '', set(), nx.FileSystemPathParameter.PathType.OutputFile)) -.. _ComputeColorTableParameter: -.. py:class:: ComputeColorTableParameter +.. _CreateColorMapParameter: +.. py:class:: CreateColorMapParameter Declaration ~~~~~~~~~~~ .. code-block:: python - ComputeColorTableParameter(name: str, human_name: str, help_text: str, default_value: str) -> None + CreateColorMapParameter(name: str, human_name: str, help_text: str, default_value: str) -> None Description ~~~~~~~~~~~ - The ``ComputeColorTableParameter`` is used to specify parameters for generating color tables, typically used in visualization or data representation. + The ``CreateColorMapParameter`` is used to specify parameters for generating color tables, typically used in visualization or data representation. - This parameter is used specifically for the :ref:`simplnx.ComputeColorTableFilter() ` filter. + This parameter is used specifically for the :ref:`simplnx.CreateColorMapFilter() ` filter. These are the color table presets: @@ -996,7 +996,7 @@ General Parameters import simplnx as nx - params.insert(nx.ComputeColorTableParameter('color_table_preset_key', "Select Color Preset...", "Select a preset color name.", "Cool to Warm")) + params.insert(nx.CreateColorMapParameter('color_table_preset_key', "Select Color Preset...", "Select a preset color name.", "Cool to Warm")) .. _GeneratedFileListParameter: .. py:class:: GeneratedFileListParameter diff --git a/wrapping/python/docs/source/User_API.rst b/wrapping/python/docs/source/User_API.rst index a58a1d1450..458fd9636a 100644 --- a/wrapping/python/docs/source/User_API.rst +++ b/wrapping/python/docs/source/User_API.rst @@ -305,10 +305,10 @@ General Parameters a_file_system_path = "/The/Path/To/The/File/Or/Directory" -.. _ComputeColorTableParameter: -.. py:class:: ComputeColorTableParameter (Updated v1.2.6) +.. _CreateColorMapParameter: +.. py:class:: CreateColorMapParameter (Updated v1.2.6) - This parameter is used specifically for the :ref:`simplnx.ComputeColorTableFilter() ` filter. This parameter + This parameter is used specifically for the :ref:`simplnx.CreateColorMapFilter() ` filter. This parameter represents a **string** value that corresponds to an RGB Preset Name and can be instantiated using a simple python string type. Default RGB Preset Names are as follows: @@ -331,7 +331,7 @@ General Parameters .. code:: python - result = nx.ComputeColorTableFilter.execute(data_structure=data_structure, + result = nx.CreateColorMapFilter.execute(data_structure=data_structure, rgb_array_path="CI Color", input_data_array_path=nx.DataPath("Small IN100/Scan Data/Confidence Index"), selected_preset="hsv") diff --git a/wrapping/python/examples/scripts/basic_ebsd_ipf.py b/wrapping/python/examples/scripts/basic_ebsd_ipf.py index 64aba640c9..fdfb5c2ad8 100644 --- a/wrapping/python/examples/scripts/basic_ebsd_ipf.py +++ b/wrapping/python/examples/scripts/basic_ebsd_ipf.py @@ -156,11 +156,11 @@ #------------------------------------------------------------------------------ # Generate a Colorized Version of the Confidence Index #------------------------------------------------------------------------------ -result = nx.ComputeColorTableFilter.execute(data_structure=data_structure, +result = nx.CreateColorMapFilter.execute(data_structure=data_structure, output_rgb_array_name="CI Color", input_data_array_path=nx.DataPath(["Small IN100", "Scan Data", "Confidence Index"]), selected_preset="Rainbow Desaturated") -nxtest.check_filter_result(nx.ComputeColorTableFilter, result) +nxtest.check_filter_result(nx.CreateColorMapFilter, result) #------------------------------------------------------------------------------ diff --git a/wrapping/python/plugins/ExamplePlugin/ExampleFilter1.py b/wrapping/python/plugins/ExamplePlugin/ExampleFilter1.py index 6441c20dcb..6b80a9158b 100644 --- a/wrapping/python/plugins/ExamplePlugin/ExampleFilter1.py +++ b/wrapping/python/plugins/ExamplePlugin/ExampleFilter1.py @@ -120,8 +120,8 @@ def parameters(self) -> nx.Parameters: ensemble_info.append(["Cubic-High m-3m","Primary","Phase 2"]) params.insert(nx.EnsembleInfoParameter(ExampleFilter1.PARAM15_KEY, "Created Ensemble Info", "The values with which to populate the crystal structures, phase types, and phase names data arrays. Each row corresponds to an ensemble phase.", ensemble_info)) - # See https://www.dream3d.io/python_docs/User_API.html#nx.ComputeColorTableParameter for the full list of preset names - params.insert(nx.ComputeColorTableParameter(ExampleFilter1.PARAM16_KEY, "Select Preset...", "Select a preset color scheme to apply to the created array", "Rainbow Desaturated")) + # See https://www.dream3d.io/python_docs/User_API.html#nx.CreateColorMapParameter for the full list of preset names + params.insert(nx.CreateColorMapParameter(ExampleFilter1.PARAM16_KEY, "Select Preset...", "Select a preset color scheme to apply to the created array", "Rainbow Desaturated")) dataset1 = nx.ReadHDF5DatasetParameter.DatasetImportInfo() dataset1.dataset_path = "/DataStructure/DataContainer/CellData/Confidence Index"