1

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):

enter image description here

6
  • What is a "slice output" of a 3D image? What do you mean by "pack them back"? What is the definition of "optimal" for you? Commented Sep 12, 2018 at 13:59
  • @norok2 slice output: a 2D image that predicted (yellow and purple points) and splitted images as you can see in the picture, Pack them back: 2D splitted image to 2D image (if you ignore white spaces in the picture, you can imagine what I want exactly.) optimal: Ignore this word. Commented Sep 12, 2018 at 14:03
  • 2
    You mean something like numpy.hstack() / numpy.vstack()? Commented Sep 12, 2018 at 14:05
  • @norok2 yeah, I have never used those commands. But, as I understand, it may work. I've started to search it. Commented Sep 12, 2018 at 14:06
  • 1
    Form a big 2d array from multiple smaller 2d arrays, is this what you are looking for? Commented Sep 12, 2018 at 20:26

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.