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 OnNewPoint(x, y, z, position): global current_cube_index global aborted z_centre = z + focus_offsets[current_cube_index] dir = output[0] + 'Point' + str(position) if not os.path.exists(dir): os.mkdir(dir) for z_current_step in range(-z_images_below, z_images_above + 1): # +1 ensures the last point is aquired if aborted: break z_current = z_centre + z_step * z_current_step print "Capturing image at (z = ", str(z_current), ")" microscope.SetStagePosition(x, y, z_current) microscope.WaitForStage(0.0, 1.0) filename = microscope.ParseSequenceFilename(output[1], position) zpos = '%(#)02d' % {"#": (z_current_step + z_images_below)} filename = microscope.InsertTextIntoFilename(filename, "z" + zpos) filename = microscope.InsertCubeIntoFilename(filename, cubes[current_cube_index]) path = dir + os.sep + filename microscope.SnapAndSaveImage(path)
def OnNewPoint(x, y, z, position): microscope.SetStagePosition(x, y, z) # 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 microscope.SnapAndSaveImage(path)
def OnNewPoint(x, y, z, position): global current_cube_index microscope.SetStagePosition(x, y, z + focus_offsets[current_cube_index]) # 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 microscope.SnapAndSaveImage(path)
def OnNewPoint(x, y, z, position): global current_cube_index, camera_acq microscope.SetStagePosition(x, y, z + focus_offsets[current_cube_index]) # 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 if camera_acq == 1: print "Camera image: ", position microscope.SnapAndSaveImage(path) else: print "Performing SPC: ", position spc.ClearBoardMemory() spc.AcquireAndSaveToFileUsingUIValues(1, path)
def OnNewPoint(x, y, z, position): microscope.MoveOpticalPathToPosition(2) microscope.MoveCubeToPosition(1) microscope.WaitForCube(0.0, 10.0) # print "Moving Stage ", (x, y, z) microscope.SetStagePosition(x, y, z) # 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 AutoFocus" #microscope.PerformSoftwareAutoFocus(path) #microscope.SnapAndSaveImage(path) microscope.MoveOpticalPathToPosition(4) microscope.MoveCubeToPosition(2) microscope.WaitForCube(0.0, 10.0) print "Performing SPC" microscope.StartSPC(path)
def OnNewPoint(x, y, z, position): # print "Moving Stage ", (x, y, z) microscope.SetStagePosition(x, y, z) # 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 microscope.PerformSoftwareAutoFocus(path) microscope.SnapAndSaveImage(path) #mrowley - 081209 - recording the software auto focus determined focal point for the given well xf, yf, zf = microscope.GetStagePosition() filenameautopts = 'AutoFocusedPlane.pts' path = output[0] + filenameautopts fileautopts = open(path, 'a') fileautopts.write('%.2f' %xf + '\t' + '%.2f' %yf + '\t' + '%.2f' %zf + '\n') fileautopts.close()
def OnNewPoint(x, y, z, position): global aborted, cube, offset print "Point: ", position if aborted: pass 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 and save ", path microscope.SnapAndSaveImage(path)