Getting Started | Documentation | Glish | Learn More | Programming | Contact Us |
Version 1.9 Build 1488 |
|
Package | general | |
Module | images | |
Tool | regionmanager |
box | in | The world region to extend over | |
Allowed: | World box region tool | ||
region | in | The world region to extend | |
Allowed: | Region tool | ||
comment | in | A comment stored with the region | |
Allowed: | String |
This function (short-hand name ext) creates a region which is the extension over specified dimensions along straight lines of the given region. For example, you might like to extend a 2-D polygon to be a 3-D `cylindrical polygon' (that is, the polygon is replicated for each plane).
The extension is specified with a world box. It can be of any dimension. However, you can't put the same axes in the extension box as are in the region you are extending.
- im := image('cube') - cs := im.coordsys() - im.shape() [155 178 64] - - drm.setcoordinates(cs) - - x := dq.quantity([40,45,48,55,48,43,40], 'pix') - y := dq.quantity([40,43,59,60,53,48,45], 'pix') - poly := drm.wpolygon(x, y, [1,3]) - box := drm.wbox(dq.quantity("20pix"), dq.quantity("30pix"), [2]) - - ext := drm.extension(box, poly, 'a cylindrical polygon') - - im.boundingbox(poly) [blc=[40 1 40] , trc=[55 178 60] , inc=[1 1 1] , bbShape=[16 178 21] , regionShape=[16 178 21] , imageShape=[155 178 256] ] - - im.boundingbox(box) [blc=[1 20 1] , trc=[155 30 256] , inc=[1 1 1] , bbShape=[155 11 256] , regionShape=[155 11 256] , imageShape=[155 178 256] ] - - im.boundingbox(ext) [blc=[40 20 40] , trc=[55 30 60] , inc=[1 1 1] , bbShape=[16 11 21] , regionShape=[16 11 21] , imageShape=[155 178 256] ]
In this example we create a 2D polygon in the XZ plane. We then create a 1D box along the Y axis from pixels 20 to 30. Then we extend the polygon with that box to make a series of XZ polygons for the specified Y pixels.
Note that when the box and poly regions are applied to the image with the boundingbox function, the auto-extension operation is applied. It is not until the region has as many dimensions as the image (the region ext) that no auto-extension occurs.