Skip to content

Commit 4babcff

Browse files
committed
Removed padding with window on layer
Removed padding transform when using single layer inference and the sliding window inference option
1 parent d2a9399 commit 4babcff

File tree

1 file changed

+16
-3
lines changed

1 file changed

+16
-3
lines changed

napari_cellseg3d/model_workers.py

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -398,19 +398,32 @@ def load_layer(self):
398398

399399
# print(volume.shape)
400400
# print(volume.dtype)
401-
402-
load_transforms = Compose(
401+
if self.use_window:
402+
load_transforms = Compose(
403403
[
404404
ToTensor(),
405405
# anisotropic_transform,
406406
AddChannel(),
407-
SpatialPad(spatial_size=pad),
407+
# SpatialPad(spatial_size=pad),
408408
AddChannel(),
409409
EnsureType(),
410410
],
411411
map_items=False,
412412
log_stats=True,
413413
)
414+
else:
415+
load_transforms = Compose(
416+
[
417+
ToTensor(),
418+
# anisotropic_transform,
419+
AddChannel(),
420+
SpatialPad(spatial_size=pad),
421+
AddChannel(),
422+
EnsureType(),
423+
],
424+
map_items=False,
425+
log_stats=True,
426+
)
414427

415428
self.log("\nLoading dataset...")
416429
input_image = load_transforms(volume)

0 commit comments

Comments
 (0)