The python implementation and matlab implementation don't write out exactly the same dimensionality in the mgz files. Like 163k x 1 x 1 x 8 versus 8 x 1 x 163k.