HELP ARRAYSLICE David Young, August 1998 ___LIB * __________ARRAYSLICE provides procedures for accessing and updating an N-1 dimensional "slice" of an N dimensional array. arrayslice(_____arrin, ___dim, _i, ______arrout, _________regionout) -> ______arrout The first argument _____arrin is an array, of say _N dimensions. A "slice" of this array is defined by those elements whose ___dim'th index is _i. For example, for a 2-D image array whose first index refers to the column and whose second index refers to the row, ___dim = 1 means extract the _i'th column, and ___dim = 2 means extract the _i'th row. For a 3-D input array, a slice is a 2-D plane, and so on. ___dim and _i must be integers. The result will have one fewer dimension than the input, and the condition satisfied on exit is thus _____arrin(<___dim-1 indices>, _i, <_N-___dim indices>) = ______arrout(, ) for all sets of indices that refer to points in the input and output regions as defined below. On entry, ______arrout may be an array which is to receive the data. In this case, the same array is returned as the result after some or all of its elements have been updated. Alternatively ______arrout may be on entry, in which case a new array is created and returned. The region from which data are taken is defined as follows. If ______arrout and _________regionout are both , then the whole of the slice of the input array is copied. For example, if the input array has boundslist [1 10 2 20 3 30] and ___dim = 2, then the newly created output array will have boundslist [1 10 3 30]. if _________regionout is not it must be a list of *boundslist type which specifies the region of the output array in which to store data. If a new array is created, then _________regionout will become its boundslist; otherwise parts of ______arrout outside _________regionout will not be changed. In either case, _________regionout also specifies the part of the input slice from which data are to be taken. For example, if _________regionout is [2 5 3 13], ___dim = 2 and _i = 10, then data will be taken from the region of the 3-D input array given by [2 5 10 10 3 13]. This region must be contained within _____arrin's array bounds. If _____arrin is an array and _________regionout is , then the output region is taken to be the whole of _____arrin, whose boundslist must therefore not go outside the input slice bounds. (_____arrin, ________regionin) -> arrayslice(______arrout, ___dim, _i) In the updating form, _____arrin has _N-1 dimensions and ______arrout has _N dimensions. Data from _____arrin are copied into the slice of ______arrout defined by ___dim and _i as described above. The relationship between elements of _____arrin and ______arrout when the procedure returns is ______arrout(<___dim-1 indices>, _i, <_N-___dim indices>) = _____arrin(, ) If ________regionin is , then the whole of _____arrin is copied to the slice, which must be large enough to contain it. Otherwise, ________regionin must be a *boundslist type list specifying the part of _____arrin from which data are taken. --- __________________________$popvision/help/arrayslice --- _________Copyright __________University __of ______Sussex _____1998. ___All ______rights _________reserved.