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

[Question] Visualize the augmented data. #280

Open
ArpanGyawali opened this issue Oct 28, 2024 · 6 comments
Open

[Question] Visualize the augmented data. #280

ArpanGyawali opened this issue Oct 28, 2024 · 6 comments
Assignees

Comments

@ArpanGyawali
Copy link

I am working on LVO detection. I used the base_more augmentation with some modification. I only wanted rotation on z-axis and only horizontal flip on axial view. So i changed the miror axis to [0]. But i am not sure i did the right thing.
So, i wanted to know if there is a way to visualize the augmented data? Or if i need to create my own script?
Even if i am right or wrong in the case of mirroring, it would be great if i would be able to visualize those dataset.
Thanks.

@mibaumgartner
Copy link
Collaborator

Dear @ArpanGyawali ,

there is no build in way of visualising the augmented data, so you need to write your own script.

Best,
Michael

@ArpanGyawali
Copy link
Author

Thanks @mibaumgartner
Can you give some insights to in?
Where can i start from?
Where the data is loaded before training and after augmentation?

@ArpanGyawali
Copy link
Author

ArpanGyawali commented Oct 29, 2024

hi @mibaumgartner @partha-ghosh
Also in addition, do you have some say regarding the mirror axis stated in above question.

@partha-ghosh
Copy link
Contributor

Hi @ArpanGyawali,
You can run the code in single threaded mode with multiprocessing: False in the config file. If you debug through the code you will find the data is being loaded in here:

def generate_train_batch(self) -> Dict[str, Any]:
and the transforms are being applied in batchgenerators: https://github.com/MIC-DKFZ/batchgenerators/blob/f53025bd05fe9642133ac539a0df3559d82415b4/batchgenerators/dataloading/single_threaded_augmenter.py#L38

The documentation on MirrorTransform from batchgenerators says: 'Randomly mirrors data along specified axes. Mirroring is evenly distributed. Probability of mirroring along each axis is 0.5'

Best,
Partha

@mibaumgartner
Copy link
Collaborator

mibaumgartner commented Oct 31, 2024

Dear @ArpanGyawali ,

please note that nnDetection transposes the data during its preprocessing -> the anisotropic axes (usually denoted by z) is moved to the first position (i.e. index 0). The definition of left/right depends on you data since the other axis do not change their ordering. Setting the mirror axis to [0] results in mirroring which is only performed along the z direction.

Having a visual look is definitely recommended when manipulating augmentation settings :)

Best,
Michael

@ArpanGyawali
Copy link
Author

@mibaumgartner @partha-ghosh
Thanks, i will try to do something for visualizing the augmented images.
If i run into some issue then, i shall ask for help.

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

3 participants