From 13399811b08afd1bb0bed578e71b171a66a02493 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ya=C3=ABl=20Balbastre?= Date: Fri, 22 Nov 2024 17:50:11 +0000 Subject: [PATCH] ENH(psoct): add option for output data type (#29) --- linc_convert/modalities/psoct/multi_slice.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/linc_convert/modalities/psoct/multi_slice.py b/linc_convert/modalities/psoct/multi_slice.py index a4c7d62..745d5b4 100644 --- a/linc_convert/modalities/psoct/multi_slice.py +++ b/linc_convert/modalities/psoct/multi_slice.py @@ -176,6 +176,7 @@ def convert( nii: bool = False, orientation: str = "RAS", center: bool = True, + dtype: str | None = None, ) -> None: """ Matlab to OME-Zarr. @@ -215,6 +216,8 @@ def convert( Orientation of the volume center Set RAS[0, 0, 0] at FOV center + dtype + Data type to write into """ if isinstance(compressor_opt, str): compressor_opt = ast.literal_eval(compressor_opt) @@ -243,10 +246,11 @@ def convert( if len(inp[0].shape) < 2: raise Exception("Input array is not 2d:", inp[0].shape) # Prepare chunking options + dtype = dtype or np.dtype(inp[0].dtype).str opt = { "dimension_separator": r"/", "order": "F", - "dtype": np.dtype(inp[0].dtype).str, + "dtype": dtype, "fill_value": None, "compressor": make_compressor(compressor, **compressor_opt), }