Skip to content

Commit 8b8327f

Browse files
authored
Merge branch 'main' into main
2 parents 89ffc8c + 75c44e0 commit 8b8327f

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

modules/dynunet_pipeline/transforms.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,9 @@ def get_task_transforms(mode, task_id, pos_sample_num, neg_sample_num, num_sampl
4040
keys = ["image", "label"]
4141
else:
4242
keys = ["image"]
43-
43+
# 1. loading
4444
load_transforms = [
45-
LoadImaged(keys=keys),
45+
LoadImaged(keys=keys, image_only=False),
4646
EnsureChannelFirstd(keys=keys),
4747
]
4848
# 2. sampling
@@ -284,6 +284,8 @@ def __init__(
284284

285285
def calculate_new_shape(self, spacing, shape):
286286
spacing_ratio = np.array(spacing) / np.array(self.target_spacing)
287+
if len(shape) == 4: # If shape includes channel dimension
288+
shape = shape[1:]
287289
new_shape = (spacing_ratio * np.array(shape)).astype(int).tolist()
288290
return new_shape
289291

0 commit comments

Comments
 (0)