PRO kernel_indices_circ, hksize_in, hires_hksize, hires_knpix, hires_kxind, hires_kyind, hires_ksize, lores_knpix, lores_kxind, lores_kyind, knpix, hksize, ksize ; Description: This module generates a set of pixel indices for a kernel array that has single-pixel kernel ; elements from the centre out to a kernel radius of "hires_hksize" and nine-pixel kernel ; elements from a kernel radius of "hires_hksize" to a kernel radius of "hksize_in". The kernel ; shape is assumed to be circular. The module also returns the number of single-pixel kernel ; elements "hires_knpix", the number of nine-pixel kernel elements "lores_knpix" and the total ; number of kernel elements "knpix", along with the final kernel radius "hksize" and kernel ; diameter "ksize" in pixels. ; ; Input Parameters: ; ; hksize_in - INTEGER/LONG - The kernel radius (pix) such that the kernel diameter is given by ; "(2*hksize_in) + 1" pixels. If this parameter is supplied with a zero or ; negative value, then the module returns one single-pixel kernel element. ; hires_hksize - INTEGER/LONG - The kernel radius (pix) for the single-pixel kernel elements such that ; the kernel diameter for the single-pixel kernel elements is given by ; "(2*hires_hksize) + 1" pixels. If this parameter has a negative or a ; zero value, then the kernel array will consist exclusively of nine-pixel ; kernel elements. If this parameter has a value that is greater than or ; equal to "hksize_in", then the kernel array will consist exclusively of ; single-pixel kernel elements. If this parameter has a value that is ; greater than zero but less than "hksize_in", then the kernel array will ; consist of a mixture of single-pixel and nine-pixel kernel elements. ; ; Output Parameters: ; ; hires_knpix - LONG - The number of single-pixel kernel elements in the kernel array. ; hires_kxind - INTEGER VECTOR - A one-dimensional vector of pixel indices along the x-axis where each ; element corresponds to a single-pixel kernel element. Hence there are ; "hires_knpix" elements in this vector. ; hires_kyind - INTEGER VECTOR - A one-dimensional vector of pixel indices along the y-axis where each ; element corresponds to a single-pixel kernel element. Hence there are ; "hires_knpix" elements in this vector. ; hires_ksize - INTEGER - The kernel diameter (pix) for the single-pixel kernel elements in the kernel ; array. ; lores_knpix - LONG - The number of nine-pixel kernel elements in the kernel array. ; lores_kxind - INTEGER VECTOR - A one-dimensional vector of pixel indices along the x-axis where each ; element corresponds to the central pixel of a nine-pixel kernel element. ; Hence there are "lores_knpix" elements in this vector. ; lores_kyind - INTEGER VECTOR - A one-dimensional vector of pixel indices along the y-axis where each ; element corresponds to the central pixel of a nine-pixel kernel element. ; Hence there are "lores_knpix" elements in this vector. ; knpix - LONG - The total number of kernel elements in the kernel array. ; hksize - INTEGER - The final kernel radius (pix) such that the kernel diameter is given by ; "(2*hksize) + 1". In the case where the kernel array includes nine-pixel kernel ; elements, the module may have found it necessary to adjust the value of "hksize_in", ; and "hksize" is the adjusted value for the kernel radius. ; ksize - INTEGER - The final kernel diameter (pix) with the value "(2*hksize) + 1". ; ; Author: Dan Bramich (dan.bramich@hotmail.co.uk) ; ; History: ; ; 03/09/2008 - Module created (dmb) ;If this module fails, then the kernel will consist of one single-pixel kernel element ;Check that "hksize_in" is a number of the correct type ;If the value of "hksize_in" is zero or negative, then return the single-pixel kernel element ;Check that "hires_hksize" is a number of the correct type ;Determine the kernel indices for a kernel array consisting exclusively of nine-pixel kernel elements ;Given that each kernel element is a 3x3 pixel array, determine the required kernel radius and diameter ;Set the relevant output parameters appropriately for a kernel that does not have any single-pixel kernel ;elements ;Set up arrays describing the x and y pixel indices of each nine-pixel kernel element and the distance of ;each kernel pixel from the kernel centre ;Determine the lists of x and y pixel indices for the central pixel of the nine-pixel kernel elements, ;along with the number of nine-pixel kernel elements ;Determine the total number of kernel elements ;Determine the kernel indices for a kernel array consisting exclusively of single-pixel kernel elements ;Determine the required kernel diameter ;Set up arrays describing the x and y pixel indices of each kernel pixel and the distance of each kernel ;pixel from the kernel centre ;Determine the lists of x and y pixel indices for the single-pixel kernel elements, along with the number ;of single-pixel kernel elements ;Set the relevant output parameters appropriately for a kernel that does not have any nine-pixel kernel ;elements ;Determine the total number of kernel elements ;Determine the kernel indices for a kernel array consisting of both single-pixel and nine-pixel kernel ;elements ;Determine the radius and diameter of the kernel as if it consists only of nine-pixel kernel elements ;Set up arrays describing the x and y pixel indices of each nine-pixel kernel element and the distance of ;each kernel pixel from the kernel centre ;Determine the lists of x and y pixel indices for the central pixel of the nine-pixel kernel elements, ;along with the number of nine-pixel kernel elements ;Set up arrays describing the x and y pixel indices of each kernel pixel ;Determine the lists of x and y pixel indices for the single-pixel kernel elements, along with the number ;of single-pixel kernel elements ;Determine the total number of kernel elements