What do you all find to be the best way to load only part of an image into a numpy array? I would generally prefer to do this using scikit-image, but I can’t find a way to do this from the API reference or from browsing the io plugins source code. So I generally use pillow–something like this:
import numpy as np from PIL import Image with Image.open('multipage.tif') as pil_image: pil_image.seek(10) #move pointer to the plane I want np_image = np.array(pil_image.crop([0,0,100,100]))
Am I totally missing something in scikit-image? Is there a better way to do this?