Reputation: 91
I can read all the *.dcm files from "imgs" with this command
vol = imageio.volread("imgs")
but I can't read jpg files. My image files has *.bmp.jpg extension (e.g. C001_IMG00023.bmp.jpg) and
histology = imageio.volread("imgs", "jpg")
command gave me
RuntimeError: Format JPEG-PIL cannot read in mode 'v'
then I read the docs and tried this command
histology = io.volread("imgs",mode="L", "jpg")
but it gave me this error
SyntaxError: positional argument follows keyword argument
I searched for the errors and about reading jpg files with imageio but i couldn't find anything about it. Is it possible to read image files from a folder with imageio or should I use different method for it? I want to read files with simple command like above.
Upvotes: 1
Views: 1651
Reputation: 3421
You can always go for skimage,
from skimage.io import imread_collection
path= 'imgs/*.jpg'
histology=imread_collection(path)
Upvotes: 1