![]() |
![]() |
Gwyddion Data Processing Library Reference Manual | ![]() |
|
---|---|---|---|---|
enum GwyPlaneFitQuantity; 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_fit_polynom (GwyDataField *data_field, gint col_degree, gint row_degree, gdouble *coeffs); 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_subtract_polynom (GwyDataField *data_field, gint col_degree, gint row_degree, const 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, const gdouble *coeffs); GwyDataField** gwy_data_field_area_fit_local_planes (GwyDataField *data_field, gint size, gint col, gint row, gint width, gint height, gint nresults, const GwyPlaneFitQuantity *types, GwyDataField **results); GwyDataField* gwy_data_field_area_local_plane_quantity (GwyDataField *data_field, gint size, gint col, gint row, gint width, gint height, GwyPlaneFitQuantity type, GwyDataField *result); GwyDataField** gwy_data_field_fit_local_planes (GwyDataField *data_field, gint size, gint nresults, const GwyPlaneFitQuantity *types, GwyDataField **results); GwyDataField* gwy_data_field_local_plane_quantity (GwyDataField *data_field, gint size, GwyPlaneFitQuantity type, GwyDataField *result);
typedef enum { GWY_PLANE_FIT_A = 1, GWY_PLANE_FIT_BX, GWY_PLANE_FIT_BY, GWY_PLANE_FIT_ANGLE, GWY_PLANE_FIT_SLOPE, GWY_PLANE_FIT_S0, GWY_PLANE_FIT_S0_REDUCED } GwyPlaneFitQuantity;
Quantity that can be requested from gwy_data_field_area_fit_local_planes()
et al.
Since 1.9
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.
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.
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. |
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. |
gdouble* gwy_data_field_fit_polynom (GwyDataField *data_field, gint col_degree, gint row_degree, gdouble *coeffs);
Fits a two-dimensional polynom to a data field.
data_field : |
A data field. |
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),
see gwy_data_field_area_fit_polynom() for details.
|
Returns : | Either coeffs if it was not NULL , or a newly allocated array
with coefficients.
|
Since 1.9
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 rectangular part of a data field.
The coefficients are stored by row into coeffs
, like data in a datafield.
Row index is y-degree, column index is x-degree.
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).
|
Returns : | Either coeffs if it was not NULL , or a newly allocated array
with coefficients.
|
Since 1.6
void gwy_data_field_subtract_polynom (GwyDataField *data_field, gint col_degree, gint row_degree, const gdouble *coeffs);
Subtracts a two-dimensional polynom from a data field.
data_field : |
A data field. |
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,
see gwy_data_field_area_fit_polynom() for details.
|
Since 1.9
void gwy_data_field_area_subtract_polynom (GwyDataField *data_field, gint col, gint row, gint width, gint height, gint col_degree, gint row_degree, const gdouble *coeffs);
Subtracts a two-dimensional polynom from a rectangular part of a data field.
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,
see gwy_data_field_area_fit_polynom() for details.
|
Since 1.6
GwyDataField** gwy_data_field_area_fit_local_planes (GwyDataField *data_field, gint size, gint col, gint row, gint width, gint height, gint nresults, const GwyPlaneFitQuantity *types, GwyDataField **results);
Fits a plane through neighbourhood of each sample in a rectangular part of a data field.
The sample is always in the origin of its local (x,y) coordinate system,
even if the neighbourhood is not centered about it (e.g. because sample
is on the edge of data field). Z-coordinate is however not centered,
that is GWY_PLANE_FIT_A
is normal mean value.
data_field : |
A data field. |
size : |
Neighbourhood size (must be at least 2). It is centered around
each pixel, unless size is even when it sticks to the right.
|
col : |
Upper-left column coordinate. |
row : |
Upper-left row coordinate. |
width : |
Area width (number of columns). |
height : |
Area height (number of rows). |
nresults : |
The number of requested quantities. |
types : |
The types of requested quantities. |
results : |
An array to store quantities to, may be NULL to allocate a new
one which must be freed by caller then. If any item is NULL ,
a new data field is allocated for it, existing data fields
are resized to width x height .
|
Returns : | An array of data fields with requested quantities, that is
results unless it was NULL and a new array was allocated.
|
Since 1.9
GwyDataField* gwy_data_field_area_local_plane_quantity (GwyDataField *data_field, gint size, gint col, gint row, gint width, gint height, GwyPlaneFitQuantity type, GwyDataField *result);
Convenience function to get just one quantity from
gwy_data_field_area_fit_local_planes()
.
data_field : |
A data field. |
size : |
Neighbourhood size. |
col : |
Upper-left column coordinate. |
row : |
Upper-left row coordinate. |
width : |
Area width (number of columns). |
height : |
Area height (number of rows). |
type : |
The type of requested quantity. |
result : |
A data field to store result to, or NULL to allocate a new one.
|
Returns : | result if it isn't NULL , otherwise a newly allocated data field.
|
Since 1.9
GwyDataField** gwy_data_field_fit_local_planes (GwyDataField *data_field, gint size, gint nresults, const GwyPlaneFitQuantity *types, GwyDataField **results);
Fits a plane through neighbourhood of each sample in a data field.
See gwy_data_field_area_fit_local_planes()
for details.
data_field : |
A data field. |
size : |
Neighbourhood size. |
nresults : |
The number of requested quantities. |
types : |
The types of requested quantities. |
results : |
An array to store quantities to. |
Returns : | An array of data fields with requested quantities. |
Since 1.9
GwyDataField* gwy_data_field_local_plane_quantity (GwyDataField *data_field, gint size, GwyPlaneFitQuantity type, GwyDataField *result);
Convenience function to get just one quantity from
gwy_data_field_fit_local_planes()
.
data_field : |
A data field. |
size : |
Neighbourhood size. |
type : |
The type of requested quantity. |
result : |
A data field to store result to, or NULL to allocate a new one.
|
Returns : | result if it isn't NULL , otherwise a newly allocated data field.
|
Since 1.9