Skip to content

Commit bab12d8

Browse files
Update segmentation vis
1 parent e523f4c commit bab12d8

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

scripts/cryo/cryo-et-portal/process_tomograms_on_the_fly.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,12 @@ def run_prediction(tomogram, deposition_id, processing_type):
5151
write_ome_zarr(output_file, segmentation, voxel_size)
5252

5353

54+
# TODO download on lower scale
5455
def check_result(tomogram, deposition_id, processing_type):
5556
import napari
5657

5758
# Read tomogram data on the fly.
59+
print("Download data ...")
5860
data, voxel_size = read_data_from_cryo_et_portal_run(
5961
tomogram.run_id, processing_type=processing_type
6062
)
@@ -63,7 +65,8 @@ def check_result(tomogram, deposition_id, processing_type):
6365
output_folder = os.path.join(f"upload_CZCDP-{deposition_id}", str(tomogram.run.dataset_id))
6466
output_file = os.path.join(output_folder, f"{tomogram.run.name}.zarr")
6567
if os.path.exists(output_file):
66-
segmentation = None # TODO load the segmentation from zarr
68+
with zarr.open(output_file, "r") as f:
69+
segmentation = f["0"][:]
6770
else:
6871
segmentation = None
6972

@@ -95,5 +98,6 @@ def main():
9598
run_prediction(tomogram, deposition_id, processing_type)
9699

97100

101+
# TODO segmented at wrong size, check voxel size!
98102
if __name__ == "__main__":
99103
main()

0 commit comments

Comments
 (0)