camera scripting
play

Camera scripting Andreas Mittelberger Outline 1. Nion Swift camera - PowerPoint PPT Presentation

Camera scripting Andreas Mittelberger Outline 1. Nion Swift camera API 2. Scientific cameras 3. Webcams 4. Simple scientific cameras Nion Swift camera API User interface ... (nionui) Core (nionswift) hardware control extensions


  1. Camera scripting Andreas Mittelberger

  2. Outline 1. Nion Swift camera API 2. Scientific cameras 3. Webcams 4. “Simple” scientific cameras

  3. Nion Swift camera API User interface ... (nionui) Core (nionswift) hardware control extensions (nionswift-instrumentation)

  4. Nion Swift camera API scan device camera device video device nionswift-instrumentation

  5. Nion Swift camera API camera device video device ● Meant for scientific cameras ● Meant for “simple” cameras ● Full control over the device (via the ● Only supports “Play” and “Pause” frame_parameters object) ● No extra control panel, just the buttons in ● Usually comes with a graphical user the data item panel interface (control panel) ● Can be controlled via API ● Data acquisition via API ● Usually high data rates (compared to scanning)

  6. Camera panel types camera device camera_panel_type = "ronchigram" camera_panel_type = "eels" camera_panel_type = "andor_eels"

  7. Webcams - built-in support video device First we have to install the nionswift-video-capture plugin: conda install -n nionswift -c nion nionswift-video-capture opencv pip install nionswift-video-capture opencv-python

  8. Webcams - built-in support video device Edit Preferences

  9. Webcams - third party video device Edit Preferences

  10. “Simple” scientific camera video device

  11. “Simple” scientific camera video device

  12. “Simple” scientific camera video device

  13. Camera scripting from nion.utils import Registry stem_controller = Registry.get_component("stem_controller") ronchigram = stem_controller.ronchigram_camera frame_parameters = ronchigram.get_current_frame_parameters() # adjust frame_parameters here if desired frame_parameters["exposure_ms"] = 200 # start the camera ronchigram.start_playing(frame_parameters) # grab two consecutive frames, with a guaranteed start time after the first call frame1 = ronchigram.grab_next_to_start()[0] frame2 = ronchigram.grab_next_to_finish()[0] # stop the camera ronchigram.stop_playing()

  14. Get the code ● Webcam plugin: https://github.com/Brow71189/SwiftCam ● “Simple” scientific camera: (careful this experimental code!) https://github.com/Brow71189/matrix_vision 18

  15. Thank you for your attention

Recommend


More recommend