DATAMANIP (kdatamanip) functions


LIBRARY ROUTINE

lksampline - Sample a data object along an arbitrary line

LIBRARY CALL

int lksampline(kobject in_obj,
	double wc1,double hc1,double dc1,double tc1,double ec1,
        double wc2,double hc2,double dc2,double tc2,double ec2,
        int n, int nc, kobject out_obj)

INPUT

OUTPUT

RETURN VALUE

TRUE (1) on success, FALSE (0) otherwise

DESCRIPTION

lksampline is used to sample the data in an object along an arbitrary line and at arbitrary intervals. The value at each sample point is obtained by an inverse distance weighting scheme.

The first sample point is precisely at the starting coordinate and the final sample is precisely at the ending coordinate.

The line may traverse any portion of the 5D data space. If a particular sample on the line lies outside the data space then the values will be interpolated using a padding value of zero.

The output object will be of the same data type as the input object. If a map is present in the input object, then the value data is sent through the map before processing. The output data will thus have no map.

Mask data, if present, is used to help control the interpolation. Value points with a corresponding mask value of zero will not be included in the interpolated value. However, a minimum number of neighboring values with a valid mask are required in order to produce a valid output value; non-valid output values are marked by a zero mask. If the mask segment is not present, then all value points in the source object are assumed to be valid.

The actual minimum required neighbor count is determined by the setting of the "nc" argument. If nc is zero, then the minimum required neighbor count will be computed from the dimensionality of the source data set. For nc=0, the minimum required neighbor count is 0.5*(2^dim)+1 where dim is the dimensionality of the source object (1 for a line, 2 for a plane, 3 for a volume, etc). If nc is non-zero, then the minimum required neighbor count is simply nc. Beware of non-intuitive results when interpolating across mask wise non-convex parts of the data object. The default minimum required neighbor count gives "reasonable" answers in these cases. Reducing the minimum required neighbor count can provide answers that are less and less meaningful.

Note that lksampline samples the data as if it were using a delta function. This implies that you may get significantly different results depending on the position of each sample location. You may wish to lowpass the source data before sampling with lksampline to avoid aliasing. This can be particularly important when dealing with "holey data" or when the sampling involves degenerate geometry (such as sampling a plane object with a sampling line that does not lie in the plane).

lksampline is implemented using point data access. A point data access is done for each sample in the line. This implies that a large number of samples may require quite some time to compute, particularly if operating on a higher dimension data set.

ADDITIONAL INFORMATION

none

EXAMPLES

none

SIDE EFFECTS

none

RESTRICTIONS

Restrictions on data or input as applicable

MODIFICATION

none

FILES

$DATAMANIP/objects/library/kdatamanip/src/lksampline.c

SEE ALSO

kdatamanip(3)

COPYRIGHT

Copyright (C) 1993 - 1997, Khoral Research, Inc. ("KRI") All rights reserved.