0

I'm trying to understand the code below and what it does:

im = pilimage.open(img_path)
image_array = np.array(im)
imgstack = image_array[area[0]:area[1],
                       area[2]:area[3], z_stack[0]:z_stack[1]]

I know that it opens up an image and stores it in im and then converts im into an array and stores that in image_array. What I don't really understand is the last part. I don't have that much experience with python syntax so can anyone help me. Thank you so much!

Tim Jones
  • 985
  • 8
  • 14
Noura
  • 149
  • 1
  • 2
  • 9

1 Answers1

0

This is an advanced-ish application of the python slice notation which you can learn about here: Understanding slice notation. There are a couple nuances here though:

Tim Jones
  • 985
  • 8
  • 14