From a5adca0d6d0d61d92420a1403ac8035874269f48 Mon Sep 17 00:00:00 2001 From: Michael Jackson Date: Thu, 19 Sep 2024 13:45:50 -0400 Subject: [PATCH] Rearrange the parameters a bit to make the flow more logical. The user should start from the "top down" when filling out the parameters. 1: Name 2: Type 3: Number of Tuples 4: Number of Components 5: Initialize values. Signed-off-by: Michael Jackson --- .../Common/ITKArrayHelper.hpp | 2 + .../Filters/CreateDataArrayAdvancedFilter.cpp | 42 +++++++++---------- .../Filters/CreateDataArrayFilter.cpp | 16 +++---- 3 files changed, 32 insertions(+), 28 deletions(-) diff --git a/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Common/ITKArrayHelper.hpp b/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Common/ITKArrayHelper.hpp index 6d6d655f83..ff19849845 100644 --- a/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Common/ITKArrayHelper.hpp +++ b/src/Plugins/ITKImageProcessing/src/ITKImageProcessing/Common/ITKArrayHelper.hpp @@ -383,8 +383,10 @@ DataStore> ConvertImageToDataStore(itk::Image concept NotBoolT = !std::is_same_v; +// clang-format on template Result<> ConvertImageToDataStore(DataStore& dataStore, itk::Image& image) diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/CreateDataArrayAdvancedFilter.cpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/CreateDataArrayAdvancedFilter.cpp index 1a76a74480..bb9d3036c0 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/CreateDataArrayAdvancedFilter.cpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/CreateDataArrayAdvancedFilter.cpp @@ -71,15 +71,33 @@ Parameters CreateDataArrayAdvancedFilter::parameters() const { Parameters params; - params.insertSeparator(Parameters::Separator{"Input Parameter(s)"}); + params.insertSeparator(Parameters::Separator{"Output Data Array"}); + params.insert(std::make_unique(k_DataPath_Key, "Created Array", "Array storing the data", DataPath({"Data"}))); params.insert(std::make_unique(k_NumericType_Key, "Output Numeric Type", "Numeric Type of data to create", NumericType::int32)); + params.insert(std::make_unique(k_DataFormat_Key, "Data Format", + "This value will specify which data format is used by the array's data store. An empty string results in in-memory data store.", "")); + + params.insertSeparator(Parameters::Separator{"Tuple Dimensions"}); + params.insertLinkableParameter(std::make_unique( + k_AdvancedOptions_Key, "Set Tuple Dimensions [not required if creating inside an existing Attribute Matrix]", + "This allows the user to set the tuple dimensions directly rather than just inheriting them. This option is NOT required if you are creating the Data Array in an Attribute Matrix", true)); - params.insertSeparator(Parameters::Separator{"Component Handling"}); { + DynamicTableInfo tableInfo; + tableInfo.setRowsInfo(DynamicTableInfo::StaticVectorInfo(1)); + tableInfo.setColsInfo(DynamicTableInfo::DynamicVectorInfo(1, "TUPLE DIM {}")); + params.insert(std::make_unique(k_TupleDims_Key, "Data Array Tuple Dimensions (Slowest to Fastest Dimensions)", + "Slowest to Fastest Dimensions. Note this might be opposite displayed by an image geometry.", tableInfo)); + } + + params.insertSeparator(Parameters::Separator{"Component Dimensions"}); + { + DynamicTableInfo::TableDataType defaultValues = {{1ULL}}; DynamicTableInfo tableInfo; tableInfo.setRowsInfo(DynamicTableInfo::StaticVectorInfo(1)); tableInfo.setColsInfo(DynamicTableInfo::DynamicVectorInfo(1, "COMP DIM {}")); - params.insert(std::make_unique(k_CompDims_Key, "Data Array Component Dimensions (Slowest to Fastest Dimensions)", "Slowest to Fastest Component Dimensions.", tableInfo)); + params.insert(std::make_unique(k_CompDims_Key, "Data Array Component Dimensions (Slowest to Fastest Dimensions)", "Slowest to Fastest Component Dimensions.", defaultValues, + tableInfo)); } params.insertSeparator(Parameters::Separator{"Initialization Options"}); @@ -107,24 +125,6 @@ Parameters CreateDataArrayAdvancedFilter::parameters() const std::make_unique(k_InitStartRange_Key, "Initialization Start Range [Seperated with ;]", "[Inclusive] The lower bound initialization range for random values", "0;0;0")); params.insert(std::make_unique(k_InitEndRange_Key, "Initialization End Range [Seperated with ;]", "[Inclusive] The upper bound initialization range for random values", "1;1;1")); - params.insertSeparator(Parameters::Separator{"Output Data Array"}); - params.insert(std::make_unique(k_DataPath_Key, "Created Array", "Array storing the data", DataPath{})); - params.insert(std::make_unique(k_DataFormat_Key, "Data Format", - "This value will specify which data format is used by the array's data store. An empty string results in in-memory data store.", "")); - - params.insertSeparator(Parameters::Separator{"Tuple Handling"}); - params.insertLinkableParameter(std::make_unique( - k_AdvancedOptions_Key, "Set Tuple Dimensions [not required if creating inside an Attribute Matrix]", - "This allows the user to set the tuple dimensions directly rather than just inheriting them. This option is NOT required if you are creating the Data Array in an Attribute Matrix", true)); - - { - DynamicTableInfo tableInfo; - tableInfo.setRowsInfo(DynamicTableInfo::StaticVectorInfo(1)); - tableInfo.setColsInfo(DynamicTableInfo::DynamicVectorInfo(1, "TUPLE DIM {}")); - params.insert(std::make_unique(k_TupleDims_Key, "Data Array Tuple Dimensions (Slowest to Fastest Dimensions)", - "Slowest to Fastest Dimensions. Note this might be opposite displayed by an image geometry.", tableInfo)); - } - // Associate the Linkable Parameter(s) to the children parameters that they control params.linkParameters(k_AdvancedOptions_Key, k_TupleDims_Key, true); diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/CreateDataArrayFilter.cpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/CreateDataArrayFilter.cpp index b93e305e5c..834668b774 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/CreateDataArrayFilter.cpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/CreateDataArrayFilter.cpp @@ -71,17 +71,13 @@ Parameters CreateDataArrayFilter::parameters() const { Parameters params; - params.insertSeparator(Parameters::Separator{"Input Parameter(s)"}); - params.insert(std::make_unique(k_NumericType_Key, "Output Numeric Type", "Numeric Type of data to create", NumericType::int32)); - params.insert(std::make_unique(k_InitializationValue_Key, "Initialization Value", "This value will be used to fill the new array", "0")); - params.insert(std::make_unique(k_NumComps_Key, "Number of Components", "Number of components", 1)); - params.insertSeparator(Parameters::Separator{"Output Data Array"}); - params.insert(std::make_unique(k_DataPath_Key, "Created Array", "Array storing the data", DataPath{})); + params.insert(std::make_unique(k_DataPath_Key, "Created Array", "Array storing the data", DataPath({"Data"}))); + params.insert(std::make_unique(k_NumericType_Key, "Output Numeric Type", "Numeric Type of data to create", NumericType::int32)); params.insert(std::make_unique(k_DataFormat_Key, "Data Format", "This value will specify which data format is used by the array's data store. An empty string results in in-memory data store.", "")); - params.insertSeparator(Parameters::Separator{"Tuple Handling"}); + params.insertSeparator(Parameters::Separator{"Tuple Dimensions"}); params.insertLinkableParameter(std::make_unique( k_AdvancedOptions_Key, "Set Tuple Dimensions [not required if creating inside an Attribute Matrix]", "This allows the user to set the tuple dimensions directly rather than just inheriting them. This option is NOT required if you are creating the Data Array in an Attribute Matrix", true)); @@ -92,6 +88,12 @@ Parameters CreateDataArrayFilter::parameters() const params.insert(std::make_unique(k_TupleDims_Key, "Data Array Dimensions (Slowest to Fastest Dimensions)", "Slowest to Fastest Dimensions. Note this might be opposite displayed by an image geometry.", tableInfo)); + params.insertSeparator(Parameters::Separator{"Component Dimensions"}); + params.insert(std::make_unique(k_NumComps_Key, "Total Number of Components", "Total number of components. Do not set the component dimensions.", 1)); + + params.insertSeparator(Parameters::Separator{"Initialization Options"}); + params.insert(std::make_unique(k_InitializationValue_Key, "Initialization Value", "This value will be used to fill the new array", "0")); + // Associate the Linkable Parameter(s) to the children parameters that they control params.linkParameters(k_AdvancedOptions_Key, k_TupleDims_Key, true);