def __init__(self): self.bridge = MagellanBridge() self.core = self.bridge.get_core() print('MicroManager Socket:') print(self.core.socket) self.magellan = self.bridge.get_magellan() print('MicroMagellan Socket:') print(self.magellan.socket) self.channelGroup = self.core.getChannelGroup()
from pygellan.acquire import MagellanBridge #establish communication with Magellan bridge = MagellanBridge() #get object representing micro-magellan API magellan = bridge.get_magellan() #get this list of acquisitions in the magellan GUI acquistions = magellan.get_acquisitions() #grab the first acquisition in the list acq = acquistions[0] acq.start() # block until the acquisition is complete acq.wait_for_completion()
""" This example shows how to use pygellan to interact with the micro-manager core. Aside from the setup section, each following section can be run independently """ from pygellan.acquire import MagellanBridge import numpy as np import matplotlib.pyplot as plt #### Setup #### #establish communication with Magellan bridge = MagellanBridge() #get object representing micro-manager core core = bridge.get_core() #### Calling core functions ### exposure = core.getExposure() #### Setting and getting properties #### #Here we set a property of the core itself, but same code works for device properties auto_shutter = core.getProperty('Core', 'AutoShutter') core.setProperty('Core', 'AutoShutter', 0) #### Acquiring images #### #The micro-manager core exposes several mechanisms foor acquiring images. In order to not interfere #with other pygellan functionality, this is the one that should be used core.snapImage() tagged_image = core.getTaggedImage() #If using micro-manager multi-camera adapter, use core.getTaggedImage(i), where i is the camera index #tagged_image is a tuple containing the raw pixel data (as a numpy array) and the image metadata (as a python dictionary) pixels_flat = tagged_image[0]