API Reference
This section documents the main classes and functions in the mitotnt
package.
MitoSegmenter
Scans a directory for subfolders matching a given pattern
(e.g., "frame_000"
, "frame_001"
), stores metadata about
the dataset, and records pixel resolution information.
Parameters: |
|
---|
Attributes: |
|
---|
run_mitograph_cpu
Run MitoGraph on each frame of the dataset using CPU in parallel with a progress bar.
Parameters: |
|
---|
Returns: |
|
---|
visualize_segmented_data
Create ChimeraX script to visualize the segmented mitochondrial surface and the raw microscopy data. This is critical to evaluate the quality of mitochondria segmentation.
Parameters: |
|
---|
Returns: |
|
---|
SkeletonizedMito
This class stores metadata and skeletonized graph representations
of mitochondria extracted from raw segmentation results produced by
MitoSegmenter
. It provides access to frame-level information and
graph structures that can later be used for tracking.
Parameters: |
|
---|
Attributes: |
|
---|
extract_graphs
Extract the graph representations of the previously segmented mitochondria used for tracking.
Parameters: |
|
---|
Returns: |
|
---|
NetworkTracker
This class provides functionality to track skeletonized mitochondria in time-lapse imaging data. It uses distance and graph-based score to link mitochondrial nodes frame-to-frame and reconstruct trajectories under configurable tracking constraints.
Parameters: |
|
---|
Attributes: |
|
---|
reload_results
Same as run()
except reload previously saved results into TrackedMito
.
Returns: |
|
---|
run
Perform frame-to-frame tracking of mitochondria using the parameters declared in NetworkTracker
.
Returns: |
|
---|
TrackedMito
This class stores the results of mitochondrial tracking based on skeletonized network representations.It also adds features such as diffusivity and remodeling events.
Parameters: |
|
---|
Attributes: |
|
---|
compute_fragment_diffusivity
Compute fragment-level diffusivity from tracked mitochondrial trajectories.
For each fragment in selected center frames, this method aggregates node-level displacements into fragment-averaged displacements, computes time-averaged mean squared displacement (TA-MSD), and estimates diffusivity coefficients using a linear least-squares fit of MSD vs. lag time.
Parameters: |
|
---|
Returns: |
|
---|
compute_mitochondria_diffusivity
Wrapper to compute mitochondrial diffusivity at one or more structural levels: nodes, segments, or fragments.
Parameters: |
|
---|
Returns: |
|
---|
compute_node_diffusivity
Compute node-level diffusivity from tracked mitochondrial trajectories.
For each tracked node, the time-averaged mean squared displacement (TA-MSD)
is calculated over time lags up to max_tau
. A linear least-squares fit of
MSD vs. lag time is then used to estimate the diffusivity coefficient (D),
assuming 3D diffusion (MSD = 6Dt
).
Parameters: |
|
---|
Returns: |
|
---|
compute_segment_diffusivity
Compute segment-level diffusivity from tracked mitochondrial trajectories.
For each segment in selected center frames, this method aggregates node-level displacements into segment-averaged displacements, computes time-averaged mean squared displacement (TA-MSD), and estimates diffusivity coefficients using a linear least-squares fit of MSD vs. lag time.
Parameters: |
|
---|
Returns: |
|
---|
detect_fusion_fission
Detect mitochondrial fusion and fission events.
Scans tracked mitochondrial nodes across frames to identify topological remodeling events (fusion and fission). A sliding temporal window is applied to ensure that events are stable over multiple frames and not due to transient noise.
Parameters: |
|
---|
Returns: |
|
---|
Visualizer
Prepare ChimeraX files for visualizing tracking.
Parameters: |
|
---|
Attributes: |
|
---|
generate_chimerax_skeleton
Export mitochondrial network skeletons to ChimeraX BILD format.
Generates .bild
files representing mitochondrial skeleton graphs
for a specified frame range. Each skeleton is rendered as cylinders
(edges) and spheres (nodes), which can be directly loaded into
ChimeraX for 3D visualization.
Parameters: |
|
---|
Returns: |
|
---|
generate_tracking_arrows
Export tracking arrows between frames to ChimeraX BILD format.
Generates .bild
files that visualize temporal linkages of tracked
mitochondrial nodes as arrows between consecutive frames. Each arrow
connects the coordinate of a node in frame t
to its linked node in
frame t + tracking_interval
.
Parameters: |
|
---|
Returns: |
|
---|
map_mitochondria_fragment_motility
Map fragment-level mitochondrial motility (diffusivity) to 3D visualization.
For each selected frame, fragment-level diffusivity values are extracted from
self.tracked_mito.fragment_diffusivity
and mapped onto the skeleton graph.
Each fragment is rendered by coloring its constituent nodes, represented as
spheres, with colors reflecting normalized diffusivity values. The output
is exported in ChimeraX BILD format for visualization.
Parameters: |
|
---|
Returns: |
|
---|
map_mitochondria_motility
Wrapper to map mitochondrial motility (diffusivity) to 3D visualization at one or more structural levels: nodes, segments, or fragments.
Parameters: |
|
---|
Returns: |
|
---|
map_mitochondria_node_motility
Map node-level mitochondrial motility (diffusivity) to 3D visualization.
For each selected frame, node-level diffusivity values are extracted from
self.tracked_mito.node_diffusivity
and mapped onto the skeleton graph.
Nodes are rendered as spheres with colors representing normalized diffusivity.
The output is exported in ChimeraX BILD format for visualization.
Parameters: |
|
---|
Returns: |
|
---|
map_mitochondria_segment_motility
Map segment-level mitochondrial motility (diffusivity) to 3D visualization.
For each selected frame, segment-level diffusivity values are extracted from
self.tracked_mito.segment_diffusivity
and mapped onto the skeleton graph.
Each segment is rendered by coloring its constituent nodes, represented as
spheres, with colors reflecting normalized diffusivity values. The output
is exported in ChimeraX BILD format for visualization.
Parameters: |
|
---|
Returns: |
|
---|
visualize_tracking
Generate a ChimeraX command script for visualizing mitochondrial tracking.
Creates a .cxc
script that loads skeletons, arrows, and optional TIFF volumes
into ChimeraX for side-by-side visualization of tracked mitochondrial
networks. Skeletons can be displayed either as constructed ChimeraX BILD skeletons
or as raw Mitograph VTK files.
Parameters: |
|
---|
Returns: |
|
---|