def createChimeraScript(self, scriptFile, fnResVol, fnOrigMap, sampRate, numColors=13, lowResLimit=None, highResLimit=None, showAxis=True): imageFile = os.path.abspath(fnResVol) _, minRes, maxRes, voldim = self.getImgData(imageFile) # Narrow the color range to the highest resolution range if lowResLimit is None: lowResLimit = min(maxRes, minRes + 5) if highResLimit is None: highResLimit = minRes stepColors = splitRange(highResLimit, lowResLimit, splitNum=numColors) colorList = plotter.getHexColorList(len(stepColors), self._getColorName()) fnVol = os.path.abspath(fnOrigMap) mapVolsWithColorkey(fnVol, imageFile, stepColors, colorList, voldim, volOrigin=None, step=-1, sampling=sampRate, scriptFileName=scriptFile, bgColorImage='white', showAxis=showAxis)
def _drawPalette(self): """ Draws the palette using current values: palette, highest, lowest and intervals""" # clean first for widget in self.palette.winfo_children(): widget.destroy() # get the colors colorList = getHexColorList(self.getIntervals(), colorName=self.getColorPalette()) # Get the label values labelValues = splitRange(self.getLowest(), self.getHighest(), self.getIntervals()) # Draw it count = 0 for color, value in zip(colorList, labelValues): self._drawLabel(color, value, count) count = count + 1
def getColors(self): low, high = self.getValuesRange() stepColors = splitRange(high, low, splitNum=self.intervals.get()) colorList = plotter.getHexColorList(len(stepColors), self.colorMap.get()) return stepColors, colorList