Skip to content

Commit 0083e99

Browse files
authored
Hotfix : v0.1.1 (#62)
* Fix shape >3 issues in sliding_window * Fix artefact removal widget visibility
1 parent 50c252e commit 0083e99

File tree

3 files changed

+10
-6
lines changed

3 files changed

+10
-6
lines changed

napari_cellseg3d/code_models/instance_segmentation.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ def sliding_window(volume, func, patch_size=512, increment_labels=True):
209209
"""
210210
result = np.zeros(volume.shape, dtype=np.uint32)
211211
max_label_id = 0
212-
x, y, z = volume.shape
212+
x, y, z = volume.shape[-3:]
213213
pbar_total = (x // patch_size) * (y // patch_size) * (z // patch_size)
214214
pbar = tqdm(total=pbar_total)
215215
for i in range(0, x, patch_size):

napari_cellseg3d/code_plugins/plugin_model_inference.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -387,6 +387,9 @@ def _toggle_display_instance(self):
387387
def _toggle_artifact_removal_widgets(self):
388388
"""Shows or hides the options for instance segmentation based on current user selection."""
389389
ui.toggle_visibility(self.use_instance_choice, self.artifact_container)
390+
ui.toggle_visibility(
391+
self.use_instance_choice, self.attempt_artifact_removal_box
392+
)
390393

391394
def _toggle_display_window_size(self):
392395
"""Show or hide window size choice depending on status of self.window_infer_box."""
@@ -513,7 +516,7 @@ def _build(self):
513516
self.artifact_removal_size,
514517
],
515518
)
516-
# self.attempt_artifact_removal_box.setVisible(False)
519+
self.attempt_artifact_removal_box.setVisible(False)
517520
self.remove_artifacts_label.setVisible(False)
518521
self.artifact_removal_size.setVisible(False)
519522

napari_cellseg3d/dev_scripts/sliding_window_voronoi.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
1+
"""Test script for sliding window Voronoi-Otsu segmentation.""."""
12
import numpy as np
23
import pyclesperanto_prototype as cle
34
from tqdm import tqdm
45

56

67
def sliding_window_voronoi_otsu(volume, spot_sigma, outline_sigma, patch_size):
7-
"""Given a volume of dimensions HxWxD, a spot_sigma and an outline_sigma,
8-
perform Voronoi-Otsu segmentation on the volume using a sliding window of
9-
size patch_size. If the edge has been reached, the patch size is reduced
8+
"""Given a volume of dimensions HxWxD, a spot_sigma and an outline_sigma, perform Voronoi-Otsu segmentation on the volume using a sliding window of size patch_size.
9+
10+
If the edge has been reached, the patch size is reduced
1011
to fit the remaining space. The result is a segmentation of the same size
1112
as the input volume.
1213
@@ -18,7 +19,7 @@ def sliding_window_voronoi_otsu(volume, spot_sigma, outline_sigma, patch_size):
1819
"""
1920
result = np.zeros(volume.shape, dtype=np.uint32)
2021
max_label_id = 0
21-
x, y, z = volume.shape
22+
x, y, z = volume.shape[-3:]
2223
for i in tqdm(range(0, x, patch_size)):
2324
for j in range(0, y, patch_size):
2425
for k in range(0, z, patch_size):

0 commit comments

Comments
 (0)