Automatically clear circular buffer in continuous sequence acquisition#588
Merged
marktsuchida merged 7 commits intomicro-manager:mainfrom Aug 15, 2025
Merged
Conversation
marktsuchida
requested changes
Mar 4, 2025
Member
marktsuchida
left a comment
There was a problem hiding this comment.
Thanks, @henrypinkard. It's so much easier to confidently review a narrowly targeted PR like this!
Contributor
Author
|
@marktsuchida ready to merge? |
This function needs to acquire g_bufferLock to be correct, but since it is not used, just delete it until the need arises.
These are the device adapters that use the newly deprecated ClearImageBuffer() function but have MSVC's SDL (Security Development Lifecycle) checks enabled, which turn C4996 (deprecation warning) into an error. AlliedVisionCamera DahengGalaxy IDSPeak Lumenera PlayerOne PyDevice QSI SequenceTester SigmaKoki SpinnakerCamera ZWO Disabling SDL checks temporarily; after updating to remove the use of the deprecated function, SDL checks should be re-enabled.
This was referenced May 16, 2025
Member
|
Code-wise, this is ready to merge, but let's wait a bit for a day on which other major changes are not going into the nightly build (we upgraded to Java 11 today).
The device interface version needs to be bumped, despite the apparent lack of change, because there is a behavioral change: camera adapters written assuming this change will fail Live when the buffer fills up if run with an older Core. We may want to coordinate this version increment with #640 and the actual removal of |
This was referenced Aug 14, 2025
marktsuchida
added a commit
to marktsuchida/mmCoreAndDevices
that referenced
this pull request
Aug 15, 2025
Clearing the Core sequence buffer on the camera device side is no longer necessary after micro-manager#588. Remove all such code from cameras. No attempt is made here to fix missing error handling (of which there are quite a few). Also removes a few places where ClearImageBuffer() was being called upon stopping acquisition, which should be unnecessary if not wrong.
marktsuchida
added a commit
to marktsuchida/mmCoreAndDevices
that referenced
this pull request
Aug 15, 2025
This function should not be necessary after micro-manager#588.
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.
This adds an overwrite mode to the circular buffer, which means that when an image is inserted and there's no more space, it will automatically clear itself. Currently, most cameras do this manually when there is an error on insert.
This is motivated by the need to deprecate the ability of devices to clear and allocate the buffer in the core. This should instead be done by higher level application code.
One thing I don't fully understand is the
stopOnOverflowargument ofstartSequenceAcquisition. Some, but not all, cameras appear to have logic that changes behavior based on this flag, but I'm not aware of any higher level code that ever sets this tofalsewhen running a finite sequence of N frames.Regardless,
stopOnOverflowshouldn't be an issue for merging this, because the only time we setoverwrite=trueis when callingstartContinuousSequenceAcquisition, wherestopOnOverflowis always false