def set_default(self, instance): """Make a copy of the default value """ value = self.klass() if self._default is not None: update_dataset(value, self._default) self.__set__(instance, value)
def properties_changed(self): """The properties 'Apply' button was clicked: updating image""" row = self.imagelist.currentRow() image = self.images[row] update_dataset(image, self.properties.dataset) self.refresh_list() self.show_data(image.data)
def set_item_parameters(self, itemparams): update_dataset(self.labelparam, itemparams.get("LegendParam"), visible_only=True) self.labelparam.update_label(self) if self.selected: self.select()
def set_item_parameters(self, itemparams): self.shape.set_item_parameters(itemparams) self.label.set_item_parameters(itemparams) update_dataset(self.annotationparam, itemparams.get("AnnotationParam"), visible_only=True) self.annotationparam.update_annotation(self)
def set_item_parameters(self, itemparams): """Set the item parameters, required for the GUI display of the measurement parameters.""" update_dataset(self.measurement, itemparams.get("MeasurementParameter"), visible_only=True) ImageItem.set_item_parameters(self, itemparams)
def properties_changed(self): """The properties 'Apply' button was clicked: updating image""" row = self.csvlist.currentRow() csvdata = self.csvmodel.csv[row] update_dataset(csvdata, self.properties.dataset) self.csvmodel.csvName[row] = csvdata.title self.refresh_list()
def curve_properties_changed(self): """The properties 'Apply' button was clicked: updating line plot""" row = self.lineList.currentRow() line = self.lines[row] update_dataset(line, self.curveProperties.dataset) self.refresh_list() self.show_data(line)
def current_item_changed(self, row): """Line list: current line changed""" line = self.lines[row] peaks = self.peaks[row] self.show_peaks(peaks) self.show_data(line) update_dataset(self.curveProperties.dataset, line) self.curveProperties.get()
def properties_changed(self): update_dataset(self.fsel, self.fit_t.dataset) self.fitc = self.data_ref.get_fit(self.fsel.fittype, self.median, self.fsel.k, self.fsel.s, self.fsel.deg, self.begin, self.end, self.flag) self.show_data(self.median[0], self.median[1], self.flag, self.fitc[0], self.fitc[1], self.fitc[3])
def array_properties_changed(self): """The properties 'Apply' button was clicked: updating image""" print("apply button click") row = self.arraylist.currentRow() arraydata = self.csvmodel.array[row] update_dataset(arraydata, self.arrayproperties.dataset) self.csvmodel.arrayName[row] = arraydata.title self.refresh_array_list()
def edit_param(self, parent): update_dataset(self.dataset, self) if self.dataset.edit(parent=parent): restore_dataset(self.dataset, self) if self.value > self.max: self.max = self.value if self.value < self.min: self.min = self.value self.update()
def get_dataset(self): """update's internal parameter representation from the item's stored value default behavior uses update_dataset and assumes internal dataset class is the same as item's value class""" item = self.item.get() update_dataset(self.dataset, item)
def edit_param(self, parent): update_dataset(self.dataset, self) if self.dataset.edit(parent=parent): restore_dataset(self.dataset, self) if self.value > self.max: self.max = self.value if self.value < self.min: self.min = self.value self.update(True)
def open_image(self, filename): """Opening image *filename*""" self.data = io.imread(filename, to_grayscale=True) self.show_data(self.data) param = ImageParam() param.title = filename param.height, param.width = self.data.shape update_dataset(self.param_gbox.dataset, param) self.param_gbox.get() self.filter_gbox.setEnabled(True)
def current_item_changed(self, row): self.image = self.images[row] med = self.data_ref.get_median_data([row], self.dssel.section, self.dssel.polar, [self.image.rangei], [self.image.ranges], [self.image.excluded]) self.image.x = med[0] self.image.y = med[1] self.show_data(self.image.x, self.image.y, self.data_ref.flag) update_dataset(self.properties.dataset, self.image) self.properties.get() self.update_info()
def properties_changed(self): row = self.imagelist.currentRow() image = self.images[row] try: image.x except: pass else: if ((self.properties.dataset.franges != 0 and self.properties.dataset.franges < len(image.x) and self.properties.dataset.frangei < self.properties.dataset.franges) or (self.properties.dataset.franges == 0 and self.properties.dataset.frangei < len(image.x))): pass else: msgBox = QMessageBox() msgBox.setText( "Fit range void or out of bound! Range max 0:%s" % (len(image.x) - 1)) msgBox.exec_() return -1 update_dataset(image, self.properties.dataset) #self.dssel.section = self.data_ref.list2choices(self.data_ref.sections[int(self.ds.dataset.feed)]) csections.set( self.data_ref.list2choices(self.data_ref.sections[int( self.ds.dataset.feed)])) update_dataset(self.dssel, self.ds.dataset) self.update_info() if self.flagname: self.data_ref.flag = self.data_ref.get_flag_curve( self.flagname, self.dssel.section) #for i in self.images: # i.otype = image.otype if image.rall == True: for i in self.images: i.rangei = image.rangei i.ranges = image.ranges if image.eall == True: for i in self.images: i.excluded = image.excluded for i in self.images: i.frangei = image.frangei i.franges = image.franges try: self.show_data(image.x, image.y, self.data_ref.flag) except: pass
def test_update(self): e1 = Parameters() e2 = Parameters() e1.float1 = 23 update_dataset(e2, e1) self.assertEquals(e2.float1, 23)
def test_update(self): e1 = Parameters() e2 = Parameters() e1.float1 = 23 update_dataset(e2, e1) self.assertEquals( e2.float1, 23 )
def set_item_parameters(self, itemparams): update_dataset(self.histparam, itemparams.get("HistogramParam"), visible_only=True) self.histparam.update_hist(self) CurveItem.set_item_parameters(self, itemparams)
def array_current_item_changed(self, row): """Image list: current image changed""" #csvdata, csvname = self.csvmodel.csvData[row], self.csvmodel.csvName[row] update_dataset(self.arrayproperties.dataset, self.csvmodel.array[row]) self.arrayproperties.get()
def current_item_changed(self, row): """Image list: current image changed""" image, lut_range = self.images[row], self.lut_ranges[row] self.show_data(image.data, lut_range) update_dataset(self.properties.dataset, image) self.properties.get()