Moved capture management into separate object
This commit is contained in:
parent
1a6088a816
commit
caf553db7a
14 changed files with 302 additions and 227 deletions
|
|
@ -85,27 +85,17 @@ def capture(
|
|||
filename = "{}_{}_{}_{}".format(basename, *microscope.stage.position)
|
||||
folder = "SCAN_{}".format(basename)
|
||||
|
||||
# Create output object
|
||||
output = microscope.camera.new_image(
|
||||
temporary=temporary, filename=filename, folder=folder
|
||||
# Do capture
|
||||
return microscope.capture(
|
||||
filename=filename,
|
||||
folder=folder,
|
||||
temporary=temporary,
|
||||
use_video_port=use_video_port, resize=resize, bayer=bayer,
|
||||
annotations=annotations,
|
||||
tags=tags,
|
||||
metadata=metadata
|
||||
)
|
||||
|
||||
# Capture
|
||||
microscope.camera.capture(
|
||||
output.file, use_video_port=use_video_port, resize=resize, bayer=bayer
|
||||
)
|
||||
|
||||
# Inject system metadata
|
||||
output.put_metadata({"instrument": microscope.metadata})
|
||||
|
||||
# Insert custom metadata
|
||||
output.put_metadata(metadata)
|
||||
|
||||
# Insert custom metadata
|
||||
output.put_annotations(annotations)
|
||||
# Insert custom tags
|
||||
output.put_tags(tags)
|
||||
|
||||
|
||||
### Scanning
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue