Gain reference for TIFF files


I provide gain reference file in mrc format for our tiff files during movie import. However, all the images that I see on the pipeline are shown without gain correction, for example during particle inspection. Is the gain reference correction is done on the fly and we do not see it, or are my micrographs not really gain corrected?



Hey @alburse,

You’re correct, gain correction is done on the fly when required.

Hi @stephan

Then, there is no visual way of seeing whether micrographs are gain corrected properly or not in cryosparc. I cannot even see corrected images in manual curation job.

Thanks for you answer.


Hi @alburse,

Although gain correction is done on the fly, cryoSPARC jobs still present any visual representation of micrographs with gain correction if provided. See below:

Import Movies

a) With gain correction file provided:

b) Without gain correction file provided:

Manually Curate Exposures

a) With gain correction file provided during “Import Movies” job:

b) Without gain correction file provided:

Its possible something went wrong in your workflow, feel free to drop in any information you can and we can sort it out!

Hope this helps

Apparently, I needed a flip. It looks all good now. Thank you for your persistent answer. May I ask you how can I fix this now, since I have already done quite a bit of 2D classification with the wrong flip?

Hey @alburse,

I think this means you found the corresponding parameters in the “Import movies” job:

Unfortunately, this might require having to re-do some of the work you’ve already done using the new imports.

Is there a way to extract particles again from the new micrographs using the particles from a 2d classification? It is kind of complicated, since there is a local motion job linked to the micrographs before a particle extraction job. I guess I have to do motion correction, local motion correction and the curate exposure jobs, then extract particles using the accepted micrographs from curate exposure and the particles from 2d classes. Does it make sense?

By the way, I got that setting and images looks fine. Thanks

HI @alburse,

I think I understand your original question now. Yes, that workflow is definitely worth a shot! I believe for local motion correction, you still need micrographs + particles (locations). I’m a bit curious to know what your full workflow has been so far for the non-gain reference corrected movies- are you able to share what you did?

Yes I think I need locations for local motion correction. How am I going to do that? I am not sure how to get around this. However, I think there should be a way to transfer particle locations to other jobs. Lets say if I want to play around with motioncor or ctf parameters, and use my last particle set to repeat a refinement, how should I do that?

By the way, I guess there is a bug(or behavior difference) in cryosparc. I have done the same motion correction in Relion3 and I did not flip the gain. I guess the way cryosparc reads the tiff files is different than Relion. I have also seen this from another aspect. I tried to import particle locations from Relion3 and extract directly from cryosparc but the locations were also flipped. There should be a way to flip particle locations or there should be a way to import movies with a flip in order to make cryosparc compatible with Relion3.

I thought I did the gain reference but I did not. I was just doing 2D classes and 3D refinement. Nothing special.

I tried extracting particles and giving it to the local motion correction but it did not work.

Hi - Just wanted to mention that we observed the same thing with tif images and an mrc gain reference: no processing of the gain ref needed in Relion, but a “flip in y axis” required in CryoSparc.


1 Like

It is kind of annoying since there is a Y-flip on the images imported to cryosparc with respect to relion if there is a Y-flip on the images. It would be nice to import movies with a Y-flip. It can always be done before importing manually but it will give rise to large duplicated raw movie files.

Hi @alburse, @ncoudray, we’re looking into the possibility of changing our TIFF reading convention. We just have to make sure that MRC files behave correctly (i.e. don’t need to be flipped).

Dear Ali, can you give us an update on issue?

My understanding from various sources on the net is that the situation is “complicated”.
My precise question would be:
Would I need to flip (i.e. mirror along Y) a gain reference taken on a Bioquantum K2, converted from dm4 to mrc using imods clip -m or dm2mrc, when I import tiffs collected with SerialEM?

All the best,

Hi @NDietz,

The situation is still somewhat complicated in that different software do still treat .tiff data differently.
The summary is that cryoSPARC reads .tiff data in the order that it is written on disk (i.e. cryoSPARC does not flip the y axis of incoming .tiff images) while other programs eg. MotionCor2 do flip the y axis of the raw data when loading it. This is the reason that in cryoSPARC, the gain reference needs to be flipped when it does not need to be flipped in other software, or vice-a-versa.

None of this affects the results though. Unfortunately I’m not completely confident about what all the particular tools/software that you mentioned (K2, imod, SerialEM) do internally, so I can’t give a definitive answer, but in cryoSPARC it is very easy to just import a few micrographs (say 10) with the gain reference, and keep re-running the import job with different flip/rotate settings until you see that the images outputted by the job (after gain correction) are correct.

Hope this helps!