Fixed imports, and PEP8 styling
This commit is contained in:
parent
298bc2ba6a
commit
89ea6a69de
3 changed files with 30 additions and 33 deletions
|
|
@ -1 +1 @@
|
|||
from .plugin import StackPlugin
|
||||
from .plugin import ScanPlugin
|
||||
|
|
|
|||
|
|
@ -1,5 +1,3 @@
|
|||
import numpy as np
|
||||
|
||||
from openflexure_microscope.api.v1.views import MicroscopeViewPlugin
|
||||
from openflexure_microscope.api.utilities import JsonPayload
|
||||
|
||||
|
|
@ -46,14 +44,13 @@ class TileScanAPI(MicroscopeViewPlugin):
|
|||
return jsonify(task.state, 202)
|
||||
|
||||
|
||||
|
||||
class ZStackAPI(MicroscopeViewPlugin):
|
||||
def post(self):
|
||||
payload = JsonPayload(request)
|
||||
|
||||
# Get params
|
||||
name = payload.param('name')
|
||||
step_size = payload.param('step_size', default=[2000, 1500], convert=list)
|
||||
step_size = payload.param('step_size', default=100, convert=int)
|
||||
steps = payload.param('steps', default=5, convert=int)
|
||||
center = payload.param('center', default=True, convert=bool)
|
||||
|
||||
|
|
|
|||
|
|
@ -5,10 +5,10 @@ import uuid
|
|||
|
||||
from openflexure_microscope.camera.base import generate_basename
|
||||
from openflexure_microscope.plugins import MicroscopePlugin
|
||||
from openflexure_microscope.utilities import set_properties
|
||||
|
||||
from .api import TileScanAPI, ZStackAPI
|
||||
|
||||
|
||||
class ScanPlugin(MicroscopePlugin):
|
||||
"""
|
||||
Stack and tile plugin
|
||||
|
|
@ -19,7 +19,6 @@ class ScanPlugin(MicroscopePlugin):
|
|||
'/stack': ZStackAPI,
|
||||
}
|
||||
|
||||
|
||||
def capture(self,
|
||||
basename,
|
||||
scan_id,
|
||||
|
|
@ -95,7 +94,8 @@ class ScanPlugin(MicroscopePlugin):
|
|||
for j in range(grid[1]):
|
||||
|
||||
if autofocus_enabled:
|
||||
self.microscope.plugin.default_autofocus.autofocus(range(-2*autofocus_dz, 3*autofocus_dz, autofocus_dz))
|
||||
self.microscope.plugin.default_autofocus.autofocus(
|
||||
range(-2 * autofocus_dz, 3 * autofocus_dz, autofocus_dz))
|
||||
|
||||
self.capture(
|
||||
basename,
|
||||
|
|
@ -120,7 +120,7 @@ class ScanPlugin(MicroscopePlugin):
|
|||
self,
|
||||
basename: str = None,
|
||||
step_size: int = 100,
|
||||
steps: list = 5,
|
||||
steps: int = 5,
|
||||
center: bool = True,
|
||||
use_video_port: bool = False,
|
||||
resize: Tuple[int, int] = None,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue