Skip to content

Mesh Generation Module Guide ​

The Mesh Generation module converts segmented image stacks into 3D surface meshes using the Marching Cubes algorithm. These meshes can be visualized interactively, exported for 3D modeling software, or prepared for 3D printing.

For a conceptual overview, see Mesh Generation.

Mesh Generation module showing generation complete with download optionsThe Mesh Generation module landing page showing step navigation and file selector


Prerequisites ​

Before using this module, ensure you have:

  • A segmented TIFF stack (from Segmentation inference or the Annotation tool)
  • The segmentation must contain at least one labeled class (non-background pixels)

Quick Start ​

  1. Launch module — Click "Mesh Generation" from the workspace hub
  2. Select segmentation — Choose a segmentation result or annotation file
  3. Configure — Choose which class(es) to mesh and set the Z voxel scale
  4. Generate — Click "Generate Mesh" and wait for processing
  5. Use results — Open in 3D Visualization or download the JSON/OBJ files

Other formats: the module writes JSON and OBJ. For STL, PLY, or glTF (GLB), right-click the OBJ in the File Browser and use Convert to…


Step-by-Step Guide ​

Step 1: Data Selection ​

Select the segmentation data to convert into a 3D mesh.

Step 1 showing file selection with validationStep 1 data selection with segmentation file validation

Input Options ​

SourceDescriptionWhen to Use
Recent ResultsSegmentation outputs from U-Net inferenceAfter running segmentation inference
Annotation FilesMasks from the Annotation ToolFor manually created segmentations
Uploaded FilesAny labeled TIFF stackFor external segmentation data

File Requirements ​

  • Format: Multi-page TIFF (.tif or .tiff)
  • Pixel Values: Integer class labels (0 = background, non-zero = object classes)
  • Data Type: Any integer type — uint8, uint16, uint32, int8, int16, or int32. The data is used as-is; no bit-depth conversion is applied

Validation ​

The module validates your file to ensure it's a proper segmentation:

CheckWhat It Means
Class DetectionFile must contain at least one non-background class
Value RangeRejects files with too many unique values (likely raw images)
Data TypeMust be integer type, not floating point

Note: Invalid uploaded files are automatically removed from your workspace to keep it clean.

For more details, see Segmentation Data.

Click "Next: Generate Mesh" to proceed to Step 2.


Step 2: Mesh Generation ​

Configure output options and generate your mesh.

Step 2 showing data summary and generation optionsStep 2 with data summary, format selection, and class options

Data Summary ​

Before generating, you'll see a summary of your selected file:

InformationExample
Filenameinference_result.tif
Dimensions64 × 512 × 512 (slices × height × width)
Detected ClassesClass 1, Class 2
Data Typeuint8
PreviewThumbnail of middle slice

Output Files ​

Every run writes two files — no format selection needed:

FormatDescriptionUse Case
JSONSlice-based format for the built-in 3D viewerInteractive visualization in browser (enables the per-class slice-range controls)
OBJ (Wavefront)Industry-standard 3D geometryBlender, Maya, 3ds Max, etc.

Need STL, PLY, or glTF? Generate the mesh, then right-click the OBJ file in the File Browser and use Convert to… — STL for 3D printing, PLY, or glTF (GLB).

Class Selection ​

Choose which classes to include in the mesh:

  • All Classes (default) — Generates a separate surface for every detected class
  • Single Class — Pick one class value to generate on its own

Z Voxel Scale ​

Controls the voxel aspect ratio along z relative to the in-plane x/y pixels (range 0.05–20, step 0.1):

ValueEffect
1 (default)Cubic voxels (1 : 1 : 1)
> 1Stretches along z — e.g. 2 for a z-step twice the in-plane pixel size
< 1Compresses along z for finely-sampled stacks

Use this when your acquisition is anisotropic so the mesh keeps true physical proportions. Compute it as z-step / in-plane pixel size from your acquisition metadata. The scale is baked into both the OBJ and the JSON (and carries into STL/PLY/glTF conversions).

For more details, see Z Voxel Scale and Output Options.

Click "Generate Mesh" to start processing.


Processing ​

During mesh generation, you'll see real-time progress updates.

Progress display showing generation in progressMesh generation progress with status and elapsed time

Progress Indicators ​

ElementDescription
Status TextCurrent operation (e.g., "Processing class 1 of 3")
Progress BarVisual percentage complete
PercentageNumeric progress (0-100%)
Elapsed TimeHow long generation has been running

Note: Generation time depends on data size and number of classes. Large volumes may take several minutes.


Results ​

After generation completes, you'll see the results summary.

Results section showing statistics and download buttonsResults section with mesh statistics and download options

Statistics Displayed ​

MetricDescription
Total VerticesNumber of 3D points in the mesh
Total FacesNumber of triangular surfaces
Classes ProcessedHow many classes were meshed
Generation TimeTotal processing duration (and the Z voxel scale, when not 1)

Download Options ​

Download buttons are offered for the JSON and OBJ files.

Actions ​

  • Open in 3D Visualization — Launch the interactive 3D viewer with your mesh
  • Start New Run — Return to Step 1 to create another mesh

Tip: If you navigate away while a generation is running, returning to the module resumes it — an in-progress job re-attaches to its progress bar, and a job that finished while you were away shows its results.


Output Files ​

FileFormatDescriptionLocation
Mesh JSONVoxelSlicesSlice-based mesh for the built-in 3D viewerresults/meshes/
Mesh OBJWavefront3D geometry for external softwareresults/meshes/
MetadataJSONGeneration statisticsresults/meshes/

STL, PLY, and glTF (GLB) are produced via the File Browser's Convert to… on the OBJ file.


Troubleshooting ​

IssueCauseSolution
"No object classes found"File contains only background (0 values)Use a file with actual segmentation labels
"Too many unique values"File appears to be raw image dataSelect a segmentation output, not raw images
Generation takes very longLarge volume or many classesNormal for large data; wait for completion
Can't click GenerateZ voxel scale out of rangeUse a value between 0.05 and 20
File validation failedUploaded file is not a valid segmentationEnsure file is a labeled TIFF with integer values

Module Overview:

Step-by-Step:

Part of DFG Priority Programme SPP2332 "Physics of Parasitism"