Skip to content

ImageWidget rgb bool arg #630

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 1, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions fastplotlib/widgets/image_widget/_widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ def __init__(
names: list[str] = None,
figure_kwargs: dict = None,
histogram_widget: bool = True,
rgb: list[bool] = None,
rgb: bool | list[bool] = None,
cmap: str = "plasma",
graphic_kwargs: dict = None,
):
Expand Down Expand Up @@ -336,8 +336,8 @@ def __init__(
make histogram LUT widget for each subplot

rgb: bool | list[bool], default None
Includes a True or False for each ``array`` in the ImageWidget, indicating whether images are displayed as
grayscale or RGB(A).
bool or list of bool for each input data array in the ImageWidget, indicating whether the corresponding
data arrays are grayscale or RGB(A).

graphic_kwargs: Any
passed to each ImageGraphic in the ImageWidget figure subplots
Expand Down Expand Up @@ -379,15 +379,15 @@ def __init__(
# Establish number of image dimensions and number of scrollable dimensions for each array
if rgb is None:
rgb = [False] * len(self.data)
if rgb is bool:
rgb = [rgb]
if isinstance(rgb, bool):
rgb = [rgb] * len(self.data)
if not isinstance(rgb, list):
raise TypeError(
f"rgb_disp parameter must be a list, a {type(rgb)} was provided"
f"`rgb` parameter must be a bool or list of bool, a <{type(rgb)}> was provided"
)
if not len(rgb) == len(self.data):
raise ValueError(
f"rgb had length {len(rgb)} but there are {len(self.data)} data arrays; these must be equal"
f"len(rgb) != len(data), {len(rgb)} != {len(self.data)}. These must be equal"
)

self._rgb = rgb
Expand Down
Loading
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy