Project

General

Profile

Corrector » History » Version 9

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