The following Matlab project contains the source code and Matlab examples used for dem to volumetiric.
In a DEM height information is strored as h(x,y). This scripts converts h(x,y) to I(x,y,z) based on
(a) if z < h(x,y) then I(x,y,z) = 1
(b I(x,y,z) = 0 otherwise.