def pushImagesDS(self, image): resultsFilename = _verifyResultsFilename( genResultFileName(image.seriesName)) self.queueName = resultsFilename debugPrint('Results file = %s' % resultsFilename) self.resultsMdh = MetaDataHandler.NestedClassMDHandler( self.analysisMDH) self.resultsMdh['DataFileID'] = fileID.genDataSourceID( image.dataSource) mn = image.dataSource.moduleName #dsID = self.image.seriesName #if it's a buffered source, go back to underlying source if mn == 'BufferedDataSource': mn = image.dataSource.dataSource.moduleName self.tq.createQueue('DSTaskQueue', self.queueName, self.resultsMdh, mn, image.seriesName, resultsFilename, startAt=self.analysisMDH['Analysis.StartAt']) evts = image.dataSource.getEvents() if len(evts) > 0: self.tq.addQueueEvents(self.queueName, evts) debugPrint('Queue created') self.onImagesPushed.send(self)
def pushImagesHDF(self, image): dataFilename = image.seriesName resultsFilename = _verifyResultsFilename( genResultFileName(image.seriesName)) self.queueName = resultsFilename self.tq.createQueue('HDFTaskQueue', self.queueName, dataFilename=dataFilename, resultsFilename=resultsFilename, startAt='notYet') mdhQ = MetaDataHandler.QueueMDHandler(self.tq, self.queueName, self.analysisMDH) mdhQ['DataFileID'] = fileID.genDataSourceID(image.dataSource) # evts = self.image.dataSource.getEvents() # if len(evts) > 0: # self.tq.addQueueEvents(self.image.seriesName, evts) self.resultsMdh = mdhQ self.tq.releaseTasks(self.queueName, self.analysisMDH['Analysis.StartAt']) self.onImagesPushed.send(self)
def pushImagesHDF(startingAt=0, detThresh=.9, fitFcn='LatGaussFitFR'): global seriesName dataFilename = seriesName resultsFilename = genResultFileName(seriesName) while os.path.exists(resultsFilename): di, fn = os.path.split(resultsFilename) fdialog = wx.FileDialog( None, 'Analysis file already exists, please select a new filename', wildcard='H5R files|*.h5r', defaultDir=di, defaultFile=os.path.splitext(fn)[0] + '_1.h5r', style=wx.FD_SAVE) succ = fdialog.ShowModal() if (succ == wx.ID_OK): resultsFilename = fdialog.GetPath() else: raise RuntimeError('Invalid results file - not running') seriesName = resultsFilename tq.createQueue('HDFTaskQueue', seriesName, dataFilename=dataFilename, resultsFilename=resultsFilename, startAt='notYet') mdhQ = MetaDataHandler.QueueMDHandler(tq, seriesName, mdh) mdhQ.setEntry('Analysis.DetectionThreshold', detThresh) mdhQ.setEntry('Analysis.FitModule', fitFcn) mdhQ.setEntry('Analysis.DataFileID', fileID.genDataSourceID(dataSource)) evts = dataSource.getEvents() if len(evts) > 0: tq.addQueueEvents(seriesName, evts) tq.releaseTasks(seriesName, startingAt)
def pushImagesQueue(self, image): image.mdh.copyEntriesFrom(self.analysisMDH) self.queueName = image.seriesName self.resultsMdh = image.mdh self.resultsMdh['DataFileID'] = fileID.genDataSourceID( image.dataSource) self.tq.releaseTasks(self.queueName, self.analysisMDH['Analysis.StartAt']) self.onImagesPushed.send(self)
def pushImagesCluster(self, image): from PYME.cluster import HTTPRulePusher resultsFilename = _verifyClusterResultsFilename( genClusterResultFileName(image.filename)) logging.debug('Results file: ' + resultsFilename) self.resultsMdh = MetaDataHandler.NestedClassMDHandler( self.analysisMDH) self.resultsMdh['DataFileID'] = fileID.genDataSourceID( image.dataSource) self.pusher = HTTPRulePusher.HTTPRulePusher( dataSourceID=image.filename, metadata=self.resultsMdh, resultsFilename=resultsFilename) self.queueName = self.pusher.queueID self.results_filename = resultsFilename debugPrint('Queue created') self.onImagesPushed.send(self)
def pushImagesQueue(startingAt=0, detThresh = .9, fitFcn='LatGaussFitFR'): mdh.setEntry('Analysis.DetectionThreshold', detThresh) mdh.setEntry('Analysis.FitModule', fitFcn) mdh.setEntry('Analysis.DataFileID', fileID.genDataSourceID(dataSource)) tq.releaseTasks(seriesName, startingAt)