Skip to content

Commit

Permalink
Add stitching, z-stacking, protocol record (#306)
Browse files Browse the repository at this point in the history
  • Loading branch information
jmcoreymv authored Nov 29, 2023
1 parent 67b22e0 commit 0a90c6c
Show file tree
Hide file tree
Showing 11 changed files with 1,238 additions and 390 deletions.
5 changes: 4 additions & 1 deletion lumascope_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,9 @@ def save_image(self, array, save_folder = './capture', file_root = 'img_', appen
except:
logger.exception("[SCOPE API ] Error: Unable to save. Perhaps save folder does not exist?")

return path


def save_live_image(
self,
save_folder = './capture',
Expand All @@ -263,7 +266,7 @@ def save_live_image(
array = self.get_image()
if array is False:
return
self.save_image(array, save_folder, file_root, append, color, tail_id_mode)
return self.save_image(array, save_folder, file_root, append, color, tail_id_mode)

def get_max_width(self):
"""CAMERA FUNCTIONS
Expand Down
159 changes: 87 additions & 72 deletions lumaviewpro.kv
Original file line number Diff line number Diff line change
Expand Up @@ -1067,33 +1067,28 @@
height: '30dp'
text_autoupdate: True
values: ''


# # Z-stack
# BoxLayout:
# orientation: 'horizontal'
# size_hint_y: None
# height: '30dp'
# spacing: '5dp'

# Label:
# text: 'Z Stack'
# size_hint_x: None
# width: '75dp'
# font_size: '12sp'

# CheckBox:
# id: acquire_zstack_id
# size_hint_x: None
# width: '30dp'
# active: False
# # TODO on_release: root.update_acquire_zstack()
# Label:
# text: 'Acquire All Steps'
# font_size: '12sp'
# halign: 'left'
# valign: 'middle'
# text_size: self.size
on_text: root.update_tiling_selection()

# Z-stack
BoxLayout:
orientation: 'horizontal'
size_hint_y: None
height: '30dp'
spacing: '5dp'

CheckBox:
id: acquire_zstack_id
size_hint_x: None
width: '30dp'
active: False
on_release: root.update_acquire_zstack()

Label:
text: 'Enable Z-Stack'
font_size: '12sp'
halign: 'left'
valign: 'middle'
text_size: self.size

# # Multiple exposure
# BoxLayout:
Expand Down Expand Up @@ -1146,6 +1141,7 @@
height: '30dp'
font_size: '12sp'
on_release: root.run_autofocus_scan()
disabled: False

# Run Protocol
Label:
Expand Down Expand Up @@ -1212,6 +1208,25 @@
# Empty widget to consume space at bottom of controls panel
Widget:


<StitchControls>:
orientation: 'vertical'

# Pad
Widget:
size_hint_y: None
height: '30dp'

FolderChooseBTN:
text: 'Apply Stitching to Protocol Folder'
size_hint_y: None
height: '30dp'
font_size: '12sp'
on_release: self.choose('apply_stitching_to_folder')

# Empty widget to consume space at bottom of controls panel
Widget:

# PostProcessingAccordion - Settings for PostProcessingAccordion
# ------------------------------------------
<PostProcessingAccordion>:
Expand Down Expand Up @@ -1243,33 +1258,9 @@
title: 'Stitch'
on_collapse: root.accordion_collapse()

BoxLayout:
padding: '5dp'
spacing: '5dp'
orientation: 'vertical'
pos_hint: {'x': 0.0, 'y': 0.0}

# Select stiching method
Spinner:
id: stitching_method_spinner
sync_height: True
font_size: '12dp'
size_hint_y: None
height: '30dp'
text_autoupdate: True
on_text: root.select_stitching_method
values: 'Features', 'Position'
orientation: 'vertical'
StitchControls:
id: stitch_controls_id

# Select image to load
Button:
text: 'Stitch'
size_hint_y: None
height: '30dp'
font_size: '12sp'
on_release: root.stitch()

Label:

# Tiling Stage Display
# FloatLayout:
Expand Down Expand Up @@ -1509,24 +1500,6 @@
disabled: True
font_size: '12sp'

BoxLayout:
orientation: 'horizontal'
size_hint_y: None
height: '30dp'
Label:
text: 'Focal Length'
size_hint_x: None
width: '120dp'
font_size: '12sp'
TextInput:
id: focal_length_id
multiline: False
padding: ['5dp', (self.height-self.line_height)/2]
halign: 'center'
text: 'tbd'
disabled: True
font_size: '12sp'

# Frame Size
BoxLayout:
orientation: 'horizontal'
Expand Down Expand Up @@ -1570,6 +1543,48 @@
on_text_validate: root.frame_size()
on_focus: if not self.focus: root.frame_size()
font_size: '12sp'

# Field of View
BoxLayout:
orientation: 'horizontal'
size_hint_y: None
height: '30dp'
Label:
text: 'Field of View'
size_hint_x: None
width: '120dp'
font_size: '12sp'

TextInput:
id: field_of_view_width_id
multiline: False
padding: ['2dp', (self.height-self.line_height)/2]
halign: 'center'
input_filter: 'int'
text: ''
font_size: '12sp'
disabled: True
Label:
text: 'x'
size_hint_x: None
width: '15dp'
font_size: '12sp'
halign: 'center'
TextInput:
id: field_of_view_height_id
multiline: False
padding: ['5dp', (self.height-self.line_height)/2]
halign: 'center'
input_filter: 'int'
text: ''
font_size: '12sp'
disabled: True
Label:
text: ' um'
size_hint_x: None
width: '15dp'
font_size: '12sp'
halign: 'center'

FileChooseBTN:
text: 'Load'
Expand Down Expand Up @@ -1686,7 +1701,7 @@
padding: ['4dp', (self.height-self.line_height)/2]
halign: 'right'
input_filter: 'float'
text: format(ill_slider.value, '.3g')
text: format(ill_slider.value, '.4g')
on_text_validate: root.ill_text()
on_focus: if not self.focus: root.ill_text()

Expand Down
Loading

0 comments on commit 0a90c6c

Please sign in to comment.