def update_preview2d(self): ''' Update the 2D image preview. ''' if len(self.data) == 0: # Hasn't been initialised yet self.data = path_to_array(self.path) self.update_dimensions() self.preview2D.plot_array(self.data, self.width, self.height)
def update_data(self): ''' Read path and update the data Trait ''' try: self.data = path_to_array(self.path) except IOError, e: dialog.error(None, "Invalid image file.")