Skip to content

Commit 6e5f6c0

Browse files
committed
WIP: ENH: Use cuCIM in CLI conversion
1 parent ae53013 commit 6e5f6c0

File tree

2 files changed

+32
-0
lines changed

2 files changed

+32
-0
lines changed

ngff_zarr/cli.py

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -336,6 +336,36 @@ def shutdown_client(sig_id, frame): # noqa: ARG001
336336
_multiscales_to_ngff_zarr(
337337
live, args, output_store, rich_dask_progress, multiscales
338338
)
339+
elif input_backend is ConversionBackend.CUCIM:
340+
try:
341+
# import cucim
342+
# print('ARGS', args)
343+
344+
# cuimage = cucim.CuImage(str(args.input[0]))
345+
if args.chunks is None:
346+
# Present the existing chunks and resolution levels
347+
# [...]
348+
# multiscales = cucim_image_to_multiscales(cuimage)
349+
pass
350+
351+
else:
352+
# ngff_image = cucim_image_to_ngff_image(cucimage)
353+
# multiscales = _ngff_image_to_multiscales(
354+
# live,
355+
# ngff_image,
356+
# args,
357+
# progress,
358+
# rich_dask_progress,
359+
# subtitle,
360+
# method,
361+
# )
362+
pass
363+
_multiscales_to_ngff_zarr(
364+
live, args, output_store, rich_dask_progress, multiscales
365+
)
366+
except ImportError:
367+
sys.stdout.write("[red]Please install the [i]cucim[/i] package.\n")
368+
sys.exit(1)
339369
elif input_backend is ConversionBackend.TIFFFILE:
340370
try:
341371
import tifffile

ngff_zarr/detect_cli_io_backend.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,8 @@ def detect_cli_io_backend(input: List[str]) -> ConversionBackend:
105105
if extension in itk_supported_extensions:
106106
return ConversionBackend.ITK
107107

108+
extension = Path(input[0]).suffixes[-1].lower()
109+
108110
if importlib.util.find_spec("cucim") is not None:
109111
cucim_supported_extensions = (".svs", ".tif", ".tiff")
110112

0 commit comments

Comments
 (0)