Skip to content

Commit

Permalink
ENH(psoct): add option for output data type (#29)
Browse files Browse the repository at this point in the history
  • Loading branch information
balbasty authored Nov 22, 2024
1 parent 158531b commit 1339981
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion linc_convert/modalities/psoct/multi_slice.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,7 @@ def convert(
nii: bool = False,
orientation: str = "RAS",
center: bool = True,
dtype: str | None = None,
) -> None:
"""
Matlab to OME-Zarr.
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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),
}
Expand Down

0 comments on commit 1339981

Please sign in to comment.