Merge branch 'temporary-scan-captures' into 'master'

Temporary scan captures

See merge request openflexure/openflexure-microscope-server!10
This commit is contained in:
Joel Collins 2019-04-14 09:00:21 +00:00
commit 941aadebfe
5 changed files with 34 additions and 92 deletions

View file

@ -7,7 +7,7 @@ import logging
from openflexure_microscope.camera.base import generate_basename
from openflexure_microscope.plugins import MicroscopePlugin
from .api import TileScanAPI, ZStackAPI
from .api import TileScanAPI
def construct_grid(initial, step_sizes, n_steps, style='raster'):
"""
@ -48,12 +48,12 @@ class ScanPlugin(MicroscopePlugin):
api_views = {
'/tile': TileScanAPI,
'/stack': ZStackAPI,
}
def capture(self,
basename,
scan_id,
temporary: bool = False,
use_video_port: bool = False,
resize: Tuple[int, int] = None,
bayer: bool = False,
@ -62,14 +62,14 @@ class ScanPlugin(MicroscopePlugin):
# Construct a tile filename
filename = "{}_{}_{}_{}".format(basename, *self.microscope.stage.position)
foldername = "SCAN_{}".format(basename)
folder = "SCAN_{}".format(basename)
# Create output object
output = self.microscope.camera.new_image(
write_to_file=True,
temporary=False,
temporary=temporary,
filename=filename,
folder=foldername)
folder=folder)
# Capture
self.microscope.camera.capture(
@ -94,6 +94,7 @@ class ScanPlugin(MicroscopePlugin):
def tile(
self,
basename: str = None,
temporary: bool = False,
step_size: int = [2000, 1500, 100],
grid: list = [3, 3, 5],
style='raster',
@ -178,6 +179,7 @@ class ScanPlugin(MicroscopePlugin):
self.capture(
basename,
scan_id,
temporary=temporary,
use_video_port=use_video_port,
resize=resize,
bayer=bayer,
@ -188,6 +190,7 @@ class ScanPlugin(MicroscopePlugin):
logging.debug("Entering z-stack")
self.stack(
basename=basename,
temporary=temporary,
scan_id=scan_id,
step_size=step_size[2],
steps=grid[2],
@ -212,6 +215,7 @@ class ScanPlugin(MicroscopePlugin):
def stack(
self,
basename: str = None,
temporary: bool = False,
scan_id: str = None,
step_size: int = 100,
steps: int = 5,
@ -251,6 +255,7 @@ class ScanPlugin(MicroscopePlugin):
self.capture(
basename,
scan_id,
temporary=temporary,
use_video_port=use_video_port,
resize=resize,
bayer=bayer,