getregion (Aug2004) | rjtools | getregion (Aug2004) |
The marked regions are formatted according to one of four formats, selected through 'format': formats "basic" and "full" are valid for rectangular pixel regions, while formats "x" and "y" are reserved for pixel ranges. The formatted region strings are appended to regions file 'output' if that file already exists and 'append = yes'. When 'imageid = yes', the image name is prepended to the regions strings.
After displaying the image (if the image is already displayed and 'redispl = no' this step is omitted), a cursor cross or circle will appear in the display (the cursor shape may depend on the application used to display images, e.g. 'ximtool', 'saoimage' or 'ds9'), signaling that the task is ready to receive input. To mark an arbitrary rectangular region, move the cursor to one of the corners of that region and hit the 'b' key once. Then move the cursor to the diagonally opposite corner and hit 'b' again. A white box will be overlayed on the image indicating the position of the region just marked. Repeat until all regions are marked. If 'boxcen = yes', one may also define a region by moving the cursor to the center of that region and hitting 'r' once. A white box will be overlayed on the image display with a size determined by the 'boxxsize' and 'boxysize' parameters. Finally, a single pixel may be marked by hitting the 'c' key. Regions defined using the 'b', 'r' and 'c' keys may be mixed within a single session when 'boxcen = yes'; if 'boxcen = no', only 'b' and 'c' keys may be mixed. To end a session, hit 'q' within the image display window. The boundaries of the marked regions will now be colored according to the key or key sequence used: 'b' --> green, 'r' --> red, and 'c' --> blue.
The output regions strings written to 'output' will have the generic format:
image_name xlo xhi ylo yhi for format "basic" image_name[xlo:xhi,ylo:yhi] for format "full"where image_name is optional, depending on the value of 'imageid'. Image_name may include an image extension specification if supplied as part of the input image name 'image'.
To mark a pixel range, the selected format should be one of "x" and "y". In that case move the cursor cross to one of the extremes of the pixel range and hit '.' once, then move the cursor to the other extreme and hit '.' again. Multiple ranges may be marked and are output as a single range string with generic format:
image_name xlo1:xhi1[,xlo2:xhi2[,...]] for format "x" image_name ylo1:yhi1[,ylo2:yhi2[,...]] for format "y"where image_name , again, is optional. When all ranges are marked, hit 'q' and the task will overlay a blue captioned bar to indicate the range(s).
rj> getregion N3795B.fits[128:384,128:384] .reg basic boxcen+ \
>>> boxx=20 boxy=20 chkbound+ savetmp+ # GETREGION: NOAO/IRAF V2.12.1-EXPORT raj@miduv Aug 08 11:22:35 2003 image = N3795B.fits[128:384,128:384] [512 x 512] output= N3795B.reg (format="basic") Displaying image "N3795B.fits[128:384,128:384]": z1=51.67, z2=282.48 Wait for the cursor cross to appear in the image display area, then mark all regions by hitting "r" at the region center, "c" to mark a single pixel, or "b" twice to mark an arbitrary rectangular region. Type "q" to quit. Type b again to draw box. # GETREGION Finished. Saved "tvmark" files as "N3795B.tvm" and "-.tvc".rj> type N3795B.tvm 259. 314. 100 r <-- square region centered on star 327. 268. 100 r idem 160. 245. 100 r idem 171. 319. 100 b <--,rectangular region marking galaxy 347. 190. 100 b <-' 384. 177. 100 c <-- pixel affected by cosmic ray
rj> type N3795B.tvc 250 305 101 :color 204 \ 250 305 101 b > red box centered on star 269 324 101 b / 318 259 101 :color 204 \
318 259 101 b > red box centered on star 337 278 101 b / 151 236 101 :color 204 \
151 236 101 b > red box centered on star 170 255 101 b / 171 190 101 :color 205 \
171 190 101 b > green rectangle centered on galaxy 347 319 101 b / 384 177 101 :color 206 \
384 177 101 b > single pixel cosmic marked blue 384 177 101 b /rj> type N3795B.reg 250 269 305 324 <-- star 318 337 259 278 idem 151 170 236 255 idem 171 347 190 319 <-- galaxy 384 384 177 177 <-- cosmic
2. Now repeat the above example for 'format = "full"', prepending the image name and also making the output less verbose. We also don't need to redisplay the image):
rj> getregion N3795B.fits[128:384,128:384] .reg2 full boxcen+ \
>>> boxx=20 boxy=20 imageid+ chkbound+ redispl- savetmp- verbose- "r" = box center, "c" = pixel, "b" twice = region, "q" = quit. Type b again to draw box.rj> type N3795B.reg2 N3795B.fits[250:269,305:324] <-- star N3795B.fits[318:337,259:278] idem N3795B.fits[151:170,236:255] idem N3795B.fits[171:347,190:319] <-- galaxy N3795B.fits[384:384,177:177] <-- cosmic