Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions modules/dynunet_pipeline/transforms.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ def get_task_transforms(mode, task_id, pos_sample_num, neg_sample_num, num_sampl
keys = ["image", "label"]
else:
keys = ["image"]

# 1. loading
load_transforms = [
LoadImaged(keys=keys),
LoadImaged(keys=keys, image_only=False),
EnsureChannelFirstd(keys=keys),
]
# 2. sampling
Expand Down Expand Up @@ -284,6 +284,8 @@ def __init__(

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

Expand Down
Loading