Module gwy :: Class DataField
[hide private]
[frames] | no frames]

Class DataField

source code

Instance Methods [hide private]
 
__init__(xres, yres, xreal, yreal, nullme)
Creates a new data field.
source code
 
sum_fields(operand1, operand2)
Sums two data fields.
source code
 
subtract_fields(operand1, operand2)
Subtracts one data field from another.
source code
 
divide_fields(operand1, operand2)
Divides one data field with another.
source code
 
multiply_fields(operand1, operand2)
Multiplies two data fields.
source code
 
min_of_fields(operand1, operand2)
Finds point-wise maxima of two data fields.
source code
 
max_of_fields(operand1, operand2)
Finds point-wise minima of two data fields.
source code
 
check_compatibility(data_field2, check)
Checks whether two data fields are compatible.
source code
 
correct_laplace_iteration(mask_field, buffer_field, corrfactor, error)
Performs one interation of Laplace data correction.
source code
 
correct_average(mask_field)
Fills data under mask with average value.
source code
 
mask_outliers(mask_field, thresh)
Creates mask of data that are above or below thresh*sigma from average height.
source code
 
mask_outliers2(mask_field, thresh_low, thresh_high)
Creates mask of data that are above or below multiples of rms from average height.
source code
 
UNIMPLEMENTED_distort(dest, invtrans, user_data, interp, exterior, fill_value)
Distorts a data field in the horizontal plane.
source code
 
get_correlation_score(kernel_field, col, row, kernel_col, kernel_row, kernel_width, kernel_height)
Calculates a correlation score in one point.
source code
 
crosscorrelate(data_field2, x_dist, y_dist, score, search_width, search_height, window_width, window_height)
Algorithm for matching two different images of the same object under changes.
source code
 
UNIMPLEMENTED_crosscorrelate_init(data_field2, x_dist, y_dist, score, search_width, search_height, window_width, window_height)
Initializes a cross-correlation iterator.
source code
 
correlate(kernel_field, score, method)
Computes correlation score for all positions in a data field.
source code
 
UNIMPLEMENTED_correlate_init(kernel_field, score)
Creates a new correlation iterator.
source code
 
new_alike(nullme)
Creates a new data field similar to an existing one.
source code
 
data_changed()
Emits signal "data-changed" on a data field.
source code
 
new_resampled(xres, yres, interpolation)
Creates a new data field by resampling an existing one.
source code
 
resample(xres, yres, interpolation)
Resamples a data field using given interpolation method
source code
 
resize(ulcol, ulrow, brcol, brrow)
Resizes (crops) a data field.
source code
 
area_extract(col, row, width, height)
Extracts a rectangular part of a data field to a new data field.
source code
 
copy(dest, nondata_too)
Copies the contents of an already allocated data field to a data field of the same size.
source code
 
area_copy(dest, col, row, width, height, destcol, destrow)
Copies a rectangular area from one data field to another.
source code
 
get_xres()
Gets X resolution (number of columns) of a data field.
source code
 
get_yres()
Gets Y resolution (number of rows) of the field.
source code
 
get_xreal()
Gets the X real (physical) size of a data field.
source code
 
get_yreal()
Gets the Y real (physical) size of a data field.
source code
 
set_xreal(xreal)
Sets X real (physical) size value of a data field.
source code
 
set_yreal(yreal)
Sets Y real (physical) size value of a data field.
source code
 
get_xoffset()
Gets the X offset of data field origin.
source code
 
get_yoffset()
Gets the Y offset of data field origin.
source code
 
set_xoffset(xoff)
Sets the X offset of a data field origin.
source code
 
set_yoffset(yoff)
Sets the Y offset of a data field origin.
source code
 
get_si_unit_xy()
Returns lateral SI unit of a data field.
source code
 
get_si_unit_z()
Returns value SI unit of a data field.
source code
 
set_si_unit_xy(si_unit)
Sets the SI unit corresponding to the lateral (XY) dimensions of a data field.
source code
 
set_si_unit_z(si_unit)
Sets the SI unit corresponding to the "height" (Z) dimension of a data field.
source code
 
UNIMPLEMENTED_get_value_format_xy(style, format)
Finds value format good for displaying coordinates of a data field.
source code
 
UNIMPLEMENTED_get_value_format_z(style, format)
Finds value format good for displaying values of a data field.
source code
 
copy_units_to_data_line(data_line)
Sets lateral and value units of a data line to match a data field.
source code
 
itor(row)
Transforms vertical pixel coordinate to real (physical) Y coordinate.
source code
 
jtor(col)
Transforms horizontal pixel coordinate to real (physical) X coordinate.
source code
 
rtoi(realy)
Transforms real (physical) Y coordinate to row.
source code
 
rtoj(realx)
Transforms real (physical) X coordinate to column.
source code
 
get_val(col, row)
Gets value at given position in a data field.
source code
 
set_val(col, row, value)
Sets value at given position in a data field.
source code
 
get_dval(x, y, interpolation)
Gets interpolated value at arbitrary data field point indexed by pixel coordinates.
source code
 
get_dval_real(x, y, interpolation)
Gets interpolated value at arbitrary data field point indexed by real coordinates.
source code
 
rotate(angle, interpolation)
Rotates a data field by a given angle.
source code
 
invert(x, y, z)
Reflects amd/or inverts a data field.
source code
 
fill(value)
Fills a data field with given value.
source code
 
clear()
Fills a data field with zeroes.
source code
 
multiply(value)
Multiplies all values in a data field by given value.
source code
 
add(value)
Adds given value to all values in a data field.
source code
 
area_fill(col, row, width, height, value)
Fills a rectangular part of a data field with given value.
source code
 
area_clear(col, row, width, height)
Fills a rectangular part of a data field with zeroes.
source code
 
area_multiply(col, row, width, height, value)
Multiplies values in a rectangular part of a data field by given value
source code
 
area_add(col, row, width, height, value)
Adds given value to all values in a rectangular part of a data field.
source code
 
get_row(data_line, row)
Extracts a data field row into a data line.
source code
 
get_column(data_line, col)
Extracts a data field column into a data line.
source code
 
set_row(data_line, row)
Sets a row in the data field to values of a data line.
source code
 
set_column(data_line, col)
Sets a column in the data field to values of a data line.
source code
 
get_row_part(data_line, row, _from, to)
Extracts part of a data field row into a data line.
source code
 
get_column_part(data_line, col, _from, to)
Extracts part of a data field column into a data line.
source code
 
set_row_part(data_line, row, _from, to)
Puts a data line into a data field row.
source code
 
set_column_part(data_line, col, _from, to)
Puts a data line into data field column.
source code
 
get_xder(col, row)
Computes central derivative in X direction.
source code
 
get_yder(col, row)
Computes central derivative in Y direction.
source code
 
get_angder(col, row, theta)
Computes derivative in direction specified by given angle.
source code
 
xdwt(wt_coefs, direction, minsize)
Performs steps of the X-direction image wavelet decomposition.
source code
 
ydwt(wt_coefs, direction, minsize)
Performs steps of the Y-direction image wavelet decomposition.
source code
 
dwt(wt_coefs, direction, minsize)
Performs steps of the 2D image wavelet decomposition.
source code
 
dwt_mark_anisotropy(mask, wt_coefs, ratio, lowlimit) source code
 
elliptic_area_fill(col, row, width, height, value)
Fills an elliptic region of a data field with given value.
source code
 
elliptic_area_unextract(col, row, width, height, data)
Puts values back to an elliptic region of a data field.
source code
 
circular_area_fill(col, row, radius, value)
Fills an elliptic region of a data field with given value.
source code
 
UNIMPLEMENTED_circular_area_extract_with_pos(col, row, radius, data, xpos, ypos)
Extracts values with positions from a circular region of a data field.
source code
 
circular_area_unextract(col, row, radius, data)
Puts values back to a circular region of a data field.
source code
 
normalize()
Normalizes data in a data field to range 0.0 to 1.0.
source code
 
renormalize(range, offset)
Transforms data in a data field with first linear function to given range.
source code
 
threshold(threshval, bottom, top)
Tresholds values of a data field.
source code
 
area_threshold(col, row, width, height, threshval, bottom, top)
Tresholds values of a rectangular part of a data field.
source code
 
clamp(bottom, top)
Limits data field values to a range.
source code
 
area_clamp(col, row, width, height, bottom, top)
Limits values in a rectangular part of a data field to a range.
source code
 
area_gather(result, buffer, hsize, vsize, average, col, row, width, height)
Sums or averages values in reactangular areas around each sample in a data field.
source code
 
convolve(kernel_field)
Convolves a data field with given kernel.
source code
 
area_convolve(kernel_field, col, row, width, height)
Convolves a rectangular part of a data field with given kernel.
source code
 
convolve_1d(kernel_line, orientation)
Convolves a data field with given linear kernel.
source code
 
area_convolve_1d(kernel_line, orientation, col, row, width, height)
Convolves a rectangular part of a data field with given linear kernel.
source code
 
filter_median(size)
Filters a data field with median filter.
source code
 
area_filter_median(size, col, row, width, height)
Filters a rectangular part of a data field with median filter.
source code
 
filter_mean(size)
Filters a data field with mean filter of size size.
source code
 
area_filter_mean(size, col, row, width, height)
Filters a rectangular part of a data field with mean filter of size size.
source code
 
filter_conservative(size)
Filters a data field with conservative denoise filter.
source code
 
area_filter_conservative(size, col, row, width, height)
Filters a rectangular part of a data field with conservative denoise filter.
source code
 
filter_laplacian()
Filters a data field with Laplacian filter.
source code
 
area_filter_laplacian(col, row, width, height)
Filters a rectangular part of a data field with Laplacian filter.
source code
 
filter_laplacian_of_gaussians()
Filters a data field with Laplacian of Gaussians filter.
source code
 
area_filter_laplacian_of_gaussians(col, row, width, height)
Filters a rectangular part of a data field with Laplacian of Gaussians filter.
source code
 
filter_sobel(orientation)
Filters a data field with Sobel filter.
source code
 
area_filter_sobel(orientation, col, row, width, height)
Filters a rectangular part of a data field with Sobel filter.
source code
 
filter_prewitt(orientation)
Filters a data field with Prewitt filter.
source code
 
area_filter_prewitt(orientation, col, row, width, height)
Filters a rectangular part of a data field with Prewitt filter.
source code
 
filter_dechecker()
Filters a data field with 5x5 checker pattern removal filter.
source code
 
area_filter_dechecker(col, row, width, height)
Filters a rectangular part of a data field with 5x5 checker pattern removal filter.
source code
 
filter_gaussian(sigma)
Filters a data field with a Gaussian filter.
source code
 
area_filter_gaussian(sigma, col, row, width, height)
Filters a rectangular part of a data field with a Gaussian filter.
source code
 
filter_minimum(size)
Filters a data field with minimum filter.
source code
 
area_filter_minimum(size, col, row, width, height)
Filters a rectangular part of a data field with minimum filter.
source code
 
filter_maximum(size)
Filters a data field with maximum filter.
source code
 
area_filter_maximum(size, col, row, width, height)
Filters a rectangular part of a data field with maximum filter.
source code
 
filter_rms(size)
Filters a data field with RMS filter.
source code
 
area_filter_rms(size, col, row, width, height)
Filters a rectangular part of a data field with RMS filter of size size.
source code
 
filter_kuwahara()
Filters a data field with Kuwahara filter.
source code
 
area_filter_kuwahara(col, row, width, height)
Filters a rectangular part of a data field with a Kuwahara (edge-preserving smoothing) filter.
source code
 
filter_canny(threshold)
Filters a rectangular part of a data field with canny edge detector filter.
source code
 
shade(target_field, theta, phi)
Shades a data field.
source code
 
filter_harris(y_gradient, result, neighbourhood, alpha) source code
 
fractal_partitioning(xresult, yresult, interpolation)
Computes data for log-log plot by partitioning.
source code
 
fractal_cubecounting(xresult, yresult, interpolation)
Computes data for log-log plot by cube counting.
source code
 
fractal_triangulation(xresult, yresult, interpolation)
Computes data for log-log plot by triangulation.
source code
 
fractal_psdf(xresult, yresult, interpolation)
Computes data for log-log plot by spectral density method.
source code
 
fractal_correction(mask_field, interpolation)
Replaces data under mask with interpolated values using fractal interpolation.
source code
 
grains_mark_curvature(grain_field, threshval, below)
Marks data that are above/below curvature threshold.
source code
 
grains_mark_watershed(grain_field, locate_steps, locate_thresh, locate_dropsize, wshed_steps, wshed_dropsize, prefilter, below)
Performs watershed algorithm.
source code
 
grains_remove_grain(col, row)
Removes one grain at given position.
source code
 
grains_extract_grain(col, row)
Removes all grains except that one at given position.
source code
 
grains_remove_by_size(size)
Removes all grain below specified area.
source code
 
grains_remove_by_height(grain_field, threshval, below)
Removes grains that are higher/lower than given threshold value.
source code
 
UNIMPLEMENTED_grains_watershed_init(grain_field, locate_steps, locate_thresh, locate_dropsize, wshed_steps, wshed_dropsize, prefilter, below)
Initializes the watershed algorithm.
source code
 
grains_mark_height(grain_field, threshval, below)
Marks data that are above/below height threshold.
source code
 
grains_mark_slope(grain_field, threshval, below)
Marks data that are above/below slope threshold.
source code
 
grains_add(add_field)
Adds add_field grains to grain_field.
source code
 
grains_intersect(intersect_field)
Performs intersection betweet two grain fields, result is stored in grain_field.
source code
 
UNIMPLEMENTED_number_grains(grains)
Numbers grains in a mask data field.
source code
 
UNIMPLEMENTED_get_grain_bounding_boxes(ngrains, grains, bboxes)
Find bounding boxes of all grains.
source code
 
UNIMPLEMENTED_grains_get_distribution(grain_field, distribution, ngrains, grains, quantity, nstats)
Computes distribution of requested grain characteristics.
source code
 
UNIMPLEMENTED_grains_get_values(values, ngrains, grains, quantity)
Calculates characteristics of grains.
source code
 
UNIMPLEMENTED_grains_get_quantities(values, quantities, nquantities, ngrains, grains)
Calculates multiple characteristics of grains simultaneously.
source code
 
area_grains_tgnd(target_line, col, row, width, height, below, nstats)
Calculates threshold grain number distribution.
source code
 
area_grains_tgnd_range(target_line, col, row, width, height, min, max, below, nstats)
Calculates threshold grain number distribution in given height range.
source code
 
grains_splash_water(minima, locate_steps, locate_dropsize) source code
 
hough_line(x_gradient, y_gradient, result, hwidth, overlapping) source code
 
hough_circle(x_gradient, y_gradient, result, radius) source code
 
hough_line_strenghten(x_gradient, y_gradient, hwidth, threshold) source code
 
hough_circle_strenghten(x_gradient, y_gradient, radius, threshold) source code
 
UNIMPLEMENTED_get_local_maxima_list(xdata, ydata, zdata, ndata, skip, threshold, subpixel) source code
 
hough_polar_line_to_datafield(rho, theta, px1, px2, py1, py2) source code
 
a_1dfft(iin, rout, iout, orientation, windowing, direction, interpolation, preserverms, level)
Transforms all rows or columns in a data field with Fast Fourier Transform.
source code
 
area_1dfft(iin, rout, iout, col, row, width, height, orientation, windowing, direction, interpolation, preserverms, level)
Transforms all rows or columns in a rectangular part of a data field with Fast Fourier Transform.
source code
 
a_1dfft_raw(iin, rout, iout, orientation, direction)
Transforms all rows or columns in a data field with Fast Fourier Transform.
source code
 
a_2dfft(iin, rout, iout, windowing, direction, interpolation, preserverms, level)
Calculates 2D Fast Fourier Transform of a rectangular a data field.
source code
 
area_2dfft(iin, rout, iout, col, row, width, height, windowing, direction, interpolation, preserverms, level)
Calculates 2D Fast Fourier Transform of a rectangular area of a data field.
source code
 
a_2dfft_raw(iin, rout, iout, direction)
Calculates 2D Fast Fourier Transform of a data field.
source code
 
a_2dfft_humanize()
Rearranges 2D FFT output to a human-friendly form.
source code
 
a_2dfft_dehumanize()
Rearranges 2D FFT output back from the human-friendly form.
source code
 
fft_filter_1d(result_field, weights, orientation, interpolation)
Performs 1D FFT filtering of a data field.
source code
 
UNIMPLEMENTED_cwt(interpolation, scale, wtype)
Computes a continuous wavelet transform (CWT) at given scale and using given wavelet.
source code
 
area_fit_plane(mask, col, row, width, height, pa, pbx, pby)
Fits a plane through a rectangular part of a data field.
source code
 
fit_plane(pa, pbx, pby)
Fits a plane through a data field.
source code
 
plane_level(a, bx, by)
Subtracts plane from a data field.
source code
 
plane_rotate(xangle, yangle, interpolation)
Performs rotation of plane along x and y axis.
source code
 
fit_lines(col, row, width, height, degree, exclude, orientation)
Independently levels profiles on each row/column in a data field.
source code
 
subtract_polynom(col_degree, row_degree, coeffs)
Subtracts a two-dimensional polynomial from a data field.
source code
 
area_subtract_polynom(col, row, width, height, col_degree, row_degree, coeffs)
Subtracts a two-dimensional polynomial from a rectangular part of a data field.
source code
 
UNIMPLEMENTED_fit_legendre(col_degree, row_degree, coeffs)
Fits two-dimensional Legendre polynomial to a data field.
source code
 
UNIMPLEMENTED_area_fit_legendre(col, row, width, height, col_degree, row_degree, coeffs)
Fits two-dimensional Legendre polynomial to a rectangular part of a data field.
source code
 
subtract_legendre(col_degree, row_degree, coeffs)
Subtracts a two-dimensional Legendre polynomial fit from a data field.
source code
 
area_subtract_legendre(col, row, width, height, col_degree, row_degree, coeffs)
Subtracts a two-dimensional Legendre polynomial fit from a rectangular part of a data field.
source code
 
UNIMPLEMENTED_fit_poly_max(max_degree, coeffs)
Fits two-dimensional polynomial with limited total degree to a data field.
source code
 
UNIMPLEMENTED_area_fit_poly_max(col, row, width, height, max_degree, coeffs)
Fits two-dimensional polynomial with limited total degree to a rectangular part of a data field.
source code
 
subtract_poly_max(max_degree, coeffs)
Subtracts a two-dimensional polynomial with limited total degree from a data field.
source code
 
area_subtract_poly_max(col, row, width, height, max_degree, coeffs)
Subtracts a two-dimensional polynomial with limited total degree from a rectangular part of a data field.
source code
 
fit_poly(mask_field, nterms, term_powers, exclude, coeffs)
Fit a given set of polynomial terms to a data field.
source code
 
area_fit_poly(mask_field, col, row, width, height, nterms, term_powers, exclude, coeffs)
Fit a given set of polynomial terms to a rectangular part of a data field.
source code
 
subtract_poly(nterms, term_powers, coeffs)
Subtract a given set of polynomial terms from a data field.
source code
 
area_subtract_poly(col, row, width, height, nterms, term_powers, coeffs)
Subtract a given set of polynomial terms from a rectangular part of a data field.
source code
 
UNIMPLEMENTED_area_fit_local_planes(size, col, row, width, height, nresults, types, results)
Fits a plane through neighbourhood of each sample in a rectangular part of a data field.
source code
 
area_local_plane_quantity(size, col, row, width, height, type, result)
Convenience function to get just one quantity from DataField.area_fit_local_planes().
source code
 
UNIMPLEMENTED_fit_local_planes(size, nresults, types, results)
Fits a plane through neighbourhood of each sample in a data field.
source code
 
local_plane_quantity(size, type, result)
Convenience function to get just one quantity from DataField.fit_local_planes().
source code
 
get_max()
Finds the maximum value of a data field.
source code
 
get_min()
Finds the minimum value of a data field.
source code
 
get_min_max(min, max)
Finds minimum and maximum values of a data field.
source code
 
get_avg()
Computes average value of a data field.
source code
 
get_rms()
Computes root mean square value of a data field.
source code
 
get_sum()
Sums all values in a data field.
source code
 
get_median()
Computes median value of a data field.
source code
 
get_surface_area()
Computes surface area of a data field.
source code
 
area_get_max(mask, col, row, width, height)
Finds the maximum value in a rectangular part of a data field.
source code
 
area_get_min(mask, col, row, width, height)
Finds the minimum value in a rectangular part of a data field.
source code
 
UNIMPLEMENTED_area_get_min_max(mask, col, row, width, height, min, max)
Finds minimum and maximum values in a rectangular part of a data field.
source code
 
UNIMPLEMENTED_area_get_min_max_mask(mask, mode, col, row, width, height, min, max)
Finds minimum and maximum values in a rectangular part of a data field.
source code
 
area_get_avg(mask, col, row, width, height)
Computes average value of a rectangular part of a data field.
source code
 
area_get_avg_mask(mask, mode, col, row, width, height)
Computes average value of a rectangular part of a data field.
source code
 
area_get_rms(mask, col, row, width, height)
Computes root mean square value of a rectangular part of a data field.
source code
 
area_get_rms_mask(mask, mode, col, row, width, height)
Computes root mean square value of deviations of a rectangular part of a data field.
source code
 
area_get_sum(mask, col, row, width, height)
Sums values of a rectangular part of a data field.
source code
 
area_get_sum_mask(mask, mode, col, row, width, height)
Sums values of a rectangular part of a data field.
source code
 
area_get_median(mask, col, row, width, height)
Computes median value of a data field area.
source code
 
area_get_median_mask(mask, mode, col, row, width, height)
Computes median value of a data field area.
source code
 
area_get_surface_area(mask, col, row, width, height) source code
 
area_get_surface_area_mask(mask, mode, col, row, width, height)
Computes surface area of a rectangular part of a data field.
source code
 
area_get_volume(basis, mask, col, row, width, height)
Computes volume of a rectangular part of a data field.
source code
 
UNIMPLEMENTED_get_autorange(_from, to)
Computes value range with outliers cut-off.
source code
 
get_stats(avg, ra, rms, skew, kurtosis)
Computes basic statistical quantities of a data field.
source code
 
area_get_stats(mask, col, row, width, height, avg, ra, rms, skew, kurtosis)
Computes basic statistical quantities of a rectangular part of a data field.
source code
 
UNIMPLEMENTED_area_get_stats_mask(mask, mode, col, row, width, height, avg, ra, rms, skew, kurtosis)
Computes basic statistical quantities of a rectangular part of a data field.
source code
 
area_count_in_range(mask, col, row, width, height, below, above, nbelow, nabove)
Counts data samples in given range.
source code
 
area_dh(mask, target_line, col, row, width, height, nstats)
Calculates distribution of heights in a rectangular part of data field.
source code
 
dh(target_line, nstats)
Calculates distribution of heights in a data field.
source code
 
area_cdh(mask, target_line, col, row, width, height, nstats)
Calculates uncertainty of the cumulative distribution of heights in a rectangular part of the data field.
source code
 
cdh(target_line, nstats)
Calculates cumulative distribution of heights in a data field.
source code
 
area_da(target_line, col, row, width, height, orientation, nstats)
Calculates distribution of slopes in a rectangular part of data field.
source code
 
da(target_line, orientation, nstats)
Calculates distribution of slopes in a data field.
source code
 
area_cda(target_line, col, row, width, height, orientation, nstats)
Calculates cumulative distribution of slopes in a rectangular part of data field.
source code
 
cda(target_line, orientation, nstats)
Calculates cumulative distribution of slopes in a data field.
source code
 
area_acf(target_line, col, row, width, height, orientation, interpolation, nstats)
Calculates one-dimensional autocorrelation function of a rectangular part of a data field.
source code
 
acf(target_line, orientation, interpolation, nstats)
Calculates one-dimensional autocorrelation function of a data field.
source code
 
area_hhcf(target_line, col, row, width, height, orientation, interpolation, nstats)
Calculates one-dimensional autocorrelation function of a rectangular part of a data field.
source code
 
hhcf(target_line, orientation, interpolation, nstats)
Calculates one-dimensional autocorrelation function of a data field.
source code
 
area_psdf(target_line, col, row, width, height, orientation, interpolation, windowing, nstats)
Calculates one-dimensional power spectrum density function of a rectangular part of a data field.
source code
 
psdf(target_line, orientation, interpolation, windowing, nstats)
Calculates one-dimensional power spectrum density function of a data field.
source code
 
area_rpsdf(target_line, col, row, width, height, interpolation, windowing, nstats)
Calculates radial power spectrum density function of a rectangular part of a data field.
source code
 
rpsdf(target_line, interpolation, windowing, nstats)
Calculates radial power spectrum density function of a data field.
source code
 
area_2dacf(target_field, col, row, width, height, xrange, yrange)
Calculates two-dimensional autocorrelation function of a data field area.
source code
 
a_2dacf(target_field)
Calculates two-dimensional autocorrelation function of a data field.
source code
 
area_racf(target_line, col, row, width, height, nstats)
Calculates radially averaged autocorrelation function of a data field.
source code
 
racf(target_line, nstats) source code
 
area_minkowski_volume(target_line, col, row, width, height, nstats)
Calculates Minkowski volume functional of a rectangular part of a data field.
source code
 
minkowski_volume(target_line, nstats)
Calculates Minkowski volume functional of a data field.
source code
 
area_minkowski_boundary(target_line, col, row, width, height, nstats)
Calculates Minkowski boundary functional of a rectangular part of a data field.
source code
 
minkowski_boundary(target_line, nstats)
Calculates Minkowski boundary functional of a data field.
source code
 
area_minkowski_euler(target_line, col, row, width, height, nstats)
Calculates Minkowski connectivity functional (Euler characteristics) of a rectangular part of a data field.
source code
 
minkowski_euler(target_line, nstats)
Calculates Minkowski connectivity functional (Euler characteristics) of a data field.
source code
 
slope_distribution(derdist, kernel_size)
Computes angular slope distribution.
source code
 
get_normal_coeffs(nx, ny, nz, normalize1)
Computes average normal vector of a data field.
source code
 
UNIMPLEMENTED_area_get_normal_coeffs(col, row, width, height, nx, ny, nz, normalize1)
Computes average normal vector of an area of a data field.
source code
 
area_get_inclination(col, row, width, height, theta, phi)
Calculates the inclination of the image (polar and azimuth angle).
source code
 
UNIMPLEMENTED_get_inclination(theta, phi)
Calculates the inclination of the image (polar and azimuth angle).
source code
 
area_get_line_stats(mask, target_line, col, row, width, height, quantity, orientation)
Calculates a line quantity for each row or column in a data field area.
source code
 
get_line_stats(target_line, quantity, orientation)
Calculates a line quantity for each row or column of a data field.
source code
 
get_profile(scol, srow, ecol, erow, res, thickness, interpolation)
Extracts a possibly averaged profile from data field to a data line.
source code
 
fit_polynom(col_degree, row_degree)
Fits a two-dimensional polynomial to a data field.
source code
 
area_fit_polynom(col, row, width, height, col_degree, row_degree)
Fits a two-dimensional polynomial to a rectangular part of a data field.
source code
 
elliptic_area_extract(col, row, width, height)
Extracts values from an elliptic region of a data field.
source code
 
circular_area_extract(col, row, radius)
Extracts values from a circular region of a data field.
source code
 
create_full_mask() source code
 
UNIMPLEMENTED_mark_scars(data_field, scar_field, threshold_high, threshold_low, min_scar_len, max_scar_width, negative) source code
 
duplicate()
Duplicate datafield
source code
 
get_data()
Create a tuple of data which the datafield contains.
source code
 
UNIMPLEMENTED_normalize_rows(dfield) source code
 
get_data_pointer()
Get Pointer to data which the datafield contains.
source code
Method Details [hide private]

__init__(xres, yres, xreal, yreal, nullme)
(Constructor)

source code 

Creates a new data field.

Parameters:
  • yres - Y-resolution, i.e., the number of rows. (int)
  • xreal - Real horizontal physical dimension. (float)
  • yreal - Real vertical physical dimension. (float)
  • nullme - Whether the data field should be initialized to zeroes. If False, the data will not be initialized. (bool)
Returns:
A newly created data field.

sum_fields(operand1, operand2)

source code 

Sums two data fields.

Parameters:
  • operand1 - First data field operand. (DataField)
  • operand2 - Second data field operand. (DataField)

subtract_fields(operand1, operand2)

source code 

Subtracts one data field from another.

Parameters:
  • operand1 - First data field operand. (DataField)
  • operand2 - Second data field operand. (DataField)

divide_fields(operand1, operand2)

source code 

Divides one data field with another.

Parameters:
  • operand1 - First data field operand. (DataField)
  • operand2 - Second data field operand. (DataField)

multiply_fields(operand1, operand2)

source code 

Multiplies two data fields.

Parameters:
  • operand1 - First data field operand. (DataField)
  • operand2 - Second data field operand. (DataField)

min_of_fields(operand1, operand2)

source code 

Finds point-wise maxima of two data fields.

Parameters:
  • operand1 - First data field operand. (DataField)
  • operand2 - Second data field operand. (DataField)

max_of_fields(operand1, operand2)

source code 

Finds point-wise minima of two data fields.

Parameters:
  • operand1 - First data field operand. (DataField)
  • operand2 - Second data field operand. (DataField)

check_compatibility(data_field2, check)

source code 

Checks whether two data fields are compatible.

Parameters:
  • data_field2 - Another data field. (DataField)
  • check - The compatibility tests to perform. (DataCompatibilityFlags)
Returns:
Zero if all tested properties are compatible. Flags corresponding to failed tests if data fields are not compatible.

correct_laplace_iteration(mask_field, buffer_field, corrfactor, error)

source code 

Performs one interation of Laplace data correction.

Tries to remove all the points in mask off the data by using iterative method similar to solving heat flux equation.

Use this function repeatedly until reasonable error is reached.

Parameters:
  • mask_field - Mask of places to be corrected. (DataField)
  • buffer_field - Initialized to same size as mask and data. (DataField)
  • error - Maximum change within last step. (float)
  • corrfactor - Correction factor within step. (float)

correct_average(mask_field)

source code 

Fills data under mask with average value.

Simply puts average value of all the data_field values into points in data_field lying under points where mask_field values are nonzero.

Parameters:
  • mask_field - Mask of places to be corrected. (DataField)

mask_outliers(mask_field, thresh)

source code 

Creates mask of data that are above or below thresh*sigma from average height.

Sigma denotes root-mean square deviation of heights. This criterium corresponds to the usual Gaussian distribution outliers detection if thresh is 3.

Parameters:
  • mask_field - A data field to be filled with mask. (DataField)
  • thresh - Threshold value. (float)

mask_outliers2(mask_field, thresh_low, thresh_high)

source code 

Creates mask of data that are above or below multiples of rms from average height.

Data that are below mean-thresh_low*sigma or above mean+thresh_high*sigma are marked as outliers, where sigma denotes the root-mean square deviation of heights.

Since: 2.26

Parameters:
  • mask_field - A data field to be filled with mask. (DataField)
  • thresh_low - Lower threshold value. (float)
  • thresh_high - Upper threshold value. (float)

UNIMPLEMENTED_distort(dest, invtrans, user_data, interp, exterior, fill_value)

source code 

Distorts a data field in the horizontal plane.

Note the transform function invtrans is the inverse transform, in other words it calculates the old coordinates from tne new coordinates (the transform would not be uniquely defined the other way round).

Since: 2.5

Parameters:
  • dest - Destination data field. (DataField)
  • invtrans - Inverse transform function, that is the transformation from new coordinates to old coordinates. It gets (j+0.5, i+0.5), where i and j are the new row and column indices, passed as the input coordinates. The output coordinates should follow the same convention. Unless a special exterior handling is requires, the transform function does not need to concern itself with coordinates being outside of the data. (CoordTransform2DFunc)
  • user_data - Pointer passed as user_data to invtrans. (gpointer)
  • interp - Interpolation type to use. (InterpolationType)
  • exterior - Exterior pixels handling. (ExteriorType)
  • fill_value - The value to use with EXTERIOR_FIXED_VALUE. (float)

get_correlation_score(kernel_field, col, row, kernel_col, kernel_row, kernel_width, kernel_height)

source code 

Calculates a correlation score in one point.

Correlation window size is given by kernel_col, kernel_row, kernel_width, kernel_height, postion of the correlation window on data is given by col, row.

If anything fails (data too close to boundary, etc.), function returns -1.0 (none correlation)..

Parameters:
  • kernel_field - Kernel to correlate data field with. (DataField)
  • col - Upper-left column position in the data field. (int)
  • row - Upper-left row position in the data field. (int)
  • kernel_col - Upper-left column position in kernel field. (int)
  • kernel_row - Upper-left row position in kernel field. (int)
  • kernel_width - Width of kernel field area. (int)
  • kernel_height - Heigh of kernel field area. (int)
Returns:
Correlation score (between -1.0 and 1.0). Value 1.0 denotes maximum correlation, -1.0 none correlation.

crosscorrelate(data_field2, x_dist, y_dist, score, search_width, search_height, window_width, window_height)

source code 

Algorithm for matching two different images of the same object under changes.

It does not use any special features for matching. It simply searches for all points (with their neighbourhood) of data_field1 within data_field2. Parameters search_width and search_height determine maimum area where to search for points. The area is cenetered in the data_field2 at former position of points at data_field1.

Parameters:
  • data_field2 - A data field. (DataField)
  • x_dist - A data field to store x-distances to. (DataField)
  • y_dist - A data field to store y-distances to. (DataField)
  • score - Data field to store correlation scores to. (DataField)
  • search_width - Search area width. (int)
  • search_height - Search area height. (int)
  • window_width - Correlation window width. (int)
  • window_height - Correlation window height. (int)

UNIMPLEMENTED_crosscorrelate_init(data_field2, x_dist, y_dist, score, search_width, search_height, window_width, window_height)

source code 

Initializes a cross-correlation iterator.

This iterator reports its state as ComputationStateType.

Parameters:
  • data_field2 - A data field. (DataField)
  • x_dist - A data field to store x-distances to, or NULL. (DataField)
  • y_dist - A data field to store y-distances to, or NULL. (DataField)
  • score - Data field to store correlation scores to, or NULL. (DataField)
  • search_width - Search area width. (int)
  • search_height - Search area height. (int)
  • window_width - Correlation window width. (int)
  • window_height - Correlation window height. (int)
Returns:
A new cross-correlation iterator.

correlate(kernel_field, score, method)

source code 

Computes correlation score for all positions in a data field.

Correlation score is compute for all points in data field data_field and full size of correlation kernel kernel_field.

The points in score correspond to centers of kernel. More precisely, the point ((kxres-1)/2, (kyres-1)/2) in score corresponds to kernel field top left corner coincident with data field top left corner. Points outside the area where the kernel field fits into the data field completely are set to -1 for CORRELATION_NORMAL.

Parameters:
  • kernel_field - Correlation kernel. (DataField)
  • score - Data field to store correlation scores to. (DataField)
  • method - Correlation score calculation method. (CorrelationType)

UNIMPLEMENTED_correlate_init(kernel_field, score)

source code 

Creates a new correlation iterator.

This iterator reports its state as ComputationStateType.

Parameters:
  • kernel_field - Kernel to correlate data field with. (DataField)
  • score - Data field to store correlation scores to. (DataField)
Returns:
A new correlation iterator.

new_alike(nullme)

source code 

Creates a new data field similar to an existing one.

Use DataField.duplicate() if you want to copy a data field including data.

Parameters:
  • nullme - Whether the data field should be initialized to zeroes. If False, the data will not be initialized. (bool)
Returns:
A newly created data field.

data_changed()

source code 

Emits signal "data-changed" on a data field.

new_resampled(xres, yres, interpolation)

source code 

Creates a new data field by resampling an existing one.

This method is equivalent to DataField.duplicate() followed by DataField.resample(), but it is more efficient.

Parameters:
  • xres - Desired X resolution. (int)
  • yres - Desired Y resolution. (int)
  • interpolation - Interpolation method to use. (InterpolationType)
Returns:
A newly created data field.

resample(xres, yres, interpolation)

source code 

Resamples a data field using given interpolation method

This method may invalidate raw data buffer returned by DataField.get_data().

Parameters:
  • xres - Desired X resolution. (int)
  • yres - Desired Y resolution. (int)
  • interpolation - Interpolation method to use. (InterpolationType)

resize(ulcol, ulrow, brcol, brrow)

source code 

Resizes (crops) a data field.

Crops a data field to a rectangle between upper-left and bottom-right points, recomputing real size.

This method may invalidate raw data buffer returned by DataField.get_data().

Parameters:
  • ulcol - Upper-left column coordinate. (int)
  • ulrow - Upper-left row coordinate. (int)
  • brcol - Bottom-right column coordinate + 1. (int)
  • brrow - Bottom-right row coordinate + 1. (int)

area_extract(col, row, width, height)

source code 

Extracts a rectangular part of a data field to a new data field.

Parameters:
  • row - Upper-left row coordinate. (int)
  • col - Upper-left column coordinate. (int)
  • width - Area width (number of columns). (int)
  • height - Area height (number of rows). (int)
Returns:
The extracted area as a newly created data field.

copy(dest, nondata_too)

source code 

Copies the contents of an already allocated data field to a data field of the same size.

Parameters:
  • dest - Destination data field. (DataField)
  • nondata_too - Whether non-data (units) should be compied too. (bool)

area_copy(dest, col, row, width, height, destcol, destrow)

source code 

Copies a rectangular area from one data field to another.

The area starts at (col, row) in src and its dimension is width*height. It is copied to dest starting from (destcol, destrow).

The source area has to be completely contained in src. No assumptions are made about destination position, however, parts of the source area sticking out the destination data field dest are cut off.

If src is equal to dest, the areas may not overlap.

Parameters:
  • dest - Destination data field. (DataField)
  • col - Area upper-left column coordinate in src. (int)
  • row - Area upper-left row coordinate src. (int)
  • width - Area width (number of columns), pass -1 for full src widdth. (int)
  • height - Area height (number of rows), pass -1 for full src height. (int)
  • destcol - Destination column in dest. (int)
  • destrow - Destination row in dest. (int)

get_xres()

source code 

Gets X resolution (number of columns) of a data field.

Returns:
X resolution.

get_yres()

source code 

Gets Y resolution (number of rows) of the field.

Returns:
Y resolution.

get_xreal()

source code 

Gets the X real (physical) size of a data field.

Returns:
X real size value.

get_yreal()

source code 

Gets the Y real (physical) size of a data field.

Returns:
Y real size value.

set_xreal(xreal)

source code 

Sets X real (physical) size value of a data field.

Parameters:
  • xreal - New X real size value. (float)

set_yreal(yreal)

source code 

Sets Y real (physical) size value of a data field.

Parameters:
  • yreal - New Y real size value. (float)

get_xoffset()

source code 

Gets the X offset of data field origin.

Returns:
X offset value.

get_yoffset()

source code 

Gets the Y offset of data field origin.

Returns:
Y offset value.

set_xoffset(xoff)

source code 

Sets the X offset of a data field origin.

Note offsets don't affect any calculation, nor functions like DataField.rotj().

Parameters:
  • xoff - New X offset value. (float)

set_yoffset(yoff)

source code 

Sets the Y offset of a data field origin.

Note offsets don't affect any calculation, nor functions like DataField.rtoi().

Parameters:
  • yoff - New Y offset value. (float)

get_si_unit_xy()

source code 

Returns lateral SI unit of a data field.

Returns:
SI unit corresponding to the lateral (XY) dimensions of the data field. Its reference count is not incremented.

get_si_unit_z()

source code 

Returns value SI unit of a data field.

Returns:
SI unit corresponding to the "height" (Z) dimension of the data field. Its reference count is not incremented.

set_si_unit_xy(si_unit)

source code 

Sets the SI unit corresponding to the lateral (XY) dimensions of a data field.

It does not assume a reference on si_unit, instead it adds its own reference.

Parameters:
  • si_unit - SI unit to be set. (SIUnit)

set_si_unit_z(si_unit)

source code 

Sets the SI unit corresponding to the "height" (Z) dimension of a data field.

It does not assume a reference on si_unit, instead it adds its own reference.

Parameters:
  • si_unit - SI unit to be set. (SIUnit)

UNIMPLEMENTED_get_value_format_xy(style, format)

source code 

Finds value format good for displaying coordinates of a data field.

Parameters:
  • style - Unit format style. (SIUnitFormatStyle)
  • format - A SI value format to modify, or NULL to allocate a new one. (SIValueFormat*)
Returns:
The value format. If format is NULL, a newly allocated format is returned, otherwise (modified) format itself is returned.

UNIMPLEMENTED_get_value_format_z(style, format)

source code 

Finds value format good for displaying values of a data field.

Parameters:
  • style - Unit format style. (SIUnitFormatStyle)
  • format - A SI value format to modify, or NULL to allocate a new one. (SIValueFormat*)
Returns:
The value format. If format is NULL, a newly allocated format is returned, otherwise (modified) format itself is returned.

copy_units_to_data_line(data_line)

source code 

Sets lateral and value units of a data line to match a data field.

Parameters:
  • data_line - A data line to set units of. (DataLine)

itor(row)

source code 

Transforms vertical pixel coordinate to real (physical) Y coordinate.

That is it maps range [0..y-resolution] to range [0..real-y-size]. It is not suitable for conversion of matrix indices to physical coordinates, you have to use DataField.itor(data_field, row + 0.5) for that.

Parameters:
  • row - Vertical pixel coordinate. (float)
Returns:
Real Y coordinate.

jtor(col)

source code 

Transforms horizontal pixel coordinate to real (physical) X coordinate.

That is it maps range [0..x-resolution] to range [0..real-x-size]. It is not suitable for conversion of matrix indices to physical coordinates, you have to use DataField.jtor(data_field, col + 0.5) for that.

Parameters:
  • col - Horizontal pixel coordinate. (float)
Returns:
Real X coordinate.

rtoi(realy)

source code 

Transforms real (physical) Y coordinate to row.

That is it maps range [0..real-y-size] to range [0..y-resolution].

Parameters:
  • realy - Real (physical) Y coordinate. (float)
Returns:
Vertical pixel coodinate.

rtoj(realx)

source code 

Transforms real (physical) X coordinate to column.

That is it maps range [0..real-x-size] to range [0..x-resolution].

Parameters:
  • realx - Real (physical) X coodinate. (float)
Returns:
Horizontal pixel coordinate.

get_val(col, row)

source code 

Gets value at given position in a data field.

Do not access data with this function inside inner loops, it's slow. Get the raw data buffer with DataField.get_data_const() and access it directly instead.

Parameters:
  • col - Column index. (int)
  • row - Row index. (int)
Returns:
Value at (col, row).

set_val(col, row, value)

source code 

Sets value at given position in a data field.

Do not set data with this function inside inner loops, it's slow. Get the raw data buffer with DataField.get_data() and write to it directly instead.

Parameters:
  • col - Column index. (int)
  • row - Row index. (int)
  • value - Value to set. (float)

get_dval(x, y, interpolation)

source code 

Gets interpolated value at arbitrary data field point indexed by pixel coordinates.

Note pixel values are centered in pixels, so to get the same value as DataField.get_val(data_field, j, i) returns, it's necessary to add 0.5: DataField.get_dval(data_field, j+0.5, i+0.5, interpolation).

See also DataField.get_dval_real() that does the same, but takes real coordinates.

Parameters:
  • x - Horizontal position in pixel units, in range [0, x-resolution]. (float)
  • y - Vertical postition in pixel units, in range [0, y-resolution]. (float)
  • interpolation - Interpolation method to be used. (InterpolationType)
Returns:
Interpolated value at position (x,y).

get_dval_real(x, y, interpolation)

source code 

Gets interpolated value at arbitrary data field point indexed by real coordinates.

See also DataField.get_dval() that does the same, but takes pixel coordinates.

Parameters:
  • x - X postion in real coordinates. (float)
  • y - Y postition in real coordinates. (float)
  • interpolation - Interpolation method to use. (InterpolationType)
Returns:
Value at position (x,y).

rotate(angle, interpolation)

source code 

Rotates a data field by a given angle.

Values that get outside of data field by the rotation are lost. Undefined values from outside of data field that get inside are set to data field minimum value.

Parameters:
  • angle - Rotation angle (in radians). (float)
  • interpolation - Interpolation method to use. (InterpolationType)

invert(x, y, z)

source code 

Reflects amd/or inverts a data field.

In the case of value reflection, it's inverted about the mean value.

Parameters:
  • x - True to reflect about X axis (i.e., vertically). (bool)
  • y - True to reflect about Y axis (i.e., horizontally). (bool)
  • z - True to invert in Z direction (i.e., invert values). (bool)

fill(value)

source code 

Fills a data field with given value.

Parameters:
  • value - Value to be entered. (float)

clear()

source code 

Fills a data field with zeroes.

multiply(value)

source code 

Multiplies all values in a data field by given value.

Parameters:
  • value - Value to multiply data_field with. (float)

add(value)

source code 

Adds given value to all values in a data field.

Parameters:
  • value - Value to be added to data field values. (float)

area_fill(col, row, width, height, value)

source code 

Fills a rectangular part of a data field with given value.

Parameters:
  • col - Upper-left column coordinate. (int)
  • row - Upper-left row coordinate. (int)
  • width - Area width (number of columns). (int)
  • height - Area height (number of rows). (int)
  • value - Value to be entered (float)

area_clear(col, row, width, height)

source code 

Fills a rectangular part of a data field with zeroes.

Parameters:
  • col - Upper-left column coordinate. (int)
  • row - Upper-left row coordinate. (int)
  • width - Area width (number of columns). (int)
  • height - Area height (number of rows). (int)

area_multiply(col, row, width, height, value)

source code 

Multiplies values in a rectangular part of a data field by given value

Parameters:
  • col - Upper-left column coordinate. (int)
  • row - Upper-left row coordinate. (int)
  • width - Area width (number of columns). (int)
  • height - Area height (number of rows). (int)
  • value - Value to multiply area with. (float)

area_add(col, row, width, height, value)

source code 

Adds given value to all values in a rectangular part of a data field.

Parameters:
  • col - Upper-left column coordinate. (int)
  • row - Upper-left row coordinate. (int)
  • width - Area width (number of columns). (int)
  • height - Area height (number of rows). (int)
  • value - Value to be added to area values. (float)

get_row(data_line, row)

source code 

Extracts a data field row into a data line.

Parameters:
  • data_line - A data line. It will be resized to width ot data_field. (DataLine)
  • row - Row index. (int)

get_column(data_line, col)

source code 

Extracts a data field column into a data line.

Parameters:
  • data_line - A data line. It will be resized to height of data_field. (DataLine)
  • col - Column index. (int)

set_row(data_line, row)

source code 

Sets a row in the data field to values of a data line.

Data line length must be equal to width of data field.

Parameters:
  • data_line - A data line. (DataLine)
  • row - Row index. (int)

set_column(data_line, col)

source code 

Sets a column in the data field to values of a data line.

Data line length must be equal to height of data field.

Parameters:
  • data_line - A data line. (DataLine)
  • col - Column index. (int)

get_row_part(data_line, row, _from, to)

source code 

Extracts part of a data field row into a data line.

Parameters:
  • data_line - A data line. It will be resized to the row part width. (DataLine)
  • row - Row index. (int)
  • _from - Start column index. (int)
  • to - End column index + 1. (int)

get_column_part(data_line, col, _from, to)

source code 

Extracts part of a data field column into a data line.

Parameters:
  • data_line - A data line. It will be resized to the column part height. (DataLine)
  • col - Column index. (int)
  • _from - Start row index. (int)
  • to - End row index + 1. (int)

set_row_part(data_line, row, _from, to)

source code 

Puts a data line into a data field row.

If data line length differs from to-from, it is resampled to this length.

Parameters:
  • data_line - A data line. (DataLine)
  • row - Row index. (int)
  • _from - Start row index. (int)
  • to - End row index + 1. (int)

set_column_part(data_line, col, _from, to)

source code 

Puts a data line into data field column.

If data line length differs from to-from, it is resampled to this length.

Parameters:
  • data_line - A data line. (DataLine)
  • col - Column index. (int)
  • _from - Start row index. (int)
  • to - End row index + 1. (int)

get_xder(col, row)

source code 

Computes central derivative in X direction.

On border points, one-side derivative is returned.

Parameters:
  • col - Column index. (int)
  • row - Row index. (int)
Returns:
Derivative in X direction.

get_yder(col, row)

source code 

Computes central derivative in Y direction.

On border points, one-side derivative is returned.

Note the derivative is for legacy reasons calulcated for the opposite y direction than is usual elsewhere in Gwyddion, i.e. if values increase with increasing row number, the returned value is negative.

Parameters:
  • col - Column index. (int)
  • row - Row index. (int)
Returns:
Derivative in Y direction

get_angder(col, row, theta)

source code 

Computes derivative in direction specified by given angle.

Parameters:
  • col - Column index. (int)
  • row - Row index. (int)
  • theta - Angle defining the direction (in radians, counterclockwise). (float)
Returns:
Derivative in direction given by angle theta.

xdwt(wt_coefs, direction, minsize)

source code 

Performs steps of the X-direction image wavelet decomposition.

The smallest low pass coefficients block is equal to minsize. Run with minsize = dfield->xres/2 to perform one step of decomposition or minsize = 4 to perform full decomposition (or anything between).

Parameters:
  • wt_coefs - Data line where the wavelet transform coefficients are stored. (DataLine)
  • direction - Transform direction. (TransformDirection)
  • minsize - size of minimal transform result block (int)

ydwt(wt_coefs, direction, minsize)

source code 

Performs steps of the Y-direction image wavelet decomposition.

The smallest low pass coefficients block is equal to minsize. Run with minsize = dfield->yres/2 to perform one step of decomposition or minsize = 4 to perform full decomposition (or anything between).

Parameters:
  • wt_coefs - Data line where the wavelet transform coefficients are stored. (DataLine)
  • direction - Transform direction. (TransformDirection)
  • minsize - size of minimal transform result block (int)

dwt(wt_coefs, direction, minsize)

source code 

Performs steps of the 2D image wavelet decomposition.

The smallest low pass coefficients block is equal to minsize. Run with minsize = dfield->xres/2 to perform one step of decomposition or minsize = 4 to perform full decomposition (or anything between).

Parameters:
  • wt_coefs - Data line where the wavelet transform coefficients are stored. (DataLine)
  • direction - Transform direction. (TransformDirection)
  • minsize - size of minimal transform result block (int)

elliptic_area_fill(col, row, width, height, value)

source code 

Fills an elliptic region of a data field with given value.

The elliptic region is defined by its bounding box which must be completely contained in the data field.

Parameters:
  • col - Upper-left bounding box column coordinate. (int)
  • row - Upper-left bounding box row coordinate. (int)
  • width - Bounding box width (number of columns). (int)
  • height - Bounding box height (number of rows). (int)
  • value - Value to be entered. (float)
Returns:
The number of filled values.

elliptic_area_unextract(col, row, width, height, data)

source code 

Puts values back to an elliptic region of a data field.

The elliptic region is defined by its bounding box which must be completely contained in the data field.

This method does the reverse of DataField.elliptic_area_extract() allowing to implement pixel-wise filters on elliptic areas. Values from data are put back to the same positions DataField.elliptic_area_extract() took them from.

Parameters:
  • col - Upper-left bounding box column coordinate. (int)
  • row - Upper-left bounding box row coordinate. (int)
  • width - Bounding box width (number of columns). (int)
  • height - Bounding box height (number of rows). (int)
  • data - The values to put back. It must be the same array as in previous DataField.elliptic_area_extract(). (const-gdouble*)

circular_area_fill(col, row, radius, value)

source code 

Fills an elliptic region of a data field with given value.

Parameters:
  • col - Row index of circular area centre. (int)
  • row - Column index of circular area centre. (int)
  • radius - Circular area radius (in pixels). Any value is allowed, although to get areas that do not deviate from true circles after pixelization too much, half-integer values are recommended, integer values are NOT recommended. (float)
  • value - Value to be entered. (float)
Returns:
The number of filled values.

UNIMPLEMENTED_circular_area_extract_with_pos(col, row, radius, data, xpos, ypos)

source code 

Extracts values with positions from a circular region of a data field.

The row and column indices stored to xpos and ypos are relative to the area centre, i.e. to (col, row). The central pixel will therefore have 0 at the corresponding position in both xpos and ypos.

Since: 2.2

Parameters:
  • col - Row index of circular area centre. (int)
  • row - Column index of circular area centre. (int)
  • radius - Circular area radius (in pixels). Any value is allowed, although to get areas that do not deviate from true circles after pixelization too much, half-integer values are recommended, integer radii are NOT recommended. (float)
  • data - Location to store the extracted values to. Its size has to be sufficient to contain all the extracted values. As a conservative estimate (2*floor(radius)+1)^2 can be used, or the size can be calculated with DataField.get_circular_area_size(). (gdouble*)
  • xpos - Location to store relative column indices of values in data to, the size requirements are the same as for data. (int)
  • ypos - Location to store relative tow indices of values in data to, the size requirements are the same as for data. (int)
Returns:
The number of extracted values. It can be zero when the inside of the circle does not intersect with the data field.

circular_area_unextract(col, row, radius, data)

source code 

Puts values back to a circular region of a data field.

This method does the reverse of DataField.circular_area_extract() allowing to implement pixel-wise filters on circular areas. Values from data are put back to the same positions DataField.circular_area_extract() took them from.

Parameters:
  • col - Row index of circular area centre. (int)
  • row - Column index of circular area centre. (int)
  • radius - Circular area radius (in pixels). (float)
  • data - The values to put back. It must be the same array as in previous DataField.circular_area_unextract(). (const-gdouble*)

normalize()

source code 

Normalizes data in a data field to range 0.0 to 1.0.

It is equivalent to DataField.renormalize(data_field, 1.0, 0.0);

If data_field is filled with only one value, it is changed to 0.0.

renormalize(range, offset)

source code 

Transforms data in a data field with first linear function to given range.

When range is positive, the new data range is (offset, offset+range); when range is negative, the new data range is (offset-range, offset). In neither case the data are flipped, negative range only means different selection of boundaries.

When range is zero, this method is equivalent to DataField.fill(data_field, offset).

Parameters:
  • range - New data interval size. (float)
  • offset - New data interval offset. (float)

threshold(threshval, bottom, top)

source code 

Tresholds values of a data field.

Values smaller than threshold are set to value bottom, values higher than threshold or equal to it are set to value top

Parameters:
  • threshval - Threshold value. (float)
  • bottom - Lower replacement value. (float)
  • top - Upper replacement value. (float)
Returns:
The total number of values above threshold.

area_threshold(col, row, width, height, threshval, bottom, top)

source code 

Tresholds values of a rectangular part of a data field.

Values smaller than threshold are set to value bottom, values higher than threshold or equal to it are set to value top

Parameters:
  • col - Upper-left column coordinate. (int)
  • row - Upper-left row coordinate. (int)
  • width - Area width (number of columns). (int)
  • height - Area height (number of rows). (int)
  • threshval - Threshold value. (float)
  • bottom - Lower replacement value. (float)
  • top - Upper replacement value. (float)
Returns:
The total number of values above threshold.

clamp(bottom, top)

source code 

Limits data field values to a range.

Parameters:
  • bottom - Lower limit value. (float)
  • top - Upper limit value. (float)
Returns:
The number of changed values, i.e., values that were outside [bottom, top].

area_clamp(col, row, width, height, bottom, top)

source code 

Limits values in a rectangular part of a data field to a range.

Parameters:
  • col - Upper-left column coordinate. (int)
  • row - Upper-left row coordinate. (int)
  • width - Area width (number of columns). (int)
  • height - Area height (number of rows). (int)
  • bottom - Lower limit value. (float)
  • top - Upper limit value. (float)
Returns:
The number of changed values, i.e., values that were outside [bottom, top].

area_gather(result, buffer, hsize, vsize, average, col, row, width, height)

source code 

Sums or averages values in reactangular areas around each sample in a data field.

When the gathered area extends out of calculation area, only samples from their intersection are taken into the local sum (or average).

There are no restrictions on values of hsize and vsize with regard to width and height, but they have to be positive.

The result is calculated by the means of two-dimensional rolling sums. One one hand it means the calculation time depends linearly on (width + hsize)*(height + vsize) instead of width*hsize*height*vsize. On the other hand it means absolute rounding errors of all output values are given by the largest input values, that is relative precision of results small in absolute value may be poor.

Parameters:
  • result - A data field to put the result to, it may be data_field itself. (DataField)
  • buffer - A data field to use as a scratch area, its size must be at least width*height. May be NULL to allocate a private temporary buffer. (DataField)
  • col - Upper-left column coordinate. (int)
  • row - Upper-left row coordinate. (int)
  • width - Area width (number of columns). (int)
  • height - Area height (number of rows). (int)
  • hsize - Horizontal size of gathered area. The area is centered around each sample if hsize is odd, it extends one pixel more to the right if hsize is even. (int)
  • vsize - Vertical size of gathered area. The area is centered around each sample if vsize is odd, it extends one pixel more down if vsize is even. (int)
  • average - True to divide resulting sums by the number of involved samples to get averages instead of sums. (bool)

convolve(kernel_field)

source code 

Convolves a data field with given kernel.

Parameters:
  • kernel_field - Kenrel field to convolve data_field with. (DataField)

area_convolve(kernel_field, col, row, width, height)

source code 

Convolves a rectangular part of a data field with given kernel.

Parameters:
  • kernel_field - Kenrel field to convolve data_field with. (DataField)
  • col - Upper-left column coordinate. (int)
  • row - Upper-left row coordinate. (int)
  • width - Area width (number of columns). (int)
  • height - Area height (number of rows). (int)

convolve_1d(kernel_line, orientation)

source code 

Convolves a data field with given linear kernel.

Since: 2.4

Parameters:

area_convolve_1d(kernel_line, orientation, col, row, width, height)

source code 

Convolves a rectangular part of a data field with given linear kernel.

For large separable kernels it can be more efficient to use a sequence of horizontal and vertical convolutions instead one 2D convolution.

Since: 2.4

Parameters:
  • kernel_line - Kernel line to convolve data_field with. (DataLine)
  • orientation - Filter orientation (ORIENTATION_HORIZONTAL for row-wise convolution, ORIENTATION_VERTICAL for column-wise convolution). (Orientation)
  • col - Upper-left column coordinate. (int)
  • row - Upper-left row coordinate. (int)
  • width - Area width (number of columns). (int)
  • height - Area height (number of rows). (int)

filter_median(size)

source code 

Filters a data field with median filter.

Parameters:
  • size - Size of area to take median of. (int)

area_filter_median(size, col, row, width, height)

source code 

Filters a rectangular part of a data field with median filter.

Parameters:
  • size - Size of area to take median of. (int)
  • col - Upper-left column coordinate. (int)
  • row - Upper-left row coordinate. (int)
  • width - Area width (number of columns). (int)
  • height - Area height (number of rows). (int)

filter_mean(size)

source code 

Filters a data field with mean filter of size size.

Parameters:
  • size - Averaged area size. (int)

area_filter_mean(size, col, row, width, height)

source code 

Filters a rectangular part of a data field with mean filter of size size.

This method is a simple DataField.area_gather() wrapper.

Parameters:
  • size - Averaged area size. (int)
  • col - Upper-left column coordinate. (int)
  • row - Upper-left row coordinate. (int)
  • width - Area width (number of columns). (int)
  • height - Area height (number of rows). (int)

filter_conservative(size)

source code 

Filters a data field with conservative denoise filter.

Parameters:
  • size - Filtered area size. (int)

area_filter_conservative(size, col, row, width, height)

source code 

Filters a rectangular part of a data field with conservative denoise filter.

Parameters:
  • size - Filtered area size. (int)
  • col - Upper-left column coordinate. (int)
  • row - Upper-left row coordinate. (int)
  • width - Area width (number of columns). (int)
  • height - Area height (number of rows). (int)

filter_laplacian()

source code 

Filters a data field with Laplacian filter.

area_filter_laplacian(col, row, width, height)

source code 

Filters a rectangular part of a data field with Laplacian filter.

Parameters:
  • col - Upper-left column coordinate. (int)
  • row - Upper-left row coordinate. (int)
  • width - Area width (number of columns). (int)
  • height - Area height (number of rows). (int)

filter_laplacian_of_gaussians()

source code 

Filters a data field with Laplacian of Gaussians filter.

Since: 2.23

area_filter_laplacian_of_gaussians(col, row, width, height)

source code 

Filters a rectangular part of a data field with Laplacian of Gaussians filter.

Since: 2.23

Parameters:
  • col - Upper-left column coordinate. (int)
  • row - Upper-left row coordinate. (int)
  • width - Area width (number of columns). (int)
  • height - Area height (number of rows). (int)

filter_sobel(orientation)

source code 

Filters a data field with Sobel filter.

Parameters:
  • orientation - Filter orientation. (Orientation)

area_filter_sobel(orientation, col, row, width, height)

source code 

Filters a rectangular part of a data field with Sobel filter.

Parameters:
  • orientation - Filter orientation. (Orientation)
  • col - Upper-left column coordinate. (int)
  • row - Upper-left row coordinate. (int)
  • width - Area width (number of columns). (int)
  • height - Area height (number of rows). (int)

filter_prewitt(orientation)

source code 

Filters a data field with Prewitt filter.

Parameters:
  • orientation - Filter orientation. (Orientation)

area_filter_prewitt(orientation, col, row, width, height)

source code 

Filters a rectangular part of a data field with Prewitt filter.

Parameters:
  • orientation - Filter orientation. (Orientation)
  • col - Upper-left column coordinate. (int)
  • row - Upper-left row coordinate. (int)
  • width - Area width (number of columns). (int)
  • height - Area height (number of rows). (int)

filter_dechecker()

source code 

Filters a data field with 5x5 checker pattern removal filter.

Since: 2.1

area_filter_dechecker(col, row, width, height)

source code 

Filters a rectangular part of a data field with 5x5 checker pattern removal filter.

Since: 2.1

Parameters:
  • col - Upper-left column coordinate. (int)
  • row - Upper-left row coordinate. (int)
  • width - Area width (number of columns). (int)
  • height - Area height (number of rows). (int)

filter_gaussian(sigma)

source code 

Filters a data field with a Gaussian filter.

Since: 2.4

Parameters:
  • sigma - The sigma parameter of the Gaussian. (float)

area_filter_gaussian(sigma, col, row, width, height)

source code 

Filters a rectangular part of a data field with a Gaussian filter.

The Gausian is normalized, i.e. it is sum-preserving.

Since: 2.4

Parameters:
  • sigma - The sigma parameter of the Gaussian. (float)
  • col - Upper-left column coordinate. (int)
  • row - Upper-left row coordinate. (int)
  • width - Area width (number of columns). (int)
  • height - Area height (number of rows). (int)

filter_minimum(size)

source code 

Filters a data field with minimum filter.

Parameters:
  • size - Neighbourhood size for minimum search. (int)

area_filter_minimum(size, col, row, width, height)

source code 

Filters a rectangular part of a data field with minimum filter.

This operation is often called erosion filter.

Parameters:
  • size - Neighbourhood size for minimum search. (int)
  • col - Upper-left column coordinate. (int)
  • row - Upper-left row coordinate. (int)
  • width - Area width (number of columns). (int)
  • height - Area height (number of rows). (int)

filter_maximum(size)

source code 

Filters a data field with maximum filter.

Parameters:
  • size - Neighbourhood size for maximum search. (int)

area_filter_maximum(size, col, row, width, height)

source code 

Filters a rectangular part of a data field with maximum filter.

This operation is often called dilation filter.

Parameters:
  • size - Neighbourhood size for maximum search. (int)
  • col - Upper-left column coordinate. (int)
  • row - Upper-left row coordinate. (int)
  • width - Area width (number of columns). (int)
  • height - Area height (number of rows). (int)

filter_rms(size)

source code 

Filters a data field with RMS filter.

Parameters:
  • size - Area size. (int)

area_filter_rms(size, col, row, width, height)

source code 

Filters a rectangular part of a data field with RMS filter of size size.

RMS filter computes root mean square in given area.

Parameters:
  • size - Area size. (int)
  • col - Upper-left column coordinate. (int)
  • row - Upper-left row coordinate. (int)
  • width - Area width (number of columns). (int)
  • height - Area height (number of rows). (int)

filter_kuwahara()

source code 

Filters a data field with Kuwahara filter.

area_filter_kuwahara(col, row, width, height)

source code 

Filters a rectangular part of a data field with a Kuwahara (edge-preserving smoothing) filter.

Parameters:
  • col - Upper-left column coordinate. (int)
  • row - Upper-left row coordinate. (int)
  • width - Area width (number of columns). (int)
  • height - Area height (number of rows). (int)

filter_canny(threshold)

source code 

Filters a rectangular part of a data field with canny edge detector filter.

Parameters:
  • threshold - Slope detection threshold (range 0..1). (float)

shade(target_field, theta, phi)

source code 

Shades a data field.

Parameters:
  • target_field - A data field to put the shade to. It will be resized to match data_field. (DataField)
  • theta - Shading angle (in radians, from north pole). (float)
  • phi - Shade orientation in xy plane (in radians, counterclockwise). (float)

fractal_partitioning(xresult, yresult, interpolation)

source code 

Computes data for log-log plot by partitioning.

Data lines xresult and yresult will be resized to the output size and they will contain corresponding values at each position.

Parameters:
  • xresult - Data line to store x-values for log-log plot to. (DataLine)
  • yresult - Data line to store y-values for log-log plot to. (DataLine)
  • interpolation - Interpolation type. (InterpolationType)

fractal_cubecounting(xresult, yresult, interpolation)

source code 

Computes data for log-log plot by cube counting.

Data lines xresult and yresult will be resized to the output size and they will contain corresponding values at each position.

Parameters:
  • xresult - Data line to store x-values for log-log plot to. (DataLine)
  • yresult - Data line to store y-values for log-log plot to. (DataLine)
  • interpolation - Interpolation type. (InterpolationType)

fractal_triangulation(xresult, yresult, interpolation)

source code 

Computes data for log-log plot by triangulation.

Data lines xresult and yresult will be resized to the output size and they will contain corresponding values at each position.

Parameters:
  • xresult - Data line to store x-values for log-log plot to. (DataLine)
  • yresult - Data line to store y-values for log-log plot to. (DataLine)
  • interpolation - Interpolation type. (InterpolationType)

fractal_psdf(xresult, yresult, interpolation)

source code 

Computes data for log-log plot by spectral density method.

Data lines xresult and yresult will be resized to the output size and they will contain corresponding values at each position.

Parameters:
  • xresult - Data line to store x-values for log-log plot to. (DataLine)
  • yresult - Data line to store y-values for log-log plot to. (DataLine)
  • interpolation - Interpolation type. (InterpolationType)

fractal_correction(mask_field, interpolation)

source code 

Replaces data under mask with interpolated values using fractal interpolation.

Parameters:
  • mask_field - Mask of places to be corrected. (DataField)
  • interpolation - Interpolation type. (InterpolationType)

grains_mark_curvature(grain_field, threshval, below)

source code 

Marks data that are above/below curvature threshold.

Parameters:
  • grain_field - Data field to store the resulting mask to. (DataField)
  • threshval - Relative curvature threshold, in percents. (float)
  • below - If True, data below threshold are marked, otherwise data above threshold are marked. (bool)

grains_mark_watershed(grain_field, locate_steps, locate_thresh, locate_dropsize, wshed_steps, wshed_dropsize, prefilter, below)

source code 

Performs watershed algorithm.

Parameters:
  • grain_field - Result of marking (mask). (DataField)
  • locate_steps - Locating algorithm steps. (int)
  • locate_thresh - Locating algorithm threshold. (int)
  • locate_dropsize - Locating drop size. (float)
  • wshed_steps - Watershed steps. (int)
  • wshed_dropsize - Watershed drop size. (float)
  • prefilter - Use prefiltering. (bool)
  • below - If True, valleys are marked, otherwise mountains are marked. (bool)

grains_remove_grain(col, row)

source code 

Removes one grain at given position.

Parameters:
  • col - Column inside a grain. (int)
  • row - Row inside a grain. (int)
Returns:
True if a grain was actually removed (i.e., (col,row) was inside a grain).

grains_extract_grain(col, row)

source code 

Removes all grains except that one at given position.

If there is no grain at (col, row), all grains are removed.

Parameters:
  • col - Column inside a grain. (int)
  • row - Row inside a grain. (int)
Returns:
True if a grain remained (i.e., (col,row) was inside a grain).

grains_remove_by_size(size)

source code 

Removes all grain below specified area.

Parameters:
  • size - Grain area threshold, in square pixels. (int)

grains_remove_by_height(grain_field, threshval, below)

source code 

Removes grains that are higher/lower than given threshold value.

Parameters:
  • grain_field - Field of marked grains (mask) (DataField)
  • threshval - Relative height threshold, in percents. (float)
  • below - If True, grains below threshold are removed, otherwise grains above threshold are removed. (bool)

UNIMPLEMENTED_grains_watershed_init(grain_field, locate_steps, locate_thresh, locate_dropsize, wshed_steps, wshed_dropsize, prefilter, below)

source code 

Initializes the watershed algorithm.

This iterator reports its state as WatershedStateType.

Parameters:
  • grain_field - Result of marking (mask). (DataField)
  • locate_steps - Locating algorithm steps. (int)
  • locate_thresh - Locating algorithm threshold. (int)
  • locate_dropsize - Locating drop size. (float)
  • wshed_steps - Watershed steps. (int)
  • wshed_dropsize - Watershed drop size. (float)
  • prefilter - Use prefiltering. (bool)
  • below - If True, valleys are marked, otherwise mountains are marked. (bool)
Returns:
A new watershed iterator.

grains_mark_height(grain_field, threshval, below)

source code 

Marks data that are above/below height threshold.

Parameters:
  • grain_field - Data field to store the resulting mask to. (DataField)
  • threshval - Relative height threshold, in percents. (float)
  • below - If True, data below threshold are marked, otherwise data above threshold are marked. (bool)

grains_mark_slope(grain_field, threshval, below)

source code 

Marks data that are above/below slope threshold.

Parameters:
  • grain_field - Data field to store the resulting mask to. (DataField)
  • threshval - Relative slope threshold, in percents. (float)
  • below - If True, data below threshold are marked, otherwise data above threshold are marked. (bool)

grains_add(add_field)

source code 

Adds add_field grains to grain_field.

Note: This function is equivalent to <literal>DataField.max_of_fields(grain_field, grain_field, add_field);</literal> and it will be probably removed someday.

Parameters:
  • add_field - Field of marked grains (mask) to be added. (DataField)

grains_intersect(intersect_field)

source code 

Performs intersection betweet two grain fields, result is stored in grain_field.

Note: This function is equivalent to <literal>DataField.min_of_fields(grain_field, grain_field, intersect_field);</literal> and it will be probably removed someday.

Parameters:
  • intersect_field - Field of marked grains (mask). (DataField)

UNIMPLEMENTED_number_grains(grains)

source code 

Numbers grains in a mask data field.

Parameters:
  • grains - Zero-filled array of integers of equal size to mask_field to put grain numbers to. Empty space will be left 0, pixels inside a grain will be set to grain number. Grains are numbered sequentially 1, 2, 3, ... (gint*)
Returns:
The number of last grain (note they are numbered from 1).

UNIMPLEMENTED_get_grain_bounding_boxes(ngrains, grains, bboxes)

source code 

Find bounding boxes of all grains.

Since: 2.3

Parameters:
  • ngrains - The number of grains as returned by DataField.number_grains(). (int)
  • grains - Grain numbers filled with DataField.number_grains(). (const-gint*)
  • bboxes - Array of size at least 4*(ngrains+1) to fill with grain bounding boxes (as usual zero does not correspond to any grain, grains start from 1). The bounding boxes are stored as quadruples of indices: (xmin, ymin, width, height). It can be NULL to allocate a new array. (gint*)
Returns:
Either bboxes (if it was not NULL), or a newly allocated array of size 4ngrains.

UNIMPLEMENTED_grains_get_distribution(grain_field, distribution, ngrains, grains, quantity, nstats)

source code 

Computes distribution of requested grain characteristics.

Puts number of grains vs. grain value data into distribution, units, scales and offsets of distribution are updated accordingly.

Parameters:
  • grain_field - Data field (mask) of marked grains. Note if you pass non-NULL grains all grain information is taken from it and grain_field can be even NULL then. (DataField)
  • distribution - Data line to store grain distribution to. (DataLine)
  • grains - Grain numbers filled with DataField.number_grains() if you have it, or NULL (the function then finds grain numbers itself which is not efficient for repeated use on the same grain field). (const-gint*)
  • ngrains - The number of grains as returned by DataField.number_grains(). Ignored in grains is NULL. (int)
  • quantity - The quantity to calculate. (GrainQuantity)
  • nstats - The number of samples to take on the distribution function. If nonpositive, a suitable resolution is determined automatically. (int)
Returns:
A data line with the distribution: distribution itself if it was not NULL, otherwise a newly created DataLine caller must destroy. If there are no grains, NULL is returned and distribution is not changed.

UNIMPLEMENTED_grains_get_values(values, ngrains, grains, quantity)

source code 

Calculates characteristics of grains.

This is a bit low-level function, see also DataField.grains_get_distribution().

The array values will be filled with the requested grain value for each individual grain (0th item of values which does not correspond to any grain will be overwritten with an arbitrary value and should be ignored).

The grain numbers serve as indices in values. Therefore as long as the same grains is used, the same position in values corresponds to the same particular grain. This enables one for instance to calculate grain sizes and grain heights and then correlate them.

Parameters:
  • values - Array of size ngrains+1 to put grain values to. It can be NULL to allocate and return a new array. (gdouble*)
  • grains - Grain numbers filled with DataField.number_grains(). (const-gint*)
  • ngrains - The number of grains as returned by DataField.number_grains(). (int)
  • quantity - The quantity to calculate. (GrainQuantity)
Returns:
values itself if it was not NULL, otherwise a newly allocated array that caller has to free.

UNIMPLEMENTED_grains_get_quantities(values, quantities, nquantities, ngrains, grains)

source code 

Calculates multiple characteristics of grains simultaneously.

See DataField.grains_get_values() for some discussion. This function is more efficient if several grain quantities need to be calculated since DataField.grains_get_values() can do lot of repeated work in such case.

Since: 2.22

Parameters:
  • values - Array of nquantities pointers to blocks of length ngrains+1 to put the calculated grain values to. Each block corresponds to one requested quantity. NULL can be passed to allocate and return a new array. (gdouble**)
  • quantities - Array of nquantities items that specify the requested GrainQuantity to put to corresponding items in values. Quantities can repeat. (const-GrainQuantity*)
  • nquantities - The number of requested different grain values. (int)
  • grains - Grain numbers filled with DataField.number_grains(). (const-gint*)
  • ngrains - The number of grains as returned by DataField.number_grains(). (int)
Returns:
values itself if it was not NULL, otherwise a newly allocated array that caller has to free with g_free(), including the contained arrays.

area_grains_tgnd(target_line, col, row, width, height, below, nstats)

source code 

Calculates threshold grain number distribution.

This function is a simple DataField.area_grains_tgnd_range() that calculates the distribution in the full range.

Parameters:
  • target_line - A data line to store the distribution to. It will be resampled to the requested width. (DataLine)
  • col - Upper-left column coordinate. (int)
  • row - Upper-left row coordinate. (int)
  • width - Area width (number of columns). (int)
  • height - Area height (number of rows). (int)
  • below - If True, valleys are marked, otherwise mountains are marked. (bool)
  • nstats - The number of samples to take on the distribution function. If nonpositive, a suitable resolution is determined automatically. (int)

area_grains_tgnd_range(target_line, col, row, width, height, min, max, below, nstats)

source code 

Calculates threshold grain number distribution in given height range.

This is the number of grains for each of nstats equidistant height threshold levels. For large nstats this function is much faster than the equivalent number of DataField.grains_mark_height() calls.

Parameters:
  • target_line - A data line to store the distribution to. It will be resampled to the requested width. (DataLine)
  • col - Upper-left column coordinate. (int)
  • row - Upper-left row coordinate. (int)
  • width - Area width (number of columns). (int)
  • height - Area height (number of rows). (int)
  • min - Minimum threshold value. (float)
  • max - Maximum threshold value. (float)
  • below - If True, valleys are marked, otherwise mountains are marked. (bool)
  • nstats - The number of samples to take on the distribution function. If nonpositive, a suitable resolution is determined automatically. (int)

a_1dfft(iin, rout, iout, orientation, windowing, direction, interpolation, preserverms, level)

source code 

Transforms all rows or columns in a data field with Fast Fourier Transform.

If requested a windowing and/or leveling is applied to preprocess data to obtain reasonable results.

Parameters:
  • iin - Imaginary input data field. It can be NULL for real-to-complex transform which can be somewhat faster than complex-to-complex transform. (DataField)
  • rout - Real output data field, it will be resized to area size. (DataField)
  • iout - Imaginary output data field, it will be resized to area size. (DataField)
  • orientation - Orientation: pass ORIENTATION_HORIZONTAL to transform rows, ORIENTATION_VERTICAL to transform columns. (Orientation)
  • windowing - Windowing type. (WindowingType)
  • direction - FFT direction. (TransformDirection)
  • interpolation - Interpolation type. Ignored since 2.8 as no resampling is performed. (InterpolationType)
  • preserverms - True to preserve RMS while windowing. (bool)
  • level - 0 to perform no leveling, 1 to subtract mean value, 2 to subtract line (the number can be interpreted as the first polynomial degree to keep, but only the enumerated three values are available). (int)

area_1dfft(iin, rout, iout, col, row, width, height, orientation, windowing, direction, interpolation, preserverms, level)

source code 

Transforms all rows or columns in a rectangular part of a data field with Fast Fourier Transform.

If requested a windowing and/or leveling is applied to preprocess data to obtain reasonable results.

Parameters:
  • iin - Imaginary input data field. It can be NULL for real-to-complex transform which can be somewhat faster than complex-to-complex transform. (DataField)
  • rout - Real output data field, it will be resized to area size. (DataField)
  • iout - Imaginary output data field, it will be resized to area size. (DataField)
  • col - Upper-left column coordinate. (int)
  • row - Upper-left row coordinate. (int)
  • width - Area width (number of columns), must be at least 2 for horizontal transforms. (int)
  • height - Area height (number of rows), must be at least 2 for vertical transforms. (int)
  • orientation - Orientation: pass ORIENTATION_HORIZONTAL to transform rows, ORIENTATION_VERTICAL to transform columns. (Orientation)
  • windowing - Windowing type. (WindowingType)
  • direction - FFT direction. (TransformDirection)
  • interpolation - Interpolation type. Ignored since 2.8 as no resampling is performed. (InterpolationType)
  • preserverms - True to preserve RMS while windowing. (bool)
  • level - 0 to perform no leveling, 1 to subtract mean value, 2 to subtract lines (the number can be interpreted as the first polynomial degree to keep, but only the enumerated three values are available). (int)

a_1dfft_raw(iin, rout, iout, orientation, direction)

source code 

Transforms all rows or columns in a data field with Fast Fourier Transform.

No leveling, windowing nor scaling is performed.

Since 2.8 the dimensions need not to be from the set of sizes returned by gwy_fft_find_nice_size().

Since: 2.1

Parameters:
  • iin - Imaginary input data field. It can be NULL for real-to-complex transform. (DataField)
  • rout - Real output data field, it will be resized to rin size. (DataField)
  • iout - Imaginary output data field, it will be resized to rin size. (DataField)
  • orientation - Orientation: pass ORIENTATION_HORIZONTAL to transform rows, ORIENTATION_VERTICAL to transform columns. (Orientation)
  • direction - FFT direction. (TransformDirection)

a_2dfft(iin, rout, iout, windowing, direction, interpolation, preserverms, level)

source code 

Calculates 2D Fast Fourier Transform of a rectangular a data field.

If requested a windowing and/or leveling is applied to preprocess data to obtain reasonable results.

Parameters:
  • iin - Imaginary input data field. It can be NULL for real-to-complex transform which can be somewhat faster than complex-to-complex transform. (DataField)
  • rout - Real output data field, it will be resized to area size. (DataField)
  • iout - Imaginary output data field, it will be resized to area size. (DataField)
  • windowing - Windowing type. (WindowingType)
  • direction - FFT direction. (TransformDirection)
  • interpolation - Interpolation type. (InterpolationType)
  • preserverms - True to preserve RMS while windowing. (bool)
  • level - 0 to perform no leveling, 1 to subtract mean value, 2 to subtract plane (the number can be interpreted as the first polynomial degree to keep, but only the enumerated three values are available). (int)

area_2dfft(iin, rout, iout, col, row, width, height, windowing, direction, interpolation, preserverms, level)

source code 

Calculates 2D Fast Fourier Transform of a rectangular area of a data field.

If requested a windowing and/or leveling is applied to preprocess data to obtain reasonable results.

Parameters:
  • iin - Imaginary input data field. It can be NULL for real-to-complex transform which can be somewhat faster than complex-to-complex transform. (DataField)
  • rout - Real output data field, it will be resized to area size. (DataField)
  • iout - Imaginary output data field, it will be resized to area size. (DataField)
  • col - Upper-left column coordinate. (int)
  • row - Upper-left row coordinate. (int)
  • width - Area width (number of columns), must be at least 2. (int)
  • height - Area height (number of rows), must be at least 2. (int)
  • windowing - Windowing type. (WindowingType)
  • direction - FFT direction. (TransformDirection)
  • interpolation - Interpolation type. Ignored since 2.8 as no resampling is performed. (InterpolationType)
  • preserverms - True to preserve RMS while windowing. (bool)
  • level - 0 to perform no leveling, 1 to subtract mean value, 2 to subtract plane (the number can be interpreted as the first polynomial degree to keep, but only the enumerated three values are available). (int)

a_2dfft_raw(iin, rout, iout, direction)

source code 

Calculates 2D Fast Fourier Transform of a data field.

No leveling, windowing nor scaling is performed.

Since 2.8 the dimensions need not to be from the set of sizes returned by gwy_fft_find_nice_size().

Since: 2.1

Parameters:
  • iin - Imaginary input data field. It can be NULL for real-to-complex transform. (DataField)
  • rout - Real output data field, it will be resized to rin size. (DataField)
  • iout - Imaginary output data field, it will be resized to rin size. (DataField)
  • direction - FFT direction. (TransformDirection)

a_2dfft_humanize()

source code 

Rearranges 2D FFT output to a human-friendly form.

Top-left, top-right, bottom-left and bottom-right sub-rectangles are swapped
to obtain a humanized 2D FFT output with (0,0) in the centre.

More precisely, for even field dimensions the equally-sized blocks starting
with the Nyquist frequency and with the zero frequency (constant component)
will exchange places.  For odd field dimensions, the block containing the
zero frequency is one item larger and the constant component will actually
end up in the exact centre.

Also note if both dimensions are even, this function is involutory and
identical to L{DataField.2dfft_dehumanize}().  However, if any dimension
is odd, L{DataField.2dfft_humanize}() and
L{DataField.2dfft_dehumanize}() are different, therefore they must be
paired properly.

@return:
          

a_2dfft_dehumanize()

source code 

Rearranges 2D FFT output back from the human-friendly form.

Top-left, top-right, bottom-left and bottom-right sub-rectangles are swapped
to reshuffle a humanized 2D FFT output back into the natural positions.

See L{DataField.2dfft_humanize}() for discussion.

Since: 2.8

@return:
          

fft_filter_1d(result_field, weights, orientation, interpolation)

source code 

Performs 1D FFT filtering of a data field.

Parameters:
  • result_field - A data field to store the result to. It will be resampled to data_field's size. (DataField)
  • weights - Filter weights for the lower half of the spectrum (the other half is symmetric). Its size can be arbitrary, it will be interpolated. (DataLine)
  • orientation - Filter direction. (Orientation)
  • interpolation - The interpolation to use for resampling. (InterpolationType)

UNIMPLEMENTED_cwt(interpolation, scale, wtype)

source code 

Computes a continuous wavelet transform (CWT) at given scale and using given wavelet.

Parameters:
  • interpolation - Interpolation type. Ignored since 2.8 as no resampling is performed. (InterpolationType)
  • scale - Wavelet scale. (float)
  • wtype - Wavelet type. (2DCWTWaveletType)

area_fit_plane(mask, col, row, width, height, pa, pbx, pby)

source code 

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

The coefficients can be used for plane leveling using the same relation as in DataField.fit_plane(), counting indices from area top left corner.

Parameters:
  • mask - Mask of values to take values into account, or NULL for full data_field. Values equal to 0.0 and below cause corresponding data_field samples to be ignored, values equal to 1.0 and above cause inclusion of corresponding data_field samples. The behaviour for values inside (0.0, 1.0) is undefined (it may be specified in the future). (DataField)
  • col - Upper-left column coordinate. (int)
  • row - Upper-left row coordinate. (int)
  • width - Area width (number of columns). (int)
  • height - Area height (number of rows). (int)
  • pa - Where constant coefficient should be stored (or NULL). (float)
  • pbx - Where x plane coefficient should be stored (or NULL). (float)
  • pby - Where y plane coefficient should be stored (or NULL). (float)

fit_plane(pa, pbx, pby)

source code 

Fits a plane through a data field.

The coefficients can be used for plane leveling using relation data[i] := data[i] - (pa + pby*i + pbx*j);

Parameters:
  • pa - Where constant coefficient should be stored (or NULL). (float)
  • pbx - Where x plane coefficient should be stored (or NULL). (float)
  • pby - Where y plane coefficient should be stored (or NULL). (float)

plane_level(a, bx, by)

source code 

Subtracts plane from a data field.

See DataField.fit_plane() for details.

Parameters:
  • a - Constant coefficient. (float)
  • bx - X plane coefficient. (float)
  • by - Y plane coefficient. (float)

plane_rotate(xangle, yangle, interpolation)

source code 

Performs rotation of plane along x and y axis.

Parameters:
  • xangle - Rotation angle in x direction (rotation along y axis, in radians). (float)
  • yangle - Rotation angle in y direction (rotation along x axis, in radians). (float)
  • interpolation - Interpolation type (can be only of two-point type). (InterpolationType)

fit_lines(col, row, width, height, degree, exclude, orientation)

source code 

Independently levels profiles on each row/column in a data field.

Lines that have no intersection with area selected by ulcol, ulrow, brcol, brrow are always leveled as a whole. Lines that have intersection with selected area, are leveled using polynomial coefficients computed only from data inside (or outside for exclude = True) the area.

Parameters:
  • col - Upper-left column coordinate. (int)
  • row - Upper-left row coordinate. (int)
  • width - Area width (number of columns). (int)
  • height - Area height (number of rows). (int)
  • degree - Fitted polynomial degree. (int)
  • exclude - If True, outside of area selected by ulcol, ulrow, brcol, brrow will be used for polynomial coefficients computation, instead of inside. (bool)
  • orientation - Line orientation. (Orientation)

subtract_polynom(col_degree, row_degree, coeffs)

source code 

Subtracts a two-dimensional polynomial from a data field.

Parameters:
  • col_degree - Degree of polynomial to subtract column-wise (x-coordinate). (int)
  • row_degree - Degree of polynomial to subtract row-wise (y-coordinate). (int)
  • coeffs - An array of size (row_degree+1)*(col_degree+1) with coefficients, see DataField.area_fit_polynom() for details. (const-gdouble*)

area_subtract_polynom(col, row, width, height, col_degree, row_degree, coeffs)

source code 

Subtracts a two-dimensional polynomial from a rectangular part of a data field.

Parameters:
  • col - Upper-left column coordinate. (int)
  • row - Upper-left row coordinate. (int)
  • width - Area width (number of columns). (int)
  • height - Area height (number of rows). (int)
  • col_degree - Degree of polynomial to subtract column-wise (x-coordinate). (int)
  • row_degree - Degree of polynomial to subtract row-wise (y-coordinate). (int)
  • coeffs - An array of size (row_degree+1)*(col_degree+1) with coefficients, see DataField.area_fit_polynom() for details. (const-gdouble*)

UNIMPLEMENTED_fit_legendre(col_degree, row_degree, coeffs)

source code 

Fits two-dimensional Legendre polynomial to a data field.

See DataField.area_fit_legendre() for details.

Parameters:
  • col_degree - Degree of polynomial to fit column-wise (x-coordinate). (int)
  • row_degree - Degree of polynomial to fit row-wise (y-coordinate). (int)
  • coeffs - An array of size (row_degree+1)*(col_degree+1) to store the coefficients to, or NULL (a fresh array is allocated then). (gdouble*)
Returns:
Either coeffs if it was not NULL, or a newly allocated array with coefficients.

UNIMPLEMENTED_area_fit_legendre(col, row, width, height, col_degree, row_degree, coeffs)

source code 

Fits two-dimensional Legendre polynomial to a rectangular part of a data field.

The col_degree and row_degree parameters limit the maximum powers of x and y exactly as if simple powers were fitted, therefore if you do not intend to interpret contents of coeffs youself, the only difference is that this method is much more numerically stable.

The coefficients are organized exactly like in DataField.area_fit_polynom(), but they are not coefficients of x^n y^m, instead they are coefficients of P_n(x) P_m(x), where P are Legendre polynomials. The polynomials are evaluated in coordinates where first row (column) corresponds to -1.0, and the last row (column) to 1.0.

Note the polynomials are normal Legendre polynomials that are not exactly orthogonal on a discrete point set (if their degrees are equal mod 2).

Parameters:
  • col - Upper-left column coordinate. (int)
  • row - Upper-left row coordinate. (int)
  • width - Area width (number of columns). (int)
  • height - Area height (number of rows). (int)
  • col_degree - Degree of polynomial to fit column-wise (x-coordinate). (int)
  • row_degree - Degree of polynomial to fit row-wise (y-coordinate). (int)
  • coeffs - An array of size (row_degree+1)*(col_degree+1) to store the coefficients to, or NULL (a fresh array is allocated then). (gdouble*)
Returns:
Either coeffs if it was not NULL, or a newly allocated array with coefficients.

subtract_legendre(col_degree, row_degree, coeffs)

source code 

Subtracts a two-dimensional Legendre polynomial fit from a data field.

Parameters:
  • col_degree - Degree of polynomial to subtract column-wise (x-coordinate). (int)
  • row_degree - Degree of polynomial to subtract row-wise (y-coordinate). (int)
  • coeffs - An array of size (row_degree+1)*(col_degree+1) with coefficients, see DataField.area_fit_legendre() for details. (const-gdouble*)

area_subtract_legendre(col, row, width, height, col_degree, row_degree, coeffs)

source code 

Subtracts a two-dimensional Legendre polynomial fit from a rectangular part of a data field.

Due to the transform of coordinates to [-1,1] x [-1,1], this method can be used on an area of dimensions different than the area the coefficients were calculated for.

Parameters:
  • col - Upper-left column coordinate. (int)
  • row - Upper-left row coordinate. (int)
  • width - Area width (number of columns). (int)
  • height - Area height (number of rows). (int)
  • col_degree - Degree of polynomial to subtract column-wise (x-coordinate). (int)
  • row_degree - Degree of polynomial to subtract row-wise (y-coordinate). (int)
  • coeffs - An array of size (row_degree+1)*(col_degree+1) with coefficients, see DataField.area_fit_legendre() for details. (const-gdouble*)

UNIMPLEMENTED_fit_poly_max(max_degree, coeffs)

source code 

Fits two-dimensional polynomial with limited total degree to a data field.

See DataField.area_fit_poly_max() for details.

Parameters:
  • max_degree - Maximum total polynomial degree, that is the maximum of m+n in x^n y^m terms. (int)
  • coeffs - An array of size (max_degree+1)*(max_degree+2)/2 to store the coefficients to, or NULL (a fresh array is allocated then). (gdouble*)
Returns:
Either coeffs if it was not NULL, or a newly allocated array with coefficients.

UNIMPLEMENTED_area_fit_poly_max(col, row, width, height, max_degree, coeffs)

source code 

Fits two-dimensional polynomial with limited total degree to a rectangular part of a data field.

See DataField.area_fit_legendre() for description. This function differs by limiting the total maximum degree, while DataField.area_fit_legendre() limits the maximum degrees in horizontal and vertical directions independently.

Parameters:
  • col - Upper-left column coordinate. (int)
  • row - Upper-left row coordinate. (int)
  • width - Area width (number of columns). (int)
  • height - Area height (number of rows). (int)
  • max_degree - Maximum total polynomial degree, that is the maximum of m+n in x^n y^m terms. (int)
  • coeffs - An array of size (max_degree+1)*(max_degree+2)/2 to store the coefficients to, or NULL (a fresh array is allocated then). (gdouble*)
Returns:
Either coeffs if it was not NULL, or a newly allocated array with coefficients.

subtract_poly_max(max_degree, coeffs)

source code 

Subtracts a two-dimensional polynomial with limited total degree from a data field.

Parameters:
  • max_degree - Maximum total polynomial degree, that is the maximum of m+n in x^n y^m terms. (int)
  • coeffs - An array of size (row_degree+1)*(col_degree+2)/2 with coefficients, see DataField.area_fit_poly_max() for details. (const-gdouble*)

area_subtract_poly_max(col, row, width, height, max_degree, coeffs)

source code 

Subtracts a two-dimensional polynomial with limited total degree from a rectangular part of a data field.

Due to the transform of coordinates to [-1,1] x [-1,1], this method can be used on an area of dimensions different than the area the coefficients were calculated for.

Parameters:
  • col - Upper-left column coordinate. (int)
  • row - Upper-left row coordinate. (int)
  • width - Area width (number of columns). (int)
  • height - Area height (number of rows). (int)
  • max_degree - Maximum total polynomial degree, that is the maximum of m+n in x^n y^m terms. (int)
  • coeffs - An array of size (row_degree+1)*(col_degree+2)/2 with coefficients, see DataField.area_fit_poly_max() for details. (const-gdouble*)

fit_poly(mask_field, nterms, term_powers, exclude, coeffs)

source code 

Fit a given set of polynomial terms to a data field.

Since: 2.11

Parameters:
  • mask_field - Mask of values to take values into account, or NULL for full data_field. Values equal to 0.0 and below cause corresponding data_field samples to be ignored, values equal to 1.0 and above cause inclusion of corresponding data_field samples. The behaviour for values inside (0.0, 1.0) is undefined (it may be specified in the future). (DataField)
  • nterms - The number of polynomial terms to take into account (half the number of items in term_powers). (int)
  • term_powers - Array of size 2*nterms describing the terms to fit. Each terms is described by a couple of powers (powerx, powery). (const-gint*)
  • exclude - Interpret values w in the mask as 1.0-w. (bool)
  • coeffs - Array of size nterms to store the coefficients to, or NULL to allocate a new array. (gdouble*)
Returns:
Either coeffs if it was not NULL, or a newly allocated array with coefficients.

area_fit_poly(mask_field, col, row, width, height, nterms, term_powers, exclude, coeffs)

source code 

Fit a given set of polynomial terms to a rectangular part of a data field.

The polynomial coefficients correspond to normalized coordinates that are always from the interval [-1,1] where -1 corresponds to the left/topmost pixel and 1 corresponds to the bottom/rightmost pixel of the area.

Since: 2.11

Parameters:
  • mask_field - Mask of values to take values into account, or NULL for full data_field. Values equal to 0.0 and below cause corresponding data_field samples to be ignored, values equal to 1.0 and above cause inclusion of corresponding data_field samples. The behaviour for values inside (0.0, 1.0) is undefined (it may be specified in the future). (DataField)
  • col - Upper-left column coordinate. (int)
  • row - Upper-left row coordinate. (int)
  • width - Area width (number of columns). (int)
  • height - Area height (number of rows). (int)
  • nterms - The number of polynomial terms to take into account (half the number of items in term_powers). (int)
  • term_powers - Array of size 2*nterms describing the terms to fit. Each terms is described by a couple of powers (powerx, powery). (const-gint*)
  • exclude - Interpret values w in the mask as 1.0-w. (bool)
  • coeffs - Array of size nterms to store the coefficients to, or NULL to allocate a new array. (gdouble*)
Returns:
Either coeffs if it was not NULL, or a newly allocated array with coefficients.

subtract_poly(nterms, term_powers, coeffs)

source code 

Subtract a given set of polynomial terms from a data field.

Since: 2.11

Parameters:
  • nterms - The number of polynomial terms to take into account (half the number of items in term_powers). (int)
  • term_powers - Array of size 2*nterms describing the fitter terms. Each terms is described by a couple of powers (powerx, powery). (const-gint*)
  • coeffs - Array of size nterms to store with the coefficients. (const-gdouble*)

area_subtract_poly(col, row, width, height, nterms, term_powers, coeffs)

source code 

Subtract a given set of polynomial terms from a rectangular part of a data field.

Since: 2.11

Parameters:
  • col - Upper-left column coordinate. (int)
  • row - Upper-left row coordinate. (int)
  • width - Area width (number of columns). (int)
  • height - Area height (number of rows). (int)
  • nterms - The number of polynomial terms to take into account (half the number of items in term_powers). (int)
  • term_powers - Array of size 2*nterms describing the fitted terms. Each terms is described by a couple of powers (powerx, powery). (const-gint*)
  • coeffs - Array of size nterms to store with the coefficients. (const-gdouble*)

UNIMPLEMENTED_area_fit_local_planes(size, col, row, width, height, nresults, types, results)

source code 

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 PLANE_FIT_A is normal mean value.

Parameters:
  • size - Neighbourhood size (must be at least 2). It is centered around each pixel, unless size is even when it sticks to the right. (int)
  • col - Upper-left column coordinate. (int)
  • row - Upper-left row coordinate. (int)
  • width - Area width (number of columns). (int)
  • height - Area height (number of rows). (int)
  • nresults - The number of requested quantities. (int)
  • types - The types of requested quantities. (const-PlaneFitQuantity*)
  • 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. (DataField**)
Returns:
An array of data fields with requested quantities, that is results unless it was NULL and a new array was allocated.

area_local_plane_quantity(size, col, row, width, height, type, result)

source code 

Convenience function to get just one quantity from DataField.area_fit_local_planes().

Parameters:
  • size - Neighbourhood size. (int)
  • col - Upper-left column coordinate. (int)
  • row - Upper-left row coordinate. (int)
  • width - Area width (number of columns). (int)
  • height - Area height (number of rows). (int)
  • type - The type of requested quantity. (PlaneFitQuantity)
  • result - A data field to store result to, or NULL to allocate a new one. (DataField)
Returns:
result if it isn't NULL, otherwise a newly allocated data field.

UNIMPLEMENTED_fit_local_planes(size, nresults, types, results)

source code 

Fits a plane through neighbourhood of each sample in a data field.

See DataField.area_fit_local_planes() for details.

Parameters:
  • size - Neighbourhood size. (int)
  • nresults - The number of requested quantities. (int)
  • types - The types of requested quantities. (const-PlaneFitQuantity*)
  • results - An array to store quantities to. (DataField**)
Returns:
An array of data fields with requested quantities.

local_plane_quantity(size, type, result)

source code 

Convenience function to get just one quantity from DataField.fit_local_planes().

Parameters:
  • size - Neighbourhood size. (int)
  • type - The type of requested quantity. (PlaneFitQuantity)
  • result - A data field to store result to, or NULL to allocate a new one. (DataField)
Returns:
result if it isn't NULL, otherwise a newly allocated data field.

get_max()

source code 

Finds the maximum value of a data field.

This quantity is cached.

Returns:
The maximum value.

get_min()

source code 

Finds the minimum value of a data field.

This quantity is cached.

Returns:
The minimum value.

get_min_max(min, max)

source code 

Finds minimum and maximum values of a data field.

Parameters:
  • min - Location to store minimum to. (float)
  • max - Location to store maximum to. (float)

get_avg()

source code 

Computes average value of a data field.

This quantity is cached.

Returns:
The average value.

get_rms()

source code 

Computes root mean square value of a data field.

This quantity is cached.

Returns:
The root mean square value.

get_sum()

source code 

Sums all values in a data field.

This quantity is cached.

Returns:
The sum of all values.

get_median()

source code 

Computes median value of a data field.

This quantity is cached.

Returns:
The median value.

get_surface_area()

source code 

Computes surface area of a data field.

This quantity is cached.

Returns:
surface area

area_get_max(mask, col, row, width, height)

source code 

Finds the maximum value in a rectangular part of a data field.

Parameters:
  • mask - Mask specifying which values to take into account/exclude, or NULL. (DataField)
  • col - Upper-left column coordinate. (int)
  • row - Upper-left row coordinate. (int)
  • width - Area width (number of columns). (int)
  • height - Area height (number of rows). (int)
Returns:
The maximum value. When the number of samples to calculate maximum of is zero, -G_MAXDOUBLE is returned.

area_get_min(mask, col, row, width, height)

source code 

Finds the minimum value in a rectangular part of a data field.

Parameters:
  • mask - Mask specifying which values to take into account/exclude, or NULL. (DataField)
  • col - Upper-left column coordinate. (int)
  • row - Upper-left row coordinate. (int)
  • width - Area width (number of columns). (int)
  • height - Area height (number of rows). (int)
Returns:
The minimum value. When the number of samples to calculate minimum of is zero, -G_MAXDOUBLE is returned.

UNIMPLEMENTED_area_get_min_max(mask, col, row, width, height, min, max)

source code 

Finds minimum and maximum values in a rectangular part of a data field.

This function is equivalent to calling DataField.area_get_min_max_mask() with masking mode MASK_INCLUDE.

Parameters:
  • mask - Mask specifying which values to take into account/exclude, or NULL. (DataField)
  • col - Upper-left column coordinate. (int)
  • row - Upper-left row coordinate. (int)
  • width - Area width (number of columns). (int)
  • height - Area height (number of rows). (int)
  • min - Location to store minimum to. (gdouble*)
  • max - Location to store maximum to. (gdouble*)

UNIMPLEMENTED_area_get_min_max_mask(mask, mode, col, row, width, height, min, max)

source code 

Finds minimum and maximum values in a rectangular part of a data field.

Since: 2.18

Parameters:
  • mask - Mask specifying which values to take into account/exclude, or NULL. (DataField)
  • mode - Masking mode to use. See the introduction for description of masking modes. (MaskingType)
  • col - Upper-left column coordinate. (int)
  • row - Upper-left row coordinate. (int)
  • width - Area width (number of columns). (int)
  • height - Area height (number of rows). (int)
  • min - Location to store minimum to. (gdouble*)
  • max - Location to store maximum to. (gdouble*)

area_get_avg(mask, col, row, width, height)

source code 

Computes average value of a rectangular part of a data field.

This function is equivalent to calling DataField.area_get_avg_mask() with masking mode MASK_INCLUDE.

Parameters:
  • mask - Mask specifying which values to take into account/exclude, or NULL. (DataField)
  • col - Upper-left column coordinate. (int)
  • row - Upper-left row coordinate. (int)
  • width - Area width (number of columns). (int)
  • height - Area height (number of rows). (int)
Returns:
The average value.

area_get_avg_mask(mask, mode, col, row, width, height)

source code 

Computes average value of a rectangular part of a data field.

Since: 2.18

Parameters:
  • mask - Mask specifying which values to take into account/exclude, or NULL. (DataField)
  • mode - Masking mode to use. See the introduction for description of masking modes. (MaskingType)
  • col - Upper-left column coordinate. (int)
  • row - Upper-left row coordinate. (int)
  • width - Area width (number of columns). (int)
  • height - Area height (number of rows). (int)
Returns:
The average value.

area_get_rms(mask, col, row, width, height)

source code 

Computes root mean square value of a rectangular part of a data field.

Parameters:
  • mask - Mask specifying which values to take into account/exclude, or NULL. (DataField)
  • col - Upper-left column coordinate. (int)
  • row - Upper-left row coordinate. (int)
  • width - Area width (number of columns). (int)
  • height - Area height (number of rows). (int)
Returns:
The root mean square value.

This function is equivalent to calling DataField.area_get_rms_mask() with masking mode MASK_INCLUDE.

area_get_rms_mask(mask, mode, col, row, width, height)

source code 

Computes root mean square value of deviations of a rectangular part of a data field.

Since: 2.18

Parameters:
  • mask - Mask specifying which values to take into account/exclude, or NULL. (DataField)
  • mode - Masking mode to use. See the introduction for description of masking modes. (MaskingType)
  • col - Upper-left column coordinate. (int)
  • row - Upper-left row coordinate. (int)
  • width - Area width (number of columns). (int)
  • height - Area height (number of rows). (int)
Returns:
The root mean square value of deviations from the mean value.

area_get_sum(mask, col, row, width, height)

source code 

Sums values of a rectangular part of a data field.

This function is equivalent to calling DataField.area_get_sum_mask() with masking mode MASK_INCLUDE.

Parameters:
  • mask - Mask specifying which values to take into account/exclude, or NULL. (DataField)
  • col - Upper-left column coordinate. (int)
  • row - Upper-left row coordinate. (int)
  • width - Area width (number of columns). (int)
  • height - Area height (number of rows). (int)
Returns:
The sum of all values inside area.

area_get_sum_mask(mask, mode, col, row, width, height)

source code 

Sums values of a rectangular part of a data field.

Since: 2.18

Parameters:
  • mask - Mask specifying which values to take into account/exclude, or NULL. (DataField)
  • mode - Masking mode to use. See the introduction for description of masking modes. (MaskingType)
  • col - Upper-left column coordinate. (int)
  • row - Upper-left row coordinate. (int)
  • width - Area width (number of columns). (int)
  • height - Area height (number of rows). (int)
Returns:
The sum of all values inside area.

area_get_median(mask, col, row, width, height)

source code 

Computes median value of a data field area.

This function is equivalent to calling DataField.area_get_median_mask() with masking mode MASK_INCLUDE.

Parameters:
  • mask - Mask specifying which values to take into account/exclude, or NULL. (DataField)
  • col - Upper-left column coordinate. (int)
  • row - Upper-left row coordinate. (int)
  • width - Area width (number of columns). (int)
  • height - Area height (number of rows). (int)
Returns:
The median value.

area_get_median_mask(mask, mode, col, row, width, height)

source code 

Computes median value of a data field area.

Since: 2.18

Parameters:
  • mask - Mask specifying which values to take into account/exclude, or NULL. (DataField)
  • mode - Masking mode to use. See the introduction for description of masking modes. (MaskingType)
  • col - Upper-left column coordinate. (int)
  • row - Upper-left row coordinate. (int)
  • width - Area width (number of columns). (int)
  • height - Area height (number of rows). (int)
Returns:
The median value.

area_get_surface_area_mask(mask, mode, col, row, width, height)

source code 

Computes surface area of a rectangular part of a data field.

This quantity makes sense only if the lateral dimensions and values of data_field are the same physical quantities.

Since: 2.18

Parameters:
  • mask - Mask specifying which values to take into account/exclude, or NULL. (DataField)
  • mode - Masking mode to use. See the introduction for description of masking modes. (MaskingType)
  • col - Upper-left column coordinate. (int)
  • row - Upper-left row coordinate. (int)
  • width - Area width (number of columns). (int)
  • height - Area height (number of rows). (int)
Returns:
The surface area.

area_get_volume(basis, mask, col, row, width, height)

source code 

Computes volume of a rectangular part of a data field.

Since: 2.3

Parameters:
  • basis - The basis or background for volume calculation if not NULL. The height of each vertex is then the difference between data_field value and basis value. Value NULL is the same as passing all zeroes for the basis. (DataField)
  • mask - Mask specifying which values to take into account/exclude, or NULL. (DataField)
  • col - Upper-left column coordinate. (int)
  • row - Upper-left row coordinate. (int)
  • width - Area width (number of columns). (int)
  • height - Area height (number of rows). (int)
Returns:
The volume.

UNIMPLEMENTED_get_autorange(_from, to)

source code 

Computes value range with outliers cut-off.

The purpose of this function is to find a range is suitable for false color mapping. The precise method how it is calculated is unspecified and may be subject to changes.

However, it is guaranteed minimum <= from <= to <= maximum.

This quantity is cached.

Parameters:
  • _from - Location to store range start. (gdouble*)
  • to - Location to store range end. (gdouble*)

get_stats(avg, ra, rms, skew, kurtosis)

source code 

Computes basic statistical quantities of a data field.

Parameters:
  • avg - Where average height value of the surface should be stored, or NULL. (float)
  • ra - Where average value of irregularities should be stored, or NULL. (float)
  • rms - Where root mean square value of irregularities (Rq) should be stored, or NULL. (float)
  • skew - Where skew (symmetry of height distribution) should be stored, or NULL. (float)
  • kurtosis - Where kurtosis (peakedness of height ditribution) should be stored, or NULL. (float)

area_get_stats(mask, col, row, width, height, avg, ra, rms, skew, kurtosis)

source code 

Computes basic statistical quantities of a rectangular part of a data field.

This function is equivalent to calling DataField.area_get_stats_mask() with masking mode MASK_INCLUDE.

Parameters:
  • mask - Mask specifying which values to take into account/exclude, or NULL. (DataField)
  • col - Upper-left column coordinate. (int)
  • row - Upper-left row coordinate. (int)
  • width - Area width (number of columns). (int)
  • height - Area height (number of rows). (int)
  • avg - Where average height value of the surface should be stored, or NULL. (float)
  • ra - Where average value of irregularities should be stored, or NULL. (float)
  • rms - Where root mean square value of irregularities (Rq) should be stored, or NULL. (float)
  • skew - Where skew (symmetry of height distribution) should be stored, or NULL. (float)
  • kurtosis - Where kurtosis (peakedness of height ditribution) should be stored, or NULL. (float)

UNIMPLEMENTED_area_get_stats_mask(mask, mode, col, row, width, height, avg, ra, rms, skew, kurtosis)

source code 

Computes basic statistical quantities of a rectangular part of a data field.

Since: 2.18

Parameters:
  • mask - Mask specifying which values to take into account/exclude, or NULL. (DataField)
  • mode - Masking mode to use. See the introduction for description of masking modes. (MaskingType)
  • col - Upper-left column coordinate. (int)
  • row - Upper-left row coordinate. (int)
  • width - Area width (number of columns). (int)
  • height - Area height (number of rows). (int)
  • avg - Where average height value of the surface should be stored, or NULL. (gdouble*)
  • ra - Where average value of irregularities should be stored, or NULL. (gdouble*)
  • rms - Where root mean square value of irregularities (Rq) should be stored, or NULL. (gdouble*)
  • skew - Where skew (symmetry of height distribution) should be stored, or NULL. (gdouble*)
  • kurtosis - Where kurtosis (peakedness of height ditribution) should be stored, or NULL. (gdouble*)

area_count_in_range(mask, col, row, width, height, below, above, nbelow, nabove)

source code 

Counts data samples in given range.

No assertion is made about the values of above and below, in other words above may be larger than below. To count samples in an open interval instead of a closed interval, exchange below and above and then subtract the nabove and nbelow from width*height to get the complementary counts.

With this trick the common task of counting positive values can be realized: <informalexample><programlisting> DataField.area_count_in_range(data_field, NULL, col, row, width, height, 0.0, 0.0, &amp;count, NULL); count = width*height - count; </programlisting></informalexample>

Parameters:
  • mask - Mask specifying which values to take into account/exclude, or NULL. (DataField)
  • col - Upper-left column coordinate. (int)
  • row - Upper-left row coordinate. (int)
  • width - Area width (number of columns). (int)
  • height - Area height (number of rows). (int)
  • below - Upper bound to compare data to. The number of samples less than or equal to below is stored in nbelow. (float)
  • above - Lower bound to compare data to. The number of samples greater than or equal to above is stored in nabove. (float)
  • nbelow - Location to store the number of samples less than or equal to below, or NULL. (int)
  • nabove - Location to store the number of samples greater than or equal to above, or NULL. (int)

area_dh(mask, target_line, col, row, width, height, nstats)

source code 

Calculates distribution of heights in a rectangular part of data field.

Parameters:
  • mask - Mask specifying which values to take into account/exclude, or NULL. (DataField)
  • target_line - A data line to store the distribution to. It will be resampled to requested width. (DataLine)
  • col - Upper-left column coordinate. (int)
  • row - Upper-left row coordinate. (int)
  • width - Area width (number of columns). (int)
  • height - Area height (number of rows). (int)
  • nstats - The number of samples to take on the distribution function. If nonpositive, a suitable resolution is determined automatically. (int)

dh(target_line, nstats)

source code 

Calculates distribution of heights in a data field.

Parameters:
  • target_line - A data line to store the distribution to. It will be resampled to requested width. (DataLine)
  • nstats - The number of samples to take on the distribution function. If nonpositive, a suitable resolution is determined automatically. (int)

area_cdh(mask, target_line, col, row, width, height, nstats)

source code 

Calculates uncertainty of the cumulative distribution of heights in a rectangular part of the data field.

Since: 2.23

Parameters:
  • mask - Mask specifying which values to take into account/exclude, or NULL. (DataField)
  • uncz_field - Corresponding uncertainty data field.
  • target_line - A data line to store the distribution to. It will be resampled to requested width. (DataLine)
  • col - Upper-left column coordinate. (int)
  • row - Upper-left row coordinate. (int)
  • width - Area width (number of columns). (int)
  • height - Area height (number of rows). (int)
  • nstats - The number of samples to take on the distribution function. If nonpositive, a suitable resolution is determined automatically. (int)

cdh(target_line, nstats)

source code 

Calculates cumulative distribution of heights in a data field.

Parameters:
  • target_line - A data line to store the distribution to. It will be resampled to requested width. (DataLine)
  • nstats - The number of samples to take on the distribution function. If nonpositive, a suitable resolution is determined automatically. (int)

area_da(target_line, col, row, width, height, orientation, nstats)

source code 

Calculates distribution of slopes in a rectangular part of data field.

Parameters:
  • target_line - A data line to store the distribution to. It will be resampled to requested width. (DataLine)
  • col - Upper-left column coordinate. (int)
  • row - Upper-left row coordinate. (int)
  • width - Area width (number of columns). (int)
  • height - Area height (number of rows). (int)
  • orientation - Orientation to compute the slope distribution in. (Orientation)
  • nstats - The number of samples to take on the distribution function. If nonpositive, a suitable resolution is determined automatically. (int)

da(target_line, orientation, nstats)

source code 

Calculates distribution of slopes in a data field.

Parameters:
  • target_line - A data line to store the distribution to. It will be resampled to requested width. (DataLine)
  • orientation - Orientation to compute the slope distribution in. (Orientation)
  • nstats - The number of samples to take on the distribution function. If nonpositive, a suitable resolution is determined automatically. (int)

area_cda(target_line, col, row, width, height, orientation, nstats)

source code 

Calculates cumulative distribution of slopes in a rectangular part of data field.

Parameters:
  • target_line - A data line to store the distribution to. It will be resampled to requested width. (DataLine)
  • col - Upper-left column coordinate. (int)
  • row - Upper-left row coordinate. (int)
  • width - Area width (number of columns). (int)
  • height - Area height (number of rows). (int)
  • orientation - Orientation to compute the slope distribution in. (Orientation)
  • nstats - The number of samples to take on the distribution function. If nonpositive, a suitable resolution is determined automatically. (int)

cda(target_line, orientation, nstats)

source code 

Calculates cumulative distribution of slopes in a data field.

Parameters:
  • target_line - A data line to store the distribution to. It will be resampled to requested width. (DataLine)
  • orientation - Orientation to compute the slope distribution in. (Orientation)
  • nstats - The number of samples to take on the distribution function. If nonpositive, a suitable resolution is determined automatically. (int)

area_acf(target_line, col, row, width, height, orientation, interpolation, nstats)

source code 

Calculates one-dimensional autocorrelation function of a rectangular part of a data field.

Parameters:
  • target_line - A data line to store the distribution to. It will be resampled to requested width. (DataLine)
  • col - Upper-left column coordinate. (int)
  • row - Upper-left row coordinate. (int)
  • width - Area width (number of columns). (int)
  • height - Area height (number of rows). (int)
  • orientation - Orientation of lines (ACF is simply averaged over the other orientation). (Orientation)
  • interpolation - Interpolation to use when nstats is given and requires resampling. (InterpolationType)
  • nstats - The number of samples to take on the distribution function. If nonpositive, width (height) is used. (int)

acf(target_line, orientation, interpolation, nstats)

source code 

Calculates one-dimensional autocorrelation function of a data field.

Parameters:
  • target_line - A data line to store the distribution to. It will be resampled to requested width. (DataLine)
  • orientation - Orientation of lines (ACF is simply averaged over the other orientation). (Orientation)
  • interpolation - Interpolation to use when nstats is given and requires resampling. (InterpolationType)
  • nstats - The number of samples to take on the distribution function. If nonpositive, data field width (height) is used. (int)

area_hhcf(target_line, col, row, width, height, orientation, interpolation, nstats)

source code 

Calculates one-dimensional autocorrelation function of a rectangular part of a data field.

Parameters:
  • target_line - A data line to store the distribution to. It will be resampled to requested width. (DataLine)
  • col - Upper-left column coordinate. (int)
  • row - Upper-left row coordinate. (int)
  • width - Area width (number of columns). (int)
  • height - Area height (number of rows). (int)
  • orientation - Orientation of lines (HHCF is simply averaged over the other orientation). (Orientation)
  • interpolation - Interpolation to use when nstats is given and requires resampling. (InterpolationType)
  • nstats - The number of samples to take on the distribution function. If nonpositive, width (height) is used. (int)

hhcf(target_line, orientation, interpolation, nstats)

source code 

Calculates one-dimensional autocorrelation function of a data field.

Parameters:
  • target_line - A data line to store the distribution to. It will be resampled to requested width. (DataLine)
  • orientation - Orientation of lines (HHCF is simply averaged over the other orientation). (Orientation)
  • interpolation - Interpolation to use when nstats is given and requires resampling. (InterpolationType)
  • nstats - The number of samples to take on the distribution function. If nonpositive, data field width (height) is used. (int)

area_psdf(target_line, col, row, width, height, orientation, interpolation, windowing, nstats)

source code 

Calculates one-dimensional power spectrum density function of a rectangular part of a data field.

Parameters:
  • target_line - A data line to store the distribution to. It will be resampled to requested width. (DataLine)
  • col - Upper-left column coordinate. (int)
  • row - Upper-left row coordinate. (int)
  • width - Area width (number of columns). (int)
  • height - Area height (number of rows). (int)
  • orientation - Orientation of lines (PSDF is simply averaged over the other orientation). (Orientation)
  • interpolation - Interpolation to use when nstats is given and requires resampling. (InterpolationType)
  • windowing - Windowing type to use. (WindowingType)
  • nstats - The number of samples to take on the distribution function. If nonpositive, data field width (height) is used. (int)

psdf(target_line, orientation, interpolation, windowing, nstats)

source code 

Calculates one-dimensional power spectrum density function of a data field.

Parameters:
  • target_line - A data line to store the distribution to. It will be resampled to requested width. (DataLine)
  • orientation - Orientation of lines (PSDF is simply averaged over the other orientation). (Orientation)
  • interpolation - Interpolation to use when nstats is given and requires resampling. (InterpolationType)
  • windowing - Windowing type to use. (WindowingType)
  • nstats - The number of samples to take on the distribution function. If nonpositive, data field width (height) is used. (int)

area_rpsdf(target_line, col, row, width, height, interpolation, windowing, nstats)

source code 

Calculates radial power spectrum density function of a rectangular part of a data field.

Since: 2.7

Parameters:
  • target_line - A data line to store the distribution to. It will be resampled to requested width. (DataLine)
  • col - Upper-left column coordinate. (int)
  • row - Upper-left row coordinate. (int)
  • width - Area width (number of columns). (int)
  • height - Area height (number of rows). (int)
  • interpolation - Interpolation to use when nstats is given and requires resampling. (InterpolationType)
  • windowing - Windowing type to use. (WindowingType)
  • nstats - The number of samples to take on the distribution function. If nonpositive, data field width (height) is used. (int)

rpsdf(target_line, interpolation, windowing, nstats)

source code 

Calculates radial power spectrum density function of a data field.

Since: 2.7

Parameters:
  • target_line - A data line to store the distribution to. It will be resampled to requested width. (DataLine)
  • interpolation - Interpolation to use when nstats is given and requires resampling. (InterpolationType)
  • windowing - Windowing type to use. (WindowingType)
  • nstats - The number of samples to take on the distribution function. If nonpositive, data field width (height) is used. (int)

area_2dacf(target_field, col, row, width, height, xrange, yrange)

source code 

Calculates two-dimensional autocorrelation function of a data field area.

The resulting data field has the correlation corresponding to (0,0) in the centre.

The maximum possible values of xrange and yrange are data_field width and height, respectively. However, as the values for longer distances are calculated from smaller number of data points they become increasingly bogus, therefore the default range is half of the size.

Since: 2.7

Parameters:
  • target_field - A data field to store the result to. It will be resampled to (2xrange-1)x(2yrange-1). (DataField)
  • col - Upper-left column coordinate. (int)
  • row - Upper-left row coordinate. (int)
  • width - Area width (number of columns). (int)
  • height - Area height (number of rows). (int)
  • xrange - Horizontal correlation range. Non-positive value means the default range of half of data_field width will be used. (int)
  • yrange - Vertical correlation range. Non-positive value means the default range of half of data_field height will be used. (int)

a_2dacf(target_field)

source code 

Calculates two-dimensional autocorrelation function of a data field.

See DataField.area_2dacf() for details. Parameters missing (not adjustable) in this function are set to their default values.

Since: 2.7

Parameters:
  • target_field - A data field to store the result to. (DataField)

area_racf(target_line, col, row, width, height, nstats)

source code 

Calculates radially averaged autocorrelation function of a data field.

Since: 2.22

Parameters:
  • target_line - A data line to store the autocorrelation function to. It will be resampled to requested width. (DataLine)
  • nstats - The number of samples to take on the autocorrelation function. If nonpositive, a suitable resolution is chosen automatically. (int)

area_minkowski_volume(target_line, col, row, width, height, nstats)

source code 

Calculates Minkowski volume functional of a rectangular part of a data field.

Volume functional is calculated as the number of values above each threshold value (,white pixels`) divided by the total number of samples in the area. Is it's equivalent to 1-CDH.

Parameters:
  • target_line - A data line to store the distribution to. It will be resampled to requested width. (DataLine)
  • col - Upper-left column coordinate. (int)
  • row - Upper-left row coordinate. (int)
  • width - Area width (number of columns). (int)
  • height - Area height (number of rows). (int)
  • nstats - The number of samples to take on the distribution function. If nonpositive, a suitable resolution is determined automatically. (int)

minkowski_volume(target_line, nstats)

source code 

Calculates Minkowski volume functional of a data field.

See DataField.area_minkowski_volume() for details.

Parameters:
  • target_line - A data line to store the distribution to. It will be resampled to requested width. (DataLine)
  • nstats - The number of samples to take on the distribution function. If nonpositive, a suitable resolution is determined automatically. (int)

area_minkowski_boundary(target_line, col, row, width, height, nstats)

source code 

Calculates Minkowski boundary functional of a rectangular part of a data field.

Boundary functional is calculated as the number of boundaries for each threshold value (the number of pixel sides where of neighouring pixels is ,white` and the other ,black`) divided by the total number of samples in the area.

Parameters:
  • target_line - A data line to store the distribution to. It will be resampled to requested width. (DataLine)
  • col - Upper-left column coordinate. (int)
  • row - Upper-left row coordinate. (int)
  • width - Area width (number of columns). (int)
  • height - Area height (number of rows). (int)
  • nstats - The number of samples to take on the distribution function. If nonpositive, a suitable resolution is determined automatically. (int)

minkowski_boundary(target_line, nstats)

source code 

Calculates Minkowski boundary functional of a data field.

See DataField.area_minkowski_boundary() for details.

Parameters:
  • target_line - A data line to store the distribution to. It will be resampled to requested width. (DataLine)
  • nstats - The number of samples to take on the distribution function. If nonpositive, a suitable resolution is determined automatically. (int)

area_minkowski_euler(target_line, col, row, width, height, nstats)

source code 

Calculates Minkowski connectivity functional (Euler characteristics) of a rectangular part of a data field.

Connectivity functional is calculated as the number connected areas of pixels above threhsold (,white`) minus the number of connected areas of pixels below threhsold (,black`) for each threshold value, divided by the total number of samples in the area.

Parameters:
  • target_line - A data line to store the distribution to. It will be resampled to requested width. (DataLine)
  • col - Upper-left column coordinate. (int)
  • row - Upper-left row coordinate. (int)
  • width - Area width (number of columns). (int)
  • height - Area height (number of rows). (int)
  • nstats - The number of samples to take on the distribution function. If nonpositive, a suitable resolution is determined automatically. (int)

minkowski_euler(target_line, nstats)

source code 

Calculates Minkowski connectivity functional (Euler characteristics) of a data field.

See DataField.area_minkowski_euler() for details.

Parameters:
  • target_line - A data line to store the distribution to. It will be resampled to requested width. (DataLine)
  • nstats - The number of samples to take on the distribution function. If nonpositive, a suitable resolution is determined automatically. (int)

slope_distribution(derdist, kernel_size)

source code 

Computes angular slope distribution.

Parameters:
  • derdist - A data line to fill with angular slope distribution. Its resolution determines resolution of the distribution. (DataLine)
  • kernel_size - If positive, local plane fitting will be used for slope computation; if nonpositive, plain central derivations will be used. (int)

get_normal_coeffs(nx, ny, nz, normalize1)

source code 

Computes average normal vector of a data field.

Parameters:
  • nx - Where x-component of average normal vector should be stored, or NULL. (float)
  • ny - Where y-component of average normal vector should be stored, or NULL. (float)
  • nz - Where z-component of average normal vector should be stored, or NULL. (float)
  • normalize1 - true to normalize the normal vector to 1, false to normalize the vector so that z-component is 1. (bool)

UNIMPLEMENTED_area_get_normal_coeffs(col, row, width, height, nx, ny, nz, normalize1)

source code 

Computes average normal vector of an area of a data field.

Parameters:
  • col - Upper-left column coordinate. (int)
  • row - Upper-left row coordinate. (int)
  • width - Area width (number of columns). (int)
  • height - Area height (number of rows). (int)
  • nx - Where x-component of average normal vector should be stored, or NULL. (gdouble*)
  • ny - Where y-component of average normal vector should be stored, or NULL. (gdouble*)
  • nz - Where z-component of average normal vector should be stored, or NULL. (gdouble*)
  • normalize1 - true to normalize the normal vector to 1, false to normalize the vector so that z-component is 1. (bool)

area_get_inclination(col, row, width, height, theta, phi)

source code 

Calculates the inclination of the image (polar and azimuth angle).

Parameters:
  • col - Upper-left column coordinate. (int)
  • row - Upper-left row coordinate. (int)
  • width - Area width (number of columns). (int)
  • height - Area height (number of rows). (int)
  • theta - Where theta angle (in radians) should be stored, or NULL. (float)
  • phi - Where phi angle (in radians) should be stored, or NULL. (float)

UNIMPLEMENTED_get_inclination(theta, phi)

source code 

Calculates the inclination of the image (polar and azimuth angle).

Parameters:
  • theta - Where theta angle (in radians) should be stored, or NULL. (gdouble*)
  • phi - Where phi angle (in radians) should be stored, or NULL. (gdouble*)

area_get_line_stats(mask, target_line, col, row, width, height, quantity, orientation)

source code 

Calculates a line quantity for each row or column in a data field area.

Since: 2.2

Parameters:
  • mask - Mask of values to take values into account, or NULL for full data_field. Masking is currently unimplemented. (DataField)
  • target_line - A data line to store the distribution to. It will be resampled to the number of rows (columns). (DataLine)
  • col - Upper-left column coordinate. (int)
  • row - Upper-left row coordinate. (int)
  • width - Area width (number of columns). (int)
  • height - Area height (number of rows). (int)
  • quantity - The line quantity to calulate for each row (column). (LineStatQuantity)
  • orientation - Line orientation. For ORIENTATION_HORIZONTAL each target_line point corresponds to a row of the area, for ORIENTATION_VERTICAL each target_line point corresponds to a column of the area. (Orientation)

get_line_stats(target_line, quantity, orientation)

source code 

Calculates a line quantity for each row or column of a data field.

Since: 2.2

Parameters:
  • target_line - A data line to store the distribution to. It will be resampled to data_field height (width). (DataLine)
  • quantity - The line quantity to calulate for each row (column). (LineStatQuantity)
  • orientation - Line orientation. See DataField.area_get_line_stats(). (Orientation)

get_profile(scol, srow, ecol, erow, res, thickness, interpolation)

source code 

Extracts a possibly averaged profile from data field to a data line.

Parameters:
  • scol - The column the line starts at (inclusive). (int)
  • srow - The row the line starts at (inclusive). (int)
  • ecol - The column the line ends at (inclusive). (int)
  • erow - The row the line ends at (inclusive). (int)
  • res - Requested resolution of data line (the number of samples to take). If nonpositive, data line resolution is chosen to match data_field's. (int)
  • thickness - Thickness of line to be averaged. (int)
  • interpolation - Interpolation type to use. (InterpolationType)
Returns:
data_line itself if it was not NULL, otherwise a newly created data line.

fit_polynom(col_degree, row_degree)

source code 

Fits a two-dimensional polynomial to a data field.

Parameters:
  • col_degree - Degree of polynomial to fit column-wise (x-coordinate). (int)
  • row_degree - Degree of polynomial to fit row-wise (y-coordinate). (int)
Returns:
a newly allocated array with coefficients.

area_fit_polynom(col, row, width, height, col_degree, row_degree)

source code 

Fits a two-dimensional polynomial 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.

Note naive x^n y^m polynomial fitting is numerically unstable, therefore this method works only up to col_degree = row_degree = 6.

Parameters:
  • col - Upper-left column coordinate. (int)
  • row - Upper-left row coordinate. (int)
  • width - Area width (number of columns). (int)
  • height - Area height (number of rows). (int)
  • col_degree - Degree of polynomial to fit column-wise (x-coordinate). (int)
  • row_degree - Degree of polynomial to fit row-wise (y-coordinate). (int)
Returns:
a newly allocated array with coefficients.

elliptic_area_extract(col, row, width, height)

source code 

Extracts values from an elliptic region of a data field.

The elliptic region is defined by its bounding box which must be completely contained in the data field.

Parameters:
  • col - Upper-left bounding box column coordinate. (int)
  • row - Upper-left bounding box row coordinate. (int)
  • width - Bounding box width (number of columns). (int)
  • height - Bounding box height (number of rows). (int)
Returns:
The number of extracted values.

circular_area_extract(col, row, radius)

source code 

Extracts values from a circular region of a data field.

Parameters:
  • col - Row index of circular area centre. (int)
  • row - Column index of circular area centre. (int)
  • radius - Circular area radius (in pixels). See DataField.circular_area_extract_with_pos() for caveats. (float)
Returns:
Array of values.

duplicate()

source code 

Duplicate datafield

Returns:
duplicated datafield

get_data()

source code 

Create a tuple of data which the datafield contains. Content of the tuple is NOT reference to original datafield but its copy.

Returns:
tuple of raw numeric data from DataField

get_data_pointer()

source code 

Get Pointer to data which the datafield contains.

Returns:
integer pointing to the raw data of the datafield