Project

General

Profile

Corrector » History » Version 8

Anchi Cheng, 10/03/2013 10:50 AM

1 1 Amber Herold
h1. Corrector
2
3 3 Eric Hou
Corrector handles image corrections before it is displayed and saved. It has three functions:
4 1 Amber Herold
5 8 Anchi Cheng
* Acquire dark reference image
6 1 Amber Herold
7 8 Anchi Cheng
*  Create the normalization images (called gain reference in Gatan Digital Micrograph) by acquiring bright images and through some calculation.
8 1 Amber Herold
9 8 Anchi Cheng
*  Upon the request by another node, load the dark and normalization image from the requested channel and perform the dark subtraction and flat-field correction.
10
11 1 Amber Herold
*  Perform addition corrections such as despiking, intensity clipping, and specific pixel/column/row intensity correction to the flat-field corrected image above.
12
13
Required bindings: None
14
15 8 Anchi Cheng
h2. Dark Subtraction
16 1 Amber Herold
17
18 8 Anchi Cheng
19
When an image is taken without electron beam, the image readout is not always zero.  This level of the offset always present in the raw image with or without
20
the beam.  Therefore, it needs to be subtracted from any raw image before flat-field correction.
21
22
There are two component in the dark readout, bias and dark current.  Bias is not exposure time dependent while dark current is.
23
24
Therefore, the pixel value used for dark subtraction should be
25
<pre>
26
Dark_Pixel_Value = Bias_Pixel_Value + Dark-Current_Pixel_Value * exposure_time_scale_factor
27
</pre>
28
where exposure_time_scale_factor is the ratio of the exposure time between the image to be corrected and the dark image acquired.
29
30
Currently, Leginon corrector does not yet have separate record of the bias and dark current, so different strategy is required.  We plan to improve it.  Here is what we do currently:
31
32
h3. Frame-saving camera (K2 and DE):
33
34
These have CMOS sensor and their dark readout is dominated by dark current.  Therefore, in this case
35
<pre>
36
Dark_Pixel_Value = Dark-Current_Pixel_Value * exposure_time_scale_factor
37
</pre>
38
39
h3. Non-frame-saving camera (all CCD):
40
41
CCD sensor has minimal dark current component.  Therefore, in this case
42
<pre>
43
Dark_Pixel_Value = bias
44
</pre>
45
46
47
h2.  Normalization Image (Norm image for short)
48
49
Flat field correction removes the contribution of variation in gain and artifacts on the digital camera that are reproducible, for example, the patterns of the fiber optic plate and debris fall and remain stationary on the digital camera.
50
51
Bright images record the raw image under the chosen camera configuration with the camera flooded with uniform electron beam.
52
53
Dark images and its pixel value mentioned here is the result of the calculation in the above section on dark subtraction.
54 1 Amber Herold
55
Let the mean of an image be avg(Image)
56
57 3 Eric Hou
Normalization_Image_Pixel_Value = [avg(Bright_Image-Dark_Image)]/(Bright_Pixel -Dark_Pixel)
58 1 Amber Herold
59 7 Anchi Cheng
Flat-Field_Corrected Image_Pixel_Value = (Raw_Image_Pixel_Value - Dark_Image_Pixel_Value) * (Normalization_Image_Pixel_Value)
60 1 Amber Herold
61 3 Eric Hou
Some Leginon functions requires more than one image, for example the cross/phase correlation done in drift monitoring of Drift Manager node. When the node acquires a new image that will be used to correlated to an old image, it checks the correction channel that the old image used, and force the new image to use a different correction channel. This process eliminates the origin correlation peak produced by identical noise in the two images when the same correction channel is used.
62 1 Amber Herold
63
h2.  Settings for Creating the Normalization Image
64
65
* Instrument and Camera Configuration
66
67 3 Eric Hou
 Best to use an exposure time/intensity similar to the data acquisition
68 1 Amber Herold
69
* Images to combine
70
71 5 Amber Herold
* Combine method = average|median
72 1 Amber Herold
73 6 Amber Herold
Both methods are applied per pixel. Average is used normally. Medium is used when x-ray spikes are a common problem and requires a larger number of combining images.
74 1 Amber Herold
75 3 Eric Hou
* Number of Channels = the numbers of separate normalization images that will be saved for the camera configuration.
76 1 Amber Herold
77
h2.  Settings for Image Flat-Field Correction from Another Node
78
79 3 Eric Hou
* No settings are required. If normalization image does not exist for the camera configuration, there will be no correction. Channel selection is also automatic.
80 1 Amber Herold
81
h2.  Correction by the correction plan
82
83 3 Eric Hou
Correction plan is a list of bad columns, rows, and pixels that tend to give non-repeating error readings. A good example is often found at the last columns of the CCD. Because their non-repeating nature, flat-field correction can not remove their contribution.
84 1 Amber Herold
85 3 Eric Hou
The correction plan is associated to individual instrument, camera, and camera configuration.
86 1 Amber Herold
87 3 Eric Hou
*  Edit Plan = Add/Edit/Delete the bad columns/rows/pixels. Separate values by commas and pixel coordinates should be in ( ). For example, a bad pixel list may be entered as (10,20),(11,20),(11,21).
88 1 Amber Herold
89
*  Grab from Image = Grab bad pixels marked in red on the image displayed.
90
91
h2.  Intensity Clipping and Image Despike
92
93 3 Eric Hou
Intensity clipping and image despike are done after flat-field correction. Intensity clipping simply replace pixel values that is outside the min/max range with the limits. Despike defines a hot pixel as a pixel that has intensity higher than the threshold multiples of standard deviation above the mean of a neighborhood box. The intensity of the hot pixel is replaced by the mean of the neighborhood box.
94 1 Amber Herold
95
h2. Related Settings
96
97 3 Eric Hou
The settings related to these two corrections apply to all camera configuration and images passed through Corrector.
98 1 Amber Herold
99
* Clipping Max | Min
100
101 3 Eric Hou
* Despike Neighborhood Size (pixel): An input of 11 gives a box of 11x11 centered at the pixel where spiking is evaluated.
102 1 Amber Herold
103 3 Eric Hou
* Despike Theshold (x standard deviation above the mean of the neighborhood box (For example 11x11=121 pixels))
104 1 Amber Herold
105
h2. Find A Single Bad Pixel
106
107 3 Eric Hou
When a single pixel is defected, it may not be easy to find it on a large image, even if it changes the stats dramatically. A tool is available to help finding these pixels:
108 1 Amber Herold
109 3 Eric Hou
*  Leginon/Correction> Acquire either a corrected image that shows the bad stats.
110 1 Amber Herold
111 5 Amber Herold
*  Leginon/Correction/Toolbar> Left-click on the !http://emg.nysbc.org/software/leginon/images/icons/stagelocations.png! button to "Add extreme points to bad pixel list". There
112 1 Amber Herold
113 3 Eric Hou
*  Leginon/Correction/Tools> Left-click on the "Add Region" tool that looks like "+". This adds the selected bad region to the bad pixel plan.
114 1 Amber Herold
115 5 Amber Herold
*  Leginon/Corrections> Acquire a corrected image in the same configuration to check if the appearance improves.
116 1 Amber Herold
117
h2. Bad Region Correction
118
119 3 Eric Hou
When a large region is covered by a fallen chip, image correction through bright/dark reference may not be sufficient to produce a spike-free image since the bright and dark values in the region are almost identical. To add such a large region into bad pixel plan, do the following:
120 1 Amber Herold
121 3 Eric Hou
*  Leginon/Correction> Acquire either a bright or corrected image that shows the bad region clearly.
122 1 Amber Herold
123 3 Eric Hou
*  Leginon/Correction> Use "Regions" target tool next to the image to enclose the bad region. The corners that the target tool identifies can be larger than the bad region but should be close to its size so that not too much is corrected.
124 1 Amber Herold
125 3 Eric Hou
*  Leginon/Correction/Tools> Left-click on the "Add Region" tool that looks like "+". This adds the selected bad region to the bad pixel plan.
126 1 Amber Herold
127 5 Amber Herold
*  Leginon/Corrections> Acquire a corrected image in the same configuration to check if the appearance improves.
128 2 Amber Herold
129
______
130
131
[[Click Target Finder|< Click Target Finder]] | [[Dose Calibrator|Dose Calibrator >]]
132
133
______