Skip to content

Commit

Permalink
FILTER: Add RemoveFlaggedEdges filter. Update other RemoveFlaggedXXX …
Browse files Browse the repository at this point in the history
…filters (#986)

- Implemented RemoveFlaggedEdges filter with option to copy cell and vertex data
- Added copying options to RemoveFlaggedTriangles and RemoveFlaggedVertices data
- Added Unit test updates
- Updated documentation for all filters
- Added example pipelines for new/updated filters


Signed-off-by: Michael Jackson <[email protected]>
Co-authored-by: nyoungbq <[email protected]>
  • Loading branch information
imikejackson and nyoungbq authored Jul 1, 2024
1 parent 365acfd commit d719016
Show file tree
Hide file tree
Showing 23 changed files with 1,451 additions and 205 deletions.
2 changes: 2 additions & 0 deletions src/Plugins/SimplnxCore/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ set(FilterList
RegularGridSampleSurfaceMeshFilter
RemoveFlaggedFeaturesFilter
RemoveFlaggedTrianglesFilter
RemoveFlaggedEdgesFilter
RemoveFlaggedVerticesFilter
RequireMinimumSizeFeaturesFilter
RenameDataObjectFilter
Expand Down Expand Up @@ -200,6 +201,7 @@ set(AlgorithmList
RegularGridSampleSurfaceMesh
RemoveFlaggedFeatures
RemoveFlaggedTriangles
RemoveFlaggedEdges
ReplaceElementAttributesWithNeighborValues
ResampleImageGeom
ResampleRectGridToImageGeom
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
35 changes: 35 additions & 0 deletions src/Plugins/SimplnxCore/docs/RemoveFlaggedEdgesFilter.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Remove Flagged Edges

## Group (Subgroup)

Surface Meshing (Misc)

## Description

This **Filter** removes **Edges** from the supplied **Edges Geometry** that are flagged by a (boolean|uint8) mask array as **true|1**. A new reduced **Edge Geometry** is created that contains all the remaining **Edges**. It is unknown until run time how many **Edges** will be removed from the **Geometry**. Therefore, this **Filter** requires that a new **EdgeGeom** be created to contain the reduced **Edge Geometry**. This new **Geometry** will *NOT* contain copies of any **Feature Attribute Matrix** or **Ensemble Attribute Matrix** from the original **Geometry**. The mask is expected to be over the edges themselves so it should be based on something from the **Edge Data Attribute Matrix**.

## Data Handling

For each of the vertex and edge data attribute matrices, the user can select to copy none, some or all of the associated data arrays into the newly created geometry. If the user wishes to not copy any of the data, just leave the choice to "Copy Selected XXX Data" [0] but do not populate the list with any selections.

*Note:* Since it cannot be known before run time how many **Edges** will be removed, the new **Edge Geometry** and all associated **Edge** data to be copied will be initialized to have size 0.

## Example Output

- The next figure shows an edge geometry that has had a mask generated. Yellow parts are flagged as true.

![Masked edge geometries for removal.](Images/RemoveFlaggedEdges_1.png)

- The next figure shows the result of running the filter.

![Resulting edge geometry](Images/RemoveFlaggedEdges_2.png)

% Auto generated parameter table will be inserted here

## 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) GitHub site where the community of DREAM3D-NX users can help answer your questions.
13 changes: 7 additions & 6 deletions src/Plugins/SimplnxCore/docs/RemoveFlaggedTrianglesFilter.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,13 @@ Surface Meshing (Misc)

## Description

This **Filter** removes **Triangles** from the supplied **Triangle Geometry** that are flagged by a boolean mask array as **true**. A new reduced **Geometry** is created that contains all the remaining **Triangles**. It is unknown until run time how many **Triangles** will be removed from the **Geometry**. Therefore, this **Filter** requires that a new **TriangleGeom** be created to contain the reduced **Triangle Geometry**. This new **Geometry** will *NOT* contain copies of any **Feature Attribute Matrix** or **Ensemble Attribute Matrix** from the original **Geometry**.
This **Filter** removes **Triangles** from the supplied **Triangle Geometry** that are flagged by a boolean mask array as **true**. A new reduced **Geometry** is created that contains all the remaining **Triangles**. It is unknown until run time how many **Triangles** will be removed from the **Geometry**. Therefore, this **Filter** requires that a new **TriangleGeom** be created to contain the reduced **Triangle Geometry**. This new **Geometry** will *NOT* contain copies of any **Feature Attribute Matrix** or **Ensemble Attribute Matrix** from the original **Geometry**. The mask is expected to be over the triangles themselves so it should be based on something from the ***Face Data*** **Attribute Matrix**.

- Additionally, all **Vertex** data will be copied, with tuples *removed* for any **Vertices** removed by the **Filter**. The user must supply a name for the reduced **Geometry**.
## Data Handling

The mask is expected to be over the triangles themselves so it should be based on something from the ***Face Data*** **Attribute Matrix**, generally we suggest basing the mask on the created **Region Ids** array from the *Label Triangle Geometry Filter*.
For each of the vertex and edge data attribute matrices, the user can select to copy none, some or all of the associated data arrays into the newly created geometry. If the user wishes to not copy any of the data, just leave the choice to "Copy Selected XXX Data" [0] but do not populate the list with any selections.

*Note:* Since it cannot be known before run time how many **Vertices** will be removed, the new **Vertex Geometry** and
all associated **Vertex** data to be copied will be initialized to have size 0.
*Note:* Since it cannot be known before run time how many **Vertices** will be removed, the new **Triangle Geometry** and all associated **Triangle** data to be copied will be initialized to have size 0.

## Example Output

Expand All @@ -27,7 +26,9 @@ all associated **Vertex** data to be copied will be initialized to have size 0.

% Auto generated parameter table will be inserted here

## Example Pipelines
## Example Pipeline

*'remove_flagged_triangles_example'* in **SimplnxCore**

## License & Copyright

Expand Down
18 changes: 3 additions & 15 deletions src/Plugins/SimplnxCore/docs/RemoveFlaggedVerticesFilter.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,16 @@

## Group (Subgroup)

DREAM3D Review (Geometry)
Data Cleanup (Geometry)

## Description

This **Filter** removes **Vertices** from the supplied **Vertex Geometry** that are flagged as **TRUE** by a boolean mask array.
A new reduced **Vertex Geometry** is
created that contains all the remaining **Vertices**. It is unknown until run time how many **Vertices** will be removed
from the **Geometry**. Therefore, this **Filter** requires that a new **Data Container** be created to contain the
reduced **Vertex Geometry**. This new **Vertex Geometry** will contain copies of any **Feature** or **Ensemble**
**Attribute Matrices** from the original **Data Container**. Additionally, all **Vertex** data will be copied, with
tuples *removed* for any **Vertices** removed by the **Filter**. The user must supply a name for the reduced **Vertex Geometry**,
but all other copied objects (**Attribute Matrices** and **Attribute Arrays**) will retain the same names
as the original source.
This **Filter** removes **Vertices** from the supplied **Vertex Geometry** that are flagged as **TRUE** by a boolean mask array. A new reduced **Vertex Geometry** is created that contains all the remaining **Vertices**. It is unknown until run time how many **Vertices** will be removed from the **Geometry**. Therefore, this **Filter** requires that a new **Data Container** be created to contain the reduced **Vertex Geometry**. This new **Vertex Geometry** will contain copies of any **Feature** or **Ensemble** **Attribute Matrices** from the original **Data Container**. Additionally, _all **Vertex** data will be copied_, with tuples *removed* for any **Vertices** removed by the **Filter**. The user must supply a name for the reduced **Vertex Geometry**, but all other copied objects (**Attribute Matrices** and **Attribute Arrays**) will retain the same names as the original source.

*Note:* Since it cannot be known before run time how many **Vertices** will be removed, the new **Vertex Geometry** and
all associated **Vertex** data to be copied will be initialized to have size 0. Any **Feature** or **Ensemble**
information will retain the same dimensions and size.
*Note:* Since it cannot be known before run time how many **Vertices** will be removed, the new **Vertex Geometry** and all associated **Vertex** data to be copied will be initialized to have size 0. Any **Feature** or **Ensemble** information will retain the same dimensions and size.

% Auto generated parameter table will be inserted here

## Example Pipelines

## License & Copyright

Please see the description file distributed with this plugin.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
{
"isDisabled": false,
"name": "remove_flagged_triangles_example.d3dpipeline",
"pinnedParams": [],
"pipeline": [
{
"args": {
"face_attribute_matrix_name": "Face Data",
"face_normals_name": "Face Normals",
"output_triangle_geometry_path": "TriangleGeometry",
"scale_factor": 1.0,
"scale_output": false,
"stl_file_path": "Data/STL_Models/Example_Triangle_Geometry.stl",
"vertex_attribute_matrix_name": "Vertex Data"
},
"comments": "",
"filter": {
"name": "nx::core::ReadStlFileFilter",
"uuid": "2f64bd45-9d28-4254-9e07-6aa7c6d3d015"
},
"isDisabled": false
},
{
"args": {
"created_region_ids_path": "TriangleGeometry/Face Data/Region Ids",
"input_triangle_geometry_path": "TriangleGeometry",
"num_triangles_name": "NumTriangles",
"triangle_attribute_matrix_name": "Cell Feature AM"
},
"comments": "",
"filter": {
"name": "nx::core::LabelTriangleGeometryFilter",
"uuid": "7a7a2c6f-3b03-444d-8b8c-5976b0e5c82e"
},
"isDisabled": false
},
{
"args": {
"array_thresholds_object": {
"inverted": false,
"thresholds": [
{
"array_path": "TriangleGeometry/Face Data/Region Ids",
"comparison": 1,
"inverted": false,
"type": "array",
"union": 0,
"value": 3.0
}
],
"type": "collection",
"union": 0
},
"created_mask_type": 1,
"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
},
"comments": "",
"filter": {
"name": "nx::core::MultiThresholdObjectsFilter",
"uuid": "4246245e-1011-4add-8436-0af6bed19228"
},
"isDisabled": false
},
{
"args": {
"input_triangle_geometry_path": "TriangleGeometry",
"mask_array_path": "TriangleGeometry/Face Data/Mask",
"output_triangle_geometry_path": "ExemplarReducedGeometry",
"triangle_data_handling_index": 0,
"triangle_data_selected_array_paths": [
"TriangleGeometry/Face Data/Face Normals",
"TriangleGeometry/Face Data/Mask",
"TriangleGeometry/Face Data/Region Ids"
],
"triangle_data_selected_attribute_matrix_path": "",
"vertex_data_handling_index": 0,
"vertex_data_selected_array_paths": [],
"vertex_data_selected_attribute_matrix_path": ""
},
"comments": "",
"filter": {
"name": "nx::core::RemoveFlaggedTrianglesFilter",
"uuid": "38155c61-2709-4731-be95-43745bb3f8d8"
},
"isDisabled": false
},
{
"args": {
"export_file_path": "Data/Output/remove_flagged_elements_data/remove_flagged_triangles_data.dream3d",
"write_xdmf_file": true
},
"comments": "",
"filter": {
"name": "nx::core::WriteDREAM3DFilter",
"uuid": "b3a95784-2ced-41ec-8d3d-0242ac130003"
},
"isDisabled": false
}
],
"version": 1,
"workflowParams": []
}
Loading

0 comments on commit d719016

Please sign in to comment.