1 Jun 2022

Create Material IDs

Using this module, the "Materials" parameter-bundle of a label-field is created and filled with an ID and name for each label-value.

CreateMaterialIDs_image

Why?

Several processing or visualization modules rely on label-fields that contain information in the "Materials" parameter-bundle. However, some methods for creating label-fields do not create that information.

Description

Connect the Create Material IDs module (found under "Xtra->Segmentation") to the label-field, then click "Apply". The module creates an ID and a name for each label-value in the "Materials" bundle. The number of materials is determined by the highest value in the label-field.

Example project

The example project shows a simple use-case:

"motor.am" is visualized using a "Volren" module. After segmenting the steel parts of "motor.am" using "Interactive Thresholding", you might want to render only the segmented material.
In general, this is possible by connecting a label-field to the "Labels" port of Volren and selecting only that material in the "Materials" section of Volren's properties. However, the "Materials" section is not shown, due to missing information in the parameter-bundle.

After clicking Apply of "Create Material IDs" and successively disconnecting and reconnecting the label-field in Volren, the "Material" section appears and you can select only the part of the grey-value volume to be rendered, which is covered by "Material1" in the label-field: