Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adding an augmentation #2176

Open
natamendelson opened this issue May 10, 2024 · 2 comments
Open

adding an augmentation #2176

natamendelson opened this issue May 10, 2024 · 2 comments
Assignees

Comments

@natamendelson
Copy link

hi, suppose i want to add a specific augmentation to the dataset while training, where is the right place to do it?
i noticed that you have a function get_training_transforms in nnUNetTrainer.py and i tried to add my own transformation there but it appears that the input array there (data_dict[self.img_key]) is shaped (12,1,602,602). If i want to apply my transformation on the original input image (RGB) before going into feature dimensions where should i do it?

thank you!
Natalie.

@FabianIsensee FabianIsensee self-assigned this May 10, 2024
@FabianIsensee
Copy link
Member

Hey Natalie,
you already found the right place! The transforms are applied in the order that they are added to the tr_transforms list. The shape you are seeing is (b, c, x, y) where b is the batch size and c is the number of channels. Your dataset seems to only have one channel.
Before you proceed I suggest you update to master. We recently replaced the entire data augmentation pipeline. The new pipeline operates on samples, so the shape in your case will be (1, 602, 602)
Best,
Fabian

@natamendelson
Copy link
Author

thank you for your reply,

the thing is that my input image is shaped (1,512,512). When it get to get_training_transforms the image size is already different. in data loader i have noticed the image might have been resampled - am i right? if so, i want to catch it even before. Our goal is to add stiches to the images randomly so it should be applied on the original image 512*512...

thank you,
Natalie.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants