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)