I am trying to randomly sample 30% of a NumPy array of shape (790, 64, 64, 1)
. The last dimension is the channel info for the image so essentially it's a 3D image. The intention is to generate 2D slices orthogonally across each dimension in a random way so as to get 30% of the total information of the original.
I looked at this question to understand how to randomly generate slices but I'm being unable to extend it to my use case.
So far I'm only able to generate the size of the data I would need.
dim1_len = 0.3 * img.shape[0]
dim2_len = 0.3 * img.shape[1]
dim3_len = 0.3 * img.shape[2]
Sorry if the question is a little broad.