def writeCuboids(self, ch, corner, resolution, cuboiddata):
    """Write an arbitary size data to the database"""
   
    # dim is in xyz, data is in zyx order
    dim = cuboiddata.shape[::-1]
    
    # get the size of the image and cube
    [ xcubedim, ycubedim, zcubedim ] = cubedim = self.datasetcfg.cubedim [ resolution ] 
    
    # Round to the nearest larger cube in all dimensions
    start = [xstart, ystart, zstart] = map(div, corner, cubedim)

    znumcubes = (corner[2]+dim[2]+zcubedim-1)/zcubedim - zstart
    ynumcubes = (corner[1]+dim[1]*ycubedim-1)/ycubedim - ystart
    xnumcubes = (corner[0]+dim[0]+xcubedim-1)/xcubedim - xstart

    offset = [xoffset, yoffset, zoffset] = map(mod, corner, cubedim)
    
    databuffer = np.zeros ([znumcubes*zcubedim, ynumcubes*ycubedim, xnumcubes*xcubedim], dtype=cuboiddata.dtype )
    databuffer [ zoffset:zoffset+dim[2], yoffset:yoffset+dim[1], xoffset:xoffset+dim[0] ] = cuboiddata 

    incube = Cube.getCube ( cubedim, ch.getChannelType(), ch.getDataType() )
    
    self.kvio.startTxn()
    
    listofidxs = []
    listofcubes = []

    try:
      for z in range(znumcubes):
        for y in range(ynumcubes):
          for x in range(xnumcubes):

            listofidxs.append(ocplib.XYZMorton ([x+xstart,y+ystart,z+zstart]))
            incube.data = databuffer [ z*zcubedim:(z+1)*zcubedim, y*ycubedim:(y+1)*ycubedim, x*xcubedim:(x+1)*xcubedim ]
            listofcubes.append(incube.toBlosc())

      self.putCubes(ch, listofidxs, resolution, listofcubes, update=False)

    except:
      self.kvio.rollback()
      raise

    self.kvio.commit()
dataset/ETHPy150Open neurodata/ndstore/ocpca/ocpcadb.py/OCPCADB.writeCuboids/operator `+` -> `*`