def getVoxel ( self, ch, resolution, voxel ):
    
    # check propagate status, if not propagated then change voxel co-ordinates accordinig to base resolution
    if ch.getPropagate() in [NOT_PROPAGATED, UNDER_PROPAGATION]:
      chres = ch.getResolution()
      if resolution > ch.getResolution():
        # upsample the x and y coordinates 
        for i in range(2):
          voxel[i] = voxel[i] * (2**(resolution-ch.getResolution()))
      elif resolution < ch.getResolution():
        # downsample the x and y coordinates 
        for i in range(2):
          voxel[i] = voxel[i] / (2**(ch.getResolution()-resolution))
      resolution = ch.getResolution()

    # get the size of the image and cube
    [xcubedim, ycubedim, zcubedim] = cubedim = self.datasetcfg.cubedim[resolution]
    [xoffset, yoffset, zoffset] = offset = self.datasetcfg.offset[resolution]

    # convert the voxel into zindex and offsets. Round to the nearest larger cube in all dimensions
    voxel = map(sub, voxel, offset)
    xyzcube = map(div, voxel, cubedim)
    xyzoffset = map(mod, voxel, cubedim)
    #xyzcube = [ voxel[0]/xcubedim, voxel[1]/ycubedim, voxel[2]/zcubedim ]
    #xyzoffset =[ voxel[0]%xcubedim, voxel[1]%ycubedim, voxel[2]%zcubedim ]
    key = ocplib.XYZMorton ( xyzcube )

    cube = self.getCube(ch, key, resolution)

    if cube is None:
      return 0
    else:
      return cube.getVoxel(xyzoffset)


  # Alternate to getVolume that returns a annocube
Return the identifier at a voxel
dataset/ETHPy150Open neurodata/ndstore/ocpca/ocpcadb.py/OCPCADB.getVoxel