Ejemplo n.º 1
0
    def draw_image(self, **kwargs):
        img_assembly = super(ExtendedImgCv, self).draw_image(**kwargs)

        #   draw grid -------------------------------------------------------
        self.set_grid_bboxes(np.asarray(self._img_draw))
        if self._grid_flag:
            img_assembly = imgtools.draw_box(img_assembly, [],
                                             self.get_grid_bboxes(),
                                             color=self._grid_color,
                                             dtype=np.int16)

        #   draw selection --------------------------------------------------
        for selection in self._selection.keys():
            if self._selection[selection]:
                img_assembly = imgtools.draw_box(img_assembly, [],
                                                 self.get_selection(selection),
                                                 self._selection_color,
                                                 dtype=np.int16)

        #   consider alpha channel
        if self._channel_flag:
            self._img_draw = Image.fromarray(
                imgtools.stack_image_dim(
                    np.asarray(self._img_draw)[..., self._idx_channel()]))

        return img_assembly
Ejemplo n.º 2
0
    def add_intensity(self, intensitymap, **kwargs):
        if not len(intensitymap):
            return

        intensitymap = imgtools.stack_image_dim(intensitymap)

        self._height.update(
            {'intensity': intensitymap[:, :, 1].reshape(self._num_points).T})
Ejemplo n.º 3
0
    def add_color(self, colormap, **kwargs):
        if not len(colormap):
            return
            
        colormap = imgtools.stack_image_dim(colormap)

        self._height.update({
                "red": colormap[:,:,0].reshape(self._num_points).T, 
                "green": colormap[:,:,1].reshape(self._num_points).T, 
                "blue": colormap[:,:,2].reshape(self._num_points).T
            }
        )