def OnNewPoint(x, y, z, position): global aborted, spc print "Point: ", position if aborted: break print "Set Fluorescence Mode" microscope.MicroscopeSetMode(0) for cube in cube_data: print "Selecting Cube ", cube['Position'], ": ", cube['Name'] microscope.MoveCubeToPosition(cube['Position']) options = microscope.GetCubeOptions( cube['Position']) # camera exposure, gain and focus offset print "Setting camera exposure to ", options[0] microscope.SetExposure(options[0]) print "Setting camera gain to ", options[1] microscope.SetGain(options[1]) # store the focus offset offset = options[2] if aborted: break print "Moving to (%0.1f, %0.1f, %0.1f)" % (x, y, z + offset) microscope.SetStagePosition(x, y, z + offset) # Wait for stage to finish moving (additional delay seconds, time out seconds) microscope.WaitForStage(0.0, 1.0) output_directory = output[0] filename = output[1] filename = microscope.ParseSequenceFilename(filename, position) filename = microscope.InsertCubeIntoFilename(filename, cube['Position']) path = output_directory + filename print "Acquire with FL cube: ", path microscope.SnapAndSaveImage(path) if aborted: pass print "Set Laser Scanning Mode" microscope.MicroscopeSetMode(2) # Laser Scanning spc.ClearBoardMemory() filename = microscope.ParseSequenceFilename(output[1], position) filename = microscope.InsertTextIntoFilename(filename, "spc") path = output[0] + filename print "Acquire with SPC: ", path spc.AcquireAndSaveToFileUsingUIValues(1, path)
def OnNewPoint(x, y, z, position): global spc microscope.SetStagePosition(x, y, z) # microscope.SetStagePosition(x, y, (z+11.50)) # wait for stage to finish moving (additional delay=0.1 seconds, time out = 1.0 seconds) microscope.WaitForStage(0.0, 1.0) filename = microscope.ParseSequenceFilename(output[1], position) path = output[0] + filename print "Performing SPC" microscope.MicroscopeSetMode(2) # Laser Scanning spc.ClearBoardMemory() spc.AcquireAndSaveToFileUsingUIValues(1, path) microscope.MicroscopeSetMode(0) # FLuorescence filename = microscope.ParseSequenceFilename(output[1], position) path = output[0] + filename microscope.SnapAndSaveImage(path)
def OnCycleStart(): global current_cube_index, camera_acq current_cube_index = 0 print "Fluorescence Mode" microscope.MicroscopeSetMode(0) # FLuorescence camera_acq = 1 # do the widefield camera images now for cube in cubes: print "Moving to cube position ", cube microscope.MoveCubeToPosition(cube) print "Setting camera exposure to ", exposures[current_cube_index] microscope.SetExposure(exposures[current_cube_index]) microscope.VisitPoints() current_cube_index = current_cube_index + 1 print "Laser Scanning Mode" camera_acq = 0 # do the flim images now microscope.MicroscopeSetMode(2) # Laser Scanning microscope.VisitPoints()
import microscope import time try: print help(microscope.MicroscopeSetMode) print "Setting microscope to mode FLUORESCENCE_MODE" microscope.MicroscopeSetMode(FLUORESCENCE_MODE) time.sleep(2) print "Setting microscope to mode BRIGHT_FIELD_MODE" microscope.MicroscopeSetMode(BRIGHT_FIELD_MODE) except: print "Could not change mode"