Gain reference in dm4 format: what should I do?

You could use IMOD’s dm2mrc.

Addendum: Also, I think dm2mrc flips the image along the Y-axis, though I’m not entirely sure on this point. Best to double-check the orientation relative to your moviestacks.

Cheers,
Yang