Skip to content

Commit

Permalink
Merge pull request #881 from mmasinas/main
Browse files Browse the repository at this point in the history
Add .flex to the allowed image file extensions
  • Loading branch information
carsen-stringer authored Sep 7, 2024
2 parents 2df57ea + e315cc8 commit 6537dde
Showing 1 changed file with 3 additions and 3 deletions.
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 @@ -295,7 +295,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 @@ -311,7 +311,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

0 comments on commit 6537dde

Please sign in to comment.