Skip to content
Snippets Groups Projects
Commit 33c9b1b4 authored by s214735's avatar s214735
Browse files

Minor fixes

parent ad711327
No related branches found
No related tags found
1 merge request!143Type hints
......@@ -25,7 +25,8 @@ import numpy as np
from .interface import BaseInterface
# from qim3d.processing import layers2d as l2d
from qim3d.processing import overlay_rgb_images, segment_layers, get_lines
from qim3d.processing import segment_layers, get_lines
from qim3d.operations import overlay_rgb_images
from qim3d.io import load
from qim3d.viz._layers2d import image_with_lines
from typing import Dict, Any
......
......@@ -239,7 +239,7 @@ class DataLoader:
return vol
def load_txrm(self, path: str|os.PathLike) -> tuple[dask.array|np.ndarray, Optional[Dict]]:
def load_txrm(self, path: str|os.PathLike) -> tuple[dask.array.core.Array|np.ndarray, Optional[Dict]]:
"""Load a TXRM/XRM/TXM file from the specified path.
Args:
......
......@@ -52,7 +52,7 @@ class OMEScaler(
self.max_layer = max_layer
self.method = method
def scaleZYX(self, base: dask.array):
def scaleZYX(self, base: da.core.Array):
"""Downsample using :func:`scipy.ndimage.zoom`."""
rv = [base]
log.info(f"- Scale 0: {rv[-1].shape}")
......@@ -63,7 +63,7 @@ class OMEScaler(
return list(rv)
def scaleZYXdask(self, base: dask.array):
def scaleZYXdask(self, base: da.core.Array):
"""
Downsample a 3D volume using Dask and scipy.ndimage.zoom.
......@@ -82,7 +82,7 @@ class OMEScaler(
"""
def resize_zoom(vol: dask.array, scale_factors, order, scaled_shape):
def resize_zoom(vol: da.core.Array, scale_factors, order, scaled_shape):
# Get the chunksize needed so that all the blocks match the new shape
# This snippet comes from the original OME-Zarr-python library
......@@ -182,7 +182,7 @@ class OMEScaler(
def export_ome_zarr(
path: str|os.PathLike,
data: np.ndarray|dask.array,
data: np.ndarray|da.core.Array,
chunk_size: int = 256,
downsample_rate: int = 2,
order: int = 1,
......
......@@ -255,7 +255,7 @@ class DataSaver:
ds.save_as(path)
def save_to_zarr(self, path: str|os.PathLike, data: np.ndarray):
def save_to_zarr(self, path: str|os.PathLike, data: da.core.Array):
"""Saves a Dask array to a Zarr array on disk.
Args:
......
......@@ -2,7 +2,7 @@ import matplotlib.pyplot as plt
import numpy as np
import qim3d
from qim3d.utils._logger import log
from segmentation._connected_components import CC
from qim3d.segmentation._connected_components import CC
def plot_cc(
connected_components: CC,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment