Gwyscan Library
 All Data Structures Files Functions Enumerations Enumerator Macros Groups
Preview data in regular matrix
GwyscanResult gwyscan_preview (const double *xypos, const double *zdata, int n, int channel, double *preview_image, double *preview_mask, int preview_width, int preview_height, double preview_xreal, double preview_yreal, double preview_xoffset, double preview_yoffset, double preview_angle)
 Interpolates non-equidistant data onto a regular grid. More...
 
GwyscanResult gwyscan_preview_subset (const double *xypos, const double *zdata, int n, int from, int len, int channel_from, int channel_to, double **preview_images, double *preview_mask, int preview_width, int preview_height, double preview_xreal, double preview_yreal, double preview_xoffset, double preview_yoffset, double preview_angle)
 Interpolates non-equidistant data onto a regular grid in one channel. More...
 
GwyscanResult gwyscan_preview_subset_all_channels (const double *xypos, const double *zdata, int n, int from, int len, int nchannels, double **preview_images, double *preview_mask, int preview_width, int preview_height, double preview_xreal, double preview_yreal, double preview_xoffset, double preview_yoffset, double preview_angle)
 Quickly interpolates non-equidistant data onto a regular grid. More...
 
GwyscanResult gwyscan_preview_average (const double *xypos, const double *zdata, int n, int channel, double *preview_image, double *preview_mask, int preview_width, int preview_height, double preview_xreal, double preview_yreal, double preview_xoffset, double preview_yoffset, double preview_angle)
 Quickly interpolates non-equidistant data onto a regular grid. Uses fast average algorithm. More...
 
GwyscanResult gwyscan_preview_subset_average (const double *xypos, const double *zdata, int n, int from, int len, int channel_from, int channel_to, double **preview_images, double *preview_mask, int preview_width, int preview_height, double preview_xreal, double preview_yreal, double preview_xoffset, double preview_yoffset, double preview_angle)
 Quickly interpolates non-equidistant data onto a regular grid in one channel. More...
 
GwyscanResult gwyscan_preview_subset_average_all_channels (const double *xypos, const double *zdata, int n, int from, int len, int nchannels, double **preview_images, double *preview_mask, int preview_width, int preview_height, double preview_xreal, double preview_yreal, double preview_xoffset, double preview_yoffset, double preview_angle)
 Quickly interpolates non-equidistant data onto a regular grid. More...
 

Detailed Description

Function Documentation

GwyscanResult gwyscan_preview ( const double *  xypos,
const double *  zdata,
int  n,
int  channel,
double *  preview_image,
double *  preview_mask,
int  preview_width,
int  preview_height,
double  preview_xreal,
double  preview_yreal,
double  preview_xoffset,
double  preview_yoffset,
double  preview_angle 
)

Interpolates non-equidistant data onto a regular grid.

Fills two dimensional array (represented as one-dimensional one) using non-equidistant data, using triangulation. Can use mask, if specified, to mark which parts of the grid should be filled. This method is computationally demanding and quite slow.

Parameters
xyposis xy positions, stored as interleaved arrays (x1, y1, x2, y2 ... xn, yn) of size 2*n.
zdatais measured values (height, error signal, etc.), stored sequentially (e.g. za1, za2, .. zan, zb1, zb2, .. zbn for channels za and zb).
nis number of measured data points or data points to use within preview function.
channelis index of channel from which the preview should be generated.
preview_imageis data to be filled by preview on regular grid. This must be allocated for xres*yres.
preview_maskis the mask array of where the data should be filled (1) or not (0), represented as array of same dimensions as data, can be NULL to fill everything.
preview_widthis number of pixels of preview image in x direction.
preview_heightis number of pixels of preview image in y direction.
preview_xrealis physical range of preview in x direction.
preview_yrealis physical range of preview in y direction.
preview_xoffsetis x offset of preview in physical units.
preview_yoffsetis y offset of preview in physical units.
preview_angleis angle of preview in radians.
Returns
error code.
GwyscanResult gwyscan_preview_average ( const double *  xypos,
const double *  zdata,
int  n,
int  channel,
double *  preview_image,
double *  preview_mask,
int  preview_width,
int  preview_height,
double  preview_xreal,
double  preview_yreal,
double  preview_xoffset,
double  preview_yoffset,
double  preview_angle 
)

Quickly interpolates non-equidistant data onto a regular grid. Uses fast average algorithm.

Fills two dimensional array (represented as one-dimensional one) using non-equidistant data, using simplified triangulation. Can use mask, if specified, to mark which parts of the grid should be filled. Method obtains pixel values using a combination of simple averaging and propagation. In dense locations where many XYZ points fall into a single pixel the value assigned to such pixel is a sort of weighted mean value of the points. In sparse locations where relatively large regions contain no XYZ data points the pixel value is propagated from close pixels that contain some XYZ data points. The main feature of this interpolation type is that it is always fast while often producing quite an acceptable result.

Parameters
xyposis xy positions, stored as interleaved arrays (x1, y1, x2, y2 ... xn, yn) of size 2*n.
zdatais measured values (height, error signal, etc.), stored sequentially (e.g. za1, za2, .. zan, zb1, zb2, .. zbn for channels za and zb).
nis number of measured data points or data points to use within preview function.
channelis index of channel from which the preview should be generated.
preview_imageis data to be filled by preview on regular grid. This must be allocated for xres*yres.
preview_maskis the mask array of where the data should be filled (1) or not (0), represented as array of same dimensions as data, can be NULL to fill everything.
preview_widthis number of pixels of preview image in x direction.
preview_heightis number of pixels of preview image in y direction.
preview_xrealis physical range of preview in x direction.
preview_yrealis physical range of preview in y direction.
preview_xoffsetis x offset of preview in physical units.
preview_yoffsetis y offset of preview in physical units.
preview_angleis angle of preview in radians.
Returns
error code.
Examples:
preview.c.
GwyscanResult gwyscan_preview_subset ( const double *  xypos,
const double *  zdata,
int  n,
int  from,
int  len,
int  channel_from,
int  channel_to,
double **  preview_images,
double *  preview_mask,
int  preview_width,
int  preview_height,
double  preview_xreal,
double  preview_yreal,
double  preview_xoffset,
double  preview_yoffset,
double  preview_angle 
)

Interpolates non-equidistant data onto a regular grid in one channel.

Fills two dimensional array (represented as one-dimensional one) using non-equidistant data, using triangulation. Can use mask, if specified, to mark which parts of the grid should be filled. This method is computationally demanding and quite slow.

Parameters
xyposis xy positions, stored as interleaved arrays (x1, y1, x2, y2 ... xn, yn) of size 2*n.
zdatais measured values (height, error signal, etc.), stored sequentially (e.g. za1, za2, .. zan, zb1, zb2, .. zbn for channels za and zb).
nis number of measured data points or data points to use within preview function.
fromis offset in zdata if not whole xyz data should be used for preview. Typically all data points are used, and value should be 0.
lenis number of measured data points or data points to use within one channel. Typically the whole channel is used, and value should be n.
channel_fromis index of channel from which the preview should be generated.
channel_tois index of channel to which the preview should be generated.
preview_imagesis array of data to be filled by preview on regular grid. This must be allocated for preview_width * . Number of array elements must be the same as number of previewed channels: number_of_preview_images = channel_to - channel_from + 1.
preview_maskis the mask array of where the data should be filled (1) or not (0), represented as array of same dimensions as the output images, can be NULL to fill everything.
preview_widthis number of pixels of preview image in x direction.
preview_heightis number of pixels of preview image in y direction.
preview_xrealis physical range of preview in x direction.
preview_yrealis physical range of preview in y direction.
preview_xoffsetis x offset of preview in physical units.
preview_yoffsetis y offset of preview in physical units.
preview_angleis angle of preview in radians.
Returns
error code.
GwyscanResult gwyscan_preview_subset_all_channels ( const double *  xypos,
const double *  zdata,
int  n,
int  from,
int  len,
int  channels,
double **  preview_images,
double *  preview_mask,
int  preview_width,
int  preview_height,
double  preview_xreal,
double  preview_yreal,
double  preview_xoffset,
double  preview_yoffset,
double  preview_angle 
)

Quickly interpolates non-equidistant data onto a regular grid.

Fills two dimensional array (represented as one-dimensional one) using non-equidistant data, using simple triangulation. Can use mask, if specified, to mark which parts of the grid should be filled.

In contrast to gwyscan_preview_subset(), this function works on all channels. Note that this function is not LabView friendly due /p **preview_images definition. LabView cannot handle array of arrays.

Parameters
xyposis xy positions, stored as interleaved arrays (x1, y1, x2, y2 ... xn, yn) of size 2*n.
zdatais measured values (height, error signal, etc.), stored sequentially (e.g. za1, za2, .. zan, zb1, zb2, .. zbn for channels za and zb).
nis number of measured data points or data points to use within preview function.
fromis offset in zdata if not whole xyz data should be used for preview. Typically all data points are used, and value should be 0.
lenis number of measured data points or data points to use within one channel. Typically the whole channel is used, and value should be n.
channelsis number of channels.
preview_imagesis array of data to be filled by preview on regular grid. This must be allocated for preview_width * . Number of array elements must be the same as number of previewed channels: number_of_preview_images = channel_to - channel_from + 1.
preview_maskis the mask array of where the data should be filled (1) or not (0), represented as array of same dimensions as the output images, can be NULL to fill everything.
preview_widthis number of pixels of preview image in x direction.
preview_heightis number of pixels of preview image in y direction.
preview_xrealis physical range of preview in x direction.
preview_yrealis physical range of preview in y direction.
preview_xoffsetis x offset of preview in physical units.
preview_yoffsetis y offset of preview in physical units.
preview_angleis angle of preview.
Returns
error code.
GwyscanResult gwyscan_preview_subset_average ( const double *  xypos,
const double *  zdata,
int  n,
int  from,
int  len,
int  channel_from,
int  channel_to,
double **  preview_images,
double *  preview_mask,
int  preview_width,
int  preview_height,
double  preview_xreal,
double  preview_yreal,
double  preview_xoffset,
double  preview_yoffset,
double  preview_angle 
)

Quickly interpolates non-equidistant data onto a regular grid in one channel.

Fills two dimensional array (represented as one-dimensional one) using non-equidistant data, using simplified triangulation. Can use mask, if specified, to mark which parts of the grid should be filled. Method obtains pixel values using a combination of simple averaging and propagation. In dense locations where many XYZ points fall into a single pixel the value assigned to such pixel is a sort of weighted mean value of the points. In sparse locations where relatively large regions contain no XYZ data points the pixel value is propagated from close pixels that contain some XYZ data points. The main feature of this interpolation type is that it is always fast while often producing quite an acceptable result.

Parameters
xyposis xy positions, stored as interleaved arrays (x1, y1, x2, y2 ... xn, yn) of size 2*n.
zdatais measured values (height, error signal, etc.), stored sequentially (e.g. za1, za2, .. zan, zb1, zb2, .. zbn for channels za and zb).
nis number of measured data points or data points to use within preview function.
fromis offset in zdata if not whole xyz data should be used for preview. Typically all data points are used, and value should be 0.
lenis number of measured data points or data points to use within one channel. Typically the whole channel is used, and value should be n.
channel_fromis index of channel from which the preview should be generated.
channel_tois index of channel to which the preview should be generated.
preview_imagesis array of data to be filled by preview on regular grid. This must be allocated for preview_width * . Number of array elements must be the same as number of previewed channels: number_of_preview_images = channel_to - channel_from + 1.
preview_maskis the mask array of where the data should be filled (1) or not (0), represented as array of same dimensions as the output images, can be NULL to fill everything.
preview_widthis number of pixels of preview image in x direction.
preview_heightis number of pixels of preview image in y direction.
preview_xrealis physical range of preview in x direction.
preview_yrealis physical range of preview in y direction.
preview_xoffsetis x offset of preview in physical units.
preview_yoffsetis y offset of preview in physical units.
preview_angleis angle of preview in radians.
Returns
error code.
GwyscanResult gwyscan_preview_subset_average_all_channels ( const double *  xypos,
const double *  zdata,
int  n,
int  from,
int  len,
int  channels,
double **  preview_images,
double *  preview_mask,
int  preview_width,
int  preview_height,
double  preview_xreal,
double  preview_yreal,
double  preview_xoffset,
double  preview_yoffset,
double  preview_angle 
)

Quickly interpolates non-equidistant data onto a regular grid.

Fills two dimensional array (represented as one-dimensional one) using non-equidistant data, using simple triangulation. Can use mask, if specified, to mark which parts of the grid should be filled.

In contrast to gwyscan_preview_subset(), this function works on all channels. Note that this function is not LabView friendly due /p **preview_images definition. LabView cannot handle array of arrays.

Parameters
xyposis xy positions, stored as interleaved arrays (x1, y1, x2, y2 ... xn, yn) of size 2*n.
zdatais measured values (height, error signal, etc.), stored sequentially (e.g. za1, za2, .. zan, zb1, zb2, .. zbn for channels za and zb).
nis number of measured data points or data points to use within preview function.
fromis offset in zdata if not whole xyz data should be used for preview. Typically all data points are used, and value should be 0.
lenis number of measured data points or data points to use within one channel. Typically the whole channel is used, and value should be n.
channelsis number of channels.
preview_imagesis array of data to be filled by preview on regular grid. This must be allocated for preview_width * . Number of array elements must be the same as number of previewed channels: number_of_preview_images = channel_to - channel_from + 1.
preview_maskis the mask array of where the data should be filled (1) or not (0), represented as array of same dimensions as the output images, can be NULL to fill everything.
preview_widthis number of pixels of preview image in x direction.
preview_heightis number of pixels of preview image in y direction.
preview_xrealis physical range of preview in x direction.
preview_yrealis physical range of preview in y direction.
preview_xoffsetis x offset of preview in physical units.
preview_yoffsetis y offset of preview in physical units.
preview_angleis angle of preview in radians.
Returns
error code.