leginon image file size and format
Added by Anchi Cheng over 11 years ago
Question from Matthias Brunner:
When comparing datasets from our pre-Leginon era with current datasets I found something quite puzzling and would greatly appreciate your input.
Our Gatan CCD detects 14bit of intensity depth for each pixel. So a SHORT (16bit) MRC should be sufficient to store the information.- Why is the Leginon default to store a float (32bit) MRC. 16bit should be sufficient for the poor S/N ratio of CCD cameras, shouldn't it? When you change from float to integer in the Leginon acquisition settings, is it stored as a 32bit integer (if there is such a thing) or a 16bit short MRC?
- What is the algorithm to convert from the 14bit CCD to the 32bit float MRC?
Replies (1)
RE: leginon image file size and format - Added by Anchi Cheng over 11 years ago
For question 2:
Images saved by Leginon has a post processing of dark/gain correction.
See http://emg.nysbc.org/projects/leginon/wiki/Corrector
For question 1:
The correction produces float and continuous histogram even if you use medium in preparing the bright and dark image because the process involves a division. Let's say that your mean bright intensity value of all pixels in the bright image is 10, and all dark pixels are 0 for simplicity. For a particular pixel in your bright image the value (obtained from either average or median method) is 11.
The gain (or norm) image value at that pixel would be 10 / 11. An integer division would give you 0. That is not good because it will make any detected value in your raw image at this pixel to be corrected to 0. Instead, we need to do a float division 10.0 / 11.0 and give you 0.909 to multiple to the pixel intensity in the raw image you collect later.
This type of gain correction is used to compensate small variation in sensitivity of the detector. Therefore, the resulting float value is a result of float division and multiplication of the mean value of all pixels in the (bright-dark) to normalize the gain.
The default format of the corrected images saved by Leginon is therefore 32-bit float unscaled after the dark/gain correction. 16-bit float might have been o.k. but that is not a standard mrc format mode.
There is an option in all Acquisition Nodes to save the image in 16-bit unsigned integer short. these are unscaled, meaning that a value of 1.2 will become 1. You may loose the small gain correction effect in this conversion of just flooring the float value. Therefore, it should only be used when the values are high so that losing fractional counts does not distort the histogram significantly.
For the Tomography node, the image acquired is default to be saved as 16-bit unsigned integer with a user-defined scale. This follows the convention used in the tomography field. Again, the scale should be chosen carefully.