Refactor sparse volume code and fix labelmap denormalizations