Example #1
0
    def set_pixmap_from_arr(self, arr, set_def=True):
        """Input array is scailed by color table. If color table is None arr set as is.
        """
        self.arr = arr
        anorm = arr if self.coltab is None else\
                ct.apply_color_table(arr, ctable=self.coltab)
        h, w = arr.shape

        image = QImage(anorm, w, h, QImage.Format_ARGB32)
        pixmap = QPixmap.fromImage(image)
        self.add_pixmap_to_scene(pixmap)

        if set_def:
            rs = QRectF(0, 0, w, h)
            self.set_rect_scene(rs, set_def)
Example #2
0
    def set_pixmap_from_arr(self,
                            arr,
                            set_def=True,
                            amin=None,
                            amax=None,
                            frmin=0.01,
                            frmax=0.99):
        """Input array is scailed by color table. If color table is None arr set as is.
        """
        self.arr = arr
        anorm = arr if self.coltab is None else\
                ct.apply_color_table(arr, ctable=self.coltab, amin=amin, amax=amax, frmin=frmin, frmax=frmax)
        h, w = arr.shape

        image = QImage(anorm, w, h, QImage.Format_ARGB32)
        pixmap = QPixmap.fromImage(image)
        self.add_pixmap_to_scene(pixmap)

        if set_def:
            rs = QRectF(0, 0, w, h)
            self.set_rect_scene(rs, set_def)

        self.image_pixmap_changed.emit()