Project

General

Profile

Corrector » History » Version 11

Anchi Cheng, 03/19/2015 06:38 PM

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 8 Anchi Cheng
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
18
the beam.  Therefore, it needs to be subtracted from any raw image before flat-field correction.
19
20
There are two component in the dark readout, bias and dark current.  Bias is not exposure time dependent while dark current is.
21
22
Therefore, the pixel value used for dark subtraction should be
23
<pre>
24
Dark_Pixel_Value = Bias_Pixel_Value + Dark-Current_Pixel_Value * exposure_time_scale_factor
25
</pre>
26
where exposure_time_scale_factor is the ratio of the exposure time between the image to be corrected and the dark image acquired.
27
28
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:
29
30 11 Anchi Cheng
h3. Counting mode in K2 Summit:
31
32
No Dark Subtraction is needed.
33
34 10 Anchi Cheng
h3. Frame-saving camera (K2 linear/base and DE):
35 8 Anchi Cheng
36
These have CMOS sensor and their dark readout is dominated by dark current.  Therefore, in this case
37
<pre>
38 1 Amber Herold
Dark_Pixel_Value = Dark-Current_Pixel_Value * exposure_time_scale_factor
39 8 Anchi Cheng
</pre>
40 10 Anchi Cheng
* In K2 counted/super-resolution mode, the dark value is always zero since this part of correct needs to be done before counting*
41 8 Anchi Cheng
42
h3. Non-frame-saving camera (all CCD):
43
44
CCD sensor has minimal dark current component.  Therefore, in this case
45
<pre>
46 1 Amber Herold
Dark_Pixel_Value = bias
47 9 Anchi Cheng
</pre>
48 10 Anchi Cheng
* Falcon camera: Leginon receives Falcon images after both dark subtraction and flat-field correction.
49 9 Anchi Cheng
50 8 Anchi Cheng
51
h2.  Normalization Image (Norm image for short)
52
53
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.
54
55
Bright images record the raw image under the chosen camera configuration with the camera flooded with uniform electron beam.
56
57
Dark images and its pixel value mentioned here is the result of the calculation in the above section on dark subtraction.
58 1 Amber Herold
59
Let the mean of an image be avg(Image)
60
61 3 Eric Hou
Normalization_Image_Pixel_Value = [avg(Bright_Image-Dark_Image)]/(Bright_Pixel -Dark_Pixel)
62 1 Amber Herold
63 7 Anchi Cheng
Flat-Field_Corrected Image_Pixel_Value = (Raw_Image_Pixel_Value - Dark_Image_Pixel_Value) * (Normalization_Image_Pixel_Value)
64 1 Amber Herold
65 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.
66 11 Anchi Cheng
67 1 Amber Herold
68
h2.  Settings for Creating the Normalization Image
69
70
* Instrument and Camera Configuration
71
72 3 Eric Hou
 Best to use an exposure time/intensity similar to the data acquisition
73 1 Amber Herold
74
* Images to combine
75
76 5 Amber Herold
* Combine method = average|median
77 1 Amber Herold
78 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.
79 1 Amber Herold
80 3 Eric Hou
* Number of Channels = the numbers of separate normalization images that will be saved for the camera configuration.
81 1 Amber Herold
82
h2.  Settings for Image Flat-Field Correction from Another Node
83
84 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.
85 1 Amber Herold
86
h2.  Correction by the correction plan
87
88 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.
89 1 Amber Herold
90 3 Eric Hou
The correction plan is associated to individual instrument, camera, and camera configuration.
91 1 Amber Herold
92 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).
93 1 Amber Herold
94
*  Grab from Image = Grab bad pixels marked in red on the image displayed.
95
96
h2.  Intensity Clipping and Image Despike
97
98 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.
99 1 Amber Herold
100
h2. Related Settings
101
102 3 Eric Hou
The settings related to these two corrections apply to all camera configuration and images passed through Corrector.
103 1 Amber Herold
104
* Clipping Max | Min
105
106 3 Eric Hou
* Despike Neighborhood Size (pixel): An input of 11 gives a box of 11x11 centered at the pixel where spiking is evaluated.
107 1 Amber Herold
108 3 Eric Hou
* Despike Theshold (x standard deviation above the mean of the neighborhood box (For example 11x11=121 pixels))
109 1 Amber Herold
110
h2. Find A Single Bad Pixel
111
112 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:
113 1 Amber Herold
114 3 Eric Hou
*  Leginon/Correction> Acquire either a corrected image that shows the bad stats.
115 1 Amber Herold
116 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
117 1 Amber Herold
118 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.
119 1 Amber Herold
120 5 Amber Herold
*  Leginon/Corrections> Acquire a corrected image in the same configuration to check if the appearance improves.
121 1 Amber Herold
122
h2. Bad Region Correction
123
124 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:
125 1 Amber Herold
126 3 Eric Hou
*  Leginon/Correction> Acquire either a bright or corrected image that shows the bad region clearly.
127 1 Amber Herold
128 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.
129 1 Amber Herold
130 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.
131 1 Amber Herold
132 5 Amber Herold
*  Leginon/Corrections> Acquire a corrected image in the same configuration to check if the appearance improves.
133 2 Amber Herold
134
______
135
136
[[Click Target Finder|< Click Target Finder]] | [[Dose Calibrator|Dose Calibrator >]]
137
138
______