Read, process and write N-dimensional cubes