Lossless Compression of Multidimensional Medical Images