Data augmentation to increase the number of dataset in monai label #7273
ArpanGyawali
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I am using these pre transform mentioned below for training my brain extraction from CTA scan model.
def train_pre_transforms(self, context: Context):
return [
LoadImaged(keys=("image", "label")),
EnsureChannelFirstd(keys=("image", "label")),
Spacingd(
keys=("image", "label"),
pixdim=(0.75, 0.75, 0.75),
mode=("bilinear", "nearest"),
),
#SetWindowd(keys="image", level=150, width=450),
ScaleIntensityRanged(keys="image", a_min=-75, a_max=375, b_min=0.0, b_max=1.0, clip=True),
CropForegroundd(keys=("image", "label"), source_key="image"),
EnsureTyped(keys=("image", "label"), device=context.device),
RandCropByPosNegLabeld(
keys=("image", "label"),
label_key="label",
spatial_size=(96, 96, 96),
pos=1,
neg=1,
num_samples=4,
image_key="image",
image_threshold=0,
),
RandShiftIntensityd(keys="image", offsets=0.1, prob=0.5),
SelectItemsd(keys=("image", "label")),
]
I wanted to increase my dataset from the existing data by few augmentation methods. For now i have 56 data, and i want to double the dataset by augmenting them. How can i do that using monai label, best without saving the augmented dataset in device.
Also in the pretransform above, Does RandCropByLabeld create 4 patches of (96,96,96) from the whole image? How are patches created in segmentation method of monai label?
Thank you in advance.
Beta Was this translation helpful? Give feedback.
All reactions