コード例 #1
0
    def updateImage(self, dummy=None):

        if self._images is None:
            raise RuntimeError("No images set!")

        images = list()
        contours = dict()

        ccolor = AtConfig().contours_complementary_color

        for i, n in self.checkedChannels().iteritems():
            # converting the gray image to the color defined in the button
            color = self.widgetAt(i, 1).currentColor()
            image = self._images[i]
            lut = self.enhancer.lut_from_color(i, color, 256)
            image.setColorTable(lut)
            images.append(image)
            if self._contours is not None:
                if ccolor:
                    color = AtPainter.complementaryColor(color)
                contours[color] = self._contours[n]

        pixmap = AtPainter.blend(images)

        # sometimes qt segfaults when drawing polygons
        if AtConfig().draw_contours_in_pixmap:
            pixmap = AtPainter.drawContours(pixmap, contours)
            self.newContourImage.emit(pixmap, None)
        else:
            self.newContourImage.emit(pixmap, contours)
コード例 #2
0
ファイル: channelbar.py プロジェクト: manerotoni/afw
    def updateImage(self, dummy=None):

        if self._images is None:
            raise RuntimeError("No images set!")

        images = list()
        contours = dict()

        ccolor = AtConfig().contours_complementary_color

        for i, n in self.checkedChannels().iteritems():
            # converting the gray image to the color defined in the button
            color = self.widgetAt(i, 1).currentColor()
            image = self._images[i]
            lut = self.enhancer.lut_from_color(i, color, 256)
            image.setColorTable(lut)
            images.append(image)
            if self._contours is not None:
                if ccolor:
                    color = AtPainter.complementaryColor(color)
                contours[color] = self._contours[n]

        pixmap = AtPainter.blend(images)

        # sometimes qt segfaults when drawing polygons
        if AtConfig().draw_contours_in_pixmap:
            pixmap = AtPainter.drawContours(pixmap, contours)
            self.newContourImage.emit(pixmap, None)
        else:
            self.newContourImage.emit(pixmap, contours)
コード例 #3
0
ファイル: cellitem.py プロジェクト: rhoef/afw
    def enhancePixmap(self, index, lut):
        self.qimages[index].setColorTable(lut)

        qimages = [img for img, flag in zip(self.qimages, self._image_flags)
                   if flag]

        if not qimages:
            self._pixmap = QtGui.QPixmap(self.shape[0], self.shape[1])
            self._pixmap.fill(Colors.black)
        else:
            self._pixmap = AtPainter.blend(qimages)
        self._pixmapItem.setPixmap(self._pixmap)
コード例 #4
0
ファイル: channelbar.py プロジェクト: rhoef/afw
    def updateView(self, dummy=None):

        if self._images is None:
            raise RuntimeError("No images set!")

        images = list()
        contours = dict()
        ccolor = AtConfig().contours_complementary_color

        for i, n in self.checkedChannels().iteritems():
            # converting the gray image to the color defined in the button
            image = self._images[i]
            lut = self.lut_from_channel(i, 256)
            image.setColorTable(lut)
            images.append(image)
            if self._contours is not None:
                color = QtGui.QColor(self.colors[n])
                if ccolor:
                    color = AtPainter.complementaryColor(color)
                contours[color] = self._contours[n]

        pixmap = AtPainter.blend(images)
        self.newContourImage.emit(pixmap, contours)
コード例 #5
0
ファイル: readercore.py プロジェクト: rhoef/afw
 def pixmap(self):
     # XXX be aware of thread safety
     images = list(self.iterQImages())
     return AtPainter.blend(images)
コード例 #6
0
 def pixmap(self):
     # XXX be aware of thread safety
     images = list(self.iterQImages())
     return AtPainter.blend(images)
コード例 #7
0
ファイル: cellitem.py プロジェクト: manerotoni/afw
 def enhancePixmap(self, index, lut):
     self.qimages[index].setColorTable(lut)
     self._pixmap = AtPainter.blend(self.qimages)
     self._pixmapItem.setPixmap(self._pixmap)