Skip to content

Commit 6ecb2fc

Browse files
committed
Remove strict channel first
1 parent 6a42d26 commit 6ecb2fc

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

napari_cellseg3d/code_models/worker_training.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ def get_patch_dataset(self, train_transforms):
200200
patch_func = Compose(
201201
[
202202
LoadImaged(keys=["image"], image_only=True),
203-
EnsureChannelFirstd(keys=["image"], channel_dim="no_channel"),
203+
EnsureChannelFirstd(keys=["image"], strict_check=False),
204204
RandSpatialCropSamplesd(
205205
keys=["image"],
206206
roi_size=(
@@ -235,7 +235,7 @@ def get_dataset_eval(self, eval_dataset_dict):
235235
[
236236
LoadImaged(keys=["image", "label"]),
237237
EnsureChannelFirstd(
238-
keys=["image", "label"], channel_dim="no_channel"
238+
keys=["image", "label"], strict_check=False
239239
),
240240
# RandSpatialCropSamplesd(
241241
# keys=["image", "label"],
@@ -280,7 +280,7 @@ def get_dataset(self, train_transforms):
280280
load_single_images = Compose(
281281
[
282282
LoadImaged(keys=["image"]),
283-
EnsureChannelFirstd(keys=["image"]),
283+
EnsureChannelFirstd(keys=["image"], strict_check=False),
284284
Orientationd(keys=["image"], axcodes="PLI"),
285285
SpatialPadd(
286286
keys=["image"],
@@ -1296,7 +1296,7 @@ def get_patch_loader_func(num_samples):
12961296
return Compose(
12971297
[
12981298
LoadImaged(keys=["image", "label"]),
1299-
EnsureChannelFirstd(keys=["image", "label"]),
1299+
EnsureChannelFirstd(keys=["image", "label"], strict_check=False),
13001300
RandSpatialCropSamplesd(
13011301
keys=["image", "label"],
13021302
roi_size=(
@@ -1381,7 +1381,7 @@ def get_patch_loader_func(num_samples):
13811381
# image_only=True,
13821382
# reader=WSIReader(backend="tifffile")
13831383
),
1384-
EnsureChannelFirstd(keys=["image", "label"]),
1384+
EnsureChannelFirstd(keys=["image", "label"], strict_check=False),
13851385
Orientationd(keys=["image", "label"], axcodes="PLI"),
13861386
QuantileNormalizationd(keys=["image"]),
13871387
SpatialPadd(

0 commit comments

Comments
 (0)