Skip to content

Commit a7ff94e

Browse files
Udpate example analysis pipeline
1 parent 22ea714 commit a7ff94e

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

examples/analysis_pipeline.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
from synapse_net.file_utils import read_mrc
55
from synapse_net.sample_data import get_sample_data
6-
from synapse_net.tools.util import run_segmentation, get_model, compute_scale_from_voxel_size
6+
from synapse_net.inference import compute_scale_from_voxel_size, get_model, run_segmentation
77

88

99
def segment_structures(tomogram, voxel_size):
@@ -65,6 +65,10 @@ def main():
6565

6666
# Segment synaptic vesicles, the active zone, and the synaptic compartment.
6767
segmentations = segment_structures(tomogram, voxel_size)
68+
import h5py
69+
with h5py.File("seg.h5", "r") as f:
70+
for name, seg in segmentations.items():
71+
f.create_dataset(name, data=seg, compression="gzip")
6872

6973
# Post-process the segmentations, to find the presynaptic terminal,
7074
# filter out vesicles not in the terminal, and to 'snape' the AZ to the presynaptic boundary.

synapse_net/inference/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
"""This submodule implements SynapseNet's segmentation functionality.
22
"""
3-
from .inference import run_segmentation, get_model
3+
from .inference import run_segmentation, get_model, compute_scale_from_voxel_size

0 commit comments

Comments
 (0)