1

I'm trying to view a series of tiff images I have saved in an array (background); I've been trying to use the scikit-image module to do this and have succeeded (I believe) in creating an image collection using the imread_collection function. However, whenever I try to view the images using imshow_collection, I get the following error:

OSError: cannot identify image file <_io.BufferedReader name='Y:/Documents/Research/Film/11_21_16_background_film003.tif'>

I've looked for similar OSErrors, but none of them seem to deal with image collections (just single images); I apologize if this is a trivial error on my part, but I would appreciate any help or suggestions as to what's going on. I've included some of my code below.

    import os, re

    from skimage import io


    background = []
    calibration = []
    profiles = []

    #sorting images into background films, calibration films, and profile films.
    for file in os.listdir('Y:/Documents/Research/Film/'):
        if filename.endswith('.tif'):
            if re.search(r'background', file):
                background.append(file)
            elif re.search(r'calibration', file):
                calibration.append(file)
            elif re.search(r'profile', file):
                profiles.append(file)
            else:
                pass


    background_imgs = io.imread_collection(background)
    io.imshow_collection(background_imgs)
  • Maybe instead of using skimage, you may try PIL. Take a look at this [link](https://stackoverflow.com/questions/7569553/working-with-tiffs-import-export-in-python-using-numpy) – hma Jun 02 '17 at 15:36
  • Can you upload the TIFF somewhere so we can take a look? – Stefan van der Walt Jun 15 '17 at 21:16

0 Answers0