Working with in situ data#

This guide outlines strategies for analyzing in situ membrane segmentations using Mosaic, demonstrated on a Giardia lamblia dataset.

Segmentation#

Load your segmentation via File > Load Session. If you don’t have one, follow the membrane segmentation guide.

Tip

Load Session sets default values that optimize downstream processing and export.

For large datasets, adjust point rendering in Preferences > Appearance (Linux: High preset; macOS: Ultra or Adaptive).

../../_images/data.png

Raw membrane segmentation#

Connected Components#

Separate the dataset into disjoint membrane partitions:

  1. Select the segmentation in the Object Browser

  2. In the Segmentation tab, configure Cluster:

    • Method: Connected Components

    • Use Points: Check

    • Drop Noise: Check

    • Distance: -1.0

  3. Click Apply

Color by entity (View > Coloring > By Entity) to distinguish components.

../../_images/components.png

Separated membrane components#

Tip

Distance -1 uses single-voxel connectivity. Increase to merge components separated by multiple voxels.

Refinement#

Remove small erroneous clusters using size-based filtering:

  1. Click Select in the Segmentation tab

  2. Adjust cutoffs to identify suitable size ranges (here, <25,000 voxels)

  3. Click Remove

../../_images/filtering.png

Size-based cluster filtering#

Tip

Manual editing is available via Actions > Pick Objects and Actions > Point Selection (or keyboard shortcuts). Use Trim for lamella editing.

Clustering#

Some membrane systems (e.g. double membranes) remain merged after connected components. Graph-based clustering can separate them.

Envelope Extraction#

Optionally thin membranes to their envelope first, reducing computation and improving separation:

  1. Select the target cluster

  2. Configure Cluster: Method: Envelope, Use Points: Check, Distance: -1.0, click Apply

Note

Check Drop Noise to add the inner membrane part as a second cluster.

../../_images/cluster.png

Slice through initial cluster#

../../_images/cluster_envelope.png

Identified envelope points#

Leiden Clustering#

Leiden clustering uses graph connectivity to separate membrane systems. The resolution parameter controls fineness — start at -7.3 and increase in steps of 1.0.

Here, resolution -7.3 yielded two clusters. Repeating at -6.3 for each produces the results below. Merge the resulting clusters into distinct membrane systems by selection.

../../_images/leiden.png

Leiden clustering result#

../../_images/leiden_merged.png

Merged membrane segmentation#

Repeat for the remainder of the dataset.

../../_images/clustered.png

Clustering applied to the entire dataset.#

Tip

When connectivity alone is insufficient, use distance-based methods like K-Means. DBSCAN and Birch can also work but are harder to tune.

Meshing#

Fit triangular meshes to analyze geometric properties:

  1. Select membrane clusters in the Object Browser

  2. In Parametrization, configure Mesh:

    • Method: Alpha Shape

    • Smoothness: 1.0, Curvature Weight: 1.0

    • Pressure: 0.0

    • Boundary Ring: 1, Alpha: 1.0

    Changed in version v1.2.1: Elastic Weight renamed to Smoothness (rescaled). Volume Weight renamed to Pressure. Neighbors, Scaling Factor, and Distance were removed. Curvature Weight: 10.0 is sensible pre 1.2.1.

  3. Click Apply

../../_images/systems.png

Membrane segmentations#

../../_images/systems_meshed.png

Membrane meshes#

Alpha shapes work well for convex membrane morphologies. For non-convex membranes, use Ball Pivoting (e.g. with core-thinning via Segmentation > Skeletonize at radius 40, then Ball Pivoting at radius 50). Poisson reconstruction also produces complete meshes using a different completion strategy.

Changed in version v1.1.0: Thin was renamed to Skeletonize.

Analyze geometric properties via Segmentation > Properties:

../../_images/systems_analysis.png

Analyzing mesh properties.#

../../_images/systems_area.png

Mesh area#

../../_images/systems_volume.png

Mesh volume#

../../_images/systems_curvature.png

Mesh mean curvature (radius 10)#