How to use the ndlib.MortonXYZ function in ndlib

To help you get started, we’ve selected a few ndlib examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github neurodata / ndstore / spdb / s3io.py View on Github external
def generateSuperZindex(self, zidx, resolution):
    """Generate super zindex from a given zindex"""
    
    [[ximagesz, yimagesz, zimagesz], timerange] = self.db.proj.datasetcfg.imageSize(resolution)
    [xcubedim, ycubedim, zcubedim] = cubedim = self.db.proj.datasetcfg.getCubeDims()[resolution]
    [xoffset, yoffset, zoffset] = self.db.proj.datasetcfg.getOffset()[resolution]
    [xsupercubedim, ysupercubedim, zsupercubedim] = super_cubedim = self.db.proj.datasetcfg.getSuperCubeDims()[resolution]
    
    # super_cubedim = map(mul, cubedim, SUPERCUBESIZE)
    [x, y, z] = ndlib.MortonXYZ(zidx)
    corner = map(mul, ndlib.MortonXYZ(zidx), cubedim)
    [x,y,z] = map(div, corner, super_cubedim)
    # print zidx, corner, [x,y,z], ndlib.XYZMorton([x,y,z])
    return ndlib.XYZMorton([x,y,z])
github neurodata / ndstore / benchmarks / benchmark.py View on Github external
def generateURL2(zidx):
  [x,y,z] = MortonXYZ(zidx)
  p.args = (x*SIZE, (x+1)*SIZE, y*SIZE, (y+1)*SIZE, z*ZSIZE, (z+1)*ZSIZE)
  return 'http://{}/{}/{}/blosc/{}/{},{}/{},{}/{},{}/'.format(SITE_HOST, p.token, ','.join(p.channels), p.resolution, *p.args)
github neurodata / ndstore / benchmarks / benchmark.py View on Github external
def generateURL(zidx):
  """Run the Benchmark."""

  i = zidx
  [x,y,z] = MortonXYZ(i)
  p.args = (x*SIZE, (x+1)*SIZE, y*SIZE, (y+1)*SIZE, z*ZSIZE, (z+1)*ZSIZE)
  image_data = np.ones([1,ZSIZE,SIZE,SIZE], dtype=np.uint32) * random.randint(0,255)
  return postBlosc(p, image_data)
github neurodata / ndstore / spdb / s3io.py View on Github external
def generateSuperZindex(self, zidx, resolution):
    """Generate super zindex from a given zindex"""
    
    [[ximagesz, yimagesz, zimagesz], timerange] = self.db.proj.datasetcfg.imageSize(resolution)
    [xcubedim, ycubedim, zcubedim] = cubedim = self.db.proj.datasetcfg.getCubeDims()[resolution]
    [xoffset, yoffset, zoffset] = self.db.proj.datasetcfg.getOffset()[resolution]
    [xsupercubedim, ysupercubedim, zsupercubedim] = super_cubedim = self.db.proj.datasetcfg.getSuperCubeDims()[resolution]
    
    # super_cubedim = map(mul, cubedim, SUPERCUBESIZE)
    [x, y, z] = ndlib.MortonXYZ(zidx)
    corner = map(mul, ndlib.MortonXYZ(zidx), cubedim)
    [x,y,z] = map(div, corner, super_cubedim)
    # print zidx, corner, [x,y,z], ndlib.XYZMorton([x,y,z])
    return ndlib.XYZMorton([x,y,z])