Skip to content

Commit

Permalink
Filter: Read VTK Structured Points (#905)
Browse files Browse the repository at this point in the history
Signed-off-by: Michael Jackson <[email protected]>
Signed-off-by: Joey Kleingers <[email protected]>
  • Loading branch information
joeykleingers authored Apr 3, 2024
1 parent cab149c commit 75122bb
Show file tree
Hide file tree
Showing 22 changed files with 2,914 additions and 218 deletions.
2 changes: 1 addition & 1 deletion scripts/simpl_filters.json
Original file line number Diff line number Diff line change
Expand Up @@ -10333,7 +10333,7 @@
"uuid": "{a043bd66-2681-5126-82e1-5fdc46694bf4}"
},
{
"name": "VtkStructuredPointsReader",
"name": "ReadVtkStructuredPoints",
"parameters": [
{
"name": "InputFile",
Expand Down
6 changes: 5 additions & 1 deletion src/Plugins/SimplnxCore/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,8 @@ set(FilterList
WriteLosAlamosFFTFilter
WriteStlFileFilter
WriteVtkRectilinearGridFilter
WriteVtkStructuredPointsFilter
ReadVtkStructuredPointsFilter
)

set(ActionList
Expand Down Expand Up @@ -208,6 +210,8 @@ set(AlgorithmList
WriteLosAlamosFFT
WriteStlFile
WriteVtkRectilinearGrid
WriteVtkStructuredPoints
ReadVtkStructuredPoints
)

create_simplnx_plugin(NAME ${PLUGIN_NAME}
Expand Down Expand Up @@ -320,7 +324,7 @@ set(PLUGIN_EXTRA_SOURCES
"${${PLUGIN_NAME}_SOURCE_DIR}/src/${PLUGIN_NAME}/utils/AvizoWriter.hpp"
"${${PLUGIN_NAME}_SOURCE_DIR}/src/${PLUGIN_NAME}/utils/AvizoWriter.cpp"
"${${PLUGIN_NAME}_SOURCE_DIR}/src/${PLUGIN_NAME}/utils/PythonPluginTemplateFile.hpp"

"${${PLUGIN_NAME}_SOURCE_DIR}/src/${PLUGIN_NAME}/utils/VtkUtilities.hpp"
"${${PLUGIN_NAME}_SOURCE_DIR}/src/${PLUGIN_NAME}/SurfaceNets/MMCellFlag.cpp"
"${${PLUGIN_NAME}_SOURCE_DIR}/src/${PLUGIN_NAME}/SurfaceNets/MMCellFlag.h"
"${${PLUGIN_NAME}_SOURCE_DIR}/src/${PLUGIN_NAME}/SurfaceNets/MMCellMap.cpp"
Expand Down
37 changes: 37 additions & 0 deletions src/Plugins/SimplnxCore/docs/ReadVtkStructuredPointsFilter.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Read VTK Structured Points File

## Group (Subgroup)

IO (Input)

## Description

This **Filter** reads a _STRUCTURED_POINTS_ type of 3D array from a legacy .vtk file. A _STRUCTURED_POINTS_ file is a more general type of **Image Geometry** where data can be stored at the vertices of each voxel. The currently supported VTK dataset attribute types are SCALARS and VECTORS. Other dataset attributes will not be read correctly and may cause issues when running the **Filter**. The VTK data must be _POINT_DATA_ and/or _CELL_DATA_ and can be either binary or ASCII. The **Filter** will create a new **Data Container** with an **Image** geometry for each of the types of data (i.e., _POINT_DATA_ and/or _CELL_DATA_) selected to be read, along with a **Cell Attribute Matrix** to hold the imported data.

*Note:* In a _STRUCTURED_POINTS_ file, _POINT_DATA_ lies on the vertices of each unit element voxel (i.e., eight values per voxel), while _CELL_DATA_ lies at the voxel center. This Filter will import *both* types of data as **Image Geometries**, since either form a structured rectilinear grid. This is to enable easier visualization of the _POINT_DATA_, and to enable greater flexibility when using DREAM.3D analysis tools, many of which rely on an **Image Geometry**.

### Example Input

# vtk DataFile Version 2.0
GrainIds Stored in Vtk File
ASCII
DATASET STRUCTURED_POINTS
DIMENSIONS 3 4 6
SPACING 1 1 1
ORIGIN 0 0 0
POINT_DATA 72
SCALARS GrainIds char 1
LOOKUP_TABLE default
0 0 0 0 0 0 0 0 0 0 0 0
0 5 10 15 20 25 25 20 15
10 5 0 0 10 20 30 40 50
50 40 30 20 10 0 0 10 20
30 40 50 50 40 30 20 10 0
0 5 10 15 20 25 25 20 15
10 5 0 0 0 0 0 0 0 0 0 0 0 0 0

% Auto generated parameter table will be inserted here

## License & Copyright

Please see the description file distributed with this **Plugin**
23 changes: 23 additions & 0 deletions src/Plugins/SimplnxCore/docs/WriteVtkStructuredPointsFilter.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Write Vtk Structured Points File

## Group (Subgroup)

I/O Filters

## Description

This Filter writes a VTK legacy file with a Dataset type of `STRUCTURED_POINTS`. The user can select which arrays from the Image Geometry will be written to the file.

Note: This filter only writes cell data to the VTK file.

% 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.
Loading

0 comments on commit 75122bb

Please sign in to comment.