dovahcrow/patchify.py

3D volumes

Olivier222 opened this issue · 4 comments

Can this be used for 3D volumes? Or is it limited to 2D images?

No, volumes are not support while I believe the source code can be adapt to any higher dimension.

For 3D input volume, you can create patches as follows:

patches = patchify(image, (2,2,3), step=1) # patch shape [2,2,3]

For merging 3D patches, I've extended the source code & created a pull request.

@Oliver222 Hi I merged the great patch from @vdivakar. Could you please have a try on that?

I think it is fixed. Issue closed.