[b64384]: / merlin / data / monai_transforms.py

Download this file

30 lines (28 with data), 785 Bytes

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
from monai.transforms import (
EnsureChannelFirstd,
Compose,
LoadImaged,
Orientationd,
ScaleIntensityRanged,
Spacingd,
SpatialPadd,
ToTensord,
CenterSpatialCropd,
)
ImageTransforms = Compose(
[
LoadImaged(keys=["image"]),
EnsureChannelFirstd(keys=["image"]),
Orientationd(keys=["image"], axcodes="RAS"),
Spacingd(keys=["image"], pixdim=(1.5, 1.5, 3), mode=("bilinear")),
ScaleIntensityRanged(
keys=["image"], a_min=-1000, a_max=1000, b_min=0.0, b_max=1.0, clip=True
),
SpatialPadd(keys=["image"], spatial_size=[224, 224, 160]),
CenterSpatialCropd(
roi_size=[224, 224, 160],
keys=["image"],
),
ToTensord(keys=["image"]),
]
)