mdbloice / Augmentor

Image augmentation library in Python for machine learning.
https://augmentor.readthedocs.io/en/stable
MIT License
5.06k stars 866 forks source link

Support for 3D data? #113

Open Issam28 opened 6 years ago

Issam28 commented 6 years ago

hi, I want to know wheather you are planning on adding support for 3D data, data that have this shape (Nb_samples, Z, Y, X, Nb_channels) ? Thanks,

xuzhang5788 commented 6 years ago

I also want to ask the same question as @Issam28. Looking forward to hearing from you.

vovochka-dev commented 5 years ago

It will be great

mdbloice commented 5 years ago

Hi @Issam28, @xuzhang5788, @Vovochka777 - yes, indeed this has just been implemented since the latest version (v0.2.3), using a new DataPipeline class. Its intended use is to allow for images to be augmented with several mask images, however there is no reason why you couldn't use it to augment 3D data, or images with arbitrarily long numbers of channels.

See Multiple-Mask-Augmentation.ipynb for details.

It is early functionality so you may come across some bugs.

shawnyuen commented 5 years ago

Hi, @mdbloice ! Thanks for your this great package for data augmentation. In .py file called Operations.py, class Distort may only perform randomised, elastic distortions on 2D images, because I see grid_width and grid_height. How about distortions on 3D images, such as CT and MR scans? The size of these data is (height, width, length), can DataPipeline class support these data? Note that, length is not the channel dimension as 2D images, 3D images capture a 3D spatial object like organs.