

def getTile(self, webargs):
    'Either fetch the file from mocpcache or load a new region into mocpcache by cutout'
    (self.token, tileszstr, self.channel, resstr, xtilestr, ytilestr, zslicestr, color, brightnessstr, rest) = webargs.split('/', 9)
    self.loadDB()
    with closing(ocpcaproj.OCPCAProjectsDB()) as projdb:
        self.proj = projdb.loadProject(self.token)
    with closing(ocpcadb.OCPCADB(self.proj)) as self.db:
        xtile = int(xtilestr)
        ytile = int(ytilestr)
        res = int(resstr)
        zslice = (int(zslicestr) - self.proj.datasetcfg.slicerange[0])
        self.tilesz = int(tileszstr)
        brightness = float(brightnessstr)
        mckey = self.buildKey(res, xtile, ytile, zslice, color, brightness)
        tile = self.mc.get(mckey)
        if (tile != None):
            fobj = cStringIO.StringIO(tile)
        else:
            img = self.cacheMiss(res, xtile, ytile, zslice, color, brightness)
            fobj = cStringIO.StringIO()
            img.save(fobj, 'PNG')
            self.mc.set(mckey, fobj.getvalue())
        fobj.seek(0)
        return fobj

dataset/ETHPy150Open neurodata/ndstore/django/catmaid/deprecated/colorcatmaid.py ColorCatmaid.getTile/original