Skip to content

Commit 8482b0c

Browse files
Fix bug in ais state caching (computational-cell-analytics#608)
1 parent 875d614 commit 8482b0c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

micro_sam/sam_annotator/_widgets.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -1330,9 +1330,9 @@ def _handle_amg_state(state, i, pbar_init, pbar_update):
13301330
save_key = f"state-{i}"
13311331
with h5py.File(cache_path, "a") as f:
13321332
g = f.create_group(save_key)
1333-
g.create_dataset("foreground", data=state["foreground"], compression="gzip")
1334-
g.create_dataset("boundary_distances", data=state["boundary_distances"], compression="gzip")
1335-
g.create_dataset("center_distances", data=state["center_distances"], compression="gzip")
1333+
g.create_dataset("foreground", data=amg_state_i["foreground"], compression="gzip")
1334+
g.create_dataset("boundary_distances", data=amg_state_i["boundary_distances"], compression="gzip")
1335+
g.create_dataset("center_distances", data=amg_state_i["center_distances"], compression="gzip")
13361336

13371337
# Otherwise (2d segmentation) we just check if the amg is initialized or not.
13381338
elif not state.amg.is_initialized:

0 commit comments

Comments
 (0)