is there a way to get list of image formats (filename extensions) that may be opened using “skimage.io.imread”?
I would like to filter the list of files to only the image-files that may be opened.
This would depend on which loader plugin you use. By default, that is
imageio, which supports these formats.
You can list them programmatically using:
import imageio imageio.formats.show()
You can get all format names using:
To get the extensions supported by any specific format (
SPE in this case):
thank you for the prompt reply, I think it solves the issue!
In the documentation mentioned that “By default, the different plugins are tried (starting with imageio) until a suitable candidate is found”
Does that mean that the following command will give me the complete list of all possible extensions for all plugins?
filenameExtensions = list() for formatId in imageio.formats: filenameExtensions.append(list(formatId.extensions)) filenameExtensions = [item for sublist in filenameExtensions for item in sublist] filenameExtensions = set(filenameExtensions) filenameExtensions = ["*" + item for item in filenameExtensions]