level

level — Plane and rotation leveling

Synopsis




void        gwy_data_field_area_fit_plane   (GwyDataField *data_field,
                                             gint col,
                                             gint row,
                                             gint width,
                                             gint height,
                                             gdouble *pa,
                                             gdouble *pbx,
                                             gdouble *pby);
void        gwy_data_field_plane_coeffs     (GwyDataField *data_field,
                                             gdouble *pa,
                                             gdouble *pbx,
                                             gdouble *pby);
void        gwy_data_field_plane_level      (GwyDataField *data_field,
                                             gdouble a,
                                             gdouble bx,
                                             gdouble by);
void        gwy_data_field_plane_rotate     (GwyDataField *data_field,
                                             gdouble xangle,
                                             gdouble yangle,
                                             GwyInterpolationType interpolation);
gdouble*    gwy_data_field_area_fit_polynom (GwyDataField *data_field,
                                             gint col,
                                             gint row,
                                             gint width,
                                             gint height,
                                             gint col_degree,
                                             gint row_degree,
                                             gdouble *coeffs);
void        gwy_data_field_area_subtract_polynom
                                            (GwyDataField *data_field,
                                             gint col,
                                             gint row,
                                             gint width,
                                             gint height,
                                             gint col_degree,
                                             gint row_degree,
                                             gdouble *coeffs);

Description

Details

gwy_data_field_area_fit_plane ()

void        gwy_data_field_area_fit_plane   (GwyDataField *data_field,
                                             gint col,
                                             gint row,
                                             gint width,
                                             gint height,
                                             gdouble *pa,
                                             gdouble *pbx,
                                             gdouble *pby);

Fits a plane through a rectangular part of a data field.

Returned coefficients are in real (physical) units.

data_field : A data field
col : Upper-left column coordinate.
row : Upper-left row coordinate.
width : Area width (number of columns).
height : Area height (number of rows).
pa : Where constant coefficient should be stored (or NULL).
pbx : Where x plane coefficient should be stored (or NULL).
pby : Where y plane coefficient should be stored (or NULL).

Since 1.2.


gwy_data_field_plane_coeffs ()

void        gwy_data_field_plane_coeffs     (GwyDataField *data_field,
                                             gdouble *pa,
                                             gdouble *pbx,
                                             gdouble *pby);

Fits a plane through a data field.

Returned coefficients are in real (physical) units.

data_field : A data field.
pa : Where constant coefficient should be stored (or NULL).
pbx : Where x plane coefficient should be stored (or NULL).
pby : Where y plane coefficient should be stored (or NULL).

gwy_data_field_plane_level ()

void        gwy_data_field_plane_level      (GwyDataField *data_field,
                                             gdouble a,
                                             gdouble bx,
                                             gdouble by);

Subtracts plane from a data field..

Coefficients should be in real (physical) units.

data_field : A data field.
a : Constant coefficient.
bx : X coefficient.
by : Y coefficient.

gwy_data_field_plane_rotate ()

void        gwy_data_field_plane_rotate     (GwyDataField *data_field,
                                             gdouble xangle,
                                             gdouble yangle,
                                             GwyInterpolationType interpolation);

Performs rotation of plane along x and y axis.

data_field : A data field.
xangle : Rotation angle in x direction (rotation along y axis).
yangle : Rotation angle in y direction (rotation along x axis).
interpolation : Interpolation type.

gwy_data_field_area_fit_polynom ()

gdouble*    gwy_data_field_area_fit_polynom (GwyDataField *data_field,
                                             gint col,
                                             gint row,
                                             gint width,
                                             gint height,
                                             gint col_degree,
                                             gint row_degree,
                                             gdouble *coeffs);

Fits a two-dimensional polynom to a part of a GwyDataField.

data_field : A data field
col : Upper-left column coordinate.
row : Upper-left row coordinate.
width : Area width (number of columns).
height : Area height (number of rows).
col_degree : Degree of polynom to fit column-wise (x-coordinate).
row_degree : Degree of polynom to fit row-wise (y-coordinate).
coeffs : An array of size (row_degree+1)*(col_degree+1) to store the coefficients to, or NULL (a fresh array is allocated then). The coefficients are stored by row, like data in a datafield.
Returns : Either coeffs if it was not NULL, or a newly allocated array with coefficients.

Since 1.6


gwy_data_field_area_subtract_polynom ()

void        gwy_data_field_area_subtract_polynom
                                            (GwyDataField *data_field,
                                             gint col,
                                             gint row,
                                             gint width,
                                             gint height,
                                             gint col_degree,
                                             gint row_degree,
                                             gdouble *coeffs);

Subtract a two-dimensional polynom from a part of a GwyDataField.

data_field : A data field
col : Upper-left column coordinate.
row : Upper-left row coordinate.
width : Area width (number of columns).
height : Area height (number of rows).
col_degree : Degree of polynom to subtract column-wise (x-coordinate).
row_degree : Degree of polynom to subtract row-wise (y-coordinate).
coeffs : An array of size (row_degree+1)*(col_degree+1) with coefficients in the same order as gwy_data_field_area_fit_polynom() uses.

Since 1.6