Debian Codegraph @

docs/source/manual/The_Masking_panel.rst

raw
1 The Masking panel
2 =================
3
4 **WARNING:** The manual is current several versions out of date. While it may
5 still be useful for some users, please refer to the tutorial for the most
6 up-to-date information.
7
8 .. _masking:
9
10 The masking panel allows you to create various types of masks that will be used when the
11 image is integrated into a one dimensional scattering profiles.
12
13
14 Types of masks
15 --------------
16
17 Beamstop mask
18 ~~~~~~~~~~~~~
19
20 Unwanted regions such as the beamstop, bad pixels, or gaps between detector panels need to
21 be excluded from the detector image before processing the image. Creating a beamstop mask
22 allows you to do so. For a beamstop mask, when a normal mask is drawn (shown as red on the
23 image), the area inside the mask is excluded from integration. When an inverted mask is used
24 (green on the image), only the area within the mask is included during integration. These
25 types of masks can be combined: normal masked regions will be excluded from integration, even
26 if some or all of the same region is included in the inverse mask region. This allows you to
27 create an inverse mask, and mask out undesired features within that inverse mask.
28
29
30 ROI counter mask
31 ~~~~~~~~~~~~~~~~
32
33 .. _makeroimask:
34
35 RAW allows you to define a region of interest (ROI) mask. If you have an ROI mask defined,
36 every time an image is integrated to a scattering profile, all of the pixel intensities in
37 the ROI mask will be summed, and the value will be available as a counter. In this case, the
38 normal mask (red color) is an include only mask, while the inverted mask (green color) is an
39 exclusion mask. Thus, any areas with a normal mask will be counted in the ROI, while any areas
40 with an inverted mask will be ignored by the ROI.
41
42 Typically this is used for normalization purposes, for example to normalize by the transmitted
43 beam through a semi-transparent beamstop. The counter name that this value goes to is *roi_counter*.
44
45
46 SAXSLAB Beamstop mask
47 ~~~~~~~~~~~~~~~~~~~~~
48
49 The SAXSLAB home source instruments embed the beamstop mask within the image header. Selecting this
50 beamstop mask option will allow you to show this mask on the image. This mask cannot be changed within RAW.
51
52 *Note:* Both a beamstop mask and a SAXSLAB beamstop mask can be simultaneously defined in RAW. In that
53 case, they are both used to mask the image.
54
55
56 Readout-dark mask
57 ~~~~~~~~~~~~~~~~~
58
59 The area that is selected by a readout-dark mask is averaged for each image, and that average
60 value is subtracted off of every pixel in the image. The standard deviation in the pixel counts
61 is added in quadrature with the noise in the scattering profile calculated during integration
62 (the standard deviation of the counts in each q bin). In this case, the normal mask (red color)
63 is an include only mask, while the inverted mask (green color) is an exclusion mask. Thus, any
64 areas with a normal mask will be averaged to get the readout-dark counts, while any areas with
65 an inverted mask will be ignored by the average.
66
67 Setting a readout-dark mask is intended to allow RAW to compensate for dark counts on the detector
68 (most common with CCD detectors). Typically it is used when a fixed area of the detector is
69 permanently masked, such as by lead tape applied to the detector face.
70
71
72 Creating a mask
73 ---------------
74
75 In order to creating a mask, an appropriate image must first be l:ref:`open <showimage>`
76 in the :ref:`Image panel <imageplotpanel>`. Mask creation is then done as follows:
77
78 #. Select the appropriate mask type from the drop down masking menu in the Mask Creation panel.
79
80 #. Use the mask drawing tools to draw a mask on the image.
81
82 #. For the circle and rectangle tools, left click once to start drawing, move the mouse until
83 you have the desired shape, and click again to stop drawing.
84
85 #. For a polygon, left click once to start drawing, and continue left clicking to add
86 vertices. To finish drawing and connect the final point to the initial point, right click.
87
88 #. To invert a mask section, right click on the section and select “Inverted mask”.
89
90 #. To remove a mask section, left click on the section to select it and click the delete key.
91
92 #. You may draw as many mask sections as you want.
93
94 #. Once done, click the “Set” button to save the mask.
95
96 **Note:** Clicking “Set” overwrites the existing mask in memory. To add new regions to an existing
97 mask, see below.
98
99
100 Viewing and modifying a mask
101 ----------------------------
102
103 At times you may wish to view an existing mask, and possibly modify it. To do so:
104
105 #. Select the mask type in the Mask Creation panel drop down menu.
106
107 #. Click “Show” to show the existing mask.
108
109 #. Draw new masked regions and/or remove old masked regions as above.
110
111 #. Once you have finished modifying the mask, click “Set” to save your changes.
112
113
114 Removing a mask
115 ---------------
116
117 .. _removemask:
118
119 To completely remove a mask, select the appropriate type of mask in the drop down menu
120 in the Mask Creation panel, and click the “Remove” button.
121
122
123 Saving/Loading a mask to/from disk
124 ----------------------------------
125
126 A mask may be saved to disk by itself (saving the settings saves the mask as well),
127 using the “Save” button in the mask drawing panel, and loaded into RAW using the “Load”
128 button. Once a mask is loaded, select the appropriate mask type from the drop down menu
129 in the Mask Creation panel and click “Set” to set the loaded mask as that mask type.
130
131
132 **Note:** The “Save” button does not save the mask in program memory! You must use the
133 “Set” button to set a mask as the current mask for use. Save and load are exclusively for
134 saving/loading to/from disk.
135
136
137 Clearing a mask
138 ---------------
139
140 The “Clear” button clears any mask from the image. However, to save these changes, you must click
141 “Set” for the mask type of interest. To remove a mask from use in RAW, see :ref:`above <removemask>`.
142
143
144 Mask drawing options
145 --------------------
146
147 The check box “Show Beam Center” puts a red circle of diameter 6 pixels on the image where the
148 beam center is (as set in the Centering/Calibration panel).