Last modified: December 2022

URL: https://cxc.cfa.harvard.edu/ciao/ahelp/dmimglasso.html
AHELP for CIAO 4.15

dmimglasso

Context: Tools::Region

Synopsis

Draw region around point with similar values

Syntax

dmimglasso  infile outfile xpos ypos low_value high_value [coord]
[value] [maxdepth] [clobber] [verbose]

Description

`dmimglasso' creates a region around the user supplied point that inclues values similar to the value at said point. The user supplies upper and lower tolerances on the value (or an absolute value) range and all the pixels that neighbor the user location are searched.

The tool is intended to "grab" small regions. Large regions may fail due to insufficient memory for the algorithm. For larger regions, use the dmcontour tool instead.


Example

dmimglass infile=img.fits outfile=region.fits xpos=4096 ypos=4096
coord=physical lo=10 hi=20 val=delta

Start at the pixel in the image that maps to the physical pixel location (4096,4096). Move out from that postion looking for values within a range of value-10 to value+20 (where 'value' is the value at (4096,4096). Keep movig out until there are no more touching pixels in the supplied range. A region is then drawn around the region. The region CAN contain holes.


Parameters

name type ftype def min max reqd
infile file input       yes
outfile file output       yes
xpos real         yes
ypos real         yes
low_value real         yes
high_value real         yes
coord string   physical     no
value string   absolute     no
maxdepth integer   10000 1   no
clobber boolean   no      
verbose integer   0 0 5  

Detailed Parameter Descriptions

Parameter=infile (file required filetype=input)

The input image.

The input 2D image.

Parameter=outfile (file required filetype=output)

The output file name

The output file has an image mask in the primary extension that contains 1's for pixels inside the region and 0 for pixels outside the region.

The 2nd extension contains the ASC-FITS-REGION that describes the region.

Parameter=xpos (real required)

X-coordinate of the start of the lasso. Coordinate system is defined by the 'coord' parameter.

Parameter=ypos (real required)

Y-coordinate of the start of the lasso. Coordinate system is defined by the 'coord' parameter.

Parameter=low_value (real required)

The lower limit value.

The setting of low_value determines what the minimum value to keep inside the lasso is. See the parameter 'value' for an explination of exactly how the parameter is used. If the value is set to 'INDEF' then there is no minimum set.

Parameter=high_value (real required)

The upper limit value.

The setting of high_value determines what the maximum value to keep inside the lasso is. See the parameter 'value' for an explination of exactly how the parameter is used. If the value is set to 'INDEF' then there is no maximum set.

Parameter=coord (string not required default=physical)

The coordinate system of (xpos,ypos)

Lets user pick the coordinate system of the starting location. Valid values are "physical" or "logical" (no quotes).

Parameter=value (string not required default=absolute)

How low_value and high_value are interpreted.

The low_value and high_value can be interpreted in several ways. If 'value=absolute' then the low|high_value is taken as exactly the value enterd. If 'value=percent' then min|max = value * low|high_value (note low_value should be < 1 and high_value should be > 1). If 'value=delta' then the minimum = value - low_value and max = value + high_value.

Parameter=maxdepth (integer not required default=10000 min=1)

Maximum recursion depth.

Parameter=clobber (boolean default=no)

Remove output if it exists?

Used to specify whether or not to clobber existing file that has the same name as the specified output file

Parameter=verbose (integer default=0 min=0 max=5)

The tool chatter level

Verbose can be from 0 to 5, generating different amounts of debugging output.


Changes in CIAO 4.15

The output file will now contain any WCS transforms set on the input image.


Bugs

There are no known bugs for this tool.

See Also

concept
subspace
dm
dmfiltering, dmmasks, dmregions
tools
convert_ds9_region_to_ciao_stack, dither_region, dmappend, dmcontour, dmellipse, dmfilth, dmgroupreg, dmimg2jpg, dmimgadapt, dmimgblob, dmimgcalc, dmimgdist, dmimgfilt, dmimghist, dmimghull, dmimglasso, dmimgpick, dmimgpm, dmimgproject, dmimgreproject, dmimgthresh, dmmakereg, dmmaskbin, dmmaskfill, dmnautilus, dmregrid, dmregrid2, dmstat, evalpos, get_src_region, imgmoment, mean_energy_map, mkbgreg, mksubbgreg, pileup_map, roi, splitroi, tg_create_mask