pycroglia.core.plot package

Submodules

class pycroglia.core.plot.branch.BranchpointsCellPlot(cell_idx, fullmask, allbranch, scale, zscale, opacity=0.1)[source]

Bases: object

Render 3D visualization of skeleton cells with global branchpoints overlay.

This class replicates the MATLAB visualization where each full skeleton is displayed in blue (translucent) and its branchpoints are shown in red (solid). It supports multiple skeletons while using a single branchpoint volume shared across them.

Parameters:
  • fullmask (list[NDArray]) – List of 3D binary arrays representing skeleton masks.

  • branchpoints (NDArray) – Single 3D binary array representing all branchpoints.

  • scale (float) – Physical voxel size along XY axes (µm/pixel).

  • zscale (float) – Scaling factor for the Z-axis (µm/pixel).

  • opacity (float, optional) – Transparency of the skeleton surfaces. Defaults to 0.1.

  • cell_idx (int)

  • allbranch (ndarray[tuple[int, ...], dtype[_ScalarType_co]])

show_all()[source]

Display all generated 3D skeleton + branchpoints plots sequentially.

Return type:

None

class pycroglia.core.plot.endpoints.EndpointsCellPlot(cell_idx, fullmask, endpoints, scale, zscale, opacity=0.1)[source]

Bases: object

Render 3D visualization of skeleton cells with endpoints overlaid.

This class reproduces the MATLAB visualization of full skeleton structure combined with endpoint markers. The full skeleton is shown as a translucent blue isosurface, and endpoints are displayed as solid red surfaces.

Parameters:
  • fullmask (list[NDArray]) – List of 3D binary arrays representing the full skeleton masks.

  • endpoints (list[NDArray]) – List of 3D binary arrays representing endpoint voxels.

  • scale (float) – Physical voxel size along XY axes (µm/pixel).

  • zscale (float) – Scaling factor for the Z-axis (µm/pixel).

  • opacity (float, optional) – Transparency of the skeleton surface. Defaults to 0.1.

  • cell_idx (int)

show_all()[source]

Display all generated 3D skeleton + endpoints plots sequentially.

Return type:

None

class pycroglia.core.plot.full_cell_analysis.FullCellAnalysisPlot(fca, masks, color='cyan', opacity=0.3, edge_color='black', line_width=1.0, lighting='gouraud')[source]

Bases: object

3D visualization and export utility for full-cell convex hull analysis results (PyVista version).

This class creates interactive 3D visualizations of convex hulls for a collection of cell masks using PyVista. Each cell’s convex volume and morphological complexity are shown with translucent colored meshes.

Parameters:
plotters

List of PyVista plotter objects for each cell.

Type:

list[pv.Plotter]

show_all()[source]

Show all PyVista windows sequentially (non-blocking).

Return type:

None

class pycroglia.core.plot.original_cell.OriginalCellPlot(masks, scale, zscale, cmap='tab20', opacity=1.0)[source]

Bases: object

Render 3-D isometric cell surfaces using PyVista.

This class visualizes segmented cell volumes as smooth, shaded 3-D surfaces generated with the marching-cubes algorithm. Each cell volume is rendered with physically scaled axes, labeled grid lines, and an isometric camera view.

It supports both desktop (native PyVista windows) and notebook rendering (via the Trame backend when available).

Parameters:
plots

List of PyVista plotters, one per cell.

Type:

list[pv.Plotter]

scale

XY voxel size in physical units (e.g., µm/pixel).

Type:

float

zscale

Z-axis voxel size in physical units.

Type:

float

opacity

Transparency of the cell surfaces in [0, 1].

Type:

float

cmap

Colormap used for per-cell coloring.

Type:

matplotlib.colors.Colormap

show_all(use_trame=False)[source]

Display each rendered cell surface interactively.

Parameters:

use_trame (bool, optional) – If True, use the Trame backend for inline rendering inside Jupyter notebooks (requires trame packages). If False, open native PyVista windows. Defaults to False.

Return type:

None

Example

`python plotter = OriginalCellPlot([mask1, mask2], scale=0.1, zscale=0.2) plotter.show(use_trame=True)  # for Jupyter notebooks `

class pycroglia.core.plot.skeleton.SkeletonCellPlot(cell_idx, fullmask, scale, zscale, opacity=0.5)[source]

Bases: object

Render 3-D isometric branch-order surfaces from one or more skeleton masks.

Each fullmask volume encodes branch order numerically:

4 → Primary branches (red) 3 → Secondary branches (yellow) 2 → Tertiary branches (green) 1 → Quaternary branches (blue)

All non-empty branch levels are displayed together with realistic lighting, shading, and spatial scaling. Multiple masks are rendered in separate PyVista windows.

Parameters:
  • fullmask (list[NDArray]) – List of 3-D integer arrays, each encoding branch order per voxel.

  • scale (float) – Physical voxel size along XY axes (µm/pixel).

  • zscale (float) – Scaling factor for the Z-axis (µm/pixel).

  • opacity (float, optional) – Transparency for each surface. Defaults to 0.5.

  • cell_idx (int)

show_all()[source]

Display all generated 3-D skeleton visualizations sequentially.

Each plot is opened in an interactive PyVista window. This call blocks execution until all windows are closed.

Example

`python plotter = SkeletonCellPlot(fullmask_list, scale=0.1, zscale=0.1) plotter.show() `

Return type:

None

Module contents