feat/channel-metadata: add ChannelMetadata and reflectors to StandardMetadata#74
feat/channel-metadata: add ChannelMetadata and reflectors to StandardMetadata#74BrianWhitneyAI wants to merge 1 commit into
Conversation
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: |
There was a problem hiding this comment.
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)
There was a problem hiding this comment.
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] |
There was a problem hiding this comment.
Did you verify these definitions with anyone?
There was a problem hiding this comment.
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
left a comment
There was a problem hiding this comment.
Clean additive changes with new fields being optional, with defaults. Approving.
|
Blocking merging this until it is verified against zen data. Additionally we should wait till the names pass Metadata working group standardization. |
Description of Changes
Adds a
ChannelMetadatadataclass tostandard_metadatafor per-channelacquisition 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_LABELSmapand a
to_dict()keyed by readable labels, mirroringStandardMetadata.StandardMetadata.reflectors—Optional[Sequence[str]]for themicroscope turret's reflector positions.
The purpose of this PR is to provide the framework to resolve #bioio-devs/bioio#204