예제 #1
0
 def _data_peak_load_roi_clicked(self):
     """
         Reached by the Load peak selection button
     """
     fname = self.data_browse_dialog(data_type="*.txt *.dat", title="Data peak selection - Choose a ROI file")
     if fname:
         #retrieved from and to pixels values
         myROI = LoadSNSRoi(filename=fname)
         mode = myROI.getMode()
         pixelRange = myROI.getPixelRange()
         self.peak_pixel_range = pixelRange
         
         if (mode == 'narrow/broad'):
             if self._summary.data_peak_discrete_switch.isChecked():
                QtGui.QMessageBox.warning(self, "Incompatibility of Formats!",
                                                   "Selection type and ROI file loaded do not match !")
             else:
                 from_pixel = pixelRange[0]
                 to_pixel = pixelRange[1]
                 self._summary.data_peak_from_pixel.setText(str(from_pixel))
                 self._summary.data_peak_to_pixel.setText(str(to_pixel))
                 self._summary.data_peak_nbr_selection_value.setText("N/A")
         else: #file loaded is a discrete ROI-------
             if self._summary.data_peak_discrete_switch.isChecked():
                 _txt = str(len(pixelRange)) + ' -> ' + myROI.retrieveFormatedDiscretePixelRange()
                 self._summary.data_peak_nbr_selection_value.setText(_txt)
             else:
                 self._summary.data_peak_nbr_selection_value.setText("N/A")
                 QtGui.QMessageBox.warning(self, "Incompatibility of Formats!",
                                               "Selection type and ROI file loaded do not match !")
         self._check_status_of_data_peak_save_button()
예제 #2
0
 def _data_background_load_roi_clicked(self):
     """
         Reached by the load background selection button
     """
     fname = self.data_browse_dialog(data_type="*.txt *.dat", title="Data background selection - Choose a ROI file")
     if fname:
         #retrieved from and to pixels values
         myROI = LoadSNSRoi(filename=fname)
         mode = myROI.getMode()
         pixelRange = myROI.getPixelRange()
         
         self.background_pixel_range = pixelRange
             
         if (mode == 'narrow/broad'):                
             from_pixel = pixelRange[0]
             to_pixel = pixelRange[1]
             self._summary.data_background_from_pixel1.setText(str(from_pixel))
             self._summary.data_background_to_pixel1.setText(str(to_pixel))
         else:
             _pixel_list = myROI.getPixelRange()
             if len(_pixel_list) == 2:
                 roi1_from = str(_pixel_list[0][0])
                 roi1_to = str(_pixel_list[0][1])
                 roi2_from = str(_pixel_list[1][0])
                 roi2_to = str(_pixel_list[1][1])
                 self._summary.data_background_from_pixel1.setText(str(roi1_from))
                 self._summary.data_background_to_pixel1.setText(str(roi1_to))
                 self._summary.data_background_from_pixel2.setText(str(roi2_from))
                 self._summary.data_background_to_pixel2.setText(str(roi2_to))
             else:
                 QtGui.QMessageBox.warning(self, "Wrong data background ROI file format!",
                                          "                         Please check the ROI file!")                  
     self._check_status_of_data_background_save_button()
예제 #3
0
 def _norm_background_roi_clicked(self):
     """
         Reached by the load background selection button
     """
     fname = self.data_browse_dialog(data_type="*.txt *.dat", title="Normalization background selection - Choose a ROI file")
     if fname:
         #retrieved from and to pixels values
         myROI = LoadSNSRoi(filename=fname)
         mode = myROI.getMode()
         pixelRange = myROI.getPixelRange()
             
         if (mode == 'narrow/broad'):                
             from_pixel = pixelRange[0]
             to_pixel = pixelRange[1]
             self._summary.norm_background_from_pixel.setText(str(from_pixel))
             self._summary.norm_background_to_pixel.setText(str(to_pixel))
         else:
             QtGui.QMessageBox.warning(self, "Wrong normalization background ROI file format!",
                                         "                                   Please check the ROI file!")