Exemple #1
0
 def setColorMap(self, map=None):
   if not map:
     if not self._cm_colors.any():
       return
     pos = np.linspace(self.cm_min/float(self.data_max_int), self.cm_max/float(self.data_max_int), num=len(self._cm_colors))
     map = ColorMap(pos, self._cm_colors)
   self.getView().setBackgroundColor(map.map(0))
   lut = map.getLookupTable(0.0,1.0,self.data_max_int, alpha=False)
   self.getImageItem().setLookupTable(lut)
   self.getImageItem().setLevels([self.cm_min/float(self.data_max_int),float(self.data_max_int)])
Exemple #2
0
 def setColorMap(self, map=None):
     if not map:
         if not self._cm_colors.any():
             return
         pos = np.linspace(0.0, 1.0,
                           num=len(self._cm_colors))  # take default values
         map = ColorMap(pos, self._cm_colors)
     self.getView().setBackgroundColor(map.map(0))
     lut = map.getLookupTable(0.0, 1.0, self.data_max_int, alpha=False)
     self.getImageItem().setLookupTable(lut)
     self.getImageItem().setLevels([
         self.cm_min, float(self.data_max_int)
     ])  # set levels from min to max of image (may improve min here)
Exemple #3
0
    def setColorMap(self, cmap=None):
        """
        Update the image colormap.

        Parameters
        ----------
        cmap : ColorMap
        """
        if not cmap:
            if not self._cm_colors.any():
                return
            # Take default values
            pos = np.linspace(0.0, 1.0, num=len(self._cm_colors))
            cmap = ColorMap(pos, self._cm_colors)
        self.getView().setBackgroundColor(cmap.map(0))
        lut = cmap.getLookupTable(0.0, 1.0, alpha=False)
        self.getImageItem().setLookupTable(lut)
Exemple #4
0
    def setColorMap(self, cmap=None):
        """
        Update the image colormap.

        Parameters
        ----------
        cmap : ColorMap
        """
        if not cmap:
            if not self._cm_colors.any():
                return
            # Take default values
            pos = np.linspace(0.0, 1.0, num=len(self._cm_colors))
            cmap = ColorMap(pos, self._cm_colors)
        self.getView().setBackgroundColor(cmap.map(0))
        lut = cmap.getLookupTable(0.0, 1.0, alpha=False)
        self.getImageItem().setLookupTable(lut)
Exemple #5
0
    def setColorMap(self, cmap=None):
        """
        Update the image colormap

        Parameters
        ----------
        cmap : ColorMap
        """
        if self.data_max_int is None:
            return
        if not cmap:
            if not self._cm_colors.any():
                return
            pos = np.linspace(0.0, 1.0,
                              num=len(self._cm_colors))  # take default values
            cmap = ColorMap(pos, self._cm_colors)
        self.getView().setBackgroundColor(cmap.map(0))
        lut = cmap.getLookupTable(0.0, 1.0, self.data_max_int, alpha=False)
        self.getImageItem().setLookupTable(lut)
        self.getImageItem().setLevels([
            self.cm_min,
            float(min(self.cm_max, self.data_max_int))
        ])  # set levels from min to max of image (may improve min here)