feat: add exposure time and objective info into ome metadata - #303
Merged
tlambert03 merged 2 commits intoJul 29, 2026
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #303 +/- ##
==========================================
+ Coverage 93.63% 93.65% +0.02%
==========================================
Files 22 22
Lines 2607 2617 +10
==========================================
+ Hits 2441 2451 +10
Misses 166 166 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Owner
|
thanks @omar-merhebi! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds three fields that
_ome.pyalready pulls values for:Plane.exposure_time:dExposureTimefrom the raw metadata.Objective.model: fromMicroscope.objectiveName.ObjectiveSettings.refractive_index: fromMicroscope.immersionRefractiveIndex.Notes
Plane.exposure_time_unitis set as milliseconds explicitly.sSampleSettingentry, it gets propagated to every channel. This is to accommodate laser-scanning confocals which write one setting to all detectors. Cameras write one entry per channel so it's eitherSizeCor 1 on the sample files. Happy to make it strictly positional instead if that's preferred.dExposureTime == 0.0is treated as absent and written asNone.ObjectiveSettingsas a whole is now written on everyImagewhenever anObjectiveexists, even if the refractive index is not present.I left out
Objective.immersion(see #294,1.0for refractive index is ambiguous) andChannel.detector_settingsbecauseome_detectorscollapses(model, serial)into a set so which channel a camera came from is lost.Added tests in
tests/test_ome.pyTwo failures (may also fail in CI) are pre-existing and unrelated to these changes:
_nd2file.py:1255assignsframe.shapewhich is deprecated in numpy 2.5 andfilterwarnings = ["error", ...]escalates it to an error. The failing test leaves the nd2 file open so this cascades into ~300 failures in the rest of the test suite. Also pre-existing: mypy is complaining about a redundant cast in_readers/_modern/modern_reader.py:275.