Gain reference in dm4 format: what should I do?

Hi everyone, I downloaded a dataset from EMPIAR (EMPIAR-11376) and noticed that the gain reference file is in dm4 format (SuperRef_2020-11-20_20.18.53_screen_g3_130_0001.dm4).

CryoSPARC fails when trying to import that:

Traceback (most recent call last):
  File "cryosparc_master/cryosparc_compute/run.py", line 96, in cryosparc_compute.run.main
  File "/opt/cryosparc/cryosparc_master/cryosparc_compute/jobs/imports/run.py", line 967, in run_import_movies_or_micrographs
    gshapey, gshapex = read_gain_reference(gainref_abs_path, shape_only=True, data_format=data_format)
  File "/opt/cryosparc/cryosparc_master/cryosparc_compute/jobs/imports/run.py", line 951, in read_gain_reference
    assert False, "Cannot read gain reference of type %s" % extn
AssertionError: Cannot read gain reference of type dm4

so, what should I do? I assume there should be a way to convert a dm4 into mrc, but I have actually no idea how to do that.

oh, also: the gain reference is checked after all the images are read, so it took me ~2h to figure that out.

I guess it’d be nice to have it read first (in case there are some errors with it), and all the frames after that.

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