-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add MDAEvent.slm_image #204
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #204 +/- ##
==========================================
+ Coverage 93.80% 93.87% +0.06%
==========================================
Files 18 18
Lines 1243 1257 +14
==========================================
+ Hits 1166 1180 +14
Misses 77 77 ☔ View full report in Codecov by Sentry. 🚨 Try these New Features:
|
Wow that was quick 😍🚀 Started working on it, but I'll abandon those efforts then haha. Happy to test though, we're setting up a new microscope with pymmcore, so the timing is perfect! Some questions I had:
|
oh i'm sorry! i didn't realize ... I should have let you do it.
good question. Since we have an independent SLMImage object here, we can certainly add a new
yeah, that is probably for pymmcore-plus to worry about. But here in useq-schema, we can certainly add documentation that specifies what a backend SHOULD do when they encounter a null |
No what you have is much better of course haha so I'm super happy!
If None, I would expect the DMD to just switch on the pixels on indefinitely, until SetSLMImage and DisplaySLMImage are called again? Otherwise if both are e.g. 20ms and are not synchronized by TTL, there could be a significant offset.
perfect! |
here too I'm a little concerned about overloading semantics (on the schema side) too much. Perhaps if the MDAEvent wants to indicate "turn on all pixels", there should be an event with |
oh sorry, you were talking about exposure right? I might have missed that. In any case ... let's start here, try to implement it on the pymmcore-plus side (would love your help there!) and then circle back if we find we need additional fields/restrictions over here. |
Ah yes, on the exposure time! I imagine the DMD mirrors like a x/y stage, an event sets a new position and if there's no new command it remains in that position (if exposure is None).
Great plan! Let me know how I can best help. Started adding code to the setup sequence, on our setup it would look like this: if event.slm_image is not None:
slm_dev = self._mmc.getSLMDevice()
if slm_dev:
try:
self._mmc.setSLMImage(slm_dev, event.slm_image)
self._mmc.displaySLMImage(slm_dev)
except Exception as e:
logger.warning("Failed to set SLM image. %s", e) This of course doesn't deal with the exposure times (and possibly sequenceable DMDs?) |
ok, in we go! |
closes #202
Any
.np.asarray(event.slm_image)