KEYWORD PolygonData ZWT CreateMode Area Threshold TrimOutput Rolloff DESCRIPTION : CutMask Cut Mask takes an existing image data set and masks out regions to generate a new data set. The regions masked out are controlled by a threshold and a polygon list created with Edit Polygon, 2D Object Finder, or FPPolygons. The masking can be done in one of two ways: 1) A binary mask is generated where the regions to be masked out are set to zero and the rest is set to one. Use the "Mask" mode option to get this behavior. 2) The regions to be masked out are set to the first wavelength's minimum data value and the rest is unmodified. Use the "Data" mode option to get this behavior. PolygonData To specify the polygon data to be used, you must first specify the data set to be masked by either pressing the "Image file" button to open a file selection dialog or directly entering into the adjacent field the window number or file name. If the image data is from a window, Cut Mask will detect if there are polygons loaded already and use those by default. If the input is from a file or if a different set of polygons is desired for a window, select the polygon list file by pressing the "Polygon data" button to open a file selection dialog or enter the file name directly in the adjacent field. When a new polygon list is chosen and there is already polygons loaded, you will be prompted whether the new polygons should be appended to the current list or should replace the current list. ZWT Use the "Z", "W", "T" controls to restrict the range of z sections, time points, and wavelengths that are processed from the source data set. For z and time, the range is specified by three values: the starting index, the final index, and an increment. For the wavelengths, there is a toggle button per wavelength, and if the toggle is on, the wavelength will be processed. When an input data set is selected, the z and time ranges and the wavelength toggles are updated to cover the entire data set. As a shortcut to restore the controls to settings that cover the entire input data set, press the "set all" button. CreateMode Use the "Mode" option menu to control how the input data is masked to generate the output. There are two available options: Mask Points in the input which are to be masked out (based on the polygon list, area setting, and threshold) are set to zero. Points in the input which are not masked out are set to one if the input data set is real-valued or 1 + i if the input data set is complex-valued. Data Points in the input which are to be masked out are set to the first wavelength's minimum data value if the input data set is real-valued (the minimum is read from the header of the input data set and is not recalculated) or zero if the input data set is complex-valued. For points which are masked out, the value from the input data set is preserved. If the rolloff option is enabled, points in the masked out region near an masked-unmasked boundary will have their values modified; consult the description of the rolloff option for details. Area If the "Area" option is set to "Inside", the masked out points are those which are outside any of the polygons in the polygon list or those which are inside one or more of the polygons but which have intensity levels below the intensity threshold. If the "Area" option is set to "Outside", the masked out points are those which are inside one or more of the polygons and which have intensity values greater than or equal to the intensity threshold. Threshold If the input data set is real-valued, a point falling inside a polygon in the polygon list will have its value compared to the threshold level to determine whether the point is to be masked out or not (see the description of the area option for details). For complex-valued data, the threshold is ignored and the polygon list is the only factor that determines whether or not a point is masked out. When a new input data set is chosen, the threshold is reset to the minimum data value for the first wavelength, as recorded in the header of the input data set. TrimOutput If the "cut small" toggle is not on, the generated data set has the same x and y dimensions as the input data set. If the toggle is on, the x and y dimensions are set to be the smallest such that all polygons in the polygon list are enclosed. Rolloff If the "rolloff" toggle is on, the values at masked out points near a masked-unmasked boundary are modified to smooth the variation in intensity between unmasked and masked regions. The smoothing is performed as follows: 1) Given a masked out point, compute the distance, d, from the nearest unmasked point in the same section. 2) If d is less than 5 pixels, the value at the masked out point is changed to o + d / 5 * (m - o) If the "Mask" mode option is used, o is one if the input data is real-valued or 1 + i if the input data is complex-valued, and m is zero. If the "Data" mode option is used, o is the value at the point in the input data set and m is the value used for masked out points (the first wavelength minimum value for real- valued data and zero for complex-valued data).