Skip to content

feat/channel-metadata: add ChannelMetadata and reflectors to StandardMetadata#74

Open
BrianWhitneyAI wants to merge 1 commit into
mainfrom
feat/channel-metadata
Open

feat/channel-metadata: add ChannelMetadata and reflectors to StandardMetadata#74
BrianWhitneyAI wants to merge 1 commit into
mainfrom
feat/channel-metadata

Conversation

@BrianWhitneyAI

@BrianWhitneyAI BrianWhitneyAI commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Description of Changes

Adds a ChannelMetadata dataclass to standard_metadata for per-channel
acquisition metadata, and wires it into StandardMetadata:

  • ChannelMetadata — a dataclass of optional per-channel fields (name,
    track, dye, contrast method, wavelengths, exposure time, imaging device,
    camera adapter, light source(s)/intensity, etc.) with a FIELD_LABELS map
    and a to_dict() keyed by readable labels, mirroring StandardMetadata.
  • StandardMetadata.reflectorsOptional[Sequence[str]] for the
    microscope turret's reflector positions.

The purpose of this PR is to provide the framework to resolve #bioio-devs/bioio#204

Add a ChannelMetadata dataclass for per-channel acquisition metadata and
wire it into StandardMetadata via new `channels` and `reflectors` fields.
StandardMetadata.to_dict now recursively expands nested objects that expose
their own to_dict (e.g. per-channel entries) into nested dictionaries.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
}

@staticmethod
def _serialize(value: Any) -> Any:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this necessary?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Its needed for going to dict to imbed in standard metadata. Honestly making standard metadata.to_dict() completely searilizable would be a nice addition, we have to do this in MXS and in bioio-conversion-pipeline (if we choose to imbed standard metadata from parent files)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed, and since this has to be done manually in MXS and bioio-conversion-pipeline, making StandardMetadata.to_dict() fully JSON-serializable here seems like the right place to centralize it.


Attributes
----------
channel_id: Optional[str]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you verify these definitions with anyone?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nope! hoping to use this as a starting point, Im not sure how these values will propagate into FMS. I just took all the fields Zen shows and turned them into annotations.

@smishra3 smishra3 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Clean additive changes with new fields being optional, with defaults. Approving.

@BrianWhitneyAI

Copy link
Copy Markdown
Contributor Author

Blocking merging this until it is verified against zen data. Additionally we should wait till the names pass Metadata working group standardization.

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 this pull request may close these issues.

4 participants