Skip to content
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

Enforce unique channel names #231

Closed
jluethi opened this issue Nov 25, 2022 · 3 comments · Fixed by #239
Closed

Enforce unique channel names #231

jluethi opened this issue Nov 25, 2022 · 3 comments · Fixed by #239

Comments

@jluethi
Copy link
Collaborator

jluethi commented Nov 25, 2022

We assign channels names, they are labels in the omero metadata on the image level, e.g. "label": "DAPI".

Channel names should be one option on how a user can select a channel (see #211). For this to work, they will need to be unique.

Thus, we need to enforce the uniqueness when we parse them.

Given that channel names are an optional input (right?), multiplexing parsing should not name the channels just A01_C01, but 0_A01_C01 (acquisition_wavelenght_identifier) if no name was provided.

@tcompa
Copy link
Collaborator

tcompa commented Dec 1, 2022

PR #239 checks uniqueness of channel labels in two cases:

  1. Whenever it writes a set of omero metadata (for a given image), it checks that the channel labels are unique.
  2. Upon creating an OME-Zarr structure, the function check_well_channel_labels is run for each well in the dataset, to verify that channel labels are also unique across images of the same well. Note that this check is only useful in the multiplexing case, in our current operating mode, because otherwise there would only be a single image per well. The check is in-place anyway, to be future-proof in case we switch to one-image-per-field-of-view mode.

We don't have, at the moment, a check upon reading a certain zarr attribute file (that would be relevant for OME-Zarr files that are written from outside fractal). Should we add it, or is it a minor point?

@jluethi
Copy link
Collaborator Author

jluethi commented Dec 1, 2022

We can have 2 backlog issues for the moment:

  1. Allow processing of multi-FOV wells (1 image per FOV => many images of the same cycle with the same channel labels)
  2. A check that external OME-Zarr files have unique channel labels

@tcompa
Copy link
Collaborator

tcompa commented Dec 1, 2022

A check that external OME-Zarr files have unique channel labels

No need for an issue. It's a three-lines change, which currently looks like this (in other places):

    # Check that channel labels are unique for this image
    labels = [c["label"] for c in omero_channels]
    if len(set(labels)) < len(labels):
        raise ValueError(f"Non-unique labels in {omero_channels=}")

Let's just decide where this check should be performed (we can do it in our call tomorrow), and add it right away.

Repository owner moved this from TODO to Done in Fractal Project Management Dec 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants