diff --git a/qim3d/gui/layers2d.py b/qim3d/gui/layers2d.py index afb8832f18b4236b0d94caf2728c614c4b2664ea..febd16a506bcba477eed1d0f42ba6e20b763d610 100644 --- a/qim3d/gui/layers2d.py +++ b/qim3d/gui/layers2d.py @@ -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 diff --git a/qim3d/io/_loading.py b/qim3d/io/_loading.py index 90c67aea5074a8c370461d71c01f1e0e216d360f..e3d7d45bc220a04c0e96e4efd5fbb2f94cc3c99a 100644 --- a/qim3d/io/_loading.py +++ b/qim3d/io/_loading.py @@ -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: diff --git a/qim3d/io/_ome_zarr.py b/qim3d/io/_ome_zarr.py index a951be725c8a6373015df2ebd1c148bac94a8ed4..36976316b8811380d68cbe1b7f5f43e5c001c4f9 100644 --- a/qim3d/io/_ome_zarr.py +++ b/qim3d/io/_ome_zarr.py @@ -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, diff --git a/qim3d/io/_saving.py b/qim3d/io/_saving.py index 42de3eb64ae774422b33cb573ccac9d088e29032..a7053c00fde4b7d4541b1a01286f18ad669e811d 100644 --- a/qim3d/io/_saving.py +++ b/qim3d/io/_saving.py @@ -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: diff --git a/qim3d/viz/_cc.py b/qim3d/viz/_cc.py index b8d81002b0e1fddf23b3f45e35b657dda4fea33a..083b53cbfd70007c83097bf241e6e4f53b37592b 100644 --- a/qim3d/viz/_cc.py +++ b/qim3d/viz/_cc.py @@ -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,