@property
    def raw(self):
        from matplotlib import colors, cm, pyplot as plt
        import glob, os
        # Get colormap from matplotlib or pycortex colormaps
        ## -- redundant code, here and in cortex/quicklflat.py -- ##
        if isinstance(self.cmap,(str,unicode)):
            if not self.cmap in cm.__dict__:
                # unknown colormap, test whether it's in pycortex colormaps
                cmapdir = options.config.get('webgl', 'colormaps')
                colormaps = glob.glob(os.path.join(cmapdir, "*.png"))
                colormaps = dict(((os.path.split(c)[1][:-4],c) for c in colormaps))
                if not self.cmap in colormaps:
                    raise Exception('Unkown color map!')
                I = plt.imread(colormaps[self.cmap])
                cmap = colors.ListedColormap(np.squeeze(I))
                # Register colormap while we're at it
                cm.register_cmap(self.cmap,cmap)
            else:
                cmap = cm.get_cmap(self.cmap)
        elif isinstance(self.cmap,colors.Colormap):
            cmap = self.cmap
        # Normalize colors according to vmin, vmax
        norm = colors.Normalize(self.vmin, self.vmax) 
        cmapper = cm.ScalarMappable(norm=norm, cmap=cmap)
        color_data = cmapper.to_rgba(self.data.flatten()).reshape(self.data.shape+(4,))
        # rollaxis puts the last color dimension first, to allow output of separate channels: r,g,b,a = dataset.raw
        return np.rollaxis(color_data, -1)
dataset/ETHPy150Open gallantlab/pycortex/cortex/dataset/views.py/Dataview.raw/original