Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add .flex to the allowed image file extensions #881

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions cellpose/io.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ def imread(filename):
"""
# ensure that extension check is not case sensitive
ext = os.path.splitext(filename)[-1].lower()
if ext == ".tif" or ext == ".tiff":
if ext == ".tif" or ext == ".tiff" or ext == ".flex":
with tifffile.TiffFile(filename) as tif:
ltif = len(tif.pages)
try:
Expand Down Expand Up @@ -294,7 +294,7 @@ def get_image_files(folder, mask_filter, imf=None, look_one_level_down=False):
if look_one_level_down:
folders = natsorted(glob.glob(os.path.join(folder, "*/")))
folders.append(folder)
exts = [".png", ".jpg", ".jpeg", ".tif", ".tiff", ".dax", ".nd2", ".nrrd"]
exts = [".png", ".jpg", ".jpeg", ".tif", ".tiff", ".flex", ".dax", ".nd2", ".nrrd"]
l0 = 0
al = 0
for folder in folders:
Expand All @@ -310,7 +310,7 @@ def get_image_files(folder, mask_filter, imf=None, look_one_level_down=False):
raise ValueError("ERROR: no files in --dir folder ")
elif l0 == 0:
raise ValueError(
"ERROR: no images in --dir folder with extensions .png, .jpg, .jpeg, .tif, .tiff"
"ERROR: no images in --dir folder with extensions .png, .jpg, .jpeg, .tif, .tiff, .flex"
)

image_names = natsorted(image_names)
Expand Down