From 5c0468b4bca772f70a06740a0be32d7809634f83 Mon Sep 17 00:00:00 2001 From: Matthieu Chourrout <83714683+chourroutm@users.noreply.github.com> Date: Tue, 2 Dec 2025 13:27:16 +0000 Subject: [PATCH 1/6] Add support for .nii.gz Add support for .nii.gz (compressed NIfTI) as NIfTI. --- igneous_cli/cli.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/igneous_cli/cli.py b/igneous_cli/cli.py index 5a17e87f..7a8b8667 100644 --- a/igneous_cli/cli.py +++ b/igneous_cli/cli.py @@ -1874,7 +1874,7 @@ def create( ): """Create a Precomputed volume from another data source. - Supports: .npy, .h5/.hdf5, .nii, .nrrd, and .ckl files + Supports: .npy, .h5/.hdf5, .nii/.nii.gz, .nrrd, and .ckl files Hopefully will support others such as TIFF in the future. """ @@ -1896,7 +1896,7 @@ def create( if arr.shape[0] == 3 and arr.ndim == 3: arr = arr[..., np.newaxis] arr = np.transpose(arr, axes=[1,2,3,0]) - elif ext == ".nii": + elif ext == ".nii" or ext == ".nii.gz": import nibabel as nib arr = nib.load(src) arr = np.array(arr.dataobj) @@ -1934,6 +1934,8 @@ def normalize_file_ext(filename): filename, ext2 = os.path.splitext(filename) if ext2 in ('.ckl', '.cpso'): return ext2 + elif ext2 == '.nii': + return ext2 + ext elif ext2 == '': return ext ext = ext2 @@ -2053,4 +2055,4 @@ def purge(queuepath): """Delete all queued messages and zero out queue statistics.""" queuepath = normalize_path(queuepath) tq = TaskQueue(queuepath) - tq.purge() \ No newline at end of file + tq.purge() From eb99cbe3b77694ccfd14561e01dae195d66b58fd Mon Sep 17 00:00:00 2001 From: Matthieu Chourrout <83714683+chourroutm@users.noreply.github.com> Date: Tue, 2 Dec 2025 16:45:33 +0000 Subject: [PATCH 2/6] Update igneous_cli/cli.py --- igneous_cli/cli.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/igneous_cli/cli.py b/igneous_cli/cli.py index 7a8b8667..09d56186 100644 --- a/igneous_cli/cli.py +++ b/igneous_cli/cli.py @@ -1935,7 +1935,7 @@ def normalize_file_ext(filename): if ext2 in ('.ckl', '.cpso'): return ext2 elif ext2 == '.nii': - return ext2 + ext + return ext2 elif ext2 == '': return ext ext = ext2 From a13d1f575673757957476c3189b4be18edbc6f1c Mon Sep 17 00:00:00 2001 From: Matthieu Chourrout <83714683+chourroutm@users.noreply.github.com> Date: Tue, 2 Dec 2025 16:45:40 +0000 Subject: [PATCH 3/6] Update igneous_cli/cli.py --- igneous_cli/cli.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/igneous_cli/cli.py b/igneous_cli/cli.py index 09d56186..ad44fd9d 100644 --- a/igneous_cli/cli.py +++ b/igneous_cli/cli.py @@ -1896,7 +1896,7 @@ def create( if arr.shape[0] == 3 and arr.ndim == 3: arr = arr[..., np.newaxis] arr = np.transpose(arr, axes=[1,2,3,0]) - elif ext == ".nii" or ext == ".nii.gz": + elif ext == ".nii": import nibabel as nib arr = nib.load(src) arr = np.array(arr.dataobj) From 35df8093dc99200c3fd55b7e29125780a7236440 Mon Sep 17 00:00:00 2001 From: Matthieu Chourrout <83714683+chourroutm@users.noreply.github.com> Date: Tue, 2 Dec 2025 16:53:00 +0000 Subject: [PATCH 4/6] Update cli.py From d761efc6c2e8efdd0e2d141aba7502f473e426bc Mon Sep 17 00:00:00 2001 From: Matthieu Chourrout <83714683+chourroutm@users.noreply.github.com> Date: Tue, 2 Dec 2025 16:56:08 +0000 Subject: [PATCH 5/6] Fix indentation for NII file extension check --- igneous_cli/cli.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/igneous_cli/cli.py b/igneous_cli/cli.py index ad44fd9d..11fd3e05 100644 --- a/igneous_cli/cli.py +++ b/igneous_cli/cli.py @@ -1934,8 +1934,8 @@ def normalize_file_ext(filename): filename, ext2 = os.path.splitext(filename) if ext2 in ('.ckl', '.cpso'): return ext2 - elif ext2 == '.nii': - return ext2 + elif ext2 == '.nii': + return ext2 elif ext2 == '': return ext ext = ext2 From 3838a8394253be39bb085a1b791c3ba312b013d5 Mon Sep 17 00:00:00 2001 From: Matthieu Chourrout <83714683+chourroutm@users.noreply.github.com> Date: Wed, 3 Dec 2025 13:29:20 +0000 Subject: [PATCH 6/6] Fix indentation issues in cli.py --- igneous_cli/cli.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/igneous_cli/cli.py b/igneous_cli/cli.py index 11fd3e05..70174bbf 100644 --- a/igneous_cli/cli.py +++ b/igneous_cli/cli.py @@ -278,7 +278,7 @@ def downsample( """ factor = (2,2,1) if volumetric: - factor = (2,2,2) + factor = (2,2,2) if compress and compress.lower() in ("none", "false"): compress = False @@ -379,7 +379,7 @@ def xfer( """ factor = (2,2,1) if volumetric: - factor = (2,2,2) + factor = (2,2,2) if compress and compress.lower() in ("none", "false"): compress = False @@ -1934,8 +1934,8 @@ def normalize_file_ext(filename): filename, ext2 = os.path.splitext(filename) if ext2 in ('.ckl', '.cpso'): return ext2 - elif ext2 == '.nii': - return ext2 + elif ext2 == '.nii': + return ext2 elif ext2 == '': return ext ext = ext2