MATLAB: How to create 3D patch in a 3D image

patch

I am having a 179x214x148 input 3D image.Now i want to create 3x3x3 patches from input image.Anyone who knows plz help me!!
Related Question