Skip to content
Snippets Groups Projects
Commit b77a07e0 authored by Christian Kento Rasmussen's avatar Christian Kento Rasmussen
Browse files

convert check for both tif and tiff

parent 3af993b1
Branches
No related tags found
4 merge requests!102Conv zarr tiff folders,!100Conv zarr nifti,!99Zarr cli,!96Zarr loading and converting
...@@ -29,14 +29,14 @@ class Convert: ...@@ -29,14 +29,14 @@ class Convert:
if os.path.isfile(input_path): if os.path.isfile(input_path):
match input_ext, output_ext: match input_ext, output_ext:
case (".tif", ".zarr"): case (".tif", ".zarr") | (".tiff", ".zarr"):
return self.convert_tif_to_zarr(input_path, output_path) return self.convert_tif_to_zarr(input_path, output_path)
case _: case _:
raise ValueError("Unsupported file format") raise ValueError("Unsupported file format")
# Load a directory # Load a directory
elif os.path.isdir(input_path): elif os.path.isdir(input_path):
match input_ext, output_ext: match input_ext, output_ext:
case (".zarr", ".tif"): case (".zarr", ".tif") | (".zarr", ".tiff"):
return self.convert_zarr_to_tif(input_path, output_path) return self.convert_zarr_to_tif(input_path, output_path)
case _: case _:
raise ValueError("Unsupported file format") raise ValueError("Unsupported file format")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment