예제 #1
0
    def _createNewTabs(self):
        logger.debug('Creating tabs')
        self.adding_panes = True
        self.mdp = MetadataTree.MetadataPanel(self, self.pipeline.mdh, editable=False)
        self.AddPage(self.mdp, caption='Metadata', select=False, update=False)
        
        #print 'cp'        
        if 'gFrac' in self.pipeline.filter.keys():
            self.colp = colourPanel.colourPanel(self, self.pipeline, self)
            self.AddPage(self.colp, caption='Colour', select=False, update=False)
            
        #print 'ev'
        if not self.pipeline.events is None:
            #self.elv = eventLogViewer.eventLogPanel(self, self.pipeline.events,
            #                                            self.pipeline.mdh,
            #                                            [0, self.pipeline.selectedDataSource['tIndex'].max()])

            st = min(self.pipeline.events['Time'].min() - self.pipeline.mdh['StartTime'], 0)
            et = 1.1*self.pipeline.selectedDataSource['tIndex'].max()*self.pipeline.mdh['Camera.CycleTime']
            print(st, et)
            
            self.elv = eventLogViewer.eventLogTPanel(self, self.pipeline.events,self.pipeline.mdh,[st, et])
    
            self.elv.SetCharts(self.pipeline.eventCharts)
            
            self.AddPage(self.elv, caption='Events', select=False, update=False)
            self.elv.activate() #turn painting on now to avoid a paint when we create

        logger.debug('Finished creating tabs')
        self.adding_panes = False
        self._mgr.Update()
예제 #2
0
def Plug(dsviewer):
    image = dsviewer.image
    if 'events' in dir(image) and len(image.events) > 0:
        st = min(image.events['Time'].min() - image.mdh['StartTime'], 0)
        stt = image.mdh.getEntry('StartTime')
        if 'EndTime' in image.mdh.getEntryNames():
            et = image.mdh.getEntry('EndTime')
        else:
            et = piecewiseMapping.frames_to_times(image.data.getNumSlices(),
                                                  image.events, image.mdh)
        dsviewer.elv = eventLogViewer.eventLogTPanel(dsviewer,
                                                     image.events,
                                                     image.mdh, [st, et - stt],
                                                     activate=True)
        dsviewer.AddPage(dsviewer.elv, False, 'Events')

        charts = []

        if b'ProtocolFocus' in dsviewer.elv.evKeyNames:
            dsviewer.zm = piecewiseMapping.GeneratePMFromEventList(
                dsviewer.elv.eventSource, image.mdh,
                image.mdh.getEntry('StartTime'),
                image.mdh.getEntry('Protocol.PiezoStartPos'))
            charts.append(('Focus [um]', dsviewer.zm, b'ProtocolFocus'))

        if b'ScannerXPos' in dsviewer.elv.evKeyNames:
            x0 = 0
            if 'Positioning.Stage_X' in image.mdh.getEntryNames():
                x0 = image.mdh.getEntry('Positioning.Stage_X')
            dsviewer.xm = piecewiseMapping.GeneratePMFromEventList(
                dsviewer.elv.eventSource, image.mdh,
                image.mdh.getEntry('StartTime'), x0, b'ScannerXPos', 0)
            charts.append(('XPos [um]', dsviewer.xm, b'ScannerXPos'))

        if b'ScannerYPos' in dsviewer.elv.evKeyNames:
            y0 = 0
            if 'Positioning.Stage_Y' in image.mdh.getEntryNames():
                y0 = image.mdh.getEntry('Positioning.Stage_Y')
            dsviewer.ym = piecewiseMapping.GeneratePMFromEventList(
                dsviewer.elv.eventSource, image.mdh,
                image.mdh.getEntry('StartTime'), y0, b'ScannerYPos', 0)
            charts.append(('YPos [um]', dsviewer.ym, b'ScannerYPos'))

        if b'ScannerZPos' in dsviewer.elv.evKeyNames:
            z0 = 0
            if 'Positioning.PIFoc' in image.mdh.getEntryNames():
                z0 = image.mdh.getEntry('Positioning.PIFoc')
            dsviewer.zm = piecewiseMapping.GeneratePMFromEventList(
                dsviewer.elv.eventSource, image.mdh,
                image.mdh.getEntry('StartTime'), z0, b'ScannerZPos', 0)
            charts.append(('ZPos [um]', dsviewer.zm, b'ScannerZPos'))

        dsviewer.elv.SetCharts(charts)

        dsviewer.updateHooks.append(Update)
예제 #3
0
def Plug(dsviewer):
    image = dsviewer.image
    if "events" in dir(image) and len(image.events) > 0:
        st = image.mdh.getEntry("StartTime")
        if "EndTime" in image.mdh.getEntryNames():
            et = image.mdh.getEntry("EndTime")
        else:
            et = piecewiseMapping.framesToTime(image.data.getNumSlices(), image.events, image.mdh)
        dsviewer.elv = eventLogViewer.eventLogTPanel(dsviewer, image.events, image.mdh, [0, et - st])
        dsviewer.AddPage(dsviewer.elv, False, "Events")

        charts = []

        if "ProtocolFocus" in dsviewer.elv.evKeyNames:
            dsviewer.zm = piecewiseMapping.GeneratePMFromEventList(
                dsviewer.elv.eventSource,
                image.mdh,
                image.mdh.getEntry("StartTime"),
                image.mdh.getEntry("Protocol.PiezoStartPos"),
            )
            charts.append(("Focus [um]", dsviewer.zm, "ProtocolFocus"))

        if "ScannerXPos" in dsviewer.elv.evKeyNames:
            x0 = 0
            if "Positioning.Stage_X" in image.mdh.getEntryNames():
                x0 = image.mdh.getEntry("Positioning.Stage_X")
            dsviewer.xm = piecewiseMapping.GeneratePMFromEventList(
                dsviewer.elv.eventSource, image.mdh, image.mdh.getEntry("StartTime"), x0, "ScannerXPos", 0
            )
            charts.append(("XPos [um]", dsviewer.xm, "ScannerXPos"))

        if "ScannerYPos" in dsviewer.elv.evKeyNames:
            y0 = 0
            if "Positioning.Stage_Y" in image.mdh.getEntryNames():
                y0 = image.mdh.getEntry("Positioning.Stage_Y")
            dsviewer.ym = piecewiseMapping.GeneratePMFromEventList(
                dsviewer.elv.eventSource, image.mdh, image.mdh.getEntry("StartTime"), y0, "ScannerYPos", 0
            )
            charts.append(("YPos [um]", dsviewer.ym, "ScannerYPos"))

        if "ScannerZPos" in dsviewer.elv.evKeyNames:
            z0 = 0
            if "Positioning.PIFoc" in image.mdh.getEntryNames():
                z0 = image.mdh.getEntry("Positioning.PIFoc")
            dsviewer.zm = piecewiseMapping.GeneratePMFromEventList(
                dsviewer.elv.eventSource, image.mdh, image.mdh.getEntry("StartTime"), z0, "ScannerZPos", 0
            )
            charts.append(("ZPos [um]", dsviewer.zm, "ScannerZPos"))

        dsviewer.elv.SetCharts(charts)

        dsviewer.updateHooks.append(Update)