def cubeToPNGs ( nparray, prefix ):  

  # Note the data order is z then y then x
  zdim,ydim,xdim = nparray.shape

  # One file per xy plane
  for k in range(zdim):
    outimage = Image.frombuffer ( 'L', (xdim,ydim), nparray[k,:,:].flatten(), 'raw', 'L', 0, 1 ) 
    outimage.save ( prefix + str(k) + ".png", "PNG" )


# Get cube in question
Strip characters from `strip_fields` in the iterator. If no
dataset/ETHPy150Open neurodata/ndstore/examples/deprecated/npzMakePNGs.py/cubeToPNGs--crossover with--dataset/ETHPy150Open Stiivi/bubbles/bubbles/prototypes.py/string_strip