示例#1
0
 def researchMosaicTileData(self):
     tilequery = leginondata.MosaicTileData(
         session=self.session, list=leginondata.ImageListData())
     mosaictiles = self.research(datainstance=tilequery)
     mosaiclists = ordereddict.OrderedDict()
     for tile in mosaictiles:
         list = tile['list']
         label = '(no label)'
         if list['targets'] is not None:
             if list['targets']['label']:
                 label = list['targets']['label']
         key = '%s:  %s' % (list.dbid, label)
         if key not in mosaiclists:
             mosaiclists[key] = []
         mosaiclists[key].append(tile)
     self.mosaicselectionmapping = mosaiclists
     return mosaiclists
	def __init__(self, id, session, managerlocation, **kwargs):

		targetwatcher.TargetWatcher.__init__(self, id, session, managerlocation, **kwargs)

		self.addEventInput(event.AcquisitionImagePublishEvent, self.handleDriftImage)
		self.addEventInput(event.DriftMonitorResultEvent, self.handleDriftResult)
		self.addEventInput(event.ImageProcessDoneEvent, self.handleImageProcessDone)
		self.addEventInput(event.MakeTargetListEvent, self.setGrid)
		self.driftdone = threading.Event()
		self.driftimagedone = threading.Event()
		self.instrument = instrument.Proxy(self.objectservice, self.session)

		self.calclients = ordereddict.OrderedDict()
		self.calclients['image shift'] = calibrationclient.ImageShiftCalibrationClient(self)
		self.calclients['stage position'] = calibrationclient.StageCalibrationClient(self)
		self.calclients['modeled stage position'] = calibrationclient.ModeledStageCalibrationClient(self)
		self.calclients['image beam shift'] = calibrationclient.ImageBeamShiftCalibrationClient(self)
		self.calclients['beam shift'] = calibrationclient.BeamShiftCalibrationClient(self)
		self.calclients['beam tilt'] = calibrationclient.BeamTiltCalibrationClient(self)

		self.presetsclient = presets.PresetsClient(self)
		self.navclient = navigator.NavigatorClient(self)
		self.doneevents = {}
		self.onTarget = False
		self.imagelistdata = None
		self.simloopstop = threading.Event()
		self.received_image_drift = threading.Event()
		self.requested_drift = None
		self.grid = None
		self.acq_counter = itertools.cycle(range(0,5))
		self.time0 = time.time()
		self.times = []
		self.intensities = []
		self.alignzlp_bound = False
		self.alignzlp_warned = False

		self.duplicatetypes = ['acquisition', 'focus']
		self.presetlocktypes = ['acquisition', 'target', 'target list']

		if debug:
			self.timedebug = {}

		self.start()
    def holeStatsTargets(self, holes):
        targets = []
        for hole in holes:

            mean = float(hole.stats['hole_mean'])
            tmean = self.icecalc.get_thickness(mean)
            std = float(hole.stats['hole_std'])
            tstd = self.icecalc.get_stdev_thickness(std, mean)

            target = {}
            target['x'] = hole.stats['center'][1]
            target['y'] = hole.stats['center'][0]
            target['stats'] = ordereddict.OrderedDict()
            target['stats']['Mean Intensity'] = mean
            target['stats']['Mean Thickness'] = tmean
            target['stats']['S.D. Intensity'] = std
            target['stats']['S.D. Thickness'] = tstd
            targets.append(target)
        return targets
示例#4
0
    def makeWellTargetsAndStats(self):
        '''
		Make targets to be set to gui.wx.TargetPanel.
		The targets in the list have information
		of the grid format raster and the plate well name coded in stats
		'''
        targets = []
        for spot_number in range(1, len(self.spottargets) + 1):
            spottarget = self.spottargets[spot_number]
            spot = spottarget['coord']
            spotmap = spottarget['map']
            target = {}
            target['x'] = spot[0]
            target['y'] = spot[1]
            target['stats'] = ordereddict.OrderedDict()
            target['stats']['Raster Col'] = spotmap['spot position']['col']
            target['stats']['Raster Row'] = spotmap['spot position']['row']
            target['stats']['Well Name'] = spotmap['name']
            targets.append(target)
        return targets
	def __init__(self, node, logger, threaded=True, queueclass=Queue.Queue, tcpport=None):
		self.logger = logger
		self.server = datatransport.Server(self, logger, tcpport=tcpport)
		self.node = node
		## this is a mapping of data class to function
		## using list instead of dict to preserve order, and also
		## because there may be more than one function for every 
		## data class
		self.threaded = threaded
		self.bindings = ordereddict.OrderedDict()
		self.remotecallobjects = {}

		## a queue to hold incoming data, and a thread
		## to process data from the queue
		self.exitedevent = threading.Event()
		self.queue = queueclass()
		t = threading.Thread(name='data binder queue thread',
													target=self.handlerLoop)
		#t.setDaemon(1)
		t.start()
        def __init__(self, id, session, managerlocation, **kwargs):
                node.Node.__init__(self, id, session, managerlocation, **kwargs)
                TargetTransformer.__init__(self)

                self.correlator = correlator.Correlator()
                self.peakfinder = peakfinder.PeakFinder()
                self.instrument = instrument.Proxy(self.objectservice, self.session,
                                                                                                                                                                self.panel)
                self.calclients = ordereddict.OrderedDict()
                self.calclients['image shift'] = calibrationclient.ImageShiftCalibrationClient(self)
                self.calclients['stage position'] = calibrationclient.StageCalibrationClient(self)
                self.calclients['modeled stage position'] = calibrationclient.ModeledStageCalibrationClient(self)
                self.calclients['image beam shift'] = calibrationclient.ImageBeamShiftCalibrationClient(self)
                self.calclients['beam shift'] = calibrationclient.BeamShiftCalibrationClient(self)
                self.pixsizeclient = calibrationclient.PixelSizeCalibrationClient(self)
                self.presetsclient = presets.PresetsClient(self)
                self.navclient = navigator.NavigatorClient(self)
                self.target_to_transform = None

                self.addEventInput(event.TransformTargetEvent, self.handleTransformTargetEvent)

                self.registrations = {
                        'correlation': transformregistration.CorrelationRegistration(self),
                }
                if not hide_incomplete:
                        self.registrations.update({
                                'keypoints': transformregistration.KeyPointsRegistration(self),
                                'logpolar': transformregistration.LogPolarRegistration(self),
                                'identity': transformregistration.IdentityRegistration(self),
                        })

                self.abortevent = threading.Event()
                self.player = player.Player(callback=self.onPlayer)
                self.panel.playerEvent(self.player.state())

                self.start()