diff --git a/src/Plugins/ITKImageProcessing/pipelines/(02) Image Segmentation.d3dpipeline b/src/Plugins/ITKImageProcessing/pipelines/(02) Image Segmentation.d3dpipeline index 4dfaaa6265..7f8e440c19 100644 --- a/src/Plugins/ITKImageProcessing/pipelines/(02) Image Segmentation.d3dpipeline +++ b/src/Plugins/ITKImageProcessing/pipelines/(02) Image Segmentation.d3dpipeline @@ -6,15 +6,8 @@ { "args": { "cell_attribute_matrix_name": "Cell Data", - "change_image_data_type": false, - "color_weights": [ - 0.21250000596046448, - 0.715399980545044, - 0.07209999859333038 - ], - "convert_to_gray_scale": false, "image_data_array_name": "ImageData", - "image_data_type_index": 0, + "output_image_geometry_path": "ImageDataContainer", "image_transform_index": 0, "input_file_list_object": { "end_index": 174, @@ -32,9 +25,6 @@ 0.0, 0.0 ], - "output_image_geometry_path": "ImageDataContainer", - "scale_images": false, - "scaling": 1.0, "spacing": [ 1.0, 1.0, @@ -43,7 +33,7 @@ }, "comments": "", "filter": { - "name": "nx::core::ITKImportImageStackFilter", + "name": "simplnx::ITKImportImageStack", "uuid": "dcf980b7-ecca-46d1-af31-ac65f6e3b6bb" }, "isDisabled": false @@ -65,16 +55,11 @@ "type": "collection", "union": 0 }, - "created_mask_type": 10, - "custom_false_value": 0.0, - "custom_true_value": 1.0, - "output_data_array_name": "Mask", - "use_custom_false_value": false, - "use_custom_true_value": false + "output_data_array_name": "Mask" }, "comments": "", "filter": { - "name": "nx::core::MultiThresholdObjectsFilter", + "name": "simplnx::MultiThresholdObjects", "uuid": "4246245e-1011-4add-8436-0af6bed19228" }, "isDisabled": false @@ -84,8 +69,8 @@ "active_array_name": "Active", "cell_feature_group_name": "Cell Feature Data", "feature_ids_name": "FeatureIds", - "input_array_path": "ImageDataContainer/Cell Data/ImageData", "input_image_geometry_path": "ImageDataContainer", + "input_array_path": "ImageDataContainer/Cell Data/ImageData", "mask_path": "ImageDataContainer/Cell Data/Mask", "randomize_features": true, "scalar_tolerance": 0, @@ -93,7 +78,7 @@ }, "comments": "", "filter": { - "name": "nx::core::ScalarSegmentFeaturesFilter", + "name": "simplnx::ScalarSegmentFeaturesFilter", "uuid": "e067cd97-9bbf-4c92-89a6-3cb4fdb76c93" }, "isDisabled": false @@ -110,7 +95,7 @@ }, "comments": "", "filter": { - "name": "nx::core::ComputeFeatureSizesFilter", + "name": "simplnx::ComputeFeatureSizesFilter", "uuid": "c666ee17-ca58-4969-80d0-819986c72485" }, "isDisabled": false @@ -119,50 +104,34 @@ "args": { "created_array_suffix": "", "feature_ids_path": "ImageDataContainer/Cell Data/FeatureIds", - "selected_feature_array_paths": [ - "ImageDataContainer/Cell Feature Data/EquivalentDiameters" - ] + "selected_feature_array_paths": ["ImageDataContainer/Cell Feature Data/EquivalentDiameters"] }, "comments": "", "filter": { - "name": "nx::core::CopyFeatureArrayToElementArrayFilter", + "name": "simplnx::CopyFeatureArrayToElementArrayFilter", "uuid": "4c8c976a-993d-438b-bd8e-99f71114b9a1" }, "isDisabled": false }, { "args": { - "component_dimensions": [ - [ - 1.0 - ] - ], + "set_tuple_dimensions": false, + "component_count": 1, "data_format": "", - "init_end_range": "1;1;1", - "init_start_range": "0;0;0", - "init_type_index": 0, - "init_value": "1", + "initialization_value_str": "1", "numeric_type_index": 4, "output_array_path": "ImageDataContainer/Cell Data/Phases", - "seed_array_name": "InitializeDataFilter SeedValue", - "seed_value": 5489, - "set_tuple_dimensions": false, - "standardize_seed": false, - "starting_fill_value": "0;1;2", - "step_operation_index": 0, - "step_value": "1;1;1", "tuple_dimensions": [ [ 164.0, 390.0, 524.0 ] - ], - "use_seed": false + ] }, "comments": "", "filter": { - "name": "nx::core::CreateDataArrayFilter", + "name": "simplnx::CreateDataArrayFilter", "uuid": "67041f9b-bdc6-4122-acc6-c9fe9280e90d" }, "isDisabled": false @@ -170,7 +139,6 @@ { "args": { "conditional_array_path": "ImageDataContainer/Cell Data/Mask", - "invert_mask": false, "remove_value": "0", "replace_value": "2", "selected_array_path": "ImageDataContainer/Cell Data/Phases", @@ -178,7 +146,7 @@ }, "comments": "", "filter": { - "name": "nx::core::ConditionalSetValueFilter", + "name": "simplnx::ConditionalSetValueFilter", "uuid": "bad9b7bd-1dc9-4f21-a889-6520e7a41881" }, "isDisabled": false @@ -192,7 +160,7 @@ }, "comments": "", "filter": { - "name": "nx::core::ComputeFeaturePhasesFilter", + "name": "simplnx::ComputeFeaturePhasesFilter", "uuid": "da5bb20e-4a8e-49d9-9434-fbab7bc434fc" }, "isDisabled": false @@ -206,7 +174,7 @@ }, "comments": "", "filter": { - "name": "nx::core::ComputeFeatureCentroidsFilter", + "name": "simplnx::ComputeFeatureCentroidsFilter", "uuid": "c6875ac7-8bdd-4f69-b6ce-82ac09bd3421" }, "isDisabled": false @@ -222,7 +190,7 @@ }, "comments": "", "filter": { - "name": "nx::core::CreateAttributeMatrixFilter", + "name": "simplnx::CreateAttributeMatrixFilter", "uuid": "a6a28355-ee69-4874-bcac-76ed427423ed" }, "isDisabled": false @@ -234,12 +202,11 @@ }, "comments": "", "filter": { - "name": "nx::core::WriteDREAM3DFilter", + "name": "simplnx::WriteDREAM3DFilter", "uuid": "b3a95784-2ced-41ec-8d3d-0242ac130003" }, "isDisabled": false } ], - "version": 1, "workflowParams": [] } diff --git a/src/Plugins/ITKImageProcessing/pipelines/(04) Porosity Analysis.d3dpipeline b/src/Plugins/ITKImageProcessing/pipelines/(04) Porosity Analysis.d3dpipeline index df3d581637..3d578c5843 100644 --- a/src/Plugins/ITKImageProcessing/pipelines/(04) Porosity Analysis.d3dpipeline +++ b/src/Plugins/ITKImageProcessing/pipelines/(04) Porosity Analysis.d3dpipeline @@ -1,12 +1,10 @@ { "isDisabled": false, - "name": "(04) Porosity Analysis.d3dpipeline", - "pinnedParams": [], + "name": "(04) Porosity Analysis", "pipeline": [ { "args": { "cell_attribute_matrix_name": "Optical Data", - "change_image_data_type": false, "color_weights": [ 0.21250000596046448, 0.715399980545044, @@ -14,7 +12,6 @@ ], "convert_to_gray_scale": false, "image_data_array_name": "ImageData", - "image_data_type_index": 0, "image_transform_index": 0, "input_file_list_object": { "end_index": 174, @@ -33,8 +30,6 @@ 0.0 ], "output_image_geometry_path": "RoboMet.3D Image Stack", - "scale_images": false, - "scaling": 1.0, "spacing": [ 1.0, 1.0, @@ -132,31 +127,17 @@ }, { "args": { - "component_dimensions": [ - [ - 1.0 - ] - ], + "component_count": 1, "data_format": "", - "init_end_range": "1;1;1", - "init_start_range": "0;0;0", - "init_type_index": 0, - "init_value": "1", + "initialization_value_str": "1", "numeric_type_index": 4, "output_array_path": "RoboMet.3D Image Stack/Optical Data/Phases", - "seed_array_name": "InitializeDataFilter SeedValue", - "seed_value": 5489, "set_tuple_dimensions": false, - "standardize_seed": false, - "starting_fill_value": "0;1;2", - "step_operation_index": 0, - "step_value": "1;1;1", "tuple_dimensions": [ [ 0.0 ] - ], - "use_seed": false + ] }, "comments": "", "filter": { @@ -231,6 +212,7 @@ "cell_ensemble_attribute_matrix_path": "RoboMet.3D Image Stack/Ensemble Data", "centroids_array_path": "RoboMet.3D Image Stack/Pore Data/Centroids", "clustering_list_array_name": "ClusteringList", + "equivalent_diameters_array_path": "RoboMet.3D Image Stack/Pore Data/EquivalentDiameters", "feature_phases_array_path": "RoboMet.3D Image Stack/Pore Data/Phases", "input_image_geometry_path": "RoboMet.3D Image Stack", "max_min_array_name": "RDFMaxMinDistances", @@ -262,6 +244,5 @@ "isDisabled": false } ], - "version": 1, - "workflowParams": [] -} + "version": 1 +} \ No newline at end of file diff --git a/src/Plugins/OrientationAnalysis/pipelines/EnsembleInfoReader.d3dpipeline b/src/Plugins/OrientationAnalysis/pipelines/EnsembleInfoReader.d3dpipeline index d56394ae55..eab706dee4 100644 --- a/src/Plugins/OrientationAnalysis/pipelines/EnsembleInfoReader.d3dpipeline +++ b/src/Plugins/OrientationAnalysis/pipelines/EnsembleInfoReader.d3dpipeline @@ -1,6 +1,6 @@ { "isDisabled": false, - "name": "EnsembleInfoReader.d3dpipeline", + "name": "ReadEnsembleInfo.d3dpipeline", "pinnedParams": [], "pipeline": [ { @@ -11,12 +11,12 @@ 100, 2 ], + "output_image_geometry_path": "[Image Geometry]", "origin": [ 0.0, 0.0, 0.0 ], - "output_image_geometry_path": "[Image Geometry]", "spacing": [ 1.0, 1.0, @@ -25,7 +25,7 @@ }, "comments": "", "filter": { - "name": "nx::core::CreateImageGeometryFilter", + "name": "simplnx::CreateImageGeometryFilter", "uuid": "c4320659-1a84-461d-939e-c7c10229a504" }, "isDisabled": false @@ -48,7 +48,7 @@ }, "comments": "", "filter": { - "name": "nx::core::ReadRawBinaryFilter", + "name": "simplnx::ReadRawBinaryFilter", "uuid": "dd159366-5f12-42db-af6d-a33592ae8a89" }, "isDisabled": false @@ -62,44 +62,28 @@ }, "comments": "", "filter": { - "name": "nx::core::ConvertOrientationsFilter", + "name": "simplnx::ConvertOrientations", "uuid": "501e54e6-a66f-4eeb-ae37-00e649c00d4b" }, "isDisabled": false }, { "args": { - "component_dimensions": [ - [ - 1.0 - ] - ], - "data_format": "", - "init_end_range": "1;1;1", - "init_start_range": "0;0;0", - "init_type_index": 0, - "init_value": "1", + "component_count": 1, + "initialization_value_str": "1", "numeric_type_index": 4, "output_array_path": "[Image Geometry]/Cell Data/Phases", - "seed_array_name": "InitializeDataFilter SeedValue", - "seed_value": 5489, - "set_tuple_dimensions": true, - "standardize_seed": false, - "starting_fill_value": "0;1;2", - "step_operation_index": 0, - "step_value": "1;1;1", "tuple_dimensions": [ [ 2.0, 100.0, 100.0 ] - ], - "use_seed": false + ] }, "comments": "", "filter": { - "name": "nx::core::CreateDataArrayFilter", + "name": "simplnx::CreateDataArrayFilter", "uuid": "67041f9b-bdc6-4122-acc6-c9fe9280e90d" }, "isDisabled": false @@ -114,7 +98,7 @@ }, "comments": "", "filter": { - "name": "nx::core::ReadEnsembleInfoFilter", + "name": "simplnx::ReadEnsembleInfoFilter", "uuid": "ecf1ec45-bc27-4ddb-b2c0-3d465b8c182a" }, "isDisabled": false @@ -135,7 +119,7 @@ }, "comments": "", "filter": { - "name": "nx::core::ComputeIPFColorsFilter", + "name": "simplnx::ComputeIPFColorsFilter", "uuid": "64cb4f27-6e5e-4dd2-8a03-0c448cb8f5e6" }, "isDisabled": false @@ -147,12 +131,11 @@ }, "comments": "", "filter": { - "name": "nx::core::WriteDREAM3DFilter", + "name": "simplnx::WriteDREAM3DFilter", "uuid": "b3a95784-2ced-41ec-8d3d-0242ac130003" }, "isDisabled": false } ], - "version": 1, "workflowParams": [] } diff --git a/src/Plugins/SimplnxCore/CMakeLists.txt b/src/Plugins/SimplnxCore/CMakeLists.txt index d327c9280c..0b9c01bf98 100644 --- a/src/Plugins/SimplnxCore/CMakeLists.txt +++ b/src/Plugins/SimplnxCore/CMakeLists.txt @@ -51,6 +51,7 @@ set(FilterList CopyFeatureArrayToElementArrayFilter CreateAttributeMatrixFilter CreateDataArrayFilter + CreateDataArrayAdvancedFilter CreateDataGroupFilter CreateFeatureArrayFromElementArrayFilter CreateGeometryFilter diff --git a/src/Plugins/SimplnxCore/docs/CreateDataArrayAdvancedFilter.md b/src/Plugins/SimplnxCore/docs/CreateDataArrayAdvancedFilter.md new file mode 100644 index 0000000000..8decabea5e --- /dev/null +++ b/src/Plugins/SimplnxCore/docs/CreateDataArrayAdvancedFilter.md @@ -0,0 +1,67 @@ +# Create Data Array (Advanced) + +## Group (Subgroup) + +Core (Generation) + +## Description + +This **Filter** creates a **Data Array** of any primitive type with any set of component dimensions. The array is initialized to a user defined value or with random values within a specified range. + +When initializing a multicomponent array square bracket notation can be used to specify different initialization values for each component. For example say that I want to intialize a 2 component array where the first component is 0 and the second component is 1 we would use the following input string for the *Initialization Value* + + 0;1 + +We are using semicolons instead of commas or decimal points due to different international standards (European versus United States?). + +Another example is if you want to create a floating point array where each tuple has 10 components but you just want the value of 2.5 to be used for each, then simply use: + + 2.5 + +When creating a Data Array within an Attribute matrix, the tuple dimensions will **always** be taken direct from the Attribute Matrix. This means that the *Set Tuple Dimensions* parameter can be unchecked to hide the tuple dimensions entry table. + +If the parent is **NOT an Attribute Matrix**, then the user ***MUST*** set the tuple dimensions themselves. + +### Scalar Type Values + + static const int Int8 = 0; + static const int UInt8 = 1; + static const int Int16 = 2; + static const int UInt16 = 3; + static const int Int32 = 4; + static const int UInt32 = 5; + static const int Int64 = 6; + static const int UInt64 = 7; + static const int Float = 8; + static const int Double = 9; + static const int Bool = 10; + +### Primitive Data Type Valid Ranges + +| Type | Size | Range | +|------------------|------|--------------------| +| Signed Integer | 8 bit |0 to 255| +| Unsigned Integer | 8 bit |-128 to 127| +| Signed Integer | 16 bit |-32,768 to 32,767| +| Unsigned Integer | 16 bit |0 to 65,535| +| Signed Integer | 32 bit |-2,147,483,648 to 2,147,483,647| +| Unsigned Integer | 32 bit |0 to 4,294,967,295| +| Signed Integer | 64 bit | 9,223,372,036,854,775,808 to 9,223,372,036,854,775,807| +| Unsigned Integer | 64 bit |0 to 18,446,744,073,709,551,615| +| Float | 32 bit | -3.4e+38 to -1.1e-38, 0.0, 1.1e-38 to 3.4e+38 (7 digits)| +| Double | 64 bit | -1.7e+308 to -2.2e-308, 0.0, 2.2e-308 to 1.7e+308 (15 digits)| +| Boolean | 8 bit |0 = false and any other value will be forced to 1 = true| + +The component dimensions should multiply together into a total number of components equal to at least 1. Examples of *Component Dimensions* would be [3] for an RGB Image, [1] for a gray scale image, [1] for a scalar array, [4] for a quaternions array, [10x5] for an array with 10x5 grids at each tuple, etc. All values of the array will be initialized using the chosen initialization option. + +% Auto generated parameter table will be inserted here + +## Example Pipelines + +## License & Copyright + +Please see the description file distributed with this **Plugin** + +## DREAM3D-NX Help + +If you need help, need to file a bug report or want to request a new feature, please head over to the [DREAM3DNX-Issues](https://github.com/BlueQuartzSoftware/DREAM3DNX-Issues/discussions) GitHub site where the community of DREAM3D-NX users can help answer your questions. diff --git a/src/Plugins/SimplnxCore/docs/CreateDataArrayFilter.md b/src/Plugins/SimplnxCore/docs/CreateDataArrayFilter.md index ba5b092cfa..9d4ee58da9 100644 --- a/src/Plugins/SimplnxCore/docs/CreateDataArrayFilter.md +++ b/src/Plugins/SimplnxCore/docs/CreateDataArrayFilter.md @@ -6,7 +6,7 @@ Core (Generation) ## Description -This **Filter** creates a **Data Array** of any primitive type with any set of component dimensions. The array is initialized to a user define value or with random values within a specified range. +This **Filter** creates an **Data Array** of any primitive type with any number of components along a *single component dimension*. For example, a scalar as (1) or a 3-vector as (3), but *not* a matrix as (3, 3). The array is initialized to a user define value or with random values within a specified range. When initializing a multicomponent array square bracket notation can be used to specify different initialization values for each component. For example say that I want to intialize a 2 component array where the first component is 0 and the second component is 1 we would use the following input string for the *Initialization Value* @@ -52,7 +52,8 @@ If the parent is **NOT an Attribute Matrix**, then the user ***MUST*** set the t | Double | 64 bit | -1.7e+308 to -2.2e-308, 0.0, 2.2e-308 to 1.7e+308 (15 digits)| | Boolean | 8 bit |0 = false and any other value will be forced to 1 = true| -The component dimensions should multiply together into a total number of components equal to at least 1. Examples of *Component Dimensions* would be [3] for an RGB Image, [1] for a gray scale image, [1] for a scalar array, [4] for a quaternions array, [10x5] for an array with 10x5 grids at each tuple, etc. All values of the array will be initialized using the chosen initialization option. +The number of components should be at least 1. Examples of *Number of Components* would be 3 for an RGB Image, 1 for a gray scale image, 1 for a scalar array, 4 for a quaternions array, etc. All values of the array will be initialized to the user set value. The initialization value text box +must have a user entry or the default value *0* will be used. % Auto generated parameter table will be inserted here diff --git a/src/Plugins/SimplnxCore/pipelines/ApplyTransformation_Demo.d3dpipeline b/src/Plugins/SimplnxCore/pipelines/ApplyTransformation_Demo.d3dpipeline index 0508c4f30a..0df9fc92ba 100644 --- a/src/Plugins/SimplnxCore/pipelines/ApplyTransformation_Demo.d3dpipeline +++ b/src/Plugins/SimplnxCore/pipelines/ApplyTransformation_Demo.d3dpipeline @@ -1,7 +1,6 @@ { "isDisabled": false, - "name": "ApplyTransformation_Demo.d3dpipeline", - "pinnedParams": [], + "name": "Apply Transformation To Geometry Demo", "pipeline": [ { "args": { @@ -48,33 +47,19 @@ }, { "args": { - "component_dimensions": [ - [ - 1.0 - ] - ], + "component_count": 1, "data_format": "", - "init_end_range": "1;1;1", - "init_start_range": "0;0;0", - "init_type_index": 0, - "init_value": "2", + "initialization_value_str": "2", "numeric_type_index": 4, "output_array_path": "Geometry/Cell Data/Data", - "seed_array_name": "InitializeDataFilter SeedValue", - "seed_value": 5489, "set_tuple_dimensions": false, - "standardize_seed": false, - "starting_fill_value": "0;1;2", - "step_operation_index": 0, - "step_value": "1;1;1", "tuple_dimensions": [ [ 2.0, 10.0, 10.0 ] - ], - "use_seed": false + ] }, "comments": "", "filter": { @@ -142,6 +127,5 @@ "isDisabled": false } ], - "version": 1, - "workflowParams": [] -} + "version": 1 +} \ No newline at end of file diff --git a/src/Plugins/SimplnxCore/pipelines/ArrayCalculatorExample.d3dpipeline b/src/Plugins/SimplnxCore/pipelines/ArrayCalculatorExample.d3dpipeline index ea5c0e5ffa..51e5b64ebc 100644 --- a/src/Plugins/SimplnxCore/pipelines/ArrayCalculatorExample.d3dpipeline +++ b/src/Plugins/SimplnxCore/pipelines/ArrayCalculatorExample.d3dpipeline @@ -1,109 +1,60 @@ { "isDisabled": false, - "name": "ArrayCalculatorExample.d3dpipeline", - "pinnedParams": [], + "name": "Untitled Pipeline", "pipeline": [ { "args": { - "component_dimensions": [ - [ - 1.0 - ] - ], - "data_format": "", - "init_end_range": "1;1;1", - "init_start_range": "0;0;0", - "init_type_index": 0, - "init_value": "2", + "component_count": 1, + "initialization_value_str": "2", "numeric_type_index": 4, "output_array_path": "TestArray", - "seed_array_name": "InitializeDataFilter SeedValue", - "seed_value": 5489, - "set_tuple_dimensions": true, - "standardize_seed": false, - "starting_fill_value": "0;1;2", - "step_operation_index": 0, - "step_value": "1;1;1", "tuple_dimensions": [ [ 10.0 ] - ], - "use_seed": false + ] }, "comments": "", "filter": { - "name": "nx::core::CreateDataArrayFilter", + "name": "simplnx::CreateDataArrayFilter", "uuid": "67041f9b-bdc6-4122-acc6-c9fe9280e90d" }, "isDisabled": false }, { "args": { - "component_dimensions": [ - [ - 1.0 - ] - ], - "data_format": "", - "init_end_range": "1;1;1", - "init_start_range": "0;0;0", - "init_type_index": 0, - "init_value": "1.23878", + "component_count": 1, + "initialization_value_str": "1.23878", "numeric_type_index": 8, "output_array_path": "Confidence Index", - "seed_array_name": "InitializeDataFilter SeedValue", - "seed_value": 5489, - "set_tuple_dimensions": true, - "standardize_seed": false, - "starting_fill_value": "0;1;2", - "step_operation_index": 0, - "step_value": "1;1;1", "tuple_dimensions": [ [ 10.0 ] - ], - "use_seed": false + ] }, "comments": "", "filter": { - "name": "nx::core::CreateDataArrayFilter", + "name": "simplnx::CreateDataArrayFilter", "uuid": "67041f9b-bdc6-4122-acc6-c9fe9280e90d" }, "isDisabled": false }, { "args": { - "component_dimensions": [ - [ - 3.0 - ] - ], - "data_format": "", - "init_end_range": "1;1;1", - "init_start_range": "0;0;0", - "init_type_index": 0, - "init_value": "1.23878", + "component_count": 3, + "initialization_value_str": "1.23878", "numeric_type_index": 8, "output_array_path": "EulerAngles", - "seed_array_name": "InitializeDataFilter SeedValue", - "seed_value": 5489, - "set_tuple_dimensions": true, - "standardize_seed": false, - "starting_fill_value": "0;1;2", - "step_operation_index": 0, - "step_value": "1;1;1", "tuple_dimensions": [ [ 10.0 ] - ], - "use_seed": false + ] }, "comments": "", "filter": { - "name": "nx::core::CreateDataArrayFilter", + "name": "simplnx::CreateDataArrayFilter", "uuid": "67041f9b-bdc6-4122-acc6-c9fe9280e90d" }, "isDisabled": false @@ -120,7 +71,7 @@ }, "comments": "", "filter": { - "name": "nx::core::ArrayCalculatorFilter", + "name": "simplnx::ArrayCalculatorFilter", "uuid": "eea49b17-0db2-5bbc-80ef-f44249cc8d55" }, "isDisabled": false @@ -137,7 +88,7 @@ }, "comments": "", "filter": { - "name": "nx::core::ArrayCalculatorFilter", + "name": "simplnx::ArrayCalculatorFilter", "uuid": "eea49b17-0db2-5bbc-80ef-f44249cc8d55" }, "isDisabled": false @@ -154,7 +105,7 @@ }, "comments": "", "filter": { - "name": "nx::core::ArrayCalculatorFilter", + "name": "simplnx::ArrayCalculatorFilter", "uuid": "eea49b17-0db2-5bbc-80ef-f44249cc8d55" }, "isDisabled": false @@ -171,7 +122,7 @@ }, "comments": "", "filter": { - "name": "nx::core::ArrayCalculatorFilter", + "name": "simplnx::ArrayCalculatorFilter", "uuid": "eea49b17-0db2-5bbc-80ef-f44249cc8d55" }, "isDisabled": false @@ -188,7 +139,7 @@ }, "comments": "", "filter": { - "name": "nx::core::ArrayCalculatorFilter", + "name": "simplnx::ArrayCalculatorFilter", "uuid": "eea49b17-0db2-5bbc-80ef-f44249cc8d55" }, "isDisabled": false @@ -205,7 +156,7 @@ }, "comments": "", "filter": { - "name": "nx::core::ArrayCalculatorFilter", + "name": "simplnx::ArrayCalculatorFilter", "uuid": "eea49b17-0db2-5bbc-80ef-f44249cc8d55" }, "isDisabled": false @@ -217,12 +168,10 @@ }, "comments": "", "filter": { - "name": "nx::core::WriteDREAM3DFilter", + "name": "simplnx::WriteDREAM3DFilter", "uuid": "b3a95784-2ced-41ec-8d3d-0242ac130003" }, "isDisabled": false } - ], - "version": 1, - "workflowParams": [] -} + ] +} \ No newline at end of file diff --git a/src/Plugins/SimplnxCore/pipelines/CreateEdgeGeom.d3dpipeline b/src/Plugins/SimplnxCore/pipelines/CreateEdgeGeom.d3dpipeline index bc4b558153..29ee3bb56b 100644 --- a/src/Plugins/SimplnxCore/pipelines/CreateEdgeGeom.d3dpipeline +++ b/src/Plugins/SimplnxCore/pipelines/CreateEdgeGeom.d3dpipeline @@ -155,31 +155,17 @@ }, { "args": { - "component_dimensions": [ - [ - 1.0 - ] - ], + "component_count": 1, "data_format": "", - "init_end_range": "1;1;1", - "init_start_range": "0;0;0", - "init_type_index": 0, - "init_value": "0", + "initialization_value_str": "0", "numeric_type_index": 4, "output_array_path": "Geometry/Edge Data/Int32Array", - "seed_array_name": "InitializeDataFilter SeedValue", - "seed_value": 5489, "set_tuple_dimensions": true, - "standardize_seed": false, - "starting_fill_value": "0;1;2", - "step_operation_index": 0, - "step_value": "1;1;1", "tuple_dimensions": [ [ 0.0 ] - ], - "use_seed": false + ] }, "comments": "", "filter": { @@ -212,31 +198,17 @@ }, { "args": { - "component_dimensions": [ - [ - 1.0 - ] - ], + "component_count": 1, "data_format": "", - "init_end_range": "1;1;1", - "init_start_range": "0;0;0", - "init_type_index": 0, - "init_value": "0", + "initialization_value_str": "0", "numeric_type_index": 6, "output_array_path": "Geometry/Edge Data/Int64Array", - "seed_array_name": "InitializeDataFilter SeedValue", - "seed_value": 5489, "set_tuple_dimensions": true, - "standardize_seed": false, - "starting_fill_value": "0;1;2", - "step_operation_index": 0, - "step_value": "1;1;1", "tuple_dimensions": [ [ 0.0 ] - ], - "use_seed": false + ] }, "comments": "", "filter": { diff --git a/src/Plugins/SimplnxCore/pipelines/CreateHexahedralGeom.d3dpipeline b/src/Plugins/SimplnxCore/pipelines/CreateHexahedralGeom.d3dpipeline index c70a6e08db..3878797320 100644 --- a/src/Plugins/SimplnxCore/pipelines/CreateHexahedralGeom.d3dpipeline +++ b/src/Plugins/SimplnxCore/pipelines/CreateHexahedralGeom.d3dpipeline @@ -173,31 +173,17 @@ }, { "args": { - "component_dimensions": [ - [ - 1.0 - ] - ], + "component_count": 1, "data_format": "", - "init_end_range": "1;1;1", - "init_start_range": "0;0;0", - "init_type_index": 0, - "init_value": "0", + "initialization_value_str": "0", "numeric_type_index": 4, "output_array_path": "Geometry/Cell Data/Int32Array", - "seed_array_name": "InitializeDataFilter SeedValue", - "seed_value": 5489, "set_tuple_dimensions": true, - "standardize_seed": false, - "starting_fill_value": "0;1;2", - "step_operation_index": 0, - "step_value": "1;1;1", "tuple_dimensions": [ [ 0.0 ] - ], - "use_seed": false + ] }, "comments": "", "filter": { @@ -230,31 +216,17 @@ }, { "args": { - "component_dimensions": [ - [ - 1.0 - ] - ], + "component_count": 1, "data_format": "", - "init_end_range": "1;1;1", - "init_start_range": "0;0;0", - "init_type_index": 0, - "init_value": "0", + "initialization_value_str": "0", "numeric_type_index": 6, "output_array_path": "Geometry/Cell Data/Int64Array", - "seed_array_name": "InitializeDataFilter SeedValue", - "seed_value": 5489, "set_tuple_dimensions": true, - "standardize_seed": false, - "starting_fill_value": "0;1;2", - "step_operation_index": 0, - "step_value": "1;1;1", "tuple_dimensions": [ [ 0.0 ] - ], - "use_seed": false + ] }, "comments": "", "filter": { diff --git a/src/Plugins/SimplnxCore/pipelines/CreateImageGeom.d3dpipeline b/src/Plugins/SimplnxCore/pipelines/CreateImageGeom.d3dpipeline index acffcbbb2f..de5010f239 100644 --- a/src/Plugins/SimplnxCore/pipelines/CreateImageGeom.d3dpipeline +++ b/src/Plugins/SimplnxCore/pipelines/CreateImageGeom.d3dpipeline @@ -48,31 +48,17 @@ }, { "args": { - "component_dimensions": [ - [ - 1.0 - ] - ], + "component_count": 1, "data_format": "", - "init_end_range": "1;1;1", - "init_start_range": "0;0;0", - "init_type_index": 0, - "init_value": "0", + "initialization_value_str": "0", "numeric_type_index": 4, "output_array_path": "Image Geometry/Cell Data/Int32Array", - "seed_array_name": "InitializeDataFilter SeedValue", - "seed_value": 5489, "set_tuple_dimensions": true, - "standardize_seed": false, - "starting_fill_value": "0;1;2", - "step_operation_index": 0, - "step_value": "1;1;1", "tuple_dimensions": [ [ 0.0 ] - ], - "use_seed": false + ] }, "comments": "", "filter": { @@ -105,31 +91,17 @@ }, { "args": { - "component_dimensions": [ - [ - 1.0 - ] - ], + "component_count": 1, "data_format": "", - "init_end_range": "1;1;1", - "init_start_range": "0;0;0", - "init_type_index": 0, - "init_value": "0", + "initialization_value_str": "0", "numeric_type_index": 6, "output_array_path": "Image Geometry/Cell Data/Int64Array", - "seed_array_name": "InitializeDataFilter SeedValue", - "seed_value": 5489, "set_tuple_dimensions": true, - "standardize_seed": false, - "starting_fill_value": "0;1;2", - "step_operation_index": 0, - "step_value": "1;1;1", "tuple_dimensions": [ [ 0.0 ] - ], - "use_seed": false + ] }, "comments": "", "filter": { diff --git a/src/Plugins/SimplnxCore/pipelines/CreateQuadGeom.d3dpipeline b/src/Plugins/SimplnxCore/pipelines/CreateQuadGeom.d3dpipeline index 7d805a4447..22e07a97bb 100644 --- a/src/Plugins/SimplnxCore/pipelines/CreateQuadGeom.d3dpipeline +++ b/src/Plugins/SimplnxCore/pipelines/CreateQuadGeom.d3dpipeline @@ -161,31 +161,17 @@ }, { "args": { - "component_dimensions": [ - [ - 1.0 - ] - ], + "component_count": 1, "data_format": "", - "init_end_range": "1;1;1", - "init_start_range": "0;0;0", - "init_type_index": 0, - "init_value": "0", + "initialization_value_str": "0", "numeric_type_index": 4, "output_array_path": "Geometry/Face Data/Int32Array", - "seed_array_name": "InitializeDataFilter SeedValue", - "seed_value": 5489, "set_tuple_dimensions": true, - "standardize_seed": false, - "starting_fill_value": "0;1;2", - "step_operation_index": 0, - "step_value": "1;1;1", "tuple_dimensions": [ [ 0.0 ] - ], - "use_seed": false + ] }, "comments": "", "filter": { @@ -218,31 +204,17 @@ }, { "args": { - "component_dimensions": [ - [ - 1.0 - ] - ], + "component_count": 1, "data_format": "", - "init_end_range": "1;1;1", - "init_start_range": "0;0;0", - "init_type_index": 0, - "init_value": "0", + "initialization_value_str": "0", "numeric_type_index": 6, "output_array_path": "Geometry/Face Data/Int64Array", - "seed_array_name": "InitializeDataFilter SeedValue", - "seed_value": 5489, "set_tuple_dimensions": true, - "standardize_seed": false, - "starting_fill_value": "0;1;2", - "step_operation_index": 0, - "step_value": "1;1;1", "tuple_dimensions": [ [ 0.0 ] - ], - "use_seed": false + ] }, "comments": "", "filter": { diff --git a/src/Plugins/SimplnxCore/pipelines/CreateRectGridGeom.d3dpipeline b/src/Plugins/SimplnxCore/pipelines/CreateRectGridGeom.d3dpipeline index ab5102a93f..43f2b04b90 100644 --- a/src/Plugins/SimplnxCore/pipelines/CreateRectGridGeom.d3dpipeline +++ b/src/Plugins/SimplnxCore/pipelines/CreateRectGridGeom.d3dpipeline @@ -85,31 +85,17 @@ }, { "args": { - "component_dimensions": [ - [ - 1.0 - ] - ], + "component_count": 1, "data_format": "", - "init_end_range": "1;1;1", - "init_start_range": "0;0;0", - "init_type_index": 0, - "init_value": "0", + "initialization_value_str": "0", "numeric_type_index": 4, "output_array_path": "Geometry/Cell Data/Int32Array", - "seed_array_name": "InitializeDataFilter SeedValue", - "seed_value": 5489, "set_tuple_dimensions": true, - "standardize_seed": false, - "starting_fill_value": "0;1;2", - "step_operation_index": 0, - "step_value": "1;1;1", "tuple_dimensions": [ [ 0.0 ] - ], - "use_seed": false + ] }, "comments": "", "filter": { @@ -142,31 +128,17 @@ }, { "args": { - "component_dimensions": [ - [ - 1.0 - ] - ], + "component_count": 1, "data_format": "", - "init_end_range": "1;1;1", - "init_start_range": "0;0;0", - "init_type_index": 0, - "init_value": "0", + "initialization_value_str": "0", "numeric_type_index": 6, "output_array_path": "Geometry/Cell Data/Int64Array", - "seed_array_name": "InitializeDataFilter SeedValue", - "seed_value": 5489, "set_tuple_dimensions": true, - "standardize_seed": false, - "starting_fill_value": "0;1;2", - "step_operation_index": 0, - "step_value": "1;1;1", "tuple_dimensions": [ [ 0.0 ] - ], - "use_seed": false + ] }, "comments": "", "filter": { diff --git a/src/Plugins/SimplnxCore/pipelines/CreateTetrahedralGeom.d3dpipeline b/src/Plugins/SimplnxCore/pipelines/CreateTetrahedralGeom.d3dpipeline index 44719460ff..c1237a6ee9 100644 --- a/src/Plugins/SimplnxCore/pipelines/CreateTetrahedralGeom.d3dpipeline +++ b/src/Plugins/SimplnxCore/pipelines/CreateTetrahedralGeom.d3dpipeline @@ -161,31 +161,17 @@ }, { "args": { - "component_dimensions": [ - [ - 1.0 - ] - ], + "component_count": 1, "data_format": "", - "init_end_range": "1;1;1", - "init_start_range": "0;0;0", - "init_type_index": 0, - "init_value": "0", + "initialization_value_str": "0", "numeric_type_index": 4, "output_array_path": "Geometry/Cell Data/Int32Array", - "seed_array_name": "InitializeDataFilter SeedValue", - "seed_value": 5489, "set_tuple_dimensions": true, - "standardize_seed": false, - "starting_fill_value": "0;1;2", - "step_operation_index": 0, - "step_value": "1;1;1", "tuple_dimensions": [ [ 0.0 ] - ], - "use_seed": false + ] }, "comments": "", "filter": { @@ -218,31 +204,17 @@ }, { "args": { - "component_dimensions": [ - [ - 1.0 - ] - ], + "component_count": 1, "data_format": "", - "init_end_range": "1;1;1", - "init_start_range": "0;0;0", - "init_type_index": 0, - "init_value": "0", + "initialization_value_str": "0", "numeric_type_index": 6, "output_array_path": "Geometry/Cell Data/Int64Array", - "seed_array_name": "InitializeDataFilter SeedValue", - "seed_value": 5489, "set_tuple_dimensions": true, - "standardize_seed": false, - "starting_fill_value": "0;1;2", - "step_operation_index": 0, - "step_value": "1;1;1", "tuple_dimensions": [ [ 0.0 ] - ], - "use_seed": false + ] }, "comments": "", "filter": { diff --git a/src/Plugins/SimplnxCore/pipelines/CreateTriangleGeom.d3dpipeline b/src/Plugins/SimplnxCore/pipelines/CreateTriangleGeom.d3dpipeline index efbf97feb7..fe4a137f90 100644 --- a/src/Plugins/SimplnxCore/pipelines/CreateTriangleGeom.d3dpipeline +++ b/src/Plugins/SimplnxCore/pipelines/CreateTriangleGeom.d3dpipeline @@ -158,31 +158,17 @@ }, { "args": { - "component_dimensions": [ - [ - 1.0 - ] - ], + "component_count": 1, "data_format": "", - "init_end_range": "1;1;1", - "init_start_range": "0;0;0", - "init_type_index": 0, - "init_value": "0", + "initialization_value_str": "0", "numeric_type_index": 4, "output_array_path": "Geometry/Face Data/Int32Array", - "seed_array_name": "InitializeDataFilter SeedValue", - "seed_value": 5489, "set_tuple_dimensions": true, - "standardize_seed": false, - "starting_fill_value": "0;1;2", - "step_operation_index": 0, - "step_value": "1;1;1", "tuple_dimensions": [ [ 0.0 ] - ], - "use_seed": false + ] }, "comments": "", "filter": { @@ -215,31 +201,17 @@ }, { "args": { - "component_dimensions": [ - [ - 1.0 - ] - ], + "component_count": 1, "data_format": "", - "init_end_range": "1;1;1", - "init_start_range": "0;0;0", - "init_type_index": 0, - "init_value": "0", + "initialization_value_str": "0", "numeric_type_index": 6, "output_array_path": "Geometry/Face Data/Int64Array", - "seed_array_name": "InitializeDataFilter SeedValue", - "seed_value": 5489, "set_tuple_dimensions": true, - "standardize_seed": false, - "starting_fill_value": "0;1;2", - "step_operation_index": 0, - "step_value": "1;1;1", "tuple_dimensions": [ [ 0.0 ] - ], - "use_seed": false + ] }, "comments": "", "filter": { diff --git a/src/Plugins/SimplnxCore/pipelines/CreateVertexGeom.d3dpipeline b/src/Plugins/SimplnxCore/pipelines/CreateVertexGeom.d3dpipeline index bdaa18160c..f461a6c40a 100644 --- a/src/Plugins/SimplnxCore/pipelines/CreateVertexGeom.d3dpipeline +++ b/src/Plugins/SimplnxCore/pipelines/CreateVertexGeom.d3dpipeline @@ -103,31 +103,17 @@ }, { "args": { - "component_dimensions": [ - [ - 1.0 - ] - ], + "component_count": 1, "data_format": "", - "init_end_range": "1;1;1", - "init_start_range": "0;0;0", - "init_type_index": 0, - "init_value": "0", + "initialization_value_str": "0", "numeric_type_index": 4, "output_array_path": "Geometry/Vertex Data/Int32Array", - "seed_array_name": "InitializeDataFilter SeedValue", - "seed_value": 5489, "set_tuple_dimensions": true, - "standardize_seed": false, - "starting_fill_value": "0;1;2", - "step_operation_index": 0, - "step_value": "1;1;1", "tuple_dimensions": [ [ 0.0 ] - ], - "use_seed": false + ] }, "comments": "", "filter": { @@ -160,31 +146,17 @@ }, { "args": { - "component_dimensions": [ - [ - 1.0 - ] - ], + "component_count": 1, "data_format": "", - "init_end_range": "1;1;1", - "init_start_range": "0;0;0", - "init_type_index": 0, - "init_value": "0", + "initialization_value_str": "0", "numeric_type_index": 6, "output_array_path": "Geometry/Vertex Data/Int64Array", - "seed_array_name": "InitializeDataFilter SeedValue", - "seed_value": 5489, "set_tuple_dimensions": true, - "standardize_seed": false, - "starting_fill_value": "0;1;2", - "step_operation_index": 0, - "step_value": "1;1;1", "tuple_dimensions": [ [ 0.0 ] - ], - "use_seed": false + ] }, "comments": "", "filter": { diff --git a/src/Plugins/SimplnxCore/pipelines/Import_CSV_File.d3dpipeline b/src/Plugins/SimplnxCore/pipelines/Import_CSV_File.d3dpipeline index 2945eda819..3c24c32fac 100644 --- a/src/Plugins/SimplnxCore/pipelines/Import_CSV_File.d3dpipeline +++ b/src/Plugins/SimplnxCore/pipelines/Import_CSV_File.d3dpipeline @@ -1,7 +1,6 @@ { "isDisabled": false, - "name": "Import_CSV_File.d3dpipeline", - "pinnedParams": [], + "name": "Import CSV File", "pipeline": [ { "args": { @@ -73,7 +72,7 @@ 480000 ] }, - "selected_attribute_matrix_path": "[Image Geometry]/Cell Data", + "selected_attribute_matrix_path": "[Image Geometry]/Cell Data/", "use_existing_group": true }, "comments": "", @@ -86,9 +85,9 @@ { "args": { "input_data_array_paths": [ - "[Image Geometry]/Cell Data/phi1", - "[Image Geometry]/Cell Data/Phi", - "[Image Geometry]/Cell Data/phi2" + "[Image Geometry]/Cell Data//phi1", + "[Image Geometry]/Cell Data//Phi", + "[Image Geometry]/Cell Data//phi2" ], "move_values": true, "normalize_data": false, @@ -124,31 +123,17 @@ }, { "args": { - "component_dimensions": [ - [ - 1.0 - ] - ], + "component_count": 1, "data_format": "", - "init_end_range": "1;1;1", - "init_start_range": "0;0;0", - "init_type_index": 0, - "init_value": "1", + "initialization_value_str": "1", "numeric_type_index": 4, - "output_array_path": "[Image Geometry]/Cell Data/Phases", - "seed_array_name": "InitializeDataFilter SeedValue", - "seed_value": 5489, + "output_array_path": "[Image Geometry]/Cell Data//Phases", "set_tuple_dimensions": true, - "standardize_seed": false, - "starting_fill_value": "0;1;2", - "step_operation_index": 0, - "step_value": "1;1;1", "tuple_dimensions": [ [ 0.0 ] - ], - "use_seed": false + ] }, "comments": "", "filter": { @@ -159,9 +144,9 @@ }, { "args": { - "cell_euler_angles_array_path": "[Image Geometry]/Cell Data/Eulers", + "cell_euler_angles_array_path": "[Image Geometry]/Cell Data//Eulers", "cell_ipf_colors_array_name": "IPFColors", - "cell_phases_array_path": "[Image Geometry]/Cell Data/Phases", + "cell_phases_array_path": "[Image Geometry]/Cell Data//Phases", "crystal_structures_array_path": "[Image Geometry]/EnsembleAttributeMatrix/CrystalStructures", "mask_array_path": "", "reference_dir": [ @@ -181,7 +166,7 @@ { "args": { "file_name": "Data/Output/Import_CSV_Example/Import_ASCII_IPF.png", - "image_array_path": "[Image Geometry]/Cell Data/IPFColors", + "image_array_path": "[Image Geometry]/Cell Data//IPFColors", "index_offset": 0, "input_image_geometry_path": "[Image Geometry]", "plane_index": 0 @@ -194,6 +179,5 @@ "isDisabled": false } ], - "version": 1, - "workflowParams": [] -} + "version": 1 +} \ No newline at end of file diff --git a/src/Plugins/SimplnxCore/pipelines/Import_STL_Model.d3dpipeline b/src/Plugins/SimplnxCore/pipelines/Import_STL_Model.d3dpipeline index 657b7a4047..ddbb0fc4f3 100644 --- a/src/Plugins/SimplnxCore/pipelines/Import_STL_Model.d3dpipeline +++ b/src/Plugins/SimplnxCore/pipelines/Import_STL_Model.d3dpipeline @@ -5,69 +5,49 @@ "pipeline": [ { "args": { - "face_attribute_matrix_name": "Face Data", - "face_normals_name": "Face Normals", "output_triangle_geometry_path": "[Triangle Geometry]", "scale_factor": 1.0, "scale_output": false, - "stl_file_path": "Data/STL_Models/Cylinder.stl", - "vertex_attribute_matrix_name": "Vertex Data" + "stl_file_path": "Data/STL_Models/Cylinder.stl" }, "comments": "", "filter": { - "name": "nx::core::ReadStlFileFilter", + "name": "simplnx::ReadStlFileFilter", "uuid": "2f64bd45-9d28-4254-9e07-6aa7c6d3d015" }, "isDisabled": false }, { "args": { - "input_triangle_geometry_path": "[Triangle Geometry]", - "triangle_areas_array_name": "Areas" + "triangle_areas_array_name": "Areas", + "input_triangle_geometry_path": "[Triangle Geometry]" }, "comments": "", "filter": { - "name": "nx::core::ComputeTriangleAreasFilter", + "name": "simplnx::ComputeTriangleAreasFilter", "uuid": "b149addd-c0c8-4010-a264-596005eaf2a5" }, "isDisabled": false }, { "args": { - "component_dimensions": [ - [ - 1.0 - ] - ], - "data_format": "", - "init_end_range": "1;1;1", - "init_start_range": "0;0;0", - "init_type_index": 0, - "init_value": "0", + "component_count": 1, + "initialization_value_str": "0", "numeric_type_index": 8, "output_array_path": "[Triangle Geometry]/Vertex Data/Node Type", - "seed_array_name": "InitializeDataFilter SeedValue", - "seed_value": 5489, - "set_tuple_dimensions": true, - "standardize_seed": false, - "starting_fill_value": "0;1;2", - "step_operation_index": 0, - "step_value": "1;1;1", "tuple_dimensions": [ [ 1.0 ] - ], - "use_seed": false + ] }, "comments": "", "filter": { - "name": "nx::core::CreateDataArrayFilter", + "name": "simplnx::CreateDataArrayFilter", "uuid": "67041f9b-bdc6-4122-acc6-c9fe9280e90d" }, "isDisabled": true } ], - "version": 1, "workflowParams": [] } diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/CreateDataArrayAdvancedFilter.cpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/CreateDataArrayAdvancedFilter.cpp new file mode 100644 index 0000000000..1a76a74480 --- /dev/null +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/CreateDataArrayAdvancedFilter.cpp @@ -0,0 +1,477 @@ +#include "CreateDataArrayAdvancedFilter.hpp" + +#include "SimplnxCore/Filters/Algorithms/InitializeData.hpp" + +#include "simplnx/Common/TypesUtility.hpp" +#include "simplnx/Filter/Actions/CreateArrayAction.hpp" +#include "simplnx/Parameters/ArrayCreationParameter.hpp" +#include "simplnx/Parameters/BoolParameter.hpp" +#include "simplnx/Parameters/DataStoreFormatParameter.hpp" +#include "simplnx/Parameters/DynamicTableParameter.hpp" +#include "simplnx/Parameters/NumberParameter.hpp" +#include "simplnx/Parameters/NumericTypeParameter.hpp" +#include "simplnx/Parameters/StringParameter.hpp" +#include "simplnx/Utilities/DataArrayUtilities.hpp" +#include "simplnx/Utilities/FilterUtilities.hpp" +#include "simplnx/Utilities/SIMPLConversion.hpp" + +#include + +using namespace nx::core; + +namespace +{ +struct CreateAndInitArrayFunctor +{ + template + void operator()(IDataArray* iDataArray, const std::string& initValue) + { + Result result = ConvertTo::convert(initValue); + + auto* dataStore = iDataArray->template getIDataStoreAs>(); + dataStore->fill(result.value()); + } +}; +} // namespace + +namespace nx::core +{ +//------------------------------------------------------------------------------ +std::string CreateDataArrayAdvancedFilter::name() const +{ + return FilterTraits::name; +} + +//------------------------------------------------------------------------------ +std::string CreateDataArrayAdvancedFilter::className() const +{ + return FilterTraits::className; +} + +//------------------------------------------------------------------------------ +Uuid CreateDataArrayAdvancedFilter::uuid() const +{ + return FilterTraits::uuid; +} + +//------------------------------------------------------------------------------ +std::string CreateDataArrayAdvancedFilter::humanName() const +{ + return "Create Data Array (Advanced)"; +} + +//------------------------------------------------------------------------------ +std::vector CreateDataArrayAdvancedFilter::defaultTags() const +{ + return {className(), "Create", "Data Structure", "Data Array", "Initialize", "Make"}; +} + +//------------------------------------------------------------------------------ +Parameters CreateDataArrayAdvancedFilter::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.insertSeparator(Parameters::Separator{"Component Handling"}); + { + 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.insertSeparator(Parameters::Separator{"Initialization Options"}); + params.insertLinkableParameter(std::make_unique(k_InitType_Key, "Initialization Type", "Method for determining the what values of the data in the array should be initialized to", + static_cast(0), + ChoicesParameter::Choices{"Fill Value", "Incremental", "Random", "Random With Range"})); // sequence dependent DO NOT REORDER + + params.insert(std::make_unique(k_InitValue_Key, "Fill Values [Seperated with ;]", + "Specify values for each component. Ex: A 3-component array would be 6;8;12 and every tuple would have these same component values", "1;1;1")); + + params.insert(std::make_unique( + k_StartingFillValue_Key, "Starting Value [Seperated with ;]", + "The value to start incrementing from. Ex: 6;8;12 would increment a 3-component array starting at 6 for the first component, 8 for the 2nd, and 12 for the 3rd.", "0;1;2")); + params.insert(std::make_unique(k_StepOperation_Key, "Step Operation", "The type of step operation to perform", static_cast(0), + ChoicesParameter::Choices{"Addition", "Subtraction"})); + params.insert(std::make_unique(k_StepValue_Key, "Increment/Step Value [Seperated with ;]", "The number to increment/decrement the fill value by", "1;1;1")); + + params.insert(std::make_unique(k_UseSeed_Key, "Use Seed for Random Generation", "When true, the Seed Value will be used to seed the generator", false)); + params.insert(std::make_unique>(k_SeedValue_Key, "Seed Value", "The seed fed into the random generator", std::mt19937::default_seed)); + params.insert(std::make_unique(k_SeedArrayName_Key, "Stored Seed Value Array Name", "Name of the array holding the seed value", "InitializeDataFilter SeedValue")); + params.insert(std::make_unique(k_StandardizeSeed_Key, "Use the Same Seed for Each Component", + "When true the same seed will be used for each component's generator in a multi-component array", false)); + + params.insert( + 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); + + // Associate the Linkable Parameter(s) to the children parameters that they control + /* Using Fill Value */ + params.linkParameters(k_InitType_Key, k_InitValue_Key, static_cast(0)); + + /* Using Incremental */ + params.linkParameters(k_InitType_Key, k_StartingFillValue_Key, static_cast(1)); + params.linkParameters(k_InitType_Key, k_StepOperation_Key, static_cast(1)); + params.linkParameters(k_InitType_Key, k_StepValue_Key, static_cast(1)); + + /* Random - Using Random */ + params.linkParameters(k_InitType_Key, k_UseSeed_Key, static_cast(2)); + params.linkParameters(k_InitType_Key, k_SeedValue_Key, static_cast(2)); + params.linkParameters(k_InitType_Key, k_SeedArrayName_Key, static_cast(2)); + params.linkParameters(k_InitType_Key, k_StandardizeSeed_Key, static_cast(2)); + + /* Random - Using Random With Range */ + params.linkParameters(k_InitType_Key, k_UseSeed_Key, static_cast(3)); + params.linkParameters(k_InitType_Key, k_SeedValue_Key, static_cast(3)); + params.linkParameters(k_InitType_Key, k_SeedArrayName_Key, static_cast(3)); + params.linkParameters(k_InitType_Key, k_StandardizeSeed_Key, static_cast(3)); + params.linkParameters(k_InitType_Key, k_InitStartRange_Key, static_cast(3)); + params.linkParameters(k_InitType_Key, k_InitEndRange_Key, static_cast(3)); + return params; +} + +//------------------------------------------------------------------------------ +IFilter::UniquePointer CreateDataArrayAdvancedFilter::clone() const +{ + return std::make_unique(); +} + +//------------------------------------------------------------------------------ +IFilter::PreflightResult CreateDataArrayAdvancedFilter::preflightImpl(const DataStructure& dataStructure, const Arguments& filterArgs, const MessageHandler& messageHandler, + const std::atomic_bool& shouldCancel) const +{ + auto useDims = filterArgs.value(k_AdvancedOptions_Key); + auto numericType = filterArgs.value(k_NumericType_Key); + auto compDimsData = filterArgs.value(k_CompDims_Key); + auto dataArrayPath = filterArgs.value(k_DataPath_Key); + auto tableData = filterArgs.value(k_TupleDims_Key); + auto dataFormat = filterArgs.value(k_DataFormat_Key); + + nx::core::Result resultOutputActions; + + std::vector compDims(compDimsData[0].size()); + std::transform(compDimsData[0].begin(), compDimsData[0].end(), compDims.begin(), [](double val) { return static_cast(val); }); + usize numComponents = std::accumulate(compDims.begin(), compDims.end(), static_cast(1), std::multiplies<>()); + if(numComponents <= 0) + { + std::string compDimsStr = std::accumulate(compDims.begin() + 1, compDims.end(), std::to_string(compDims[0]), [](const std::string& a, int b) { return a + " x " + std::to_string(b); }); + return MakePreflightErrorResult( + -78601, + fmt::format("The chosen component dimensions ({}) results in 0 total components. Please choose component dimensions that result in a positive number of total components.", compDimsStr)); + } + + std::vector tupleDims = {}; + + auto* parentAM = dataStructure.getDataAs(dataArrayPath.getParent()); + if(parentAM == nullptr) + { + if(!useDims) + { + return MakePreflightErrorResult( + -78602, fmt::format("The DataArray to be created '{}'is not within an AttributeMatrix, so the dimensions cannot be determined implicitly. Check Set Tuple Dimensions to set the dimensions", + dataArrayPath.toString())); + } + else + { + const auto& rowData = tableData.at(0); + tupleDims.reserve(rowData.size()); + for(auto floatValue : rowData) + { + if(floatValue == 0) + { + return MakePreflightErrorResult(-78603, "Tuple dimension cannot be zero"); + } + + tupleDims.push_back(static_cast(floatValue)); + } + } + } + else + { + tupleDims = parentAM->getShape(); + if(useDims) + { + resultOutputActions.warnings().push_back( + Warning{-78604, "You checked Set Tuple Dimensions, but selected a DataPath that has an Attribute Matrix as the parent. The Attribute Matrix tuples will override your " + "custom dimensions. It is recommended to uncheck Set Tuple Dimensions for the sake of clarity."}); + } + } + + auto arrayDataType = ConvertNumericTypeToDataType(numericType); + auto action = std::make_unique(ConvertNumericTypeToDataType(numericType), tupleDims, compDims, dataArrayPath, dataFormat); + + resultOutputActions.value().appendAction(std::move(action)); + + auto seedArrayNameValue = filterArgs.value(k_SeedArrayName_Key); + auto initializeTypeValue = static_cast(filterArgs.value(k_InitType_Key)); + + // nx::core::Result resultOutputActions; + std::vector preflightUpdatedValues; + + if(arrayDataType == DataType::boolean) + { + std::stringstream updatedValStrm; + + updatedValStrm << "We detected that you are doing an operation on a boolean array.\n"; + updatedValStrm << "The ONLY two ways to specify a 'false' boolean value are as follows:\n"; + updatedValStrm << "- boolean value string types as follows ignoring apostrophe marks: 'False', 'FALSE', 'false'\n"; + updatedValStrm << "- all well formed integers and well formed floating point definitions of 0\n\n"; + + updatedValStrm << "ANY OTHER string or number WILL BE 'true', although it is good practice to define true values as follows:\n"; + updatedValStrm << "- boolean value string types as follows ignoring apostrophe marks: 'True', 'TRUE', 'true'\n"; + updatedValStrm << "- all well formed integers and well formed floating point definitions of 1"; + + preflightUpdatedValues.push_back({"Boolean Note", updatedValStrm.str()}); + } + + if(numComponents > 1) + { + std::stringstream updatedValStrm; + + updatedValStrm << "We detected that you are doing an operation on a multi-component array.\n"; + updatedValStrm + << "If you do NOT want to use unique values for each component, you can just supply one value to the input box and we will apply that value to every component for the tuple.\nExample: 1\n\n"; + + updatedValStrm << fmt::format("If you DO want to use unique values for each component, you need to supply {} values of type {} seperated by '{}'.\n", numComponents, + DataTypeToString(arrayDataType), k_DelimiterChar); + updatedValStrm << "Example: "; + + for(usize comp = 0; comp < numComponents; comp++) + { + updatedValStrm << "1"; + + if(comp != numComponents - 1) + { + updatedValStrm << k_DelimiterChar; + } + } + + preflightUpdatedValues.push_back({"Multi-Component Note", updatedValStrm.str()}); + } + + std::stringstream operationNuancesStrm; + + switch(initializeTypeValue) + { + case InitializeType::FillValue: { + auto result = ExecuteDataFunction(::ValidateMultiInputFunctor{}, arrayDataType, numComponents, filterArgs.value(k_InitValue_Key), 1); + if(result.outputActions.invalid()) + { + return {MergeResults(result.outputActions, std::move(resultOutputActions)), std::move(preflightUpdatedValues)}; + } + + operationNuancesStrm << "None to note"; + + break; + } + case InitializeType::Incremental: { + auto result = ExecuteDataFunction(::ValidateMultiInputFunctor{}, arrayDataType, numComponents, filterArgs.value(k_StartingFillValue_Key), 1); + if(result.outputActions.invalid()) + { + return {MergeResults(result.outputActions, std::move(resultOutputActions)), std::move(preflightUpdatedValues)}; + } + + if(arrayDataType == DataType::boolean) + { + // custom bool checks here + std::stringstream updatedValStrm; + + updatedValStrm << "We detected that you are doing an incremental operation on a boolean array.\n"; + updatedValStrm << "For the step values please enter uint8 values, preferably a 0 or 1 only.\n"; + + switch(static_cast(filterArgs.value(k_StepOperation_Key))) + { + case Addition: { + updatedValStrm << "You have currently selected the addition operation.\nAny step value that is greater than 0 will cause all values to be 'true' after the first tuple, 'true' " + "values will remain unchanged.\n"; + updatedValStrm << "The two possibilities:\n"; + updatedValStrm << "- If your start value is 'false' and step value > 0, the array will initialize to | false | true | true | ... |\n"; + updatedValStrm << "- If your start value is 'true' and step value > 0, the array will initialize to | true | true | true | ... |"; + break; + } + case Subtraction: { + updatedValStrm << "You have currently selected the addition operation.\nAny step value that is greater than 0 will cause all values to be 'false' after the first tuple, 'false' " + "values will remain unchanged.\n"; + updatedValStrm << "The two possibilities:\n"; + updatedValStrm << "- If your start value is 'true' and step value > 0, the array will initialize to | true | false | false | ... |\n"; + updatedValStrm << "- If your start value is 'false' and step value > 0, the array will initialize to | false | false | false | ... |"; + break; + } + } + + preflightUpdatedValues.push_back({"Boolean Incremental Nuances", updatedValStrm.str()}); + + result = ExecuteDataFunction(::ValidateMultiInputFunctor{}, DataType::uint8, numComponents, filterArgs.value(k_StepValue_Key), 1); + if(result.outputActions.invalid()) + { + return {MergeResults(result.outputActions, std::move(resultOutputActions)), std::move(preflightUpdatedValues)}; + } + } + else + { + result = ExecuteDataFunction(::ValidateMultiInputFunctor{}, arrayDataType, numComponents, filterArgs.value(k_StepValue_Key), 1); + if(result.outputActions.invalid()) + { + return {MergeResults(result.outputActions, std::move(resultOutputActions)), std::move(preflightUpdatedValues)}; + } + } + auto values = StringUtilities::split(filterArgs.value(k_StepValue_Key), ";", false); + std::vector zeroIdx; + for(size_t i = 0; i < values.size(); i++) + { + if(values[i] == "0") + { + zeroIdx.push_back(i); + } + } + if(!zeroIdx.empty()) + { + + operationNuancesStrm << "Warning: Zero Step Value found. Component(s) " << fmt::format("[{}]", fmt::join(zeroIdx, ",")) + << " have a ZERO value for the step/increment.\n The values for those components will be unchanged from the starting value.\n"; + operationNuancesStrm << fmt::format(" Example: Suppose we have a two component array with a Step Values of '2{}0', Starting Values of '0', and an addition Step Operation\n", k_DelimiterChar); + operationNuancesStrm << " The output array would look like 0,0 | 2,0 | 4,0 | 6,0 | ..."; + } + break; + } + case InitializeType::RangedRandom: { + auto result = ExecuteDataFunction(::ValidateMultiInputFunctor{}, arrayDataType, numComponents, filterArgs.value(k_InitStartRange_Key), 1); + if(result.outputActions.invalid()) + { + return {MergeResults(result.outputActions, std::move(resultOutputActions)), std::move(preflightUpdatedValues)}; + } + + result = ExecuteDataFunction(::ValidateMultiInputFunctor{}, arrayDataType, numComponents, filterArgs.value(k_InitEndRange_Key), 1); + if(result.outputActions.invalid()) + { + return {MergeResults(result.outputActions, std::move(resultOutputActions)), std::move(preflightUpdatedValues)}; + } + + [[fallthrough]]; + } + case InitializeType::Random: { + auto createAction = std::make_unique(DataType::uint64, std::vector{1}, std::vector{1}, DataPath({seedArrayNameValue})); + resultOutputActions.value().appendAction(std::move(createAction)); + + if(numComponents == 1) + { + if(filterArgs.value(k_StandardizeSeed_Key)) + { + operationNuancesStrm << fmt::format("You chose to standardize the seed for each component, but the array {} is a single component so it will not alter the randomization scheme.", + dataArrayPath.getTargetName()); + } + } + else + { + if(filterArgs.value(k_StandardizeSeed_Key)) + { + operationNuancesStrm << "This generates THE SAME sequences of random numbers for each component in the array based on one seed.\n"; + operationNuancesStrm << "The resulting array will look like | 1,1,1 | 9,9,9 | ...\n"; + } + else + { + operationNuancesStrm << "This generates DIFFERENT sequences of random numbers for each component in the array based on x seeds all modified versions of an original seed.\n"; + operationNuancesStrm << "The resulting array will look like | 1,9,5 | 7,1,6 | ...\n"; + } + } + + break; + } + } + + preflightUpdatedValues.push_back({"Operation Nuances", operationNuancesStrm.str()}); + + return {std::move(resultOutputActions), std::move(preflightUpdatedValues)}; +} + +//------------------------------------------------------------------------------ +Result<> CreateDataArrayAdvancedFilter::executeImpl(DataStructure& dataStructure, const Arguments& filterArgs, const PipelineFilter* pipelineNode, const MessageHandler& messageHandler, + const std::atomic_bool& shouldCancel) const +{ + auto path = filterArgs.value(k_DataPath_Key); + + ExecuteNeighborFunction(CreateAndInitArrayFunctor{}, ConvertNumericTypeToDataType(filterArgs.value(k_NumericType_Key)), dataStructure.getDataAs(path), "0"); + + auto initType = static_cast(filterArgs.value(k_InitType_Key)); + + auto seed = filterArgs.value(k_SeedValue_Key); + if(!filterArgs.value(k_UseSeed_Key)) + { + seed = static_cast(std::chrono::steady_clock::now().time_since_epoch().count()); + } + + if(initType == InitializeType::Random || initType == InitializeType::RangedRandom) + { + // Store Seed Value in Top Level Array + dataStructure.getDataRefAs(DataPath({filterArgs.value(k_SeedArrayName_Key)}))[0] = seed; + } + + InitializeDataInputValues inputValues; + inputValues.InputArrayPath = filterArgs.value(k_DataPath_Key); + inputValues.initType = initType; + inputValues.stepType = static_cast(filterArgs.value(k_StepOperation_Key)); + inputValues.stringValues = StringUtilities::split(StringUtilities::trimmed(filterArgs.value(k_InitValue_Key)), k_DelimiterChar); + inputValues.startValues = StringUtilities::split(StringUtilities::trimmed(filterArgs.value(k_StartingFillValue_Key)), k_DelimiterChar); + inputValues.stepValues = StringUtilities::split(StringUtilities::trimmed(filterArgs.value(k_StepValue_Key)), k_DelimiterChar); + inputValues.seed = seed; + inputValues.randBegin = StringUtilities::split(StringUtilities::trimmed(filterArgs.value(k_InitStartRange_Key)), k_DelimiterChar); + inputValues.randEnd = StringUtilities::split(StringUtilities::trimmed(filterArgs.value(k_InitEndRange_Key)), k_DelimiterChar); + inputValues.standardizeSeed = filterArgs.value(k_StandardizeSeed_Key); + + return InitializeData(dataStructure, messageHandler, shouldCancel, &inputValues)(); +} + +namespace +{ +namespace SIMPL +{ +constexpr StringLiteral k_ScalarTypeKey = "ScalarType"; +constexpr StringLiteral k_NumberOfComponentsKey = "NumberOfComponents"; +constexpr StringLiteral k_InitializationValueKey = "InitializationValue"; +constexpr StringLiteral k_NewArrayKey = "NewArray"; +} // namespace SIMPL +} // namespace + +Result CreateDataArrayAdvancedFilter::FromSIMPLJson(const nlohmann::json& json) +{ + Arguments args = CreateDataArrayAdvancedFilter().getDefaultArguments(); + + args.insertOrAssign(k_AdvancedOptions_Key, false); + + std::vector> results; + + results.push_back(SIMPLConversion::ConvertParameter(args, json, SIMPL::k_ScalarTypeKey, k_NumericType_Key)); + // Initialize Type parameter is not applicable in NX + results.push_back(SIMPLConversion::ConvertParameter(args, json, SIMPL::k_InitializationValueKey, k_InitValue_Key)); + // Initialization Range parameter is not applicable in NX + // Starting Index value parameter is not applicable in NX + results.push_back(SIMPLConversion::ConvertParameter(args, json, SIMPL::k_NewArrayKey, k_DataPath_Key)); + + Result<> conversionResult = MergeResults(std::move(results)); + + return ConvertResultTo(std::move(conversionResult), std::move(args)); +} +} // namespace nx::core diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/CreateDataArrayAdvancedFilter.hpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/CreateDataArrayAdvancedFilter.hpp new file mode 100644 index 0000000000..d1fcf9e9ff --- /dev/null +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/CreateDataArrayAdvancedFilter.hpp @@ -0,0 +1,114 @@ +#pragma once + +#include "SimplnxCore/SimplnxCore_export.hpp" + +#include "simplnx/Common/StringLiteral.hpp" +#include "simplnx/Filter/FilterTraits.hpp" +#include "simplnx/Filter/IFilter.hpp" + +namespace nx::core +{ +class SIMPLNXCORE_EXPORT CreateDataArrayAdvancedFilter : public IFilter +{ +public: + CreateDataArrayAdvancedFilter() = default; + ~CreateDataArrayAdvancedFilter() noexcept override = default; + + CreateDataArrayAdvancedFilter(const CreateDataArrayAdvancedFilter&) = delete; + CreateDataArrayAdvancedFilter(CreateDataArrayAdvancedFilter&&) noexcept = delete; + + CreateDataArrayAdvancedFilter& operator=(const CreateDataArrayAdvancedFilter&) = delete; + CreateDataArrayAdvancedFilter& operator=(CreateDataArrayAdvancedFilter&&) noexcept = delete; + + // Parameter Keys + static inline constexpr StringLiteral k_NumericType_Key = "numeric_type_index"; + static inline constexpr StringLiteral k_AdvancedOptions_Key = "set_tuple_dimensions"; + static inline constexpr StringLiteral k_CompDims_Key = "component_dimensions"; + static inline constexpr StringLiteral k_TupleDims_Key = "tuple_dimensions"; + static inline constexpr StringLiteral k_DataPath_Key = "output_array_path"; + static inline constexpr StringLiteral k_DataFormat_Key = "data_format"; + static inline constexpr StringLiteral k_InitType_Key = "init_type_index"; + static inline constexpr StringLiteral k_InitValue_Key = "init_value"; + static inline constexpr StringLiteral k_StartingFillValue_Key = "starting_fill_value"; + static inline constexpr StringLiteral k_StepOperation_Key = "step_operation_index"; + static inline constexpr StringLiteral k_StepValue_Key = "step_value"; + static inline constexpr StringLiteral k_UseSeed_Key = "use_seed"; + static inline constexpr StringLiteral k_SeedValue_Key = "seed_value"; + static inline constexpr StringLiteral k_SeedArrayName_Key = "seed_array_name"; + static inline constexpr StringLiteral k_InitStartRange_Key = "init_start_range"; + static inline constexpr StringLiteral k_InitEndRange_Key = "init_end_range"; + static inline constexpr StringLiteral k_StandardizeSeed_Key = "standardize_seed"; + + /** + * @brief Reads SIMPL json and converts it simplnx Arguments. + * @param json + * @return Result + */ + static Result FromSIMPLJson(const nlohmann::json& json); + + /** + * @brief Returns the filter's name. + * @return std::string + */ + std::string name() const override; + + /** + * @brief Returns the C++ classname of this filter. + * @return std::string + */ + std::string className() const override; + + /** + * @brief Returns the filter's UUID. + * @return Uuid + */ + Uuid uuid() const override; + + /** + * @brief Returns the filter name as a human-readable string. + * @return std::string + */ + std::string humanName() const override; + + /** + * @brief Returns the default tags for this filter. + * @return + */ + std::vector defaultTags() const override; + + /** + * @brief Returns a collection of parameters required to execute the filter. + * @return Parameters + */ + Parameters parameters() const override; + + /** + * @brief Creates and returns a copy of the filter. + * @return UniquePointer + */ + UniquePointer clone() const override; + +protected: + /** + * @brief + * @param data + * @param filterArgs + * @param messageHandler + * @return Result + */ + PreflightResult preflightImpl(const DataStructure& dataStructure, const Arguments& filterArgs, const MessageHandler& messageHandler, const std::atomic_bool& shouldCancel) const override; + + /** + * @brief + * @param dataStructure + * @param args + * @param pipelineNode + * @param messageHandler + * @return Result<> + */ + Result<> executeImpl(DataStructure& dataStructure, const Arguments& args, const PipelineFilter* pipelineNode, const MessageHandler& messageHandler, + const std::atomic_bool& shouldCancel) const override; +}; +} // namespace nx::core + +SIMPLNX_DEF_FILTER_TRAITS(nx::core, CreateDataArrayAdvancedFilter, "67041f9b-bdc6-4122-acc6-c9fe9280e90d"); diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/CreateDataArrayFilter.cpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/CreateDataArrayFilter.cpp index e78c21c764..b93e305e5c 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/CreateDataArrayFilter.cpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/CreateDataArrayFilter.cpp @@ -1,7 +1,5 @@ #include "CreateDataArrayFilter.hpp" -#include "SimplnxCore/Filters/Algorithms/InitializeData.hpp" - #include "simplnx/Common/TypesUtility.hpp" #include "simplnx/Filter/Actions/CreateArrayAction.hpp" #include "simplnx/Parameters/ArrayCreationParameter.hpp" @@ -21,6 +19,8 @@ using namespace nx::core; namespace { +constexpr int32 k_EmptyParameterError = -123; + struct CreateAndInitArrayFunctor { template @@ -73,39 +73,8 @@ Parameters CreateDataArrayFilter::parameters() const 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.insertSeparator(Parameters::Separator{"Component Handling"}); - { - 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.insertSeparator(Parameters::Separator{"Initialization Options"}); - params.insertLinkableParameter(std::make_unique(k_InitType_Key, "Initialization Type", "Method for determining the what values of the data in the array should be initialized to", - static_cast(0), - ChoicesParameter::Choices{"Fill Value", "Incremental", "Random", "Random With Range"})); // sequence dependent DO NOT REORDER - - params.insert(std::make_unique(k_InitValue_Key, "Fill Values [Seperated with ;]", - "Specify values for each component. Ex: A 3-component array would be 6;8;12 and every tuple would have these same component values", "1;1;1")); - - params.insert(std::make_unique( - k_StartingFillValue_Key, "Starting Value [Seperated with ;]", - "The value to start incrementing from. Ex: 6;8;12 would increment a 3-component array starting at 6 for the first component, 8 for the 2nd, and 12 for the 3rd.", "0;1;2")); - params.insert(std::make_unique(k_StepOperation_Key, "Step Operation", "The type of step operation to perform", static_cast(0), - ChoicesParameter::Choices{"Addition", "Subtraction"})); - params.insert(std::make_unique(k_StepValue_Key, "Increment/Step Value [Seperated with ;]", "The number to increment/decrement the fill value by", "1;1;1")); - - params.insert(std::make_unique(k_UseSeed_Key, "Use Seed for Random Generation", "When true, the Seed Value will be used to seed the generator", false)); - params.insert(std::make_unique>(k_SeedValue_Key, "Seed Value", "The seed fed into the random generator", std::mt19937::default_seed)); - params.insert(std::make_unique(k_SeedArrayName_Key, "Stored Seed Value Array Name", "Name of the array holding the seed value", "InitializeDataFilter SeedValue")); - params.insert(std::make_unique(k_StandardizeSeed_Key, "Use the Same Seed for Each Component", - "When true the same seed will be used for each component's generator in a multi-component array", false)); - - params.insert( - 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.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{})); @@ -116,40 +85,16 @@ Parameters CreateDataArrayFilter::parameters() const 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, "DIM {}")); - { - 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.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)); // Associate the Linkable Parameter(s) to the children parameters that they control params.linkParameters(k_AdvancedOptions_Key, k_TupleDims_Key, true); - // Associate the Linkable Parameter(s) to the children parameters that they control - /* Using Fill Value */ - params.linkParameters(k_InitType_Key, k_InitValue_Key, static_cast(0)); - - /* Using Incremental */ - params.linkParameters(k_InitType_Key, k_StartingFillValue_Key, static_cast(1)); - params.linkParameters(k_InitType_Key, k_StepOperation_Key, static_cast(1)); - params.linkParameters(k_InitType_Key, k_StepValue_Key, static_cast(1)); - - /* Random - Using Random */ - params.linkParameters(k_InitType_Key, k_UseSeed_Key, static_cast(2)); - params.linkParameters(k_InitType_Key, k_SeedValue_Key, static_cast(2)); - params.linkParameters(k_InitType_Key, k_SeedArrayName_Key, static_cast(2)); - params.linkParameters(k_InitType_Key, k_StandardizeSeed_Key, static_cast(2)); - - /* Random - Using Random With Range */ - params.linkParameters(k_InitType_Key, k_UseSeed_Key, static_cast(3)); - params.linkParameters(k_InitType_Key, k_SeedValue_Key, static_cast(3)); - params.linkParameters(k_InitType_Key, k_SeedArrayName_Key, static_cast(3)); - params.linkParameters(k_InitType_Key, k_StandardizeSeed_Key, static_cast(3)); - params.linkParameters(k_InitType_Key, k_InitStartRange_Key, static_cast(3)); - params.linkParameters(k_InitType_Key, k_InitEndRange_Key, static_cast(3)); return params; } @@ -165,24 +110,26 @@ IFilter::PreflightResult CreateDataArrayFilter::preflightImpl(const DataStructur { auto useDims = filterArgs.value(k_AdvancedOptions_Key); auto numericType = filterArgs.value(k_NumericType_Key); - auto compDimsData = filterArgs.value(k_CompDims_Key); + auto numComponents = filterArgs.value(k_NumComps_Key); auto dataArrayPath = filterArgs.value(k_DataPath_Key); + auto initValue = filterArgs.value(k_InitializationValue_Key); auto tableData = filterArgs.value(k_TupleDims_Key); auto dataFormat = filterArgs.value(k_DataFormat_Key); nx::core::Result resultOutputActions; - std::vector compDims(compDimsData[0].size()); - std::transform(compDimsData[0].begin(), compDimsData[0].end(), compDims.begin(), [](double val) { return static_cast(val); }); - usize numComponents = std::accumulate(compDims.begin(), compDims.end(), static_cast(1), std::multiplies<>()); - if(numComponents <= 0) + if(initValue.empty()) { - std::string compDimsStr = std::accumulate(compDims.begin() + 1, compDims.end(), std::to_string(compDims[0]), [](const std::string& a, int b) { return a + " x " + std::to_string(b); }); - return MakePreflightErrorResult( - -78601, - fmt::format("The chosen component dimensions ({}) results in 0 total components. Please choose component dimensions that result in a positive number of total components.", compDimsStr)); + return MakePreflightErrorResult(k_EmptyParameterError, fmt::format("{}: Init Value cannot be empty.{}({})", humanName(), __FILE__, __LINE__)); + } + // Sanity check that what the user entered for an init value can be converted safely to the final numeric type + Result<> result = CheckValueConverts(initValue, numericType); + if(result.invalid()) + { + return {ConvertResultTo(std::move(result), {})}; } + std::vector compDims = std::vector{numComponents}; std::vector tupleDims = {}; auto* parentAM = dataStructure.getDataAs(dataArrayPath.getParent()); @@ -220,228 +167,23 @@ IFilter::PreflightResult CreateDataArrayFilter::preflightImpl(const DataStructur } } - auto arrayDataType = ConvertNumericTypeToDataType(numericType); auto action = std::make_unique(ConvertNumericTypeToDataType(numericType), tupleDims, compDims, dataArrayPath, dataFormat); resultOutputActions.value().appendAction(std::move(action)); - auto seedArrayNameValue = filterArgs.value(k_SeedArrayName_Key); - auto initializeTypeValue = static_cast(filterArgs.value(k_InitType_Key)); - - // nx::core::Result resultOutputActions; - std::vector preflightUpdatedValues; - - if(arrayDataType == DataType::boolean) - { - std::stringstream updatedValStrm; - - updatedValStrm << "We detected that you are doing an operation on a boolean array.\n"; - updatedValStrm << "The ONLY two ways to specify a 'false' boolean value are as follows:\n"; - updatedValStrm << "- boolean value string types as follows ignoring apostrophe marks: 'False', 'FALSE', 'false'\n"; - updatedValStrm << "- all well formed integers and well formed floating point definitions of 0\n\n"; - - updatedValStrm << "ANY OTHER string or number WILL BE 'true', although it is good practice to define true values as follows:\n"; - updatedValStrm << "- boolean value string types as follows ignoring apostrophe marks: 'True', 'TRUE', 'true'\n"; - updatedValStrm << "- all well formed integers and well formed floating point definitions of 1"; - - preflightUpdatedValues.push_back({"Boolean Note", updatedValStrm.str()}); - } - - if(numComponents > 1) - { - std::stringstream updatedValStrm; - - updatedValStrm << "We detected that you are doing an operation on a multi-component array.\n"; - updatedValStrm - << "If you do NOT want to use unique values for each component, you can just supply one value to the input box and we will apply that value to every component for the tuple.\nExample: 1\n\n"; - - updatedValStrm << fmt::format("If you DO want to use unique values for each component, you need to supply {} values of type {} seperated by '{}'.\n", numComponents, - DataTypeToString(arrayDataType), k_DelimiterChar); - updatedValStrm << "Example: "; - - for(usize comp = 0; comp < numComponents; comp++) - { - updatedValStrm << "1"; - - if(comp != numComponents - 1) - { - updatedValStrm << k_DelimiterChar; - } - } - - preflightUpdatedValues.push_back({"Multi-Component Note", updatedValStrm.str()}); - } - - std::stringstream operationNuancesStrm; - - switch(initializeTypeValue) - { - case InitializeType::FillValue: { - auto result = ExecuteDataFunction(::ValidateMultiInputFunctor{}, arrayDataType, numComponents, filterArgs.value(k_InitValue_Key), 1); - if(result.outputActions.invalid()) - { - return {MergeResults(result.outputActions, std::move(resultOutputActions)), std::move(preflightUpdatedValues)}; - } - - operationNuancesStrm << "None to note"; - - break; - } - case InitializeType::Incremental: { - auto result = ExecuteDataFunction(::ValidateMultiInputFunctor{}, arrayDataType, numComponents, filterArgs.value(k_StartingFillValue_Key), 1); - if(result.outputActions.invalid()) - { - return {MergeResults(result.outputActions, std::move(resultOutputActions)), std::move(preflightUpdatedValues)}; - } - - if(arrayDataType == DataType::boolean) - { - // custom bool checks here - std::stringstream updatedValStrm; - - updatedValStrm << "We detected that you are doing an incremental operation on a boolean array.\n"; - updatedValStrm << "For the step values please enter uint8 values, preferably a 0 or 1 only.\n"; - - switch(static_cast(filterArgs.value(k_StepOperation_Key))) - { - case Addition: { - updatedValStrm << "You have currently selected the addition operation.\nAny step value that is greater than 0 will cause all values to be 'true' after the first tuple, 'true' " - "values will remain unchanged.\n"; - updatedValStrm << "The two possibilities:\n"; - updatedValStrm << "- If your start value is 'false' and step value > 0, the array will initialize to | false | true | true | ... |\n"; - updatedValStrm << "- If your start value is 'true' and step value > 0, the array will initialize to | true | true | true | ... |"; - break; - } - case Subtraction: { - updatedValStrm << "You have currently selected the addition operation.\nAny step value that is greater than 0 will cause all values to be 'false' after the first tuple, 'false' " - "values will remain unchanged.\n"; - updatedValStrm << "The two possibilities:\n"; - updatedValStrm << "- If your start value is 'true' and step value > 0, the array will initialize to | true | false | false | ... |\n"; - updatedValStrm << "- If your start value is 'false' and step value > 0, the array will initialize to | false | false | false | ... |"; - break; - } - } - - preflightUpdatedValues.push_back({"Boolean Incremental Nuances", updatedValStrm.str()}); - - result = ExecuteDataFunction(::ValidateMultiInputFunctor{}, DataType::uint8, numComponents, filterArgs.value(k_StepValue_Key), 1); - if(result.outputActions.invalid()) - { - return {MergeResults(result.outputActions, std::move(resultOutputActions)), std::move(preflightUpdatedValues)}; - } - } - else - { - result = ExecuteDataFunction(::ValidateMultiInputFunctor{}, arrayDataType, numComponents, filterArgs.value(k_StepValue_Key), 1); - if(result.outputActions.invalid()) - { - return {MergeResults(result.outputActions, std::move(resultOutputActions)), std::move(preflightUpdatedValues)}; - } - } - auto values = StringUtilities::split(filterArgs.value(k_StepValue_Key), ";", false); - std::vector zeroIdx; - for(size_t i = 0; i < values.size(); i++) - { - if(values[i] == "0") - { - zeroIdx.push_back(i); - } - } - if(!zeroIdx.empty()) - { - - operationNuancesStrm << "Warning: Zero Step Value found. Component(s) " << fmt::format("[{}]", fmt::join(zeroIdx, ",")) - << " have a ZERO value for the step/increment.\n The values for those components will be unchanged from the starting value.\n"; - operationNuancesStrm << fmt::format(" Example: Suppose we have a two component array with a Step Values of '2{}0', Starting Values of '0', and an addition Step Operation\n", k_DelimiterChar); - operationNuancesStrm << " The output array would look like 0,0 | 2,0 | 4,0 | 6,0 | ..."; - } - break; - } - case InitializeType::RangedRandom: { - auto result = ExecuteDataFunction(::ValidateMultiInputFunctor{}, arrayDataType, numComponents, filterArgs.value(k_InitStartRange_Key), 1); - if(result.outputActions.invalid()) - { - return {MergeResults(result.outputActions, std::move(resultOutputActions)), std::move(preflightUpdatedValues)}; - } - - result = ExecuteDataFunction(::ValidateMultiInputFunctor{}, arrayDataType, numComponents, filterArgs.value(k_InitEndRange_Key), 1); - if(result.outputActions.invalid()) - { - return {MergeResults(result.outputActions, std::move(resultOutputActions)), std::move(preflightUpdatedValues)}; - } - - [[fallthrough]]; - } - case InitializeType::Random: { - auto createAction = std::make_unique(DataType::uint64, std::vector{1}, std::vector{1}, DataPath({seedArrayNameValue})); - resultOutputActions.value().appendAction(std::move(createAction)); - - if(numComponents == 1) - { - if(filterArgs.value(k_StandardizeSeed_Key)) - { - operationNuancesStrm << fmt::format("You chose to standardize the seed for each component, but the array {} is a single component so it will not alter the randomization scheme.", - dataArrayPath.getTargetName()); - } - } - else - { - if(filterArgs.value(k_StandardizeSeed_Key)) - { - operationNuancesStrm << "This generates THE SAME sequences of random numbers for each component in the array based on one seed.\n"; - operationNuancesStrm << "The resulting array will look like | 1,1,1 | 9,9,9 | ...\n"; - } - else - { - operationNuancesStrm << "This generates DIFFERENT sequences of random numbers for each component in the array based on x seeds all modified versions of an original seed.\n"; - operationNuancesStrm << "The resulting array will look like | 1,9,5 | 7,1,6 | ...\n"; - } - } - - break; - } - } - - preflightUpdatedValues.push_back({"Operation Nuances", operationNuancesStrm.str()}); - - return {std::move(resultOutputActions), std::move(preflightUpdatedValues)}; + return {std::move(resultOutputActions)}; } //------------------------------------------------------------------------------ -Result<> CreateDataArrayFilter::executeImpl(DataStructure& dataStructure, const Arguments& filterArgs, const PipelineFilter* pipelineNode, const MessageHandler& messageHandler, +Result<> CreateDataArrayFilter::executeImpl(DataStructure& dataStructure, const Arguments& args, const PipelineFilter* pipelineNode, const MessageHandler& messageHandler, const std::atomic_bool& shouldCancel) const { - auto path = filterArgs.value(k_DataPath_Key); - - ExecuteNeighborFunction(CreateAndInitArrayFunctor{}, ConvertNumericTypeToDataType(filterArgs.value(k_NumericType_Key)), dataStructure.getDataAs(path), "0"); + auto path = args.value(k_DataPath_Key); + auto initValue = args.value(k_InitializationValue_Key); - auto initType = static_cast(filterArgs.value(k_InitType_Key)); - - auto seed = filterArgs.value(k_SeedValue_Key); - if(!filterArgs.value(k_UseSeed_Key)) - { - seed = static_cast(std::chrono::steady_clock::now().time_since_epoch().count()); - } - - if(initType == InitializeType::Random || initType == InitializeType::RangedRandom) - { - // Store Seed Value in Top Level Array - dataStructure.getDataRefAs(DataPath({filterArgs.value(k_SeedArrayName_Key)}))[0] = seed; - } + ExecuteNeighborFunction(CreateAndInitArrayFunctor{}, ConvertNumericTypeToDataType(args.value(k_NumericType_Key)), dataStructure.getDataAs(path), initValue); - InitializeDataInputValues inputValues; - inputValues.InputArrayPath = filterArgs.value(k_DataPath_Key); - inputValues.initType = initType; - inputValues.stepType = static_cast(filterArgs.value(k_StepOperation_Key)); - inputValues.stringValues = StringUtilities::split(StringUtilities::trimmed(filterArgs.value(k_InitValue_Key)), k_DelimiterChar); - inputValues.startValues = StringUtilities::split(StringUtilities::trimmed(filterArgs.value(k_StartingFillValue_Key)), k_DelimiterChar); - inputValues.stepValues = StringUtilities::split(StringUtilities::trimmed(filterArgs.value(k_StepValue_Key)), k_DelimiterChar); - inputValues.seed = seed; - inputValues.randBegin = StringUtilities::split(StringUtilities::trimmed(filterArgs.value(k_InitStartRange_Key)), k_DelimiterChar); - inputValues.randEnd = StringUtilities::split(StringUtilities::trimmed(filterArgs.value(k_InitEndRange_Key)), k_DelimiterChar); - inputValues.standardizeSeed = filterArgs.value(k_StandardizeSeed_Key); - - return InitializeData(dataStructure, messageHandler, shouldCancel, &inputValues)(); + return {}; } namespace @@ -464,8 +206,9 @@ Result CreateDataArrayFilter::FromSIMPLJson(const nlohmann::json& jso std::vector> results; results.push_back(SIMPLConversion::ConvertParameter(args, json, SIMPL::k_ScalarTypeKey, k_NumericType_Key)); + results.push_back(SIMPLConversion::ConvertParameter>(args, json, SIMPL::k_NumberOfComponentsKey, k_NumComps_Key)); // Initialize Type parameter is not applicable in NX - results.push_back(SIMPLConversion::ConvertParameter(args, json, SIMPL::k_InitializationValueKey, k_InitValue_Key)); + results.push_back(SIMPLConversion::ConvertParameter(args, json, SIMPL::k_InitializationValueKey, k_InitializationValue_Key)); // Initialization Range parameter is not applicable in NX // Starting Index value parameter is not applicable in NX results.push_back(SIMPLConversion::ConvertParameter(args, json, SIMPL::k_NewArrayKey, k_DataPath_Key)); diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/CreateDataArrayFilter.hpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/CreateDataArrayFilter.hpp index bf225bc39d..e3e38e9856 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/CreateDataArrayFilter.hpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/CreateDataArrayFilter.hpp @@ -23,21 +23,11 @@ class SIMPLNXCORE_EXPORT CreateDataArrayFilter : public IFilter // Parameter Keys static inline constexpr StringLiteral k_NumericType_Key = "numeric_type_index"; static inline constexpr StringLiteral k_AdvancedOptions_Key = "set_tuple_dimensions"; - static inline constexpr StringLiteral k_CompDims_Key = "component_dimensions"; + static inline constexpr StringLiteral k_NumComps_Key = "component_count"; static inline constexpr StringLiteral k_TupleDims_Key = "tuple_dimensions"; static inline constexpr StringLiteral k_DataPath_Key = "output_array_path"; + static inline constexpr StringLiteral k_InitializationValue_Key = "initialization_value_str"; static inline constexpr StringLiteral k_DataFormat_Key = "data_format"; - static inline constexpr StringLiteral k_InitType_Key = "init_type_index"; - static inline constexpr StringLiteral k_InitValue_Key = "init_value"; - static inline constexpr StringLiteral k_StartingFillValue_Key = "starting_fill_value"; - static inline constexpr StringLiteral k_StepOperation_Key = "step_operation_index"; - static inline constexpr StringLiteral k_StepValue_Key = "step_value"; - static inline constexpr StringLiteral k_UseSeed_Key = "use_seed"; - static inline constexpr StringLiteral k_SeedValue_Key = "seed_value"; - static inline constexpr StringLiteral k_SeedArrayName_Key = "seed_array_name"; - static inline constexpr StringLiteral k_InitStartRange_Key = "init_start_range"; - static inline constexpr StringLiteral k_InitEndRange_Key = "init_end_range"; - static inline constexpr StringLiteral k_StandardizeSeed_Key = "standardize_seed"; /** * @brief Reads SIMPL json and converts it simplnx Arguments. diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/utils/nanoflann.hpp b/src/Plugins/SimplnxCore/src/SimplnxCore/utils/nanoflann.hpp index 1d462f1c34..42fc0372fe 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/utils/nanoflann.hpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/utils/nanoflann.hpp @@ -2205,7 +2205,7 @@ struct KDTreeEigenMatrixAdaptor /** @} */ }; // end of KDTreeEigenMatrixAdaptor -/** @} */ + /** @} */ /** @} */ // end of grouping } // namespace nanoflann diff --git a/src/Plugins/SimplnxCore/test/CMakeLists.txt b/src/Plugins/SimplnxCore/test/CMakeLists.txt index 93e0bab441..691dc537d1 100644 --- a/src/Plugins/SimplnxCore/test/CMakeLists.txt +++ b/src/Plugins/SimplnxCore/test/CMakeLists.txt @@ -52,6 +52,7 @@ set(${PLUGIN_NAME}UnitTest_SRCS CoreFilterTest.cpp CreateAttributeMatrixTest.cpp CreateDataArrayTest.cpp + CreateDataArrayAdvancedTest.cpp CreateFeatureArrayFromElementArrayTest.cpp CreateGeometryTest.cpp CreateImageGeometryTest.cpp diff --git a/src/Plugins/SimplnxCore/test/CreateDataArrayAdvancedTest.cpp b/src/Plugins/SimplnxCore/test/CreateDataArrayAdvancedTest.cpp new file mode 100644 index 0000000000..670acac366 --- /dev/null +++ b/src/Plugins/SimplnxCore/test/CreateDataArrayAdvancedTest.cpp @@ -0,0 +1,138 @@ +#include "SimplnxCore/Filters/CreateDataArrayAdvancedFilter.hpp" +#include "SimplnxCore/SimplnxCore_test_dirs.hpp" + +#include "simplnx/Parameters/DynamicTableParameter.hpp" +#include "simplnx/UnitTest/UnitTestCommon.hpp" + +#include + +using namespace nx::core; + +TEST_CASE("SimplnxCore::CreateDataArrayAdvancedFilter(Instantiate)", "[SimplnxCore][CreateDataArrayAdvancedFilter]") +{ + static constexpr uint64 k_NComp = 3; + static constexpr uint64 k_NumTuples = 25; + const static DynamicTableInfo::TableDataType k_TupleDims = {{static_cast(k_NumTuples)}}; + + static const DataPath k_DataPath({"foo"}); + + CreateDataArrayAdvancedFilter filter; + DataStructure dataStructure; + Arguments args; + + args.insert(CreateDataArrayAdvancedFilter::k_NumericType_Key, std::make_any(NumericType::int32)); + args.insert(CreateDataArrayAdvancedFilter::k_CompDims_Key, std::make_any(DynamicTableInfo::TableDataType{{static_cast(k_NComp)}})); + args.insert(CreateDataArrayAdvancedFilter::k_TupleDims_Key, std::make_any(k_TupleDims)); + args.insert(CreateDataArrayAdvancedFilter::k_DataPath_Key, std::make_any(k_DataPath)); + + auto result = filter.execute(dataStructure, args); + SIMPLNX_RESULT_REQUIRE_VALID(result.result); +} + +TEST_CASE("SimplnxCore::CreateDataArrayAdvancedFilter(Invalid Parameters)", "[SimplnxCore][CreateDataArrayAdvancedFilter]") +{ + static constexpr uint64 k_NComp = 3; + static constexpr uint64 k_NumTuples = 25; + const static DynamicTableInfo::TableDataType k_TupleDims = {{static_cast(k_NumTuples)}}; + static const DataPath k_DataPath({"foo"}); + + CreateDataArrayAdvancedFilter filter; + DataStructure dataStructure; + Arguments args; + + SECTION("Section1") + { + args.insert(CreateDataArrayAdvancedFilter::k_NumericType_Key, std::make_any(NumericType::uint16)); + args.insert(CreateDataArrayAdvancedFilter::k_CompDims_Key, std::make_any(DynamicTableInfo::TableDataType{{static_cast(k_NComp)}})); + args.insert(CreateDataArrayAdvancedFilter::k_TupleDims_Key, std::make_any(k_TupleDims)); + args.insert(CreateDataArrayAdvancedFilter::k_DataPath_Key, std::make_any(k_DataPath)); + args.insert(CreateDataArrayAdvancedFilter::k_InitValue_Key, std::make_any("-1")); + + auto result = filter.execute(dataStructure, args); + SIMPLNX_RESULT_REQUIRE_INVALID(result.result); + } + SECTION("Section2") + { + args.insert(CreateDataArrayAdvancedFilter::k_NumericType_Key, std::make_any(NumericType::int8)); + args.insert(CreateDataArrayAdvancedFilter::k_CompDims_Key, std::make_any(DynamicTableInfo::TableDataType{{static_cast(k_NComp)}})); + args.insert(CreateDataArrayAdvancedFilter::k_TupleDims_Key, std::make_any(k_TupleDims)); + args.insert(CreateDataArrayAdvancedFilter::k_DataPath_Key, std::make_any(k_DataPath)); + args.insert(CreateDataArrayAdvancedFilter::k_InitValue_Key, std::make_any("1024")); + + auto result = filter.execute(dataStructure, args); + SIMPLNX_RESULT_REQUIRE_INVALID(result.result); + } + SECTION("Section3") + { + args.insert(CreateDataArrayAdvancedFilter::k_NumericType_Key, std::make_any(NumericType::float32)); + args.insert(CreateDataArrayAdvancedFilter::k_CompDims_Key, std::make_any(DynamicTableInfo::TableDataType{{0.0}})); + args.insert(CreateDataArrayAdvancedFilter::k_TupleDims_Key, std::make_any(k_TupleDims)); + args.insert(CreateDataArrayAdvancedFilter::k_DataPath_Key, std::make_any(k_DataPath)); + args.insert(CreateDataArrayAdvancedFilter::k_InitValue_Key, std::make_any("1")); + + auto result = filter.execute(dataStructure, args); + SIMPLNX_RESULT_REQUIRE_INVALID(result.result); + } + SECTION("Section4") + { + args.insert(CreateDataArrayAdvancedFilter::k_NumericType_Key, std::make_any(NumericType::float32)); + args.insert(CreateDataArrayAdvancedFilter::k_CompDims_Key, std::make_any(DynamicTableInfo::TableDataType{{1.0}})); + + DynamicTableInfo::TableDataType tupleDims = {{static_cast(0.0)}}; + args.insert(CreateDataArrayAdvancedFilter::k_TupleDims_Key, std::make_any(tupleDims)); + args.insert(CreateDataArrayAdvancedFilter::k_DataPath_Key, std::make_any(k_DataPath)); + args.insert(CreateDataArrayAdvancedFilter::k_InitValue_Key, std::make_any("1")); + + auto result = filter.execute(dataStructure, args); + SIMPLNX_RESULT_REQUIRE_INVALID(result.result); + } + SECTION("Section5") + { + args.insert(CreateDataArrayAdvancedFilter::k_NumericType_Key, std::make_any(NumericType::int8)); + args.insert(CreateDataArrayAdvancedFilter::k_CompDims_Key, std::make_any(DynamicTableInfo::TableDataType{{1.0}})); + DynamicTableInfo::TableDataType tupleDims = {{static_cast(1.0)}}; + args.insert(CreateDataArrayAdvancedFilter::k_TupleDims_Key, std::make_any(tupleDims)); + args.insert(CreateDataArrayAdvancedFilter::k_DataPath_Key, std::make_any(k_DataPath)); + args.insert(CreateDataArrayAdvancedFilter::k_InitValue_Key, std::make_any("")); + + auto result = filter.execute(dataStructure, args); + SIMPLNX_RESULT_REQUIRE_INVALID(result.result); + } + SECTION("Section6") + { + args.insert(CreateDataArrayAdvancedFilter::k_NumericType_Key, std::make_any(NumericType::int8)); + args.insert(CreateDataArrayAdvancedFilter::k_CompDims_Key, std::make_any(DynamicTableInfo::TableDataType{{1.0}})); + DynamicTableInfo::TableDataType tupleDims = {{static_cast(1.0)}}; + args.insert(CreateDataArrayAdvancedFilter::k_TupleDims_Key, std::make_any(tupleDims)); + args.insert(CreateDataArrayAdvancedFilter::k_DataPath_Key, std::make_any(k_DataPath)); + args.insert(CreateDataArrayAdvancedFilter::k_InitValue_Key, std::make_any("1000")); + + auto result = filter.execute(dataStructure, args); + SIMPLNX_RESULT_REQUIRE_INVALID(result.result); + + args.insert(CreateDataArrayAdvancedFilter::k_NumericType_Key, std::make_any(NumericType::uint8)); + args.insert(CreateDataArrayAdvancedFilter::k_InitValue_Key, std::make_any("-1")); + result = filter.execute(dataStructure, args); + SIMPLNX_RESULT_REQUIRE_INVALID(result.result); + + args.insert(CreateDataArrayAdvancedFilter::k_NumericType_Key, std::make_any(NumericType::int16)); + args.insert(CreateDataArrayAdvancedFilter::k_InitValue_Key, std::make_any("70000")); + result = filter.execute(dataStructure, args); + SIMPLNX_RESULT_REQUIRE_INVALID(result.result); + + args.insert(CreateDataArrayAdvancedFilter::k_NumericType_Key, std::make_any(NumericType::uint16)); + args.insert(CreateDataArrayAdvancedFilter::k_InitValue_Key, std::make_any("-1")); + result = filter.execute(dataStructure, args); + SIMPLNX_RESULT_REQUIRE_INVALID(result.result); + + args.insert(CreateDataArrayAdvancedFilter::k_NumericType_Key, std::make_any(NumericType::int32)); + args.insert(CreateDataArrayAdvancedFilter::k_InitValue_Key, std::make_any("4294967297")); + result = filter.execute(dataStructure, args); + SIMPLNX_RESULT_REQUIRE_INVALID(result.result); + + args.insert(CreateDataArrayAdvancedFilter::k_NumericType_Key, std::make_any(NumericType::int32)); + args.insert(CreateDataArrayAdvancedFilter::k_InitValue_Key, std::make_any("-4294967297")); + result = filter.execute(dataStructure, args); + SIMPLNX_RESULT_REQUIRE_INVALID(result.result); + } +} diff --git a/src/Plugins/SimplnxCore/test/CreateDataArrayTest.cpp b/src/Plugins/SimplnxCore/test/CreateDataArrayTest.cpp index bd6cfa76ee..41aa318dd4 100644 --- a/src/Plugins/SimplnxCore/test/CreateDataArrayTest.cpp +++ b/src/Plugins/SimplnxCore/test/CreateDataArrayTest.cpp @@ -21,7 +21,7 @@ TEST_CASE("SimplnxCore::CreateDataArrayFilter(Instantiate)", "[SimplnxCore][Crea Arguments args; args.insert(CreateDataArrayFilter::k_NumericType_Key, std::make_any(NumericType::int32)); - args.insert(CreateDataArrayFilter::k_CompDims_Key, std::make_any(DynamicTableInfo::TableDataType{{static_cast(k_NComp)}})); + args.insert(CreateDataArrayFilter::k_NumComps_Key, std::make_any(k_NComp)); args.insert(CreateDataArrayFilter::k_TupleDims_Key, std::make_any(k_TupleDims)); args.insert(CreateDataArrayFilter::k_DataPath_Key, std::make_any(k_DataPath)); @@ -43,10 +43,10 @@ TEST_CASE("SimplnxCore::CreateDataArrayFilter(Invalid Parameters)", "[SimplnxCor SECTION("Section1") { args.insert(CreateDataArrayFilter::k_NumericType_Key, std::make_any(NumericType::uint16)); - args.insert(CreateDataArrayFilter::k_CompDims_Key, std::make_any(DynamicTableInfo::TableDataType{{static_cast(k_NComp)}})); + args.insert(CreateDataArrayFilter::k_NumComps_Key, std::make_any(k_NComp)); args.insert(CreateDataArrayFilter::k_TupleDims_Key, std::make_any(k_TupleDims)); args.insert(CreateDataArrayFilter::k_DataPath_Key, std::make_any(k_DataPath)); - args.insert(CreateDataArrayFilter::k_InitValue_Key, std::make_any("-1")); + args.insert(CreateDataArrayFilter::k_InitializationValue_Key, std::make_any("-1")); auto result = filter.execute(dataStructure, args); SIMPLNX_RESULT_REQUIRE_INVALID(result.result); @@ -54,10 +54,10 @@ TEST_CASE("SimplnxCore::CreateDataArrayFilter(Invalid Parameters)", "[SimplnxCor SECTION("Section2") { args.insert(CreateDataArrayFilter::k_NumericType_Key, std::make_any(NumericType::int8)); - args.insert(CreateDataArrayFilter::k_CompDims_Key, std::make_any(DynamicTableInfo::TableDataType{{static_cast(k_NComp)}})); + args.insert(CreateDataArrayFilter::k_NumComps_Key, std::make_any(k_NComp)); args.insert(CreateDataArrayFilter::k_TupleDims_Key, std::make_any(k_TupleDims)); args.insert(CreateDataArrayFilter::k_DataPath_Key, std::make_any(k_DataPath)); - args.insert(CreateDataArrayFilter::k_InitValue_Key, std::make_any("1024")); + args.insert(CreateDataArrayFilter::k_InitializationValue_Key, std::make_any("1024")); auto result = filter.execute(dataStructure, args); SIMPLNX_RESULT_REQUIRE_INVALID(result.result); @@ -65,10 +65,10 @@ TEST_CASE("SimplnxCore::CreateDataArrayFilter(Invalid Parameters)", "[SimplnxCor SECTION("Section3") { args.insert(CreateDataArrayFilter::k_NumericType_Key, std::make_any(NumericType::float32)); - args.insert(CreateDataArrayFilter::k_CompDims_Key, std::make_any(DynamicTableInfo::TableDataType{{0.0}})); + args.insert(CreateDataArrayFilter::k_NumComps_Key, std::make_any(0)); args.insert(CreateDataArrayFilter::k_TupleDims_Key, std::make_any(k_TupleDims)); args.insert(CreateDataArrayFilter::k_DataPath_Key, std::make_any(k_DataPath)); - args.insert(CreateDataArrayFilter::k_InitValue_Key, std::make_any("1")); + args.insert(CreateDataArrayFilter::k_InitializationValue_Key, std::make_any("1")); auto result = filter.execute(dataStructure, args); SIMPLNX_RESULT_REQUIRE_INVALID(result.result); @@ -76,12 +76,12 @@ TEST_CASE("SimplnxCore::CreateDataArrayFilter(Invalid Parameters)", "[SimplnxCor SECTION("Section4") { args.insert(CreateDataArrayFilter::k_NumericType_Key, std::make_any(NumericType::float32)); - args.insert(CreateDataArrayFilter::k_CompDims_Key, std::make_any(DynamicTableInfo::TableDataType{{1.0}})); + args.insert(CreateDataArrayFilter::k_NumComps_Key, std::make_any(1)); DynamicTableInfo::TableDataType tupleDims = {{static_cast(0.0)}}; args.insert(CreateDataArrayFilter::k_TupleDims_Key, std::make_any(tupleDims)); args.insert(CreateDataArrayFilter::k_DataPath_Key, std::make_any(k_DataPath)); - args.insert(CreateDataArrayFilter::k_InitValue_Key, std::make_any("1")); + args.insert(CreateDataArrayFilter::k_InitializationValue_Key, std::make_any("1")); auto result = filter.execute(dataStructure, args); SIMPLNX_RESULT_REQUIRE_INVALID(result.result); @@ -89,11 +89,11 @@ TEST_CASE("SimplnxCore::CreateDataArrayFilter(Invalid Parameters)", "[SimplnxCor SECTION("Section5") { args.insert(CreateDataArrayFilter::k_NumericType_Key, std::make_any(NumericType::int8)); - args.insert(CreateDataArrayFilter::k_CompDims_Key, std::make_any(DynamicTableInfo::TableDataType{{1.0}})); + args.insert(CreateDataArrayFilter::k_NumComps_Key, std::make_any(1)); DynamicTableInfo::TableDataType tupleDims = {{static_cast(1.0)}}; args.insert(CreateDataArrayFilter::k_TupleDims_Key, std::make_any(tupleDims)); args.insert(CreateDataArrayFilter::k_DataPath_Key, std::make_any(k_DataPath)); - args.insert(CreateDataArrayFilter::k_InitValue_Key, std::make_any("")); + args.insert(CreateDataArrayFilter::k_InitializationValue_Key, std::make_any("")); auto result = filter.execute(dataStructure, args); SIMPLNX_RESULT_REQUIRE_INVALID(result.result); @@ -101,37 +101,37 @@ TEST_CASE("SimplnxCore::CreateDataArrayFilter(Invalid Parameters)", "[SimplnxCor SECTION("Section6") { args.insert(CreateDataArrayFilter::k_NumericType_Key, std::make_any(NumericType::int8)); - args.insert(CreateDataArrayFilter::k_CompDims_Key, std::make_any(DynamicTableInfo::TableDataType{{1.0}})); + args.insert(CreateDataArrayFilter::k_NumComps_Key, std::make_any(1)); DynamicTableInfo::TableDataType tupleDims = {{static_cast(1.0)}}; args.insert(CreateDataArrayFilter::k_TupleDims_Key, std::make_any(tupleDims)); args.insert(CreateDataArrayFilter::k_DataPath_Key, std::make_any(k_DataPath)); - args.insert(CreateDataArrayFilter::k_InitValue_Key, std::make_any("1000")); + args.insert(CreateDataArrayFilter::k_InitializationValue_Key, std::make_any("1000")); auto result = filter.execute(dataStructure, args); SIMPLNX_RESULT_REQUIRE_INVALID(result.result); args.insert(CreateDataArrayFilter::k_NumericType_Key, std::make_any(NumericType::uint8)); - args.insert(CreateDataArrayFilter::k_InitValue_Key, std::make_any("-1")); + args.insert(CreateDataArrayFilter::k_InitializationValue_Key, std::make_any("-1")); result = filter.execute(dataStructure, args); SIMPLNX_RESULT_REQUIRE_INVALID(result.result); args.insert(CreateDataArrayFilter::k_NumericType_Key, std::make_any(NumericType::int16)); - args.insert(CreateDataArrayFilter::k_InitValue_Key, std::make_any("70000")); + args.insert(CreateDataArrayFilter::k_InitializationValue_Key, std::make_any("70000")); result = filter.execute(dataStructure, args); SIMPLNX_RESULT_REQUIRE_INVALID(result.result); args.insert(CreateDataArrayFilter::k_NumericType_Key, std::make_any(NumericType::uint16)); - args.insert(CreateDataArrayFilter::k_InitValue_Key, std::make_any("-1")); + args.insert(CreateDataArrayFilter::k_InitializationValue_Key, std::make_any("-1")); result = filter.execute(dataStructure, args); SIMPLNX_RESULT_REQUIRE_INVALID(result.result); args.insert(CreateDataArrayFilter::k_NumericType_Key, std::make_any(NumericType::int32)); - args.insert(CreateDataArrayFilter::k_InitValue_Key, std::make_any("4294967297")); + args.insert(CreateDataArrayFilter::k_InitializationValue_Key, std::make_any("4294967297")); result = filter.execute(dataStructure, args); SIMPLNX_RESULT_REQUIRE_INVALID(result.result); args.insert(CreateDataArrayFilter::k_NumericType_Key, std::make_any(NumericType::int32)); - args.insert(CreateDataArrayFilter::k_InitValue_Key, std::make_any("-4294967297")); + args.insert(CreateDataArrayFilter::k_InitializationValue_Key, std::make_any("-4294967297")); result = filter.execute(dataStructure, args); SIMPLNX_RESULT_REQUIRE_INVALID(result.result); } diff --git a/src/Plugins/SimplnxCore/test/DREAM3DFileTest.cpp b/src/Plugins/SimplnxCore/test/DREAM3DFileTest.cpp index 8c8cf99da8..87fdc875e0 100644 --- a/src/Plugins/SimplnxCore/test/DREAM3DFileTest.cpp +++ b/src/Plugins/SimplnxCore/test/DREAM3DFileTest.cpp @@ -160,10 +160,10 @@ Pipeline CreateExportPipeline() Arguments args; args.insert("set_tuple_dimensions", std::make_any(true)); args.insert("numeric_type_index", std::make_any(NumericType::int8)); - args.insert("component_dimensions", DynamicTableInfo::TableDataType{{3.0}}); + args.insert("component_count", std::make_any(3)); args.insert("tuple_dimensions", DynamicTableInfo::TableDataType{{1.0}}); - args.insert("init_value", std::make_any("7")); + args.insert("initialization_value_str", std::make_any("7")); args.insert("output_array_path", DataPath({DataNames::k_ArrayName})); args.insert("data_format", std::string("")); pipeline.push_back(k_CreateDataArrayHandle, args); diff --git a/src/Plugins/TestOne/src/TestOne/Filters/CreateOutOfCoreArrayFilter.hpp b/src/Plugins/TestOne/src/TestOne/Filters/CreateOutOfCoreArrayFilter.hpp index 2b63c45269..0912ca8ea2 100644 --- a/src/Plugins/TestOne/src/TestOne/Filters/CreateOutOfCoreArrayFilter.hpp +++ b/src/Plugins/TestOne/src/TestOne/Filters/CreateOutOfCoreArrayFilter.hpp @@ -21,7 +21,7 @@ class TESTONE_EXPORT CreateOutOfCoreArray : public IFilter // Parameter Keys static inline constexpr StringLiteral k_NumericType_Key = "numeric_type_index"; - static inline constexpr StringLiteral k_NumComps_Key = "component_dimensions"; + static inline constexpr StringLiteral k_NumComps_Key = "component_count"; static inline constexpr StringLiteral k_TupleDims_Key = "tuple_dimensions"; static inline constexpr StringLiteral k_DataPath_Key = "output_array_path"; static inline constexpr StringLiteral k_InitilizationValue_Key = "initialization_value_str"; diff --git a/wrapping/python/docs/source/DataObjects.rst b/wrapping/python/docs/source/DataObjects.rst index 758951dbb0..1c136ef08a 100644 --- a/wrapping/python/docs/source/DataObjects.rst +++ b/wrapping/python/docs/source/DataObjects.rst @@ -297,13 +297,12 @@ and then print the name, tuple_dimensions and component_dims of the created DatA data_structure = nx.DataStructure() result = nx.CreateDataArrayFilter.execute(data_structure=data_structure, - component_dimensions=[[3]], - data_format="", - init_type_index=0, - init_value="0", - numeric_type_index=nx.NumericType.float32, - output_array_path=nx.DataPath(["2D Array"]), - tuple_dimensions=[[4, 5]]) + component_count=3, + data_format="", + initialization_value="0", + numeric_type=nx.NumericType.float32, + output_data_array=nx.DataPath(["2D Array"]), + tuple_dimensions=[[4, 5]]) data_array = data_structure[output_array_path] print(f'name: {data_array.name}') @@ -475,9 +474,9 @@ Pipeline create_data_array_args:dict = { "data_format": "", - "component_dimensions":[1], + "component_count":1, "initialization_value":"0", - "numeric_type_index":nx.NumericType.int8, + "numeric_type":nx.NumericType.int8, "output_data_array":nx.DataPath("Geometry/Cell Data/data"), "advanced_options": False, "tuple_dimensions": [[10,20,30]] diff --git a/wrapping/python/docs/source/Python_Introduction.rst b/wrapping/python/docs/source/Python_Introduction.rst index b2b65e23bb..752834b8fe 100644 --- a/wrapping/python/docs/source/Python_Introduction.rst +++ b/wrapping/python/docs/source/Python_Introduction.rst @@ -77,10 +77,10 @@ An example of executing a file in immediate mode using a filter from the simplnx import simplnx as nx result = nx.CreateDataArrayFilter.execute(data_structure=data_structure, - component_dimensions=[[1]], + component_count=1, data_format="", initialization_value="10", - numeric_type_index=nx.NumericType.float32, + numeric_type=nx.NumericType.float32, output_data_array=nx.DataPath(["3D Array"]), tuple_dimensions= [[3, 2, 5]]) npdata = data_structure[nx.DataPath(["3D Array"])].npview() @@ -130,10 +130,10 @@ of the method is as follows. # Instantiate and execute immediately teh CreateDataArrayFilter Filter result = nx.CreateDataArrayFilter.execute(data_structure=data_structure, - component_dimensions=[[1]], + component_count=1, data_format="", initialization_value="10", - numeric_type_index=nx.NumericType.float32, + numeric_type=nx.NumericType.float32, output_data_array=nx.DataPath(["3D Array"]), tuple_dimensions= [[3, 2, 5]]) # The returned result holds any warnings or errors that occurred during execution @@ -254,8 +254,8 @@ connectivity from a sample file. # Create the vertex array and fill it from data on disk array_path = nx.DataPath(['Vertices']) result = nx.CreateDataArrayFilter.execute(data_structure, - numeric_type_index=nx.NumericType.float32, - component_dimensions=[[3]], + numeric_type=nx.NumericType.float32, + component_count=3, tuple_dimensions=[[144]], output_data_array=array_path, initialization_value='0') @@ -266,8 +266,8 @@ connectivity from a sample file. # Create the triangle connectivity array and fill it from data on disk array_path = nx.DataPath(['Triangles']) result = nx.CreateDataArrayFilter.execute(data_structure, - numeric_type_index=nx.NumericType.uint64, - component_dimensions=[[3]], + numeric_type=nx.NumericType.uint64, + component_count=3, tuple_dimensions=[[242]], output_data_array=array_path, initialization_value='0') @@ -336,10 +336,10 @@ The next code section was take from `basic_arrays.py class CreateArrayFilter: NUMERIC_TYPE_KEY = "numeric_type_index" - INITILIZATION_VALUE_KEY = "init_value" + INITILIZATION_VALUE_KEY = "initialization_value_str" NUM_COMPS_KEY = "component_count" DATA_PATH_KEY = "output_array_path" TUPLE_DIMS_KEY = "tuple_dimensions"