コード例 #1
0
    def create_main_frame(self):
                # Load Qt UI from .ui file
        ui_loader = QtUiTools.QUiLoader()
        ui_file = QtCore.QFile("view_data.ui")
        ui_file.open(QtCore.QFile.ReadOnly); 
        self.ui = ui_loader.load(ui_file)
        ui_file.close()
        
        self.ui.setParent(self)

        
        #set up image
        pg.setConfigOptions(useWeave=False)
        self.imv = pg.ImageView()
#         self.vLine_1, self.hLine_1 = self.cross_hair(self.imv)
        self.square = self.make_dot(self.imv)
        
        self.imv.setMinimumSize(350, 350)
        plot_tools.plot_pyqt(self.imv,self.data , self.dataview)
        self.imv.scene.sigMouseClicked.connect(self.mouseMoved_image)
        self.imv.getView().setMouseEnabled(x=False, y=False)
        

        self.graph = self.setup_graph()
        
        self.ui.image.addWidget(self.imv)
        self.ui.graphs.addWidget(self.graph)
        
        self.set_slider_settings()

        self.connect_events()
        self.connect_shortcuts()
コード例 #2
0
    def create_main_frame(self):
        # Load Qt UI from .ui file
        ui_loader = QtUiTools.QUiLoader()
        ui_file = QtCore.QFile("view_data.ui")
        ui_file.open(QtCore.QFile.ReadOnly)
        self.ui = ui_loader.load(ui_file)
        ui_file.close()

        self.ui.setParent(self)

        #set up image
        pg.setConfigOptions(useWeave=False)
        self.imv = pg.ImageView()
        #         self.vLine_1, self.hLine_1 = self.cross_hair(self.imv)
        self.square = self.make_dot(self.imv)

        self.imv.setMinimumSize(350, 350)
        plot_tools.plot_pyqt(self.imv, self.data, self.dataview)
        self.imv.scene.sigMouseClicked.connect(self.mouseMoved_image)
        self.imv.getView().setMouseEnabled(x=False, y=False)

        self.graph = self.setup_graph()

        self.ui.image.addWidget(self.imv)
        self.ui.graphs.addWidget(self.graph)

        self.set_slider_settings()

        self.connect_events()
        self.connect_shortcuts()
コード例 #3
0
 def change_display(self):
     """
     changes the view between ev and wavelength
     """
     plot_tools.change_display_pyqt(self.p1, self.dataview)
     plot_tools.change_display_pyqt(self.p2, self.dataview)
     plot_tools.plot_pyqt(self.imv,self.data, self.dataview)                                       
     self.update_label() 
コード例 #4
0
 def change_display(self):
     """
     changes the view between ev and wavelength
     """
     plot_tools.change_display_pyqt(self.p1, self.dataview)
     plot_tools.change_display_pyqt(self.p2, self.dataview)
     plot_tools.plot_pyqt(self.imv, self.data, self.dataview)
     self.update_label()
コード例 #5
0
    def update_image_from_slider(self, sliderval):
        
        if self.dataview.display_ev:
            self.dataview.slider_val = sliderval-1
        else:
            self.dataview.slider_val = self.dataview.number_of_slices - sliderval           

        plot_tools.plot_pyqt(self.imv,self.data, self.dataview)
        self.update_control()
コード例 #6
0
    def update_image_from_slider(self, sliderval):

        if self.dataview.display_ev:
            self.dataview.slider_val = sliderval - 1
        else:
            self.dataview.slider_val = self.dataview.number_of_slices - sliderval

        plot_tools.plot_pyqt(self.imv, self.data, self.dataview)
        self.update_control()
コード例 #7
0
 def update_imageslice_from_control(self):
     """
     updates the imageslice from the input from the control panel. 
     the image displayed is the image with the first integer value
     of the input
     """
     try:
         slice_input = float(self.ui.imageslice.text())
     except Exception as e:
         print e
     index = analysis.get_index(slice_input, self.data, self.dataview)
     value = analysis.get_slider_value(index, self.dataview)
     self.ui.slider.setValue(value)
     plot_tools.plot_pyqt(self.imv, self.data, self.dataview)
コード例 #8
0
 def update_imageslice_from_control(self):
     """
     updates the imageslice from the input from the control panel. 
     the image displayed is the image with the first integer value
     of the input
     """
     try:
         slice_input = float(self.ui.imageslice.text())
     except Exception as e:
         print e
     index = analysis.get_index(slice_input,
                                self.data,
                                self.dataview)
     value = analysis.get_slider_value(index, self.dataview)
     self.ui.slider.setValue(value)
     plot_tools.plot_pyqt(self.imv,self.data, self.dataview)