def set_image_data(self, arr, set_hlims=False): '''Sets new image data array: ''' log.info('%s.set_image_data' % self._name) if arr is None: log.warning('%s.set_image_data: data array is None' % (self._name)) return self.wimg.set_pixmap_from_arr(arr) self.set_spectral_data(arr, set_hlims=set_hlims)
def on_but_calib(self, cdir): w = self.w_calib if str(cdir).rsplit('/',1)[1] != 'calib' : log.warning('NOT A calib DIRECTORY: %s'%(cdir), self._name) w.edi.setStyleSheet(style.styleButtonBad) w.but.setStyleSheet(style.styleButtonGood) return w.edi.setStyleSheet(style.styleWhiteFixed) w.but.setStyleSheet(style.styleButton) par = self.calib_dir par.setValue(cdir)
def get_image_array(self): import expmon.PSUtils as psu ifname = cp.fname_img.value() arr = psu.get_image_array_from_file(ifname) if arr is None: log.warning( '%s Can not get image from file: %s Substitute simulated image' % (self._name, ifname)) arr = image_with_random_peaks((1000, 1000)) log.info('Image array shape: %s' % str(arr.shape)) return arr
def on_but_fname(self, fname): w = self.w_fname print '%s.%s: fname=%s' % (self._name, sys._getframe().f_code.co_name, fname) if not os.path.exists(fname) : log.warning('DOES NOT EXIST: %s'%(fname), self._name) w.edi.setStyleSheet(style.styleButtonBad) w.but.setStyleSheet(style.styleButtonGood) return w.edi.setStyleSheet(style.styleWhiteFixed) w.but.setStyleSheet(style.styleButton) par = self.fname_img #if fname != par.value() : # self.emit(QtCore.SIGNAL('new_image_file_name_is_selected(QString)'), fname) # #w.edi.setText(par.value()) par.setValue(fname)