Skip to content

Commit

Permalink
fix: roi size (Project-MONAI#75)
Browse files Browse the repository at this point in the history
  • Loading branch information
upupming authored Jul 1, 2022
1 parent 51a0a4f commit 2f881c6
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions SwinUNETR/BRATS21/utils/data_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,10 +103,10 @@ def get_loader(args):
transforms.ConvertToMultiChannelBasedOnBratsClassesd(keys="label"),
transforms.CropForegroundd(keys=["image", "label"], source_key="image", k_divisible=[args.roi_x,
args.roi_y,
args.roi_x]),
args.roi_z]),
transforms.RandSpatialCropd(keys=["image", "label"], roi_size=[args.roi_x,
args.roi_y,
args.roi_x],
args.roi_z],
random_size=False),
transforms.RandFlipd(keys=["image", "label"], prob=0.5, spatial_axis=0),
transforms.RandFlipd(keys=["image", "label"], prob=0.5, spatial_axis=1),
Expand Down
2 changes: 1 addition & 1 deletion SwinUNETR/BTCV/utils/data_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ def get_loader(args):
transforms.RandCropByPosNegLabeld(
keys=["image", "label"],
label_key="label",
spatial_size=(args.roi_x, args.roi_y, args.roi_x),
spatial_size=(args.roi_x, args.roi_y, args.roi_z),
pos=1,
neg=1,
num_samples=4,
Expand Down
2 changes: 1 addition & 1 deletion UNETR/BTCV/utils/data_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ def get_loader(args):
transforms.RandCropByPosNegLabeld(
keys=["image", "label"],
label_key="label",
spatial_size=(args.roi_x, args.roi_y, args.roi_x),
spatial_size=(args.roi_x, args.roi_y, args.roi_z),
pos=1,
neg=1,
num_samples=4,
Expand Down

0 comments on commit 2f881c6

Please sign in to comment.