DATAMANIP (kdatamanip) functions


LIBRARY ROUTINE

lkresample - resample the value data of an object

LIBRARY CALL

int lkresample(
	kobject i,
	double wfactor, 
	double hfactor, 
	double dfactor, 
	double tfactor, 
	double efactor,
	int wcenter, 
	int hcenter, 
	int dcenter, 
	int tcenter, 
	int ecenter,
	int resize,
	int interpolate,
	kobject o)

INPUT

OUTPUT

RETURN VALUE

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

DESCRIPTION

lkresample is the library routine that actually resamples the object data. lkresample magnifies or reduces the source data object (i) by using the selected interpolation method (interpolate). (At this time, only only pixel replication is supported.) Magnification factors greater than 1 magnify the object, and magnification factors between 0 and 1 reduce the object.

Pixel replication and subsampling are done on a floating point indexing basis, where the data point index is obtained by truncating the cumulative floating point index. Therefore, when the calculated replication factor or the subsampling step size is non-integer, the resulting integer step size varies during the process.

The options for the interpolate parameter are KPAD and KZERO_ORDER (pixel replication). A third option, KZERO_ORDER (bilinear interpolation) will be added in the future.

Magnification Factors: individual magnification factors are specified for each dimension by the wfactor, hfactor, dfactor, tfactor, and efactor parameters, and must be values greater than zero.

Center of Action: The magnification or reduction is done about a center point that can be specified to be anywhere in the object (even outside of the object). The center of action coordinates are specified for each dimension by the wcenter, hcenter, dcenter, tcenter, and ecenter parameters.

Destination Object Size: The resultant destination object size will be the same as the source object size if the resize flag is FALSE, or it will be resized to fit the magnified or reduced data set if resize flag is TRUE.

If resize is FALSE, and the source object is reduced (magnification factors < 1.0) then unknown pixels are set to zero. Likewise, if the source object is magnified (magnification factor > 1.0) then input data that would be mapped outside of the destination object are lost.

Data Type: The data type of the destination object's value data is the same as the source object's value data type.

If there is map and value data in the source object, and zero order interpolation (pixel replication) is used, the map is transferred to the destination object. If any interpolation algorithm is used, the value data is mapped before the operation can begin and the destination will not have map data. This program fails if the source object lacks both map data and value data.

This program fails if there is mask data and the operation uses anything other than zero order interpolation. In other words, if value data is being replicated or subsample on grid, then the mask can be correspondingly replicated or subsampled. (Bilinear interpolation can not be performed on mask data.)

If explicit location or time data are available, the sampling algorithm can not resample these data yet, and will fail. This will be implemented later ....

ADDITIONAL INFORMATION

none

EXAMPLES

none

SIDE EFFECTS

none

RESTRICTIONS

none

MODIFICATION

13 Dec 1993 - Scott Wilson - Converted from lkresample()

FILES

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

SEE ALSO

kdatamanip(3)

COPYRIGHT

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