I have a 3d image and try to predict their slice outputs by using neural networks. The problem is that, after prediction, I would like to find a way to pack them back. I have an idea that uses grid method, however, I am not sure it is the best way to do it.
fig=plt.figure(figsize=(20, 20))
columns = rangex_of_crop
rows = rangey_of_crop
for i, x in enumerate(cropped_images):
img = x
fig.add_subplot(rows, columns, i+1)
plt.axis('off')
plt.imshow(np.squeeze(x))
fig = plt.figure(figsize=(15, 15), frameon=False)
plt.show()
The output must be np.array of whole image and we have to assume that slices can be different sizes (not one by one, all together i.e. the all splitted images can be 32x32 or 64x64):