def do_plot_3d(self): """ :return: """ # color: get R, G, B status, rgb_values = guiutility.parse_float_editors([self.ui.lineEdit_baseColorRed, self.ui.lineEdit_baseColorGreen, self.ui.lineEdit_baseColorBlue]) assert status # set the color to get change change_r = self.ui.checkBox_changeRed.isChecked() change_g = self.ui.checkBox_changeGreen.isChecked() change_b = self.ui.checkBox_changeBlue.isChecked() # get threshold status, thresholds = guiutility.parse_integers_editors([self.ui.lineEdit_countsThresholdLower, self.ui.lineEdit_countsThresholdUpper], allow_blank=True) assert status, thresholds if thresholds[0] is None: thresholds[0] = 0 if thresholds[1] is None: thresholds[1] = sys.maxsize assert 0 <= thresholds[0] < thresholds[1] # data key data_key = int(self.ui.comboBox_dataKey.currentText()) # plot self.plot_3d(data_key, rgb_values, thresholds, [change_r, change_g, change_b]) return
def do_plot_3d(self): """ :return: """ # color: get R, G, B status, rgb_values = guiutility.parse_float_editors([self.ui.lineEdit_baseColorRed, self.ui.lineEdit_baseColorGreen, self.ui.lineEdit_baseColorBlue]) assert status # set the color to get change change_r = self.ui.checkBox_changeRed.isChecked() change_g = self.ui.checkBox_changeGreen.isChecked() change_b = self.ui.checkBox_changeBlue.isChecked() # get threshold status, thresholds = guiutility.parse_integers_editors([self.ui.lineEdit_countsThresholdLower, self.ui.lineEdit_countsThresholdUpper], allow_blank=True) assert status, thresholds if thresholds[0] is None: thresholds[0] = 0 if thresholds[1] is None: thresholds[1] = sys.maxsize assert 0 <= thresholds[0] < thresholds[1] # data key data_key = int(self.ui.comboBox_dataKey.currentText()) # plot self.plot_3d(data_key, rgb_values, thresholds, [change_r, change_g, change_b]) return
def do_check_counts(self): """ Check the intensity and count how many data points are above threshold of specified data-key :return: """ # get threshold (upper and lower) status, ret_obj = guiutility.parse_integers_editors([self.ui.lineEdit_countsThresholdLower, self.ui.lineEdit_countsThresholdUpper], allow_blank=True) assert status, ret_obj threshold_lower, threshold_upper = ret_obj if threshold_lower is None: threshold_lower = 0 if threshold_upper is None: threshold_upper = sys.maxsize assert 0 <= threshold_lower < threshold_upper # get data key data_key = int(self.ui.comboBox_dataKey.currentText()) assert data_key in self._dataKeyList, 'Data key %d does not exist in ' \ 'key list %s.' % (data_key, str(self._dataKeyList)) # get intensity points, intensity_array = self.ui.graphicsView.get_data(data_key) assert points is not None num_within_threshold = 0 array_size = len(intensity_array) for index in range(array_size): if threshold_lower <= intensity_array[index] <= threshold_upper: num_within_threshold += 1 # END-FOR # set value self.ui.label_numberDataPoints.setText('%d' % num_within_threshold) return
def do_check_counts(self): """ Check the intensity and count how many data points are above threshold of specified data-key :return: """ # get threshold (upper and lower) status, ret_obj = guiutility.parse_integers_editors([self.ui.lineEdit_countsThresholdLower, self.ui.lineEdit_countsThresholdUpper], allow_blank=True) assert status, ret_obj threshold_lower, threshold_upper = ret_obj if threshold_lower is None: threshold_lower = 0 if threshold_upper is None: threshold_upper = sys.maxsize assert 0 <= threshold_lower < threshold_upper # get data key data_key = int(self.ui.comboBox_dataKey.currentText()) assert data_key in self._dataKeyList, 'Data key %d does not exist in ' \ 'key list %s.' % (data_key, str(self._dataKeyList)) # get intensity points, intensity_array = self.ui.graphicsView.get_data(data_key) assert points is not None num_within_threshold = 0 array_size = len(intensity_array) for index in range(array_size): if threshold_lower <= intensity_array[index] <= threshold_upper: num_within_threshold += 1 # END-FOR # set value self.ui.label_numberDataPoints.setText('%d' % num_within_threshold) return