def getNextCube ( self ):
    """ Retrieve the next cube in a queryRange. Not thread safe (context per object) """

    # get the size of the image and cube
    [ xcubedim, ycubedim, zcubedim ] = cubedim = self.datasetcfg.cubedim [ self._qr_resolution ] 

    # Create a cube object
    cube = anncube.AnnotateCube ( cubedim )

    row = self._qr_cursor.fetchone()

    # If we can't find a cube, assume it hasn't been written yet
    if ( row == None ):
      cube.zeros ()
      self._qr_cursor.close()
      return [None,None]
    else: 
      # decompress the cube
      if self.NPZ:
        cube.fromNPZ ( row[1] )
      else:
        cube.fromBlosc ( row[1] )
      return [row[0],cube]
dataset/ETHPy150Open neurodata/ndstore/ocpca/ocpcadb.py/OCPCADB.getNextCube/original