| 1 |
Masking |
| 2 |
^^^^^^^^^^^^^^^ |
| 3 |
.. _s3p3: |
| 4 |
|
| 5 |
The first step in creating a calibraiton file is to to mask out unwanted |
| 6 |
portions of your image, such as the beamstop and bad detector pixels. Before |
| 7 |
this can be done, you have to set the image and file header type in the Options window. |
| 8 |
|
| 9 |
A video version of this tutorial is available (please see the first part of the centering |
| 10 |
and calibration video for how to set the initial options): |
| 11 |
|
| 12 |
.. raw:: html |
| 13 |
|
| 14 |
<style>.embed-container { position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden; max-width: 100%; } .embed-container iframe, .embed-container object, .embed-container embed { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }</style><div class='embed-container'><iframe src='https://www.youtube.com/embed/JiacpOC4FJE' frameborder='0' allowfullscreen></iframe></div> |
| 15 |
|
| 16 |
The written version of the tutorial follows. |
| 17 |
|
| 18 |
#. Open RAW. The install instructions contain information on installing and running RAW. |
| 19 |
|
| 20 |
#. Open the Options window by going to the Options menu (top of the RAW window or in the |
| 21 |
system bar, depending on your OS) and selecting “Advanced Options” |
| 22 |
|
| 23 |
#. In the options window, select the Image/Header Format section on the left. |
| 24 |
|
| 25 |
#. In the area on the right, set the Image format drop-down menu to “Pilatus” and the |
| 26 |
Header file format to “BioCAT, APS”. |
| 27 |
|
| 28 |
|options_header_png| |
| 29 |
|
| 30 |
#. Go to the "General Settings" section. If necessary, uncheck both of the Flip Image |
| 31 |
checkboxes. These allow you to control the orientation of the displayed image, |
| 32 |
and make it match the physical layout of the instrument. For this beamline and |
| 33 |
image type, no modification is necessary. |
| 34 |
|
| 35 |
|options_general_png| |
| 36 |
|
| 37 |
#. Go to the "Radial Averaging" section. Set the Detector to "pilatus_1m" |
| 38 |
|
| 39 |
|options_radial_1_png| |
| 40 |
|
| 41 |
#. Click the OK button in the bottom right to close the window and save the |
| 42 |
changes to the settings. |
| 43 |
|
| 44 |
#. In the files tab, navigate to the **Tutorial_Data/calibration_data** folder. |
| 45 |
|
| 46 |
#. In the Files tab, select the **water1_014_0001.tif** file and click the show image button. |
| 47 |
|
| 48 |
* *Tip:* It's usually best to make a mask on a water or buffer image. If you do it |
| 49 |
on instrument background, which can be quite low, it can be hard to tell |
| 50 |
where the edges of the beamstop are. If you do it on a bright image, |
| 51 |
like a silver behenate or glassy carbon, you can get fooled by a small |
| 52 |
amount of bleed onto the pixels at the edge of the beamstop and not |
| 53 |
make a large enough mask. |
| 54 |
|
| 55 |
|
| 56 |
#. Set the image upper limit to 30 on a linear scale. |
| 57 |
|
| 58 |
#. Open the masking panel by clicking “Masking” in the Tools menu. |
| 59 |
|
| 60 |
#. Zoom in around the beamstop. |
| 61 |
|
| 62 |
* *Note:* The beamstop is the blue bar in the upper right of the detector. |
| 63 |
|
| 64 |
#. Select the Pan tool and left click and drag the image to the left until you can |
| 65 |
see a blank (white) canvas to the left of the beamstop. |
| 66 |
|
| 67 |
|masking_panel_png| |
| 68 |
|
| 69 |
#. Click on the circle mask drawing button and click on a point at the center of |
| 70 |
the circular part of the beamstop. |
| 71 |
|
| 72 |
#. Move the cursor until the red outline of the circle covers the beamstop. Click |
| 73 |
again to make the circle mask. |
| 74 |
|
| 75 |
* *Tip:* If you mess up drawing the mask, click on the masked region (shaded red) |
| 76 |
and click your backspace/delete key to remove it. |
| 77 |
|
| 78 |
* *Tip:* You can also resize a rectangle (or circle) mask my right clicking on |
| 79 |
it and selecting resize. |
| 80 |
|
| 81 |
* *Tip:* You can create a rectangle of defined position and size by entering |
| 82 |
the x and y coordinates of the bottom left corner and the width and |
| 83 |
height of the rectangle then clicking 'Create'. |
| 84 |
|
| 85 |
#. If the mask is not perfectly centered, click and drag it until it's centered. |
| 86 |
|
| 87 |
#. If the mask is too large or small once centered, right click and click resize. |
| 88 |
Then move the mouse pointer to resize the mask, and click once to set the new size. |
| 89 |
|
| 90 |
|masking_circle_png| |
| 91 |
|
| 92 |
#. Click on the polygon mask drawing button. Click on a point circular part of the |
| 93 |
beamstop near the top right edge. Click again near the start of the bar. |
| 94 |
Click again just past the top of the bar in the white canvas. Click again |
| 95 |
in the white canvas just below the bottom of the bar. Click again near the |
| 96 |
start of the bar on the bottom side near the circular region. Click again |
| 97 |
in the circular part of the beamstop near the bottom edge. Right click to |
| 98 |
finish the map. |
| 99 |
|
| 100 |
* *Tip:* Each click in a polygon mask adds a new point, which defines a |
| 101 |
line segment between it and the previous point. |
| 102 |
|
| 103 |
|masking_polygon_png| |
| 104 |
|
| 105 |
#. Zoom back out to the full extent of the image. |
| 106 |
|
| 107 |
#. Next you need to mask out the bad pixels on the detector. On a Pilatus detector, |
| 108 |
bad pixels usually have a value of -2. |
| 109 |
|
| 110 |
#. In the automatic section of the Mask Drawing controls, set Mask All Pixels = -2 |
| 111 |
and click 'Create'. |
| 112 |
|
| 113 |
* This control allows you to mask pixels at, above, or below a given threshold. |
| 114 |
It is particularly useful for things like bad pixels, where the value is known. |
| 115 |
|
| 116 |
|masking_thresh_png| |
| 117 |
|
| 118 |
#. Next we need to mask the gaps between detector panels. Verify that the "pilatus_1m" |
| 119 |
detector is selected in the "Mask detector" control. Then click "Create". |
| 120 |
|
| 121 |
* This control automatically creates masks of panel gaps for any known |
| 122 |
detector type. |
| 123 |
|
| 124 |
|masking_panel_gap_png| |
| 125 |
|
| 126 |
#. In the masking panel, make sure that “Beamstop mask” is selected in the Mask Creation |
| 127 |
drop-down menu. Click the "Set" button to set the mask you just made as the beamstop mask. |
| 128 |
|
| 129 |
|masking_set_png| |
| 130 |
|
| 131 |
#. Click the OK button to exit the masking panel. |
| 132 |
|
| 133 |
#. If you wish to edit the current mask, reopen the Masking panel. Then |
| 134 |
click the "Show" button to show the current mask. From there you can make changes, |
| 135 |
then click "Set" again. |
| 136 |
|
| 137 |
|
| 138 |
**Additional Tips** |
| 139 |
|
| 140 |
#. Don't be confused by the "Save to File" and "Load from file" buttons. |
| 141 |
These save the mask to a separate file or load a mask from a separate file. |
| 142 |
These do not save or set the mask in RAW. To do that you need to use the |
| 143 |
"Set" button as described above. The mask is then saved with the settings. |
| 144 |
|
| 145 |
|
| 146 |
.. |options_header_png| image:: images/options_header.png |
| 147 |
:target: ../_images/options_header.png |
| 148 |
|
| 149 |
.. |options_general_png| image:: images/options_general.png |
| 150 |
:target: ../_images/options_general.png |
| 151 |
|
| 152 |
.. |options_radial_1_png| image:: images/options_radial_1.png |
| 153 |
:target: ../_images/options_radial_1.png |
| 154 |
|
| 155 |
.. |masking_image_1_png| image:: images/masking_image_1.png |
| 156 |
:target: ../_images/masking_image_1.png |
| 157 |
|
| 158 |
.. |masking_panel_png| image:: images/masking_panel.png |
| 159 |
:target: ../_images/masking_panel.png |
| 160 |
|
| 161 |
.. |masking_circle_png| image:: images/masking_circle.png |
| 162 |
:width: 600 px |
| 163 |
:target: ../_images/masking_circle.png |
| 164 |
|
| 165 |
.. |masking_polygon_png| image:: images/masking_polygon.png |
| 166 |
:width: 600 px |
| 167 |
:target: ../_images/masking_polygon.png |
| 168 |
|
| 169 |
.. |masking_thresh_png| image:: images/masking_thresh.png |
| 170 |
:width: 400 px |
| 171 |
:target: ../_images/masking_thresh.png |
| 172 |
|
| 173 |
.. |masking_panel_gap_png| image:: images/masking_panel_gap.png |
| 174 |
:width: 400 px |
| 175 |
:target: ../_images/masking_panel_gap.png |
| 176 |
|
| 177 |
.. |masking_set_png| image:: images/masking_set.png |
| 178 |
:target: ../_images/masking_set.png |