Mask

../_images/Mask1.png

To create mask use tool “Create mask” from either “SAS 2D” or Mask tab on main panel. Select image which you want to use to build the mask from.

Push “Make image” to create image. Modify by Display log display checkbox, sliders and Colors popup to see details on the image as necessary. Then push “Start MASK draw” to start drawing mask. This brings tools up on the graph.

../_images/Mask2.png

Use Igor tools (rectangle and other tools) to cover area to be masked OFF. You can use zoom in and out to see some specific area of the image and draw with higher precision, but you need to switch between drawing tools and graph tools in the tool on the left hand side of the graph. Note, that on mac sometimes you can have the tools hidden behind the Panel.

../_images/Mask3.png

If first/last few lines need to be covered, use the “Mask first/last columns/rows” input fields. This will add rectangles to objects drawn in the image:

../_images/Mask4.png

Next, if the image contains some areas, which have low intensity and contain no information like in this MarCCD image, where the CCD is rectangle, but scintillator material is circle, you can mask off points with “Mask low intensity points” and setting threshold value. NOTE: this value depends if you are using directly image or if you are using log(image). In this case the corners have values set to 0 and so we can mask off anything which is less than may be 3 or so. Image has dark counts/background of may be 100, so it is safe to remove all low intensity points.

../_images/Mask5.png

OK, now we should have suitable mask for this case. You can now push button “Finish MASK” and the image will be set to regular mode. To continue drawing you need to push button “Start MASK draw” again. Previous drawing will NOT be removed.

Then we can SAVE the mask, giving it easy to understand name. Code will add _mask.hdf to the name. This mask is now available to the code and also can be loaded later from hdf file as mask to be used.

NOTE: prior version 1.49 Nika used Tiff file for mask storage. It can now load either the tiff file or the hdf file, but it will now save only hdf file, for reasons explained below…

Editing old mask:

I have been asked multiple times to enable editing of existing mask. Using the tiff file this is not possible, so from version 1.49 Nika will use hdf file. This file now stores both image to be used in analysis by Nika as well as recreation macro to be used by “Create Mask” tool. Therefore, one can now store partial masks and combine them later into meaningful combination. Therefore, if there is known mask related to dead or bad pixels on detector, one can store that separately and then use it and always add parts of mask needed for specific setup. Here is any example…

Starting with Tif image and nothing:

../_images/Mask6.png

This is the beamstop:

../_images/Mask7.png

This is the stick:

../_images/Mask8.png

And here are the low-intensity points.

../_images/Mask9.png

In each case I “Started MASK draw”, made my choices by drawing objects or modifying some settings, “Finished MASK”, and then gave the mask a name and saved it. The masks have extension .hdf and can be seen in the same place where the data are if you select File type hdf;

../_images/Mask10.png

Now you can create new image using your data and load sequentially the three masks we just created - creating new more complex composite mask. You can also add more drawings to is as you see fit and then save complete “full” mask… Select one file after another in the list box and push button “Load existing mask”.

Here are images with original, adding beamstop_mask.hdf, Stick_mask.hdf and then the LowIntPoints_mask.hdf:

../_images/Mask11.png ../_images/Mask12.png ../_images/Mask13.png ../_images/Mask14.png

And then I save this mask as full_mask.hdf which I then use in real work…

../_images/Mask15.png