Skip to content

Commit 1e07c1d

Browse files
committed
Merge branch 'cy/layer-inference' of https://github.com/AdaptiveMotorControlLab/CellSeg3d into cy/layer-inference
2 parents 2fc88d0 + 23578a4 commit 1e07c1d

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

napari_cellseg3d/model_workers.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,10 @@ def __init__(
233233
self.window_infer_size = window_infer_size
234234
self.keep_on_cpu = keep_on_cpu
235235
self.stats_to_csv = stats_csv
236+
############################################
237+
############################################
238+
self.layer = layer
239+
self.images_filepaths = images_filepaths
236240

237241
############################################
238242
############################################
@@ -360,8 +364,10 @@ def load_layer(self):
360364
dims_check = volume.shape
361365
self.log("\nChecking dimensions...")
362366
pad = utils.get_padding_dim(dims_check)
367+
363368
# print(volume.shape)
364369
# print(volume.dtype)
370+
365371
load_transforms = Compose(
366372
[
367373
ToTensor(),
@@ -532,11 +538,14 @@ def inference_on_list(self, inf_data, i, model, post_process_transforms):
532538

533539
def stats_csv(self, instance_labels):
534540
if self.stats_to_csv:
541+
535542
# try:
543+
536544
data_dict = volume_stats(
537545
instance_labels
538546
) # TODO test with area mesh function
539547
return data_dict
548+
540549
# except ValueError as e:
541550
# self.log(f"Error occurred during stats computing : {e}")
542551
# return None
@@ -679,6 +688,7 @@ def inference(self):
679688
if self.model_dict["name"] == "SegResNet":
680689
model = self.model_dict["class"].get_net()(
681690
input_image_size=[
691+
682692
dims,
683693
dims,
684694
dims,

napari_cellseg3d/plugin_model_inference.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,10 +219,12 @@ def __init__(self, viewer: "napari.viewer.Viewer"):
219219
"Image size on which the SegResNet has been trained (default : 128)"
220220
)
221221

222+
222223
thresh_desc = (
223224
"Thresholding : all values in the image below the chosen probability"
224225
" threshold will be set to 0, and all others to 1."
225226
)
227+
226228
self.thresholding_checkbox.setToolTip(thresh_desc)
227229
self.thresholding_count.setToolTip(thresh_desc)
228230
self.window_infer_box.setToolTip(
@@ -634,6 +636,7 @@ def start(self, on_layer=False):
634636

635637
self.worker.set_download_log(self.log)
636638

639+
637640
yield_connect_show_res = lambda data: self.on_yield(
638641
data,
639642
widget=self,

0 commit comments

Comments
 (0)