Skip to content
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

Surface detection and faster z-stacks #188

Merged
merged 56 commits into from Jan 25, 2024

Conversation

outofculture
Copy link
Collaborator

closes #166
closes #171

outofculture and others added 29 commits November 14, 2023 08:54
refactored the ImageSequencerThread along the way to make it possible to use it without the Ctrl
this way, we can more easily wait for results
@outofculture outofculture changed the title Surface detection Surface detection and faster z-stacks Dec 6, 2023
- restore the driver-supported frame acqisition to its previous glory
- fix Future.wrap to not clobber "self"
- muck about with at fair few other things that got in the way
Stage.positionUpdatesPerSecond implemented for Sensapex and MockStage only, so far
- put Number in typing
- minor cleanups in all files touched
Conflicts:
	acq4/devices/PatchPipette/statemanager.py - fixing the same problem
def acquireFrames(self, n=1, stack=True):
"""Immediately acquire and return a specific number of frames.
@contextmanager
def run(self, ensureFreshFrames=False):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Camera.ensureRunning ?

def getEstimatedFrameRate(self, _future: Future):
"""Return the estimated frame rate of the camera.
"""
if not self.isRunning():
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't be necessary? Just:

with self.ensureRunning():
    ...

@@ -434,9 +434,9 @@ def _solveGlobalStagePosition(self, pos):
spos = np.asarray(stage.globalPosition())
return spos + dif

def _moveToLocal(self, pos, speed, linear=False):
def moveToLocal(self, pos, speed, linear=False):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

consider reverting this

@@ -365,7 +365,8 @@ def sample(self):
xRange = (self.ui.xMinSpin.value(), self.ui.xMaxSpin.value())
yRange = (self.ui.yMinSpin.value(), self.ui.yMaxSpin.value())

background = camera.acquireFrames(1)
with camera.run(ensureFreshFrames=True):
background = camera.acquireFrames(1).getResult()[0]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can this be camera.acquireFrames(1, ensureFresh=True)?

@outofculture outofculture merged commit fa5dadc into acq4:main Jan 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Automatic tissue surface detection Fast z-stacks
3 participants