bioio icon indicating copy to clipboard operation
bioio copied to clipboard

Define timelapse interval and timelapse duration more precisely

Open pgarrison opened this issue 5 months ago • 3 comments

Issue 1

On the web documentation for standard_metadata, all it says is "Return a set of standardized metadata. The possible fields are predefined by the StandardMetadata dataclass.", but there is no documentation for the StandardMetadata class on that website. I think every field should have clear end-user documentation on the website and in the BioImage docstrings.

Issue 2

Currently, the best documentation we have for the fields in standard_metadata appears to be the comments in standard_metadata.py.

# Time interval between frames.
timelapse_interval: Optional[float] = None

# Total time duration of imaging.
total_time_duration: Optional[str] = None

In implementing these for bioio-czi, I've found that there is more nuance than this. A CZI likely has many acquisitions per timepoint (different Z positions, different channels, etc.), and they don't happen instantaneously. This is visible, for example, in our test file S=2_4x2_T=2=Z=3_CH=2.czi, where the first Z slice of the first frame is at 2021-06-15T06:14:14.3695692Z and the second Z slice is at 2021-06-15T06:14:14.6555758Z. This makes duration particularly complicated: does it measure from the first acquisition of the first timepoint to the first acquisition of the last timepoint, or to the last acquisition of the last timepoint?

In addition to communicating clearly to users what these fields mean, I think we should agree on a definition for sake of continuity between bioio plugins.

Proposal

For lack of a standard, I suggest that we adopt the following definitions.

  • timelapse_interval is the time between the first acquisition of the first timepoint in the scene and the first acquisition of the second timepoint in the scene.
  • total_time_duration is the time from the first acquisition of the first timepoint in the scene to the last acquisition of the last timepoint in the scene.

I think this makes sense for the following reasons.

  • Some images have a single timepoint but take a long time to acquire. Our test file OverViewScan.czi has 120 tiles and took over 3 minutes to acquire. The proposed definition makes this duration available.
  • The time it takes to acquire a single timepoint is meaningful to scientists, especially when investigating a fast-moving phenomenon with many Z slices.

However, this definition of duration is likely confusing for scientists who are imagining that each timepoint is imaged approximately at the same time, so if we go this route I advise explicit, accessible documentation (see Issue 1).

Notes

I attempted to find a pre-existing standard in the OME Data Model 6.0.1, but I did not identify anything relevant. I am unfamiliar with that standard, however.

pgarrison avatar May 13 '25 00:05 pgarrison