next up previous 526
Next: Using World or Axis Co-ordinates to Specify Sections
Up: NDF Sections
Previous: Specifying Lower and Upper Bounds


Specifying Centre and Extent

An alternative form for the subscript expression involves specifying the centre and extent of the region required along each dimension, as follows

name( p$ \sim$q, r$ \sim$s, ... )

where `p$ \sim$q', `r$ \sim$s', (etc.) specify the centre and extent. Thus,

name(100$ \sim$11,200$ \sim$5)

would refer to an 11$ \times$5-pixel region of an image centred on pixel (100, 200).

If the value before the delimiting `$ \sim$' is omitted, it will default to the index of the central pixel in that dimension (rounded downwards if there are an even number of pixels). If the value following the `$ \sim$' is omitted, it will default to the number of pixels in that dimension. Thus,

image( $ \sim$100, $ \sim$100)

could be used to refer to a 100$ \times$100-pixel region located centrally within an image, while

image( 10$ \sim$, 20$ \sim$ )

would specify a section which is the same size as the original image, but displaced so that it is centred on pixel (10, 20).


next up previous 526
Next: Using World or Axis Co-ordinates to Specify Sections
Up: NDF Sections
Previous: Specifying Lower and Upper Bounds

KAPPA --- Kernel Application Package
Starlink User Note 95
Malcolm J. Currie & David S. Berry
2008 September 12
E-mail:ussc@star.rl.ac.uk

Copyright © 2008 Science and Technology Facilities Council