Skip to content

Commit

Permalink
Can take series of images at different height
Browse files Browse the repository at this point in the history
  • Loading branch information
AurelienChagnon committed Aug 4, 2017
1 parent db076f4 commit 9993171
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
6 changes: 6 additions & 0 deletions AutomaticPatch/GUI.py
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,11 @@ def __init__(self, master=None):
)
self.paramecia.grid(row=2, column=0, padx=2, pady=2)

self.screenshots = Button(self.misc,
text='image series',
state='disable')
self.screenshots.grid(row=2, column=1, padx=2, pady=2)

# Messages zone
self.text_zone = ScrolledText(master=self, width=60, height=10, state='disabled')
self.text_zone.grid(row=2, column=0, columnspan=3)
Expand Down Expand Up @@ -340,6 +345,7 @@ def connect(self):
self.switch_follow.config(state='normal')
self.save_pos.config(state='normal', command=self.robot.save_position)
self.paramecia.config(state='normal')
self.screenshots.config(state='normal', command=self.robot.get_image_series(51))

# Checking changes of robot messages and display them
self.check_message()
Expand Down
9 changes: 9 additions & 0 deletions AutomaticPatch/PatchClampRobot.py
Original file line number Diff line number Diff line change
Expand Up @@ -654,6 +654,15 @@ def pipettechange(self):
break
pass

def get_image_series(self, nb_img):
z_pos = self.microscope.position(2)
for k in range(nb_img):
self.microscope.absolute_move(z_pos + k - (nb_img - 1) / 2, 2)
self.microscope.wait_motor_stop(2)
time.sleep(1)
img = self.cam.frame
cv2.imwrite('./screenshots/series{}.jpg'.format(k), img)

def get_template_series(self, nb_images):
"""
Get a series of template images of the tip, at different height, around the center of an image.
Expand Down

0 comments on commit 9993171

Please sign in to comment.