From a70544f345a981f340692ab7281dff2dbe0273f3 Mon Sep 17 00:00:00 2001 From: s214735 <s214735@dtu.dk> Date: Mon, 30 Dec 2024 11:05:51 +0100 Subject: [PATCH] More fixes --- qim3d/viz/_cc.py | 2 +- qim3d/viz/_data_exploration.py | 2 +- qim3d/viz/_k3d.py | 2 +- qim3d/viz/_local_thickness.py | 4 ++-- qim3d/viz/_structure_tensor.py | 4 ++-- qim3d/viz/itk_vtk_viewer/run.py | 2 +- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/qim3d/viz/_cc.py b/qim3d/viz/_cc.py index ebb67d03..63731f2f 100644 --- a/qim3d/viz/_cc.py +++ b/qim3d/viz/_cc.py @@ -21,7 +21,7 @@ def plot_cc( Parameters: connected_components (CC): The connected components object. - component_indexs (list | tuple, optional): The components to plot. If None the first max_cc_to_plot=32 components will be plotted. Defaults to None. + component_indexs (list or tuple, optional): The components to plot. If None the first max_cc_to_plot=32 components will be plotted. Defaults to None. max_cc_to_plot (int, optional): The maximum number of connected components to plot. Defaults to 32. overlay (np.ndarray, optional): Overlay image. Defaults to None. crop (bool, optional): Whether to crop the image to the cc. Defaults to False. diff --git a/qim3d/viz/_data_exploration.py b/qim3d/viz/_data_exploration.py index a4e46237..7cc75c2a 100644 --- a/qim3d/viz/_data_exploration.py +++ b/qim3d/viz/_data_exploration.py @@ -604,7 +604,7 @@ def chunks(zarr_path: str, **kwargs): Function to visualize chunks of a Zarr dataset using the specified visualization method. Args: - zarr_path (str): Path to the Zarr dataset. + zarr_path (str or os.PathLike): Path to the Zarr dataset. **kwargs (Any): Additional keyword arguments to pass to the visualization method. Example: diff --git a/qim3d/viz/_k3d.py b/qim3d/viz/_k3d.py index 382c220e..21626cf8 100644 --- a/qim3d/viz/_k3d.py +++ b/qim3d/viz/_k3d.py @@ -43,7 +43,7 @@ def volumetric( file will be saved. Defaults to False. grid_visible (bool, optional): If True, the grid is visible in the plot. Defaults to False. color_map (str or matplotlib.colors.Colormap or list, optional): The color map to be used for the volume rendering. If a string is passed, it should be a matplotlib colormap name. Defaults to None. - constant_opacity (bool, float): Set to True if doing an object label visualization with a corresponding color_map; otherwise, the plot may appear poorly. Defaults to False. + constant_opacity (float): Set to True if doing an object label visualization with a corresponding color_map; otherwise, the plot may appear poorly. Defaults to False. vmin (float, optional): Together with vmax defines the data range the colormap covers. By default colormap covers the full range. Defaults to None. vmax (float, optional): Together with vmin defines the data range the colormap covers. By default colormap covers the full range. Defaults to None samples (int, optional): The number of samples to be used for the volume rendering in k3d. Defaults to 512. diff --git a/qim3d/viz/_local_thickness.py b/qim3d/viz/_local_thickness.py index 243dc360..0f63c641 100644 --- a/qim3d/viz/_local_thickness.py +++ b/qim3d/viz/_local_thickness.py @@ -30,13 +30,13 @@ def local_thickness( number of slices and rounded to the nearest integer. If None, the middle slice will be used for 3D images. Unused for 2D images. Defaults to None. show (bool, optional): If True, displays the plot (i.e. calls plt.show()). Defaults to False. - figsize (Tuple[int, int], optional): The size of the figure. Defaults to (15, 5). + figsize (tuple, optional): The size of the figure. Defaults to (15, 5). Raises: ValueError: If the slice index is not an integer or a float between 0 and 1. Returns: - If the input is 3D, returns an interactive widget. Otherwise, returns a matplotlib figure. + local_thickness (widgets.interactive or plt.Figure): If the input is 3D, returns an interactive widget. Otherwise, returns a matplotlib figure. Example: ```python diff --git a/qim3d/viz/_structure_tensor.py b/qim3d/viz/_structure_tensor.py index 63d141c4..a3464033 100644 --- a/qim3d/viz/_structure_tensor.py +++ b/qim3d/viz/_structure_tensor.py @@ -44,7 +44,7 @@ def vectors( be used. Defaults to None. grid_size (int, optional): The size of the grid. Defaults to 10. interactive (bool, optional): If True, returns an interactive widget. Defaults to True. - figsize (Tuple[int, int], optional): The size of the figure. Defaults to (15, 5). + figsize (tuple, optional): The size of the figure. Defaults to (15, 5). show (bool, optional): If True, displays the plot (i.e. calls plt.show()). Defaults to False. Raises: @@ -52,7 +52,7 @@ def vectors( ValueError: If the slice index is not an integer or a float between 0 and 1. Returns: - fig (Union[plt.Figure, widgets.interactive]): If `interactive` is True, returns an interactive widget. Otherwise, returns a matplotlib figure. + fig (widgets.interactive or plt.Figure): If `interactive` is True, returns an interactive widget. Otherwise, returns a matplotlib figure. Note: The orientation of the vectors is visualized using an HSV color map, where the saturation corresponds to the vector component diff --git a/qim3d/viz/itk_vtk_viewer/run.py b/qim3d/viz/itk_vtk_viewer/run.py index 8fa5e6b8..cd0d5721 100644 --- a/qim3d/viz/itk_vtk_viewer/run.py +++ b/qim3d/viz/itk_vtk_viewer/run.py @@ -89,7 +89,7 @@ def itk_vtk( is not installed, it raises a NotInstalledError. Args: - filename (str, optional): Path to the file or OME-Zarr store to be visualized. Trailing slashes in + filename (str or or.PathLike, optional): Path to the file or OME-Zarr store to be visualized. Trailing slashes in the path are normalized. Defaults to None. open_browser (bool, optional): If True, opens the visualization in a new browser tab. Defaults to True. -- GitLab