Skip to content

Do not prefix camera metadata with label#833

Merged
marktsuchida merged 1 commit intomicro-manager:mainfrom
marktsuchida:metadata-no-label
Feb 17, 2026
Merged

Do not prefix camera metadata with label#833
marktsuchida merged 1 commit intomicro-manager:mainfrom
marktsuchida:metadata-no-label

Conversation

@marktsuchida
Copy link
Copy Markdown
Member

@marktsuchida marktsuchida commented Feb 10, 2026

Fix the minority of cameras that use metadata keys "MyLabel-Key" instead of "Key" for some or all fields of the camera-generated metadata. In the case of TISCam, delete the redundant fields.

Affected cameras: Andor, AndorSDK3, PICAM, PrincetonInstruments, RaptorEPIX (& HoribaEPIX), TIScam, TwoPhoton.
PVCAM change is commented code only.

Fixes #831.

@marktsuchida marktsuchida marked this pull request as ready for review February 10, 2026 00:51
@marktsuchida
Copy link
Copy Markdown
Member Author

Regarding the breaking change:

Given that devices get a default label equal to their name, one possibility is to add prefixes like Andor-, AndorSDK3-, etc., instead of just removing the prefixes outright. This has two advantages: it clarifies the data source and it opportunistically preserves compatibility for people using the default label. (PVCAM follows this style with PVCAM-FrameNr, etc., though I'm not aware of any other camera adapter doing so.)

Question would be whether to do this only for non-standard properties (I think yes).

@marktsuchida marktsuchida marked this pull request as draft February 13, 2026 23:32
@marktsuchida
Copy link
Copy Markdown
Member Author

Ok, here's a better plan:

Andor

Raw key Previous New Remarks
SRRFFrameTime-ms label-SRRFFrameTime-ms Andor-SRRFFrameTime Custom tag
ElapsedTime-ms label-ElapsedTime-ms Andor-ElapsedTime-ms Plain ElapsedTime-ms is NOT overwritten by Core, but is supposed to be ms since start of acquisition. But the value inserted here is the absolute MMTime ms value, so it should not use the standard key
ElapsedTime-ms(HW) label-ElapsedTime-ms(HW) Andor-ElapsedTime-ms(HW) Custom tag
ImageNumber label-ImageNumber Andor-ImageNumber Plain ImageNumber is currently overwritten by Core. The number produced here, however, may differ due to acquisition restart situations. Keep it separate.
Binning label-Binning Binning Standard, not touched by Core. But the Binning property will produce label-Binning, which is often Andor-Binning, unless state cache metadata is disabled.
CurrentTemperature label-CurrentTemperature Andor-CurrentTemperature Custom tag

AndorSDK3

The existing code prefixes the tags with Andor sCMOS Camera, not the label. So we can keep the exact behavior:

Full key (unchanged)
Andor sCMOS Camera-ImageNumber
Andor sCMOS Camera-ElapsedTime-ms
Andor sCMOS Camera-SRRFFrameTime-ms

PICAM

ElapsedTime-ms and ImageNumber. These do not offer anything that the unprefixed tags added by Core do not offer. Just remove.

PrincetonInstruments

This adapter is obsolete and not in any build. Should remove the whole adapter.

PVCAM

As stated above, only commented code is updated here.

RaptorEPIX, HoribaEPIX

All custom keys; prefix with RaptorEPIX- or HoribaEPIX-

TIScam

ElapsedTime-ms, ImageNumber, and Binning. The first 2 are redundant; remove. Keep Binning but without label prefix.

TwoPhoton

ElapsedTime-ms and ImageNumber. These might be sort of redundant, but there is value in setting them uniformly across the multiple channels of the camera. And ImageNumber is probably not generated correctly by Core for this multi-channel case with uniform camera label. Keep, with TwoPhoton- (rather than label) prefix.

CameraChannelIndex and CameraChannelName: these do in fact need to have the label prefix for backward compatibility, at least until we start handling these in the Core (#840). For now, add tags with and without the label prefix.

Fix the minority of cameras that use metadata keys "MyLabel-Key" instead
of "Key" for some or all fields of the camera-generated metadata. Avoid
using MetadataSingleTag and SetTag(); replace with straightforward
PutImageTag().

Andor, TwoPhoton: generally replace with fixed name prefix. No prefix
for Binning tag. For these cameras, prefixed ElapsedTime-ms and
ImageNumber contain distinct information from the standard unprefixed
tags added by the Core. Keep those separate.

TwoPhoton: CameraChannelIndex and CameraChannelName keep the
label-prefixed tags, at least for now. Also emit unprefixed.

RaptorEPIX, HoribaEPIX: replace label prefix with fixed name prefix;
this was only needed for the custom tags (others already used
PutImageTag()).

AndorSDK3: already had fixed prefix; keep behavior but use PutImageTag().

PICAM, TIScam: remove ElapsedTime-ms and ImageNumber (redundnt with
Core); no prefix for Binning tag.

PVCAM change is commented code only.

The idea behind replacing the camera label prefix with the fixed name
prefix is that the camera device name is the default for the camera
label. The two may have even been confused during implementation of
these tags.
@marktsuchida marktsuchida marked this pull request as ready for review February 17, 2026 20:28
@marktsuchida marktsuchida merged commit 5660eee into micro-manager:main Feb 17, 2026
2 checks passed
@marktsuchida marktsuchida deleted the metadata-no-label branch February 17, 2026 22:34
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.

Camera-generated metadata inconsistency (keys including/not including device label)

1 participant