def _itemSelected(self, obj): index = obj.getIndex() filename = obj.getFileName() if index: filename = "%03d@%s" % (index, filename) # self.image = xmipp.Image() self.image = ImageHandler()._img try: self.image.readPreview(filename, self.dim) if filename.endswith('.psd'): self.image.convertPSD() self.Z = self.image.getData() except Exception, e: from pyworkflow.gui.matplotlib_image import getPngData self.Z = getPngData(findResource('no-image.png')) dialog.showError("Input particles", "Error reading image <%s>" % filename, self)
def _itemSelected(self, obj): index = obj.getIndex() filename = emlib.image.ImageHandler.fixXmippVolumeFileName(obj) if index: filename = "%03d@%s" % (index, filename) self.image = emlib.image.ImageHandler()._img try: self.image.readPreview(filename, self.dim) if filename.endswith('.psd'): self.image.convertPSD() self.Z = self.image.getData() except Exception as e: from pyworkflow.gui.matplotlib_image import getPngData self.Z = getPngData(pw.findResource('no-image.gif')) dialog.showError("Input particles", "Error reading image <%s>" % filename, self) self.preview.updateData(self.Z)