Skip to content

Commit

Permalink
Merge pull request micro-manager#1900 from nicost/acqj
Browse files Browse the repository at this point in the history
Studo-AcqEngJ: ensure autofocus runs at each new XY stage position.
  • Loading branch information
nicost authored Feb 21, 2024
2 parents 170fe24 + 6250d60 commit 1cc660f
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,8 @@ private Datastore runAcquisition(SequenceSettings sequenceSettings) {
}

// These hooks implement Autofocus
// TODO: does this give the correct behavior? This should run after the XY stage
// reaches its new position, but before the z stage is moved from its current position
if (sequenceSettings_.useAutofocus()) {
currentAcquisition_.addHook(autofocusHookBefore(sequenceSettings_.skipAutofocusCount()),
AcquisitionAPI.BEFORE_HARDWARE_HOOK);
Expand Down Expand Up @@ -730,8 +732,6 @@ protected AcquisitionHook autofocusHookBefore(int skipFrames) {
public AcquisitionEvent run(AcquisitionEvent event) {
if (!event.isAcquisitionFinishedEvent()
&& (event.getZIndex() == null || event.getZIndex() == 0)
&& (event.getAxisPosition(MDAAcqEventModules.POSITION_AXIS) == null
|| (Integer) event.getAxisPosition(MDAAcqEventModules.POSITION_AXIS) == 0)
&& (event.getAxisPosition(AcqEngMetadata.CHANNEL_AXIS) == null
|| (Integer) event.getAxisPosition(AcqEngMetadata.CHANNEL_AXIS) == 0)) {
if (event.getTIndex() != null && skipFrames != 0
Expand Down

0 comments on commit 1cc660f

Please sign in to comment.