Description: The unique, programmatic name of the parameter. This is the name used internally by the system to identify the parameter.
Type: string (str)
human_namestr
Description: The human-readable name of the parameter. This is the name presented to users and is meant to be more descriptive and user-friendly.
Type: string (str)
help_textstr
Description: A brief description or help text for the parameter. This text is intended to guide the user in understanding the purpose of the parameter and how to use it.
Description: The default value for the parameter. For the ArrayCreationParameter, this is a DataPath object that points to the location within the data structure where the data array will be created.
importsimplnxasnxparams.insert(nx.ArrayThresholdsParameter('data_thresholds_key','Data Thresholds','DataArray thresholds to mask',nx.ArrayThresholdSet()))
array_path – The DataPath to the array to use for this ArrayThreshold
comparison – Int. The comparison operator to use. 0=”>”, 1=”<”, 2=”=”, 3=”!=”
value –
Numerical Value. The value for the comparison
The below code will create an ArrayThresholdSet that is used to create a “Mask” output array of type boolean that will mark
each value in its output array as “True” if both of the ArrayThreshold Objects evaluate to True. Specifically, the “Confidence Index” and “Image Quality”
array MUST have the same number of Tuples and the output “Mask” array will also have the same number of tuples.
The following example sets up a BoolParameter so that it toggles the availability of a DataGroupSelectionParameter.
importsimplnxasnxparams.insert_linkable_parameter(nx.BoolParameter('example_bool_key','Bool Parameter','Example bool help text',True))params.insert(nx.DataGroupSelectionParameter('example_data_group_selection_key','DataGroupSelectionParameter','Example data group selection help text',nx.DataPath([]),set([nx.BaseGroup.GroupType.DataGroup])))params.link_parameters('example_bool_key','example_data_group_selection_key',True)
importsimplnxasnxcalc_param=nx.CalculatorParameter.ValueType(nx.DataPath("Small IN100/Scan Data"),"Confidence Index * 10",nx.CalculatorParameter.AngleUnits.Radians)params.insert(nx.CalculatorParameter(ExampleFilter2.PARAM18_KEY,"CalculatorParameter","Example help text for calculator parameter",calc_param))
The following example sets up a ChoicesParameter so that it toggles the availability of a DataPathSelectionParameter based on whether or not the ChoicesParameter is set to the second choice.
importsimplnxasnxparams.insert_linkable_parameter(nx.ChoicesParameter('example_choices_key','Choices Parameter','Example choices help text',0,["foo","bar","baz"]))params.insert(nx.DataPathSelectionParameter('example_data_path_selection_key','DataPathSelectionParameter','Example data path selection help text',nx.DataPath([])))params.link_parameters('example_choices_key','example_data_path_selection_key',1)
importsimplnxasnxparams.insert(nx.DataGroupCreationParameter('example_data_group_creation_key','DataGroupCreationParameter','Example data group creation help text',nx.DataPath([])))
importsimplnxasnxparams.insert(nx.DataGroupSelectionParameter('example_data_group_selection_key','DataGroupSelectionParameter','Example data group selection help text',nx.DataPath([]),set([nx.BaseGroup.GroupType.DataGroup])))
The DataObjectNameParameter is used to specify the name of a data object within the data structure. This parameter
is used most often when the developer of the filter intends the output “Group|Array|ArrtributeMatrix|Geometry” to be
created as a sibling to an input DataObject or as a Child of an input DataObject. Examples would be a filter that asks
for an input array “Foo” and creates an output array that they want to be a sibling of “Foo” called “Bar”. Another
example would be a filter that asks for an input Attribute Matrix and wants to create an output array as a child of
the input Attribute Matrix. The major difference between this Parameter and the String parameter is that if a user
changes the value of a DataObjectName parameter, other filters further down the pipeline will be updated with the new
value.
importsimplnxasnxparams.insert(nx.DataObjectNameParameter('data_object_name_key',"DataObjectNameParameter","Example help text for DataObjectNameParameter","Data Group"))
importsimplnxasnxparams.insert(nx.DataPathSelectionParameter('example_data_path_key','DataPathSelectionParameter','Example data path selection help text',nx.DataPath([])))
importsimplnxasnxparams.insert(nx.DataStoreFormatParameter('data_store_format_key','Data Store 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.',""))
The Dream3dImportParameter holds the information necessary to import a .dream3d file through the ImportData object. This parameter
should rarely, if ever, be used outside of the filter it was created to be used by.
importsimplnxasnximport_data=nx.Dream3dImportParameter.ImportData()import_data.file_path="/private/tmp/basic_ebsd.dream3d"import_data.data_paths=Noneparams.insert(nx.Dream3dImportParameter('import_file_path_key',"Import File Path","The HDF5 file path the DataStructure should be imported from.",import_data))
The DynamicTableParameter is used to specify parameters for dynamic tables which can be modified by the user
during runtime. It involves detailed configuration of rows and columns using the DynamicTableInfo class. The parameter
can have either static or adjustable (dynamic) rows and columns at runtime. This is done through the configuration
object.
importsimplnxasnxdefault_table=[[10,20],[30,40]]row_info=nx.DynamicTableInfo.DynamicVectorInfo(0,"Row {}")col_info=nx.DynamicTableInfo.DynamicVectorInfo(2,"Col {}")dynamic_table_info=nx.DynamicTableInfo(nx.DynamicTableInfo.VectorInfo(row_info),nx.DynamicTableInfo.VectorInfo(col_info))params.insert(nx.DynamicTableParameter('dynamic_table','DynamicTableParameter','DynamicTableParameter Example Help Text',default_table,dynamic_table_info))
The EnsembleInfoParameter is used to create the necessary phase information that will help when analyzing EBSD style of
data where crystallographic information about the phases is needed. This kind of data is typically read as part of EBSD
files but there are cases where this kind of data is being read from CSV files. It is represented a list of 3 value lists.
Each list holds 3 values, Crystal Structure, Phase Type, Phase Name.
Each row represents a specific phase.
The valid values for the Crystal Structures are:
“Hexagonal-High 6/mmm”
“Cubic-High m-3m”
“Hexagonal-Low 6/m”
“Cubic-Low m-3 (Tetrahedral)”
“Triclinic -1”
“Monoclinic 2/m”
“Orthorhombic mmm”
“Tetragonal-Low 4/m”
“Tetragonal-High 4/mmm”
“Trigonal-Low -3”,
“Trigonal-High -3m”
The valid Phase Types are:
“Primary”
“Precipitate”
“Transformation”
“Matrix”
“Boundary”
The user can define their own phase names.
This parameter is typically used in combination with the OrientationAnalysis.CreateEnsembleInfoFilter() filter
but could find uses in other filters that need this kind of information from the user.
importsimplnxasnxensemble_info=[]ensemble_info.append(["Hexagonal-High 6/mmm","Primary","Phase 1"])ensemble_info.append(["Cubic-High m-3m","Primary","Phase 2"])params.insert(nx.EnsembleInfoParameter('created_ensemble_info_key',"Created Ensemble Info","The values with which to populate the crystal structures, phase types, and phase names data arrays. Each row corresponds to an ensemble phase.",ensemble_info))
The FileSystemPathParameter is used to ask a user for a path from the local computer system. The parameter can be
configured to allow the user to select directories or files for input or output operations.
importsimplnxasnxparams.insert(nx.CreateColorMapParameter('color_table_preset_key',"Select Color Preset...","Select a preset color name.","Cool to Warm"))
The GeneratedFileListParameter is used to specify parameters for generating a list of file paths, typically used in batch processing or automated file generation.
In order to instantiate this parameter, the programmer should use the GeneratedFileListParameter.ValueType data member.
If you have a stack of images in tif format numbered from 11 to 174 where there are only 2 digits for slice indices < 100 and 3 digits after 100, the breakdown of the file name is as follows:
Prefix
index and padding digits
suffix
extension
slice-
100
_Data
.tif
The python code to implement this scheme is as follows:
importsimplnxasnxdefpreflight_impl(self,data_structure:nx.DataStructure,args:dict,message_handler:nx.IFilter.MessageHandler,should_cancel:nx.AtomicBoolProxy)->nx.IFilter.PreflightResult:params=nx.Parameters()generated_file_list_value=nx.GeneratedFileListParameter.ValueType()generated_file_list_value.input_path="DREAM3DNXData/Data/Porosity_Image"generated_file_list_value.ordering=nx.GeneratedFileListParameter.Ordering.LowToHighgenerated_file_list_value.file_prefix="slice-"generated_file_list_value.file_suffix=""generated_file_list_value.file_extension=".tif"generated_file_list_value.start_index=11generated_file_list_value.end_index=174generated_file_list_value.increment_index=1generated_file_list_value.padding_digits=2params.insert(nx.GeneratedFileListParameter(FilterClassName.INPUT_FILE_LIST_KEY,"Input File List","The list of files to be read",generated_file_list_value))defpreflight_impl(self,data_structure:nx.DataStructure,args:dict,message_handler:nx.IFilter.MessageHandler,should_cancel:nx.AtomicBoolProxy)->nx.IFilter.PreflightResult:file_list:nx.GeneratedFileListParameter.ValueType=[FilterClassName.INPUT_FILE_LIST_KEY].generate()forfileinfile_list:print(f'{file}')
The GeometrySelectionParameter is used to specify a valid simplnx.Geometry() selection within the data structure, constrained by allowed geometry types.
importsimplnxasnxparams.insert(nx.GeometrySelectionParameter('example_geometry_selection_parameter','GeometrySelectionParameter','Example geometry selection help text',nx.DataPath([]),set([nx.IGeometry.Type.Image,nx.IGeometry.Type.RectGrid])))
The ReadCSVFileParameter is used to specify parameters for reading data from a CSV (Comma-Separated Values) file using a ReadCSVDataParameter instance for detailed configuration.
The file can be comma, space, tab or semicolon separated.
The file optionally can have a line of headers. The user can specify what line number the header is located.
The import can start at a user specified line number and will continue importing lines equal to the total number of tuples that the user specified.
The primary python object that will hold the parameter information is the ReadCSVDataParameter class described below.
The ReadCSVDataParameter class holds all the necessary information to import a CSV formatted file into DREAM3D-NX. There are
a number of member variables that need to be set correctly before passing it into the filter parameter as the default value.
column_data_typesList[DataType]
Description: The data types of the columns in the CSV file. Indicates the kind of native numerical values (int, float… ) that will be used in the created DataArray.
importsimplnxasnx# Example File has 7 columns to importread_csv_data=nx.ReadCSVDataParameter()read_csv_data.input_file_path="/tmp/test_csv_data.csv"read_csv_data.start_import_row=2read_csv_data.delimiters=[',']read_csv_data.custom_headers=[]read_csv_data.column_data_types=[nx.DataType.float32,nx.DataType.float32,nx.DataType.float32,nx.DataType.float32,nx.DataType.float32,nx.DataType.float32,nx.DataType.int32]read_csv_data.skipped_array_mask=[False,False,False,False,False,False,False]read_csv_data.tuple_dims=[37989]read_csv_data.headers_line=1read_csv_data.header_mode=nx.ReadCSVDataParameter.HeaderMode.Lineparams.insert(nx.ReadCSVFileParameter('csv_importer_data_key',"CSV Importer Data","Holds all relevant csv file data collected from the custom interface",read_csv_data))
The primary python object that will hold the default information to pass to this parameter is the ReadH5EbsdFileParameter.ValueType class described below.
importorientationanalysisasoaread_h5ebsd_data=oa.ReadH5EbsdFileParameter.ValueType()read_h5ebsd_data.euler_representation=0read_h5ebsd_data.end_slice=117read_h5ebsd_data.selected_array_names=["Confidence Index","EulerAngles","Fit","Image Quality","Phases","SEM Signal","X Position","Y Position"]read_h5ebsd_data.input_file_path="Data/Output/Reconstruction/Small_IN100.h5ebsd"read_h5ebsd_data.start_slice=1read_h5ebsd_data.use_recommended_transform=Trueparams.insert(oa.ReadH5EbsdFileParameter('import_h5ebsd_file_key',"Import H5Ebsd File","Object that holds all relevant information to import data from the file.",read_h5ebsd_data))
This parameter is used for the simplnx.ReadHDF5DatasetFilter and holds the information to import specific data sets from within the HDF5 file into DREAM3D/simplnx
Description: The list of data sets to be imported.
input_filestr
Description: The file path to the input HDF5 file.
parentOptional[DataPath]
Description: The DataPath object to a parent group to create the DataArrays into. If left blank, the DataArray will be created at the top level of the DataStructure.
This parameter is used to specify a selection of multiple arrays within the data structure, constrained by component dimensions as well as allowed array and data types.
importsimplnxasnxparams.insert(nx.MultiArraySelectionParameter(ExampleFilter2.PARAM12_KEY,'MultiArraySelectionParameter','Example multiarray selection help text',[],set([nx.IArray.ArrayType.Any]),nx.get_all_data_types(),[[1]]))
importsimplnxasnxparams.insert(nx.MultiPathSelectionParameter('objects_to_copy_key',"Objects to copy","A list of DataPaths to the DataObjects to be copied",[nx.DataPath("Small IN100/Scan Data/Confidence Index"),nx.DataPath("Small IN100/Scan Data/Euler Angles")]))
The NeighborListSelectionParameter is used to specify a selection of a neighbor list array within the data structure, constrained by allowed data types.
importsimplnxasnxparams.insert(nx.NeighborListSelectionParameter('neighbor_list_key',"Neighbor List","List of the contiguous neighboring Features for a given Feature",nx.DataPath([]),set([nx.DataType.int32])))
This parameter represents a choice from a list of known numeric types. The programmer should use the predefined types instead of a plain integer value.
This group of parameters wrap a specific native C++ numeric type and can be used to add integer/float inputs to a filter. Their default values can be instantiated using standard python integers or decimal values.
The figure shows two different numerical vector parameters each having a different number of components to the vector.
The user interface has built in Copy/Paste functionality to easily get data into and out of the text fields.
This group of parameters can be used to gather more than a single scalar value from the user. For example, an Origin for an Image Geometry or the dimensions of a DataArray. It is represented as a list of numerical values.
Description: The programmatic name of the parameter.
Type: string (str)
human_namestr
Description: The human-readable name of the parameter.
Type: string (str)
help_textstr
Description: A brief description or help text for the parameter.
Type: string (str)
default_valueint
Description: The default value for the parameter, a list of integers or floats that are all expected to be within the range of the chosen float or integer type.
Type: List of Integers or Floats
namesint
Description: The list of names that describe each value in the vector.
importsimplnxasnxparams.insert(nx.VectorInt32Parameter('3d_dimensions_key','3D Dimensions','Example int32 vector help text',[-19,-100,456],["X","Y","Z"]))params.insert(nx.VectorFloat64Parameter('quaternion_key','Quaternion','Example float64 vector help text',[0,84.98,234.12,985.98],["U","V","W","X"]))
Preflight actions perform modifications to the DataStructure before executing the filter. Some examples include:
Creating a data array
Creating a geometry
Deleting a data object
Moving a data object
The following is an example that shows how to create an action and append it to the OutputActions object that gets returned by preflight. In this example, we are deleting an array from the DataStructure.
Preflight actions can also be deferred, which means that they are applied after the filter is finished executing, instead of before execution. An example of when using a deferred action might be useful is if the filter developer needs a data object to exist during filter execution, but does not want that data object to exist afterwards. In that case, the filter developer could write the following code:
The CreateImageGeometryAction is used to create a structured grid or image geometry, specifying dimensions, origin, and spacing, with an attribute matrix that can store cell data arrays.
importsimplnxasnx# Create image geometry with specified dimensions, origin, and spacing at /Image Geometrygeom_path=nx.DataPath('Image Geometry')dims=[256,256,100]origin=[0.0,0.0,0.0]spacing=[0.75,0.75,1.0]cell_matrix_name='Cell Data'output_actions=nx.OutputActions()output_actions.append_action(nx.CreateImageGeometryAction(geom_path,dims,origin,spacing,cell_matrix_name))
The CreateRectGridGeometryAction is intended to create rectilinear grid geometries either by specifying dimensions and boundary array names or by utilizing existing boundary arrays.
Description: The path where the rectilinear grid geometry will be created.
Type: DataPath
x_bounds_dim
Description: The number of divisions along the X dimension.
Type: int
y_bounds_dim
Description: The number of divisions along the Y dimension.
Type: int
z_bounds_dim
Description: The number of divisions along the Z dimension.
Type: int
cell_attribute_matrix_name
Description: Name for the newly created cell attribute matrix.
Type: str
x_bounds_name
Description: Name for the X boundary array.
Type: str
y_bounds_name
Description: Name for the Y boundary array.
Type: str
z_bounds_name
Description: Name for the Z boundary array.
Type: str
Second Constructor:
path
Description: The path where the rectilinear grid geometry will be created.
Type: DataPath
input_x_bounds_path
Description: The path to the input X boundary array.
Type: DataPath
input_y_bounds_path
Description: The path to the input Y boundary array.
Type: DataPath
input_z_bounds_path
Description: The path to the input Z boundary array.
Type: DataPath
cell_attribute_matrix_name
Description: The name for the newly created cell attribute matrix.
Type: str
array_type
Description: Specifies how the input arrays should be handled when creating new arrays in the rectilinear grid geometry. Possible values are Copy, Move, Reference, or Create.
importsimplnxasnx# Example using the first constructor to create a rectangular grid geometryoutput_actions=nx.OutputActions()output_actions.append_action(nx.CreateRectGridGeometryAction(nx.DataPath('Rect Grid Geometry'),10,20,30,'Cell Matrix','X Bounds','Y Bounds','Z Bounds'))# Example using the second constructor to create a rectangular grid geometry using existing arraysx_bounds_path=DataPath(['Other Rect Grid Geometry','X Bounds'])y_bounds_path=DataPath(['Other Rect Grid Geometry','Y Bounds'])z_bounds_path=DataPath(['Other Rect Grid Geometry','Z Bounds'])output_actions.append_action(nx.CreateRectGridGeometryAction(nx.DataPath('Rect Grid Geometry'),x_bounds_path,y_bounds_path,z_bounds_path,'Cell Matrix',nx.IDataCreationAction.ArrayHandlingType.Copy))
The CreateVertexGeometryAction is used to create a vertex geometry within the data structure, either by specifying the number of vertices and a vertex data array name, or by utilizing an existing vertex data array.
Description: The path where the vertex geometry will be created.
Type: nx.DataPath
num_vertices
Description: Number of vertices to create.
Type: int
vertex_attribute_matrix_name
Description: Name for the newly created vertex attribute matrix.
Type: str
shared_vertex_list_name
Description: Name for the newly created shared vertex list.
Type: str
Second Constructor:
geometry_path
Description: The path where the vertex geometry will be created.
Type: nx.DataPath
input_vertices_array_path
Description: The path to the input vertex array.
Type: nx.DataPath
vertex_attribute_matrix_name
Description: The name for the newly created vertex attribute matrix.
Type: str
array_type
Description: Specifies how the input array should be handled when creating new arrays in the vertex geometry. Possible values are Copy, Move, Reference, or Create.
importsimplnxasnx# Example using the first constructor to create a vertex geometryoutput_actions=nx.OutputActions()output_actions.append_action(nx.CreateVertexGeometryAction(nx.DataPath('Vertex Geometry'),1000,'Vertex Matrix','Shared Vertex List'))# Example using the second constructor to create a vertex geometry using an existing arrayvertices_path=nx.DataPath('Other Vertex Geometry/Vertices')output_actions.append_action(nx.CreateVertexGeometryAction(nx.DataPath('Vertex Geometry'),vertices_path,'Vertex Matrix',nx.IDataCreationAction.ArrayHandlingType.Reference))
The CreateEdgeGeometryAction is used to create an edge geometry in a data structure. There are two ways to create the geometry:
Specifying the number of edges and vertices along with attribute matrix and data array names (the vertex and edge arrays will be created for you).
Using existing arrays for vertices and edges and including an array handling type (Copy, Move, Reference, or Create) that determines how these existing arrays are handled by the action.
Description: The path where the edge geometry will be created.
Type: nx.DataPath
num_edges
Description: The number of edges to be created.
Type: int
num_vertices
Description: The number of vertices to be created.
Type: int
vertex_attribute_matrix_name
Description: The name for the newly created vertex attribute matrix.
Type: str
edge_attribute_matrix_name
Description: The name for the newly created edge attribute matrix.
Type: str
shared_vertices_name
Description: The name for the newly created vertices array.
Type: str
shared_edges_name
Description: The name for the newly created edges array.
Type: str
Second Constructor:
geometry_path
Description: The path where the edge geometry will be created.
Type: nx.DataPath
input_vertices_array_path
Description: The path to the input array of vertices.
Type: nx.DataPath
input_edges_array_path
Description: The path to the input array of edges.
Type: nx.DataPath
vertex_attribute_matrix_name
Description: The name for the newly created vertex attribute matrix.
Type: str
edge_attribute_matrix_name
Description: The name for the newly created edge attribute matrix.
Type: str
array_type
Description: Specifies how the input arrays should be handled when creating new arrays in the edge geometry. Possible values are Copy, Move, Reference, or Create.
importsimplnxasnx# Example using the first constructoroutput_actions=nx.OutputActions()output_actions.append_action(nx.CreateEdgeGeometryAction(nx.DataPath('Edge Geometry'),100,200,'Vertex Matrix','Edge Matrix','Vertices','Edges'))# Example using the second constructorvertices_path=nx.DataPath('Other Edge Geometry/Vertices')edges_path=nx.DataPath('Other Edge Geometry/Edges')output_actions.append_action(nx.CreateEdgeGeometryAction(nx.DataPath('Edge Geometry'),vertices_path,edges_path,'Vertex Matrix','Edge Matrix',nx.IDataCreationAction.ArrayHandlingType.Copy))
The CreateTriangleGeometryAction is designed to create a triangle geometry within the data structure, either by specifying the counts of faces and vertices along with their data names, or by directly using existing vertex and face arrays.
Description: The path where the triangular geometry will be created.
Type: nx.DataPath
num_faces
Description: Number of triangular faces to create.
Type: int
num_vertices
Description: Number of vertices to create.
Type: int
vertex_attribute_matrix_name
Description: Name for the newly created vertex attribute matrix.
Type: str
face_attribute_matrix_name
Description: Name for the newly created face attribute matrix.
Type: str
shared_vertices_name
Description: Name for the newly created shared vertices array.
Type: str
shared_faces_name
Description: Name for the newly created shared faces array.
Type: str
Second Constructor:
geometry_path
Description: The path where the triangular geometry will be created.
Type: nx.DataPath
input_vertices_array_path
Description: The path to the input vertex array.
Type: nx.DataPath
input_faces_array_path
Description: The path to the input face array.
Type: nx.DataPath
vertex_attribute_matrix_name
Description: The name for the newly created vertex attribute matrix.
Type: str
face_attribute_matrix_name
Description: The name for the newly created face attribute matrix.
Type: str
array_type
Description: Specifies how the input arrays should be handled when creating new arrays in the triangular geometry. Possible values are Copy, Move, Reference, or Create.
importsimplnxasnx# Example using the first constructor to create a triangle geometryoutput_actions=nx.OutputActions()output_actions.append_action(nx.CreateTriangleGeometryAction(nx.DataPath('Triangle Geometry'),150,300,'Vertex Matrix','Face Matrix','Shared Vertices','Shared Faces'))# Example using the second constructor to create a triangle geometry using existing arraysvertices_path=nx.DataPath('Other Triangle Geometry/Vertices')faces_path=nx.DataPath('Other Triangle Geometry/Faces')output_actions.append_action(nx.CreateTriangleGeometryAction(nx.DataPath('Triangle Geometry'),vertices_path,faces_path,'Vertex Matrix','Face Matrix',nx.IDataCreationAction.ArrayHandlingType.Move))
The CreateQuadGeometryAction is designed to create a quad geometry within the data structure, either by specifying the counts of faces and vertices along with associated attribute matrix and data names, or by directly using existing vertex and face arrays.
Description: The path where the quad geometry will be created.
Type: DataPath
num_faces
Description: Number of quad faces to create.
Type: int
num_vertices
Description: Number of vertices to create.
Type: int
vertex_attribute_matrix_name
Description: Name for the newly created vertex attribute matrix.
Type: str
face_attribute_matrix_name
Description: Name for the newly created face attribute matrix.
Type: str
shared_vertices_name
Description: Name for the newly created shared vertices array.
Type: str
shared_faces_name
Description: Name for the newly created shared faces array.
Type: str
Second Constructor:
geometry_path
Description: The path where the quad geometry will be created.
Type: DataPath
input_vertices_array_path
Description: The path to the input vertex array.
Type: DataPath
input_faces_array_path
Description: The path to the input face array.
Type: DataPath
vertex_attribute_matrix_name
Description: The name for the newly created vertex attribute matrix.
Type: str
face_attribute_matrix_name
Description: The name for the newly created face attribute matrix.
Type: str
array_type
Description: Specifies how the input arrays should be handled when creating new arrays in the quad geometry. Possible values are Copy, Move, Reference, or Create.
importsimplnxasnx# Example using the first constructor to create a quad geometryoutput_actions=nx.OutputActions()output_actions.append_action(nx.CreateQuadGeometryAction(nx.DataPath('Quad Geometry'),50,100,'Vertex Matrix','Face Matrix','Shared Vertices','Shared Faces'))# Example using the second constructor to create a quad geometry using existing arraysvertices_path=DataPath(['Other Quad Geometry','Vertices'])faces_path=DataPath(['Other Quad Geometry','Faces'])output_actions.append_action(nx.CreateQuadGeometryAction(nx.DataPath('Quad Geometry'),vertices_path,faces_path,'Vertex Matrix','Face Matrix',nx.IDataCreationAction.ArrayHandlingType.Copy))
The CreateHexahedralGeometryAction is designed to create a hexahedral geometry within the data structure, either by specifying the counts of cells and vertices, or by directly using existing vertex and cell arrays.
Description: The path where the hexahedral geometry will be created.
Type: nx.DataPath
num_cells
Description: Number of hexahedral cells to create.
Type: int
num_vertices
Description: Number of vertices to create.
Type: int
vertex_data_name
Description: Name for the newly created vertex data array.
Type: str
cell_data_name
Description: Name for the newly created cell data array.
Type: str
shared_vertices_name
Description: Name for the newly created vertex array.
Type: str
shared_cells_name
Description: Name for the newly created cells array.
Type: str
Second Constructor:
geometry_path
Description: The path where the hexahedral geometry will be created.
Type: nx.DataPath
input_vertices_array_path
Description: The path to the input vertex array.
Type: nx.DataPath
input_cell_array_path
Description: The path to the input cell array.
Type: nx.DataPath
vertex_attribute_matrix_name
Description: The name for the newly created vertex attribute matrix.
Type: str
cell_attribute_matrix_name
Description: The name for the newly created cell attribute matrix.
Type: str
array_type
Description: Specifies how the input arrays should be handled when creating new arrays in the hexahedral geometry. Possible values are Copy, Move, Reference, or Create.
importsimplnxasnx# Example using the first constructor to create a hexahedral geometryoutput_actions=nx.OutputActions()output_actions.append_action(nx.CreateHexahedralGeometryAction(nx.DataPath('Hexahedral Geometry'),100,200,'Vertex Data','Cell Data','Shared Vertices','Shared Hexahedrals'))# Example using the second constructor to create a hexahedral geometry using existing arraysvertices_path=nx.DataPath('Other Hexahedral Geometry/Vertices')cells_path=nx.DataPath('Other Hexahedral Geometry/Hexahedrals')output_actions.append_action(nx.CreateHexahedralGeometryAction(nx.DataPath('Hexahedral Geometry'),vertices_path,cells_path,'Vertex Matrix','Cell Matrix',nx.IDataCreationAction.ArrayHandlingType.Copy))
The CreateTetrahedralGeometryAction creates a tetrahedral geometry within the data structure, either by specifying the counts of cells and vertices along with cell and vertex data names, or by directly using existing vertex and cell arrays.
Description: The path where the tetrahedral geometry will be created.
Type: DataPath
num_cells
Description: Number of tetrahedral cells to create.
Type: int
num_vertices
Description: Number of vertices to create.
Type: int
vertex_data_name
Description: Name for the newly created vertex data array.
Type: str
cell_data_name
Description: Name for the newly created cell data array.
Type: str
shared_vertices_name
Description: Name for the newly created shared vertices array.
Type: str
shared_cells_name
Description: Name for the newly created shared cells array.
Type: str
Second Constructor:
geometry_path
Description: The path where the tetrahedral geometry will be created.
Type: DataPath
input_vertices_array_path
Description: The path to the input vertex array.
Type: DataPath
input_cell_array_path
Description: The path to the input cell array.
Type: DataPath
vertex_attribute_matrix_name
Description: The name for the newly created vertex attribute matrix.
Type: str
cell_attribute_matrix_name
Description: The name for the newly created cell attribute matrix.
Type: str
array_type
Description: Specifies how the input arrays should be handled when creating new arrays in the tetrahedral geometry. Possible values are Copy, Move, Reference, or Create.
importsimplnxasnx# Example using the first constructor to create a tetrahedral geometryoutput_actions=nx.OutputActions()output_actions.append_action(nx.CreateTetrahedralGeometryAction(nx.DataPath('Tetrahedral Geometry'),500,1000,'Vertex Data','Cell Data','Shared Vertices','Shared Tetrahedrals'))# Example using the second constructor to create a tetrahedral geometry using existing arraysvertices_path=DataPath(['Other Tetrahedral Geometry','Vertices'])cells_path=DataPath(['Other Tetrahedral Geometry','Tetrahedrals'])output_actions.append_action(nx.CreateTetrahedralGeometryAction(nx.DataPath('Tetrahedral Geometry'),vertices_path,cells_path,'Vertex Matrix','Cell Matrix',nx.IDataCreationAction.ArrayHandlingType.Copy))
The CreateArrayAction is used to create a new array with specific data type, tuple dimensions, and component dimensions at a specified path within the data structure.
importsimplnxasnx# Create an array with specified dimensions and data type at /Data Arraydtype=nx.DataType.float32t_dims=[100,100]c_dims=[3]path=nx.DataPath('Data Array')output_actions=nx.OutputActions()output_actions.append_action(nx.CreateArrayAction(dtype,t_dims,c_dims,path))# In-memory
importsimplnxasnx# Create a data group at /Data Grouppath=nx.DataPath('Data Group')output_actions=nx.OutputActions()output_actions.append_action(nx.CreateDataGroupAction(path))
importsimplnxasnx# Create a neighbor list for integer data type with 100 tuples at /Data/Neighborsdata_type=nx.DataType.int32tuple_count=100path=nx.DataPath('Data/Neighbors')output_actions=nx.OutputActions()output_actions.append_action(nx.CreateNeighborListAction(data_type,tuple_count,path))
The CreateStringArrayAction is designed to create a string array at a specified path within the data structure, with the option to initialize all elements with a given value.
importsimplnxasnx# Example of creating a 2D string array initialized with "foo"output_actions=nx.OutputActions()output_actions.append_action(nx.CreateStringArrayAction([10,20],nx.DataPath('String Array'),'foo'))
The ImportH5ObjectPathsAction is used to import specific objects from an HDF5 file into the data structure. This action allows for selective data import based on provided paths.
Description: The file path of the HDF5 file from which to import data.
Type: os.PathLike
paths
Description: A list of paths specifying which objects to import from the HDF5 file. If None, all objects will be imported. If list is empty, nothing will be imported.
importsimplnxasnximportos# Example of importing specific object paths from an H5 fileoutput_actions=nx.OutputActions()h5_file_path=os.path.join('path','to','file.h5')output_actions.append_action(nx.ImportH5ObjectPathsAction(h5_file_path,['Data/Object1','Data/Object2']))# Example of importing all objects from an H5 fileoutput_actions=nx.OutputActions()h5_file_path=os.path.join('path','to','file.h5')output_actions.append_action(nx.ImportH5ObjectPathsAction(h5_file_path,None))# Example of importing nothing from an H5 fileoutput_actions=nx.OutputActions()h5_file_path=os.path.join('path','to','file.h5')output_actions.append_action(nx.ImportH5ObjectPathsAction(h5_file_path,[]))
importsimplnxasnx# Copy the array at /Original/Path to /New/Pathselected_data_path=nx.DataPath('Original/Path')created_data_path=nx.DataPath('New/Path')output_actions=nx.OutputActions()output_actions.append_action(nx.CopyArrayInstanceAction(selected_data_path,created_data_path))
The CopyDataObjectAction is used to copy a data object from one path to another within a data structure.
If copying a Data Group, Attribute Matrix, or Geometry, this action will also recursively copy all children.
Note: For copying data arrays, we recommend using CopyArrayInstanceAction. This action offers enhanced error-checking and superior out-of-core handling tailored specifically for data arrays.
importsimplnxasnx# Copy the data object from /Original/Path to /New/Pathpath=nx.DataPath('Original/Path')new_path=nx.DataPath('New/Path')all_created_paths=[]output_actions=nx.OutputActions()output_actions.append_action(nx.CopyDataObjectAction(path,new_path,[]))
The DeleteType is used to determine the type of deletion to perform. Currently, only the JustObject type is available, which deletes the specified object and all children.
importsimplnxasnx# Example of deleting data using the DeleteDataActionoutput_actions=nx.OutputActions()output_actions.append_action(nx.DeleteDataAction(nx.DataPath('Path/To/Data'),nx.DeleteDataAction.DeleteType.JustObject))
The MoveDataAction facilitates the relocation of data within the data structure, allowing data at a specified path to be moved to a new parent location.
importsimplnxasnx# Example of moving data within the data structureoutput_actions=nx.OutputActions()data_path=nx.DataPath('Current/Location/Data')new_parent=nx.DataPath('New/Location')output_actions.append_action(nx.MoveDataAction(data_path,new_parent))
importsimplnxasnx# Example of renaming a data objectoutput_actions=nx.OutputActions()data_path=nx.DataPath('Current/Name')new_data_name='New Name'output_actions.append_action(nx.RenameDataAction(data_path,new_data_name))
The UpdateImageGeomAction modifies the geometry parameters of an image stored in the data structure. It updates the origin and spacing of the image to better align with spatial or resolution requirements.
Description: The new origin coordinates of the image. This should be a tuple of floats indicating the starting point of the image in its coordinate space.
Type: tuple[float, float, float]
spacing
Description: The new spacing between the pixels (or voxels) of the image. This should be a tuple of floats representing the distance between elements in each dimension.
Type: tuple[float, float, float]
path
Description: The path to the image geometry that needs updating.
importsimplnxasnx# Example of updating image geometryoutput_actions=nx.OutputActions()image_path=nx.DataPath('Image Geometry')new_origin=(0.0,0.0,0.0)new_spacing=(1.0,1.0,1.0)output_actions.append_action(nx.UpdateImageGeomAction(new_origin,new_spacing,image_path))