def imsave(filename, img): # we can add support for other than 3D uint8 here... img = prepare_for_display(img) qimg = QImage(img.data, img.shape[1], img.shape[0], img.strides[0], QImage.Format_RGB888) saved = qimg.save(filename) if not saved: from textwrap import dedent msg = dedent('''The image was not saved. Allowable file formats for the QT imsave plugin are: BMP, JPG, JPEG, PNG, PPM, TIFF, XBM, XPM''') raise RuntimeError(msg)
def imsave(filename, img): # we can add support for other than 3D uint8 here... img = prepare_for_display(img) qimg = QImage(img.data, img.shape[1], img.shape[0], img.strides[0], QImage.Format_RGB888) saved = qimg.save(filename) if not saved: from textwrap import dedent msg = dedent( '''The image was not saved. Allowable file formats for the QT imsave plugin are: BMP, JPG, JPEG, PNG, PPM, TIFF, XBM, XPM''') raise RuntimeError(msg)
def imshow(arr, fancy=False): global app if not app: app = QApplication([]) arr = prepare_for_display(arr) if not fancy: iw = ImageWindow(arr, window_manager) else: from scivi import SciviImageWindow iw = SciviImageWindow(arr, window_manager) iw.show()
def imshow(arr): arr = prepare_for_display(arr) iw = ImageWindow(arr, window_manager) iw.show()
def update_image(self): arr = prepare_for_display(self.image_data[self.counter])