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

Class DataField


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

Method Details

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

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.

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

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.Expected values: ORIENTATION_HORIZONTAL, ORIENTATION_VERTICAL, (Orientation)
windowing - Windowing type.Expected values: WINDOWING_NONE, WINDOWING_HANN, WINDOWING_HAMMING, WINDOWING_BLACKMANN, WINDOWING_LANCZOS, WINDOWING_WELCH, WINDOWING_RECT, WINDOWING_NUTTALL, WINDOWING_FLAT_TOP, WINDOWING_KAISER25, (WindowingType)
direction - FFT direction.Expected values: TRANSFORM_DIRECTION_BACKWARD, TRANSFORM_DIRECTION_FORWARD, (TransformDirection)
interpolation - Interpolation type. Ignored since 2.8 as no reampling is performed.Expected values: INTERPOLATION_NONE, INTERPOLATION_ROUND, INTERPOLATION_LINEAR, INTERPOLATION_BILINEAR, INTERPOLATION_KEY, INTERPOLATION_BSPLINE, INTERPOLATION_OMOMS, INTERPOLATION_NNA, INTERPOLATION_SCHAUM, (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)

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

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.Expected values: ORIENTATION_HORIZONTAL, ORIENTATION_VERTICAL, (Orientation)
direction - FFT direction.Expected values: TRANSFORM_DIRECTION_BACKWARD, TRANSFORM_DIRECTION_FORWARD, (TransformDirection)

a_2dacf(target_field)

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)

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

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.Expected values: WINDOWING_NONE, WINDOWING_HANN, WINDOWING_HAMMING, WINDOWING_BLACKMANN, WINDOWING_LANCZOS, WINDOWING_WELCH, WINDOWING_RECT, WINDOWING_NUTTALL, WINDOWING_FLAT_TOP, WINDOWING_KAISER25, (WindowingType)
direction - FFT direction.Expected values: TRANSFORM_DIRECTION_BACKWARD, TRANSFORM_DIRECTION_FORWARD, (TransformDirection)
interpolation - Interpolation type.Expected values: INTERPOLATION_NONE, INTERPOLATION_ROUND, INTERPOLATION_LINEAR, INTERPOLATION_BILINEAR, INTERPOLATION_KEY, INTERPOLATION_BSPLINE, INTERPOLATION_OMOMS, INTERPOLATION_NNA, INTERPOLATION_SCHAUM, (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_dehumanize()

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

a_2dfft_humanize()

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.

a_2dfft_raw(iin, rout, iout, direction)

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.Expected values: TRANSFORM_DIRECTION_BACKWARD, TRANSFORM_DIRECTION_FORWARD, (TransformDirection)

acf(target_line, orientation, interpolation, nstats)

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).Expected values: ORIENTATION_HORIZONTAL, ORIENTATION_VERTICAL, (Orientation)
interpolation - Interpolation to use when nstats is given and requires resampling.Expected values: INTERPOLATION_NONE, INTERPOLATION_ROUND, INTERPOLATION_LINEAR, INTERPOLATION_BILINEAR, INTERPOLATION_KEY, INTERPOLATION_BSPLINE, INTERPOLATION_OMOMS, INTERPOLATION_NNA, INTERPOLATION_SCHAUM, (InterpolationType)
nstats - The number of samples to take on the distribution function. If nonpositive, data field width (height) is used. (int)

add(value)

Adds given value to all values in a data field.
Parameters:
value - Value to be added to data field values. (float)

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.

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.Expected values: ORIENTATION_HORIZONTAL, ORIENTATION_VERTICAL, (Orientation)
windowing - Windowing type.Expected values: WINDOWING_NONE, WINDOWING_HANN, WINDOWING_HAMMING, WINDOWING_BLACKMANN, WINDOWING_LANCZOS, WINDOWING_WELCH, WINDOWING_RECT, WINDOWING_NUTTALL, WINDOWING_FLAT_TOP, WINDOWING_KAISER25, (WindowingType)
direction - FFT direction.Expected values: TRANSFORM_DIRECTION_BACKWARD, TRANSFORM_DIRECTION_FORWARD, (TransformDirection)
interpolation - Interpolation type. Ignored since 2.8 as no reampling is performed.Expected values: INTERPOLATION_NONE, INTERPOLATION_ROUND, INTERPOLATION_LINEAR, INTERPOLATION_BILINEAR, INTERPOLATION_KEY, INTERPOLATION_BSPLINE, INTERPOLATION_OMOMS, INTERPOLATION_NNA, INTERPOLATION_SCHAUM, (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)

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

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)

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.

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.Expected values: WINDOWING_NONE, WINDOWING_HANN, WINDOWING_HAMMING, WINDOWING_BLACKMANN, WINDOWING_LANCZOS, WINDOWING_WELCH, WINDOWING_RECT, WINDOWING_NUTTALL, WINDOWING_FLAT_TOP, WINDOWING_KAISER25, (WindowingType)
direction - FFT direction.Expected values: TRANSFORM_DIRECTION_BACKWARD, TRANSFORM_DIRECTION_FORWARD, (TransformDirection)
interpolation - Interpolation type. Ignored since 2.8 as no reampling is performed.Expected values: INTERPOLATION_NONE, INTERPOLATION_ROUND, INTERPOLATION_LINEAR, INTERPOLATION_BILINEAR, INTERPOLATION_KEY, INTERPOLATION_BSPLINE, INTERPOLATION_OMOMS, INTERPOLATION_NNA, INTERPOLATION_SCHAUM, (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_acf(target_line, col, row, width, height, orientation, interpolation, nstats)

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).Expected values: ORIENTATION_HORIZONTAL, ORIENTATION_VERTICAL, (Orientation)
interpolation - Interpolation to use when nstats is given and requires resampling.Expected values: INTERPOLATION_NONE, INTERPOLATION_ROUND, INTERPOLATION_LINEAR, INTERPOLATION_BILINEAR, INTERPOLATION_KEY, INTERPOLATION_BSPLINE, INTERPOLATION_OMOMS, INTERPOLATION_NNA, INTERPOLATION_SCHAUM, (InterpolationType)
nstats - The number of samples to take on the distribution function. If nonpositive, width (height) is used. (int)

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

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)

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

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.Expected values: ORIENTATION_HORIZONTAL, ORIENTATION_VERTICAL, (Orientation)
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)

Calculates cumulative distribution of heights in a rectangular part of data field.
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)
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)

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

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_clear(col, row, width, height)

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_convolve(kernel_field, col, row, width, height)

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)

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

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).Expected values: ORIENTATION_HORIZONTAL, ORIENTATION_VERTICAL, (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)

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

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)

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

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 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)
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_da(target_line, col, row, width, height, orientation, nstats)

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.Expected values: ORIENTATION_HORIZONTAL, ORIENTATION_VERTICAL, (Orientation)
nstats - The number of samples to take on the distribution function. If nonpositive, a suitable resolution is determined automatically. (int)

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

Calculates distribution of heights in a rectangular part of data field.
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)
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)

area_extract(col, row, width, height)

Extracts a rectangular part of a data field to a new 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)
Returns:
The extracted area as a newly created data field.

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

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_filter_conservative(size, col, row, width, height)

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)

area_filter_dechecker(col, row, width, height)

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)

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

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)

area_filter_kuwahara(col, row, width, height)

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)

area_filter_laplacian(col, row, width, height)

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)

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

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)

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

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)

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

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)

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

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)

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

Filters a rectangular part of a data field with Prewitt filter.
Parameters:
orientation - Filter orientation.Expected values: ORIENTATION_HORIZONTAL, ORIENTATION_VERTICAL, (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)

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

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)

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

Filters a rectangular part of a data field with Sobel filter.
Parameters:
orientation - Filter orientation.Expected values: ORIENTATION_HORIZONTAL, ORIENTATION_VERTICAL, (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)

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

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)

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.
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 (twice 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.

Since: 2.11

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

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.

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.

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)
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)
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_get_avg(mask, col, row, width, height)

Computes average value of a rectangular part of a data field.
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)
Returns:
The average value.

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

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)

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.

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).Expected values: LINE_STAT_MEAN, LINE_STAT_MEDIAN, LINE_STAT_MINIMUM, LINE_STAT_MAXIMUM, LINE_STAT_RMS, LINE_STAT_LENGTH, LINE_STAT_SLOPE, LINE_STAT_TAN_BETA0, LINE_STAT_RA, LINE_STAT_RZ, LINE_STAT_RT, LINE_STAT_SKEW, LINE_STAT_KURTOSIS, (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.Expected values: ORIENTATION_HORIZONTAL, ORIENTATION_VERTICAL, (Orientation)

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

Finds the maximum value in a rectangular part of a data field.
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)
Returns:
The maximum value. When the number of samples to calculate maximum of is zero, -G_MAXDOUBLE is returned.

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

Computes median value of a data field area.
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)
Returns:
The median value.

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

Finds the minimum value in a rectangular part of a data field.
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)
Returns:
The minimum value. When the number of samples to calculate minimum of is zero, -G_MAXDOUBLE is returned.

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

Computes root mean square value of a rectangular part of a data field.
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)
Returns:
The root mean square value.

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.
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)
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_sum(mask, col, row, width, height)

Sums values of a rectangular part of a data field.
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)
Returns:
The sum of all values inside area.

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

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.
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)
Returns:
The surface area.

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

Computes volume of a rectangular part of a data field.
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 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)
Returns:

The volume.

Since: 2.3

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

Calculates threshold grain number distribution.

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().
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)
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_hhcf(target_line, col, row, width, height, orientation, interpolation, nstats)

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).Expected values: ORIENTATION_HORIZONTAL, ORIENTATION_VERTICAL, (Orientation)
interpolation - Interpolation to use when nstats is given and requires resampling.Expected values: INTERPOLATION_NONE, INTERPOLATION_ROUND, INTERPOLATION_LINEAR, INTERPOLATION_BILINEAR, INTERPOLATION_KEY, INTERPOLATION_BSPLINE, INTERPOLATION_OMOMS, INTERPOLATION_NNA, INTERPOLATION_SCHAUM, (InterpolationType)
nstats - The number of samples to take on the distribution function. If nonpositive, width (height) is used. (int)

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

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.Expected values: PLANE_FIT_A, PLANE_FIT_BX, PLANE_FIT_BY, PLANE_FIT_ANGLE, PLANE_FIT_SLOPE, PLANE_FIT_S0, PLANE_FIT_S0_REDUCED, (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.

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

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)

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

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)

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

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)

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

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_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.
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).Expected values: ORIENTATION_HORIZONTAL, ORIENTATION_VERTICAL, (Orientation)
interpolation - Interpolation to use when nstats is given and requires resampling (and possibly in FFT too).Expected values: INTERPOLATION_NONE, INTERPOLATION_ROUND, INTERPOLATION_LINEAR, INTERPOLATION_BILINEAR, INTERPOLATION_KEY, INTERPOLATION_BSPLINE, INTERPOLATION_OMOMS, INTERPOLATION_NNA, INTERPOLATION_SCHAUM, (InterpolationType)
windowing - Windowing type to use.Expected values: WINDOWING_NONE, WINDOWING_HANN, WINDOWING_HAMMING, WINDOWING_BLACKMANN, WINDOWING_LANCZOS, WINDOWING_WELCH, WINDOWING_RECT, WINDOWING_NUTTALL, WINDOWING_FLAT_TOP, WINDOWING_KAISER25, (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)

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 (and possibly in FFT too).Expected values: INTERPOLATION_NONE, INTERPOLATION_ROUND, INTERPOLATION_LINEAR, INTERPOLATION_BILINEAR, INTERPOLATION_KEY, INTERPOLATION_BSPLINE, INTERPOLATION_OMOMS, INTERPOLATION_NNA, INTERPOLATION_SCHAUM, (InterpolationType)
windowing - Windowing type to use.Expected values: WINDOWING_NONE, WINDOWING_HANN, WINDOWING_HAMMING, WINDOWING_BLACKMANN, WINDOWING_LANCZOS, WINDOWING_WELCH, WINDOWING_RECT, WINDOWING_NUTTALL, WINDOWING_FLAT_TOP, WINDOWING_KAISER25, (WindowingType)
nstats - The number of samples to take on the distribution function. If nonpositive, data field width (height) is used. (int)

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.

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*)

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.

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 (twice 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*)

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.

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*)

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.
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*)

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

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.

cda(target_line, orientation, nstats)

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.Expected values: ORIENTATION_HORIZONTAL, ORIENTATION_VERTICAL, (Orientation)
nstats - The number of samples to take on the distribution function. If nonpositive, a suitable resolution is determined automatically. (int)

cdh(target_line, nstats)

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)

check_compatibility(data_field2, check)

Checks whether two data fields are compatible.
Parameters:
data_field2 - Another data field. (DataField)
check - The compatibility tests to perform.Expected values: DATA_COMPATIBILITY_RES, DATA_COMPATIBILITY_REAL, DATA_COMPATIBILITY_MEASURE, DATA_COMPATIBILITY_LATERAL, DATA_COMPATIBILITY_VALUE, DATA_COMPATIBILITY_ALL, (DataCompatibilityFlags)
Returns:
Zero if all tested properties are compatible. Flags corresponding to failed tests if data fields are not compatible.

circular_area_extract(col, row, radius)

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.

circular_area_fill(col, row, radius, value)

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.

circular_area_unextract(col, row, radius, data)

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*)

clamp(bottom, top)

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].

clear()

Fills a data field with zeroes.

convolve(kernel_field)

Convolves a data field with given kernel.
Parameters:
kernel_field - Kenrel field to convolve data_field with. (DataField)

convolve_1d(kernel_line, orientation)

Convolves a data field with given linear kernel.

Since: 2.4
Parameters:
kernel_line - Kenrel line to convolve data_field with. (DataLine)
orientation - Filter orientation (see DataField.area_convolve_1d()).Expected values: ORIENTATION_HORIZONTAL, ORIENTATION_VERTICAL, (Orientation)

copy(dest, nondata_too)

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)

copy_units_to_data_line(data_line)

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)

correct_average(mask_field)

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)

correct_laplace_iteration(mask_field, buffer_field, corrfactor, error)

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)
corrfactor - Correction factor within step. (float)
error - Maximum change within last step. (float)

correlate(kernel_field, score, method)

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)

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.

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)

da(target_line, orientation, nstats)

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.Expected values: ORIENTATION_HORIZONTAL, ORIENTATION_VERTICAL, (Orientation)
nstats - The number of samples to take on the distribution function. If nonpositive, a suitable resolution is determined automatically. (int)

data_changed()

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

dh(target_line, nstats)

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)

divide_fields(operand1, operand2)

Divides one data field with another.
Parameters:
operand1 - First data field operand. (DataField)
operand2 - Second data field operand. (DataField)

duplicate()

Duplicate datafield
Returns:
duplicated datafield

dwt(wt_coefs, direction, minsize)

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.Expected values: TRANSFORM_DIRECTION_BACKWARD, TRANSFORM_DIRECTION_FORWARD, (TransformDirection)
minsize - size of minimal transform result block (int)

elliptic_area_extract(col, row, width, height)

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.

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

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)

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*)

fft_filter_1d(result_field, weights, orientation, interpolation)

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.Expected values: ORIENTATION_HORIZONTAL, ORIENTATION_VERTICAL, (Orientation)
interpolation - The interpolation to use for resampling.Expected values: INTERPOLATION_NONE, INTERPOLATION_ROUND, INTERPOLATION_LINEAR, INTERPOLATION_BILINEAR, INTERPOLATION_KEY, INTERPOLATION_BSPLINE, INTERPOLATION_OMOMS, INTERPOLATION_NNA, INTERPOLATION_SCHAUM, (InterpolationType)

fill(value)

Fills a data field with given value.
Parameters:
value - Value to be entered. (float)

filter_canny(threshold)

Filters a rectangular part of a data field with canny edge detector filter.
Parameters:
threshold - Slope detection threshold (range 0..1). (float)

filter_conservative(size)

Filters a data field with conservative denoise filter.
Parameters:
size - Filtered area size. (int)

filter_dechecker()

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

Since: 2.1

filter_gaussian(sigma)

Filters a data field with a Gaussian filter.

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

filter_kuwahara()

Filters a data field with Kuwahara filter.

filter_laplacian()

Filters a data field with Laplacian filter.

filter_maximum(size)

Filters a data field with maximum filter.
Parameters:
size - Neighbourhood size for maximum search. (int)

filter_mean(size)

Filters a data field with mean filter of size size.
Parameters:
size - Averaged area size. (int)

filter_median(size)

Filters a data field with median filter.
Parameters:
size - Size of area to take median of. (int)

filter_minimum(size)

Filters a data field with minimum filter.
Parameters:
size - Neighbourhood size for minimum search. (int)

filter_prewitt(orientation)

Filters a data field with Prewitt filter.
Parameters:
orientation - Filter orientation.Expected values: ORIENTATION_HORIZONTAL, ORIENTATION_VERTICAL, (Orientation)

filter_rms(size)

Filters a data field with RMS filter.
Parameters:
size - Area size. (int)

filter_sobel(orientation)

Filters a data field with Sobel filter.
Parameters:
orientation - Filter orientation.Expected values: ORIENTATION_HORIZONTAL, ORIENTATION_VERTICAL, (Orientation)

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

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.Expected values: ORIENTATION_HORIZONTAL, ORIENTATION_VERTICAL, (Orientation)

fit_plane(pa, pbx, pby)

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)

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

Fit a given set of polynomial terms to a data field.
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 (twice 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.

Since: 2.11

fit_polynom(col_degree, row_degree)

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.

fractal_correction(mask_field, interpolation)

Replaces data under mask with interpolated values using fractal interpolation.
Parameters:
mask_field - Mask of places to be corrected. (DataField)
interpolation - Interpolation type.Expected values: INTERPOLATION_NONE, INTERPOLATION_ROUND, INTERPOLATION_LINEAR, INTERPOLATION_BILINEAR, INTERPOLATION_KEY, INTERPOLATION_BSPLINE, INTERPOLATION_OMOMS, INTERPOLATION_NNA, INTERPOLATION_SCHAUM, (InterpolationType)

fractal_cubecounting(xresult, yresult, interpolation)

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.Expected values: INTERPOLATION_NONE, INTERPOLATION_ROUND, INTERPOLATION_LINEAR, INTERPOLATION_BILINEAR, INTERPOLATION_KEY, INTERPOLATION_BSPLINE, INTERPOLATION_OMOMS, INTERPOLATION_NNA, INTERPOLATION_SCHAUM, (InterpolationType)

fractal_partitioning(xresult, yresult, interpolation)

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.Expected values: INTERPOLATION_NONE, INTERPOLATION_ROUND, INTERPOLATION_LINEAR, INTERPOLATION_BILINEAR, INTERPOLATION_KEY, INTERPOLATION_BSPLINE, INTERPOLATION_OMOMS, INTERPOLATION_NNA, INTERPOLATION_SCHAUM, (InterpolationType)

fractal_psdf(xresult, yresult, interpolation)

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.Expected values: INTERPOLATION_NONE, INTERPOLATION_ROUND, INTERPOLATION_LINEAR, INTERPOLATION_BILINEAR, INTERPOLATION_KEY, INTERPOLATION_BSPLINE, INTERPOLATION_OMOMS, INTERPOLATION_NNA, INTERPOLATION_SCHAUM, (InterpolationType)

fractal_triangulation(xresult, yresult, interpolation)

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.Expected values: INTERPOLATION_NONE, INTERPOLATION_ROUND, INTERPOLATION_LINEAR, INTERPOLATION_BILINEAR, INTERPOLATION_KEY, INTERPOLATION_BSPLINE, INTERPOLATION_OMOMS, INTERPOLATION_NNA, INTERPOLATION_SCHAUM, (InterpolationType)

get_angder(col, row, theta)

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.

get_avg()

Computes average value of a data field.

This quantity is cached.
Returns:
The average value.

get_column(data_line, col)

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)

get_column_part(data_line, col, _from, to)

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)

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

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.

get_data()

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_dval(x, y, interpolation)

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.Expected values: INTERPOLATION_NONE, INTERPOLATION_ROUND, INTERPOLATION_LINEAR, INTERPOLATION_BILINEAR, INTERPOLATION_KEY, INTERPOLATION_BSPLINE, INTERPOLATION_OMOMS, INTERPOLATION_NNA, INTERPOLATION_SCHAUM, (InterpolationType)
Returns:
Interpolated value at position (x,y).

get_dval_real(x, y, interpolation)

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.Expected values: INTERPOLATION_NONE, INTERPOLATION_ROUND, INTERPOLATION_LINEAR, INTERPOLATION_BILINEAR, INTERPOLATION_KEY, INTERPOLATION_BSPLINE, INTERPOLATION_OMOMS, INTERPOLATION_NNA, INTERPOLATION_SCHAUM, (InterpolationType)
Returns:
Value at position (x,y).

get_line_stats(target_line, quantity, orientation)

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).Expected values: LINE_STAT_MEAN, LINE_STAT_MEDIAN, LINE_STAT_MINIMUM, LINE_STAT_MAXIMUM, LINE_STAT_RMS, LINE_STAT_LENGTH, LINE_STAT_SLOPE, LINE_STAT_TAN_BETA0, LINE_STAT_RA, LINE_STAT_RZ, LINE_STAT_RT, LINE_STAT_SKEW, LINE_STAT_KURTOSIS, (LineStatQuantity)
orientation - Line orientation. See DataField.area_get_line_stats().Expected values: ORIENTATION_HORIZONTAL, ORIENTATION_VERTICAL, (Orientation)

get_max()

Finds the maximum value of a data field.

This quantity is cached.
Returns:
The maximum value.

get_median()

Computes median value of a data field.

This quantity is cached.
Returns:
The median value.

get_min()

Finds the minimum value of a data field.

This quantity is cached.
Returns:
The minimum value.

get_min_max(min, max)

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_normal_coeffs(nx, ny, nz, normalize1)

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)

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

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.Expected values: INTERPOLATION_NONE, INTERPOLATION_ROUND, INTERPOLATION_LINEAR, INTERPOLATION_BILINEAR, INTERPOLATION_KEY, INTERPOLATION_BSPLINE, INTERPOLATION_OMOMS, INTERPOLATION_NNA, INTERPOLATION_SCHAUM, (InterpolationType)
Returns:
data_line itself if it was not NULL, otherwise a newly created data line.

get_rms()

Computes root mean square value of a data field.

This quantity is cached.
Returns:
The root mean square value.

get_row(data_line, row)

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_row_part(data_line, row, _from, to)

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_si_unit_xy()

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

get_si_unit_z()

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

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

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)

get_sum()

Sums all values in a data field.

This quantity is cached.
Returns:
The sum of all values.

get_surface_area()

Computes surface area of a data field.

This quantity is cached.
Returns:
surface area

get_val(col, row)

Gets value at given position in a data field.

Do not access data with this function inside inner loops, it's slow. Get 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).

get_xder(col, row)

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_xoffset()

Gets the X offset of data field origin.
Returns:
X offset value.

get_xreal()

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

get_xres()

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

get_yder(col, row)

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_yoffset()

Gets the Y offset of data field origin.
Returns:
Y offset value.

get_yreal()

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

get_yres()

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

grains_add(add_field)

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_extract_grain(col, row)

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_intersect(intersect_field)

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)

grains_mark_curvature(grain_field, threshval, below)

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_height(grain_field, threshval, below)

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)

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_mark_watershed(grain_field, locate_steps, locate_thresh, locate_dropsize, wshed_steps, wshed_dropsize, prefilter, below)

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_by_height(grain_field, threshval, below)

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)

grains_remove_by_size(size)

Removes all grain below specified area.
Parameters:
size - Grain area threshold, in square pixels. (int)

grains_remove_grain(col, row)

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).

hhcf(target_line, orientation, interpolation, nstats)

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).Expected values: ORIENTATION_HORIZONTAL, ORIENTATION_VERTICAL, (Orientation)
interpolation - Interpolation to use when nstats is given and requires resampling.Expected values: INTERPOLATION_NONE, INTERPOLATION_ROUND, INTERPOLATION_LINEAR, INTERPOLATION_BILINEAR, INTERPOLATION_KEY, INTERPOLATION_BSPLINE, INTERPOLATION_OMOMS, INTERPOLATION_NNA, INTERPOLATION_SCHAUM, (InterpolationType)
nstats - The number of samples to take on the distribution function. If nonpositive, data field width (height) is used. (int)

invert(x, y, z)

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)

itor(row)

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)

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.

local_plane_quantity(size, type, result)

Convenience function to get just one quantity from DataField.fit_local_planes().
Parameters:
size - Neighbourhood size. (int)
type - The type of requested quantity.Expected values: PLANE_FIT_A, PLANE_FIT_BX, PLANE_FIT_BY, PLANE_FIT_ANGLE, PLANE_FIT_SLOPE, PLANE_FIT_S0, PLANE_FIT_S0_REDUCED, (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.

mask_outliers(mask_field, thresh)

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 usual Gaussian distribution outliers detection for thresh = 3.
Parameters:
mask_field - A data field to be filled with mask. (DataField)
thresh - Threshold value. (float)

max_of_fields(operand1, operand2)

Finds point-wise minima of two data fields.
Parameters:
operand1 - First data field operand. (DataField)
operand2 - Second data field operand. (DataField)

min_of_fields(operand1, operand2)

Finds point-wise maxima of two data fields.
Parameters:
operand1 - First data field operand. (DataField)
operand2 - Second data field operand. (DataField)

minkowski_boundary(target_line, nstats)

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)

minkowski_euler(target_line, nstats)

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)

minkowski_volume(target_line, nstats)

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)

multiply(value)

Multiplies all values in a data field by given value.
Parameters:
value - Value to multiply data_field with. (float)

multiply_fields(operand1, operand2)

Multiplies two data fields.
Parameters:
operand1 - First data field operand. (DataField)
operand2 - Second data field operand. (DataField)

new_alike(nullme)

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.

new_resampled(xres, yres, interpolation)

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.Expected values: INTERPOLATION_NONE, INTERPOLATION_ROUND, INTERPOLATION_LINEAR, INTERPOLATION_BILINEAR, INTERPOLATION_KEY, INTERPOLATION_BSPLINE, INTERPOLATION_OMOMS, INTERPOLATION_NNA, INTERPOLATION_SCHAUM, (InterpolationType)
Returns:
A newly created data field.

normalize()

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.

plane_level(a, bx, by)

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)

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).Expected values: INTERPOLATION_NONE, INTERPOLATION_ROUND, INTERPOLATION_LINEAR, INTERPOLATION_BILINEAR, INTERPOLATION_KEY, INTERPOLATION_BSPLINE, INTERPOLATION_OMOMS, INTERPOLATION_NNA, INTERPOLATION_SCHAUM, (InterpolationType)

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

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).Expected values: ORIENTATION_HORIZONTAL, ORIENTATION_VERTICAL, (Orientation)
interpolation - Interpolation to use when nstats is given and requires resampling (and possibly in FFT too).Expected values: INTERPOLATION_NONE, INTERPOLATION_ROUND, INTERPOLATION_LINEAR, INTERPOLATION_BILINEAR, INTERPOLATION_KEY, INTERPOLATION_BSPLINE, INTERPOLATION_OMOMS, INTERPOLATION_NNA, INTERPOLATION_SCHAUM, (InterpolationType)
windowing - Windowing type to use.Expected values: WINDOWING_NONE, WINDOWING_HANN, WINDOWING_HAMMING, WINDOWING_BLACKMANN, WINDOWING_LANCZOS, WINDOWING_WELCH, WINDOWING_RECT, WINDOWING_NUTTALL, WINDOWING_FLAT_TOP, WINDOWING_KAISER25, (WindowingType)
nstats - The number of samples to take on the distribution function. If nonpositive, data field width (height) is used. (int)

renormalize(range, offset)

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)

resample(xres, yres, interpolation)

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.Expected values: INTERPOLATION_NONE, INTERPOLATION_ROUND, INTERPOLATION_LINEAR, INTERPOLATION_BILINEAR, INTERPOLATION_KEY, INTERPOLATION_BSPLINE, INTERPOLATION_OMOMS, INTERPOLATION_NNA, INTERPOLATION_SCHAUM, (InterpolationType)

resize(ulcol, ulrow, brcol, brrow)

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)

rotate(angle, interpolation)

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.Expected values: INTERPOLATION_NONE, INTERPOLATION_ROUND, INTERPOLATION_LINEAR, INTERPOLATION_BILINEAR, INTERPOLATION_KEY, INTERPOLATION_BSPLINE, INTERPOLATION_OMOMS, INTERPOLATION_NNA, INTERPOLATION_SCHAUM, (InterpolationType)

rpsdf(target_line, interpolation, windowing, nstats)

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 (and possibly in FFT too).Expected values: INTERPOLATION_NONE, INTERPOLATION_ROUND, INTERPOLATION_LINEAR, INTERPOLATION_BILINEAR, INTERPOLATION_KEY, INTERPOLATION_BSPLINE, INTERPOLATION_OMOMS, INTERPOLATION_NNA, INTERPOLATION_SCHAUM, (InterpolationType)
windowing - Windowing type to use.Expected values: WINDOWING_NONE, WINDOWING_HANN, WINDOWING_HAMMING, WINDOWING_BLACKMANN, WINDOWING_LANCZOS, WINDOWING_WELCH, WINDOWING_RECT, WINDOWING_NUTTALL, WINDOWING_FLAT_TOP, WINDOWING_KAISER25, (WindowingType)
nstats - The number of samples to take on the distribution function. If nonpositive, data field width (height) is used. (int)

rtoi(realy)

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)

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.

set_column(data_line, col)

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)

set_column_part(data_line, col, _from, to)

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)

set_row(data_line, row)

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_row_part(data_line, row, _from, to)

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_si_unit_xy(si_unit)

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)

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)

set_val(col, row, value)

Sets value at given position in a data field.

Do not set data with this function inside inner loops, it's slow. Get 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)

set_xoffset(xoff)

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_xreal(xreal)

Sets X real (physical) size value of a data field.
Parameters:
xreal - New X real size value. (float)

set_yoffset(yoff)

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)

set_yreal(yreal)

Sets Y real (physical) size value of a data field.
Parameters:
yreal - New Y real size value. (float)

shade(target_field, theta, phi)

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)

slope_distribution(derdist, kernel_size)

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)

subtract_fields(operand1, operand2)

Subtracts one data field from another.
Parameters:
operand1 - First data field operand. (DataField)
operand2 - Second data field operand. (DataField)

subtract_legendre(col_degree, row_degree, coeffs)

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*)

subtract_poly(nterms, term_powers, coeffs)

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 (twice 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*)

subtract_poly_max(max_degree, coeffs)

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*)

subtract_polynom(col_degree, row_degree, coeffs)

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*)

sum_fields(operand1, operand2)

Sums two data fields.
Parameters:
operand1 - First data field operand. (DataField)
operand2 - Second data field operand. (DataField)

threshold(threshval, bottom, top)

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.

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.

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.

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.

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.

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.

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.

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.
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)
min - Location to store minimum to. (gdouble*)
max - Location to store maximum to. (gdouble*)

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

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)

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

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.
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.

Since: 2.2

UNIMPLEMENTED_correlate_init(kernel_field, score)

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.

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

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.

UNIMPLEMENTED_cwt(interpolation, scale, wtype)

Computes a continuous wavelet transform (CWT) at given scale and using given wavelet.
Parameters:
interpolation - Interpolation type. Ignored since 2.8 as no reampling is performed.Expected values: INTERPOLATION_NONE, INTERPOLATION_ROUND, INTERPOLATION_LINEAR, INTERPOLATION_BILINEAR, INTERPOLATION_KEY, INTERPOLATION_BSPLINE, INTERPOLATION_OMOMS, INTERPOLATION_NNA, INTERPOLATION_SCHAUM, (InterpolationType)
scale - Wavelet scale. (float)
wtype - Wavelet type. (2DCWTWaveletType)

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

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.Expected values: INTERPOLATION_NONE, INTERPOLATION_ROUND, INTERPOLATION_LINEAR, INTERPOLATION_BILINEAR, INTERPOLATION_KEY, INTERPOLATION_BSPLINE, INTERPOLATION_OMOMS, INTERPOLATION_NNA, INTERPOLATION_SCHAUM, (InterpolationType)
exterior - Exterior pixels handling.Expected values: EXTERIOR_UNDEFINED, EXTERIOR_BORDER_EXTEND, EXTERIOR_MIRROR_EXTEND, EXTERIOR_PERIODIC, EXTERIOR_FIXED_VALUE, (ExteriorType)
fill_value - The value to use with EXTERIOR_FIXED_VALUE. (float)

UNIMPLEMENTED_fit_legendre(col_degree, row_degree, coeffs)

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_fit_local_planes(size, nresults, types, results)

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.

UNIMPLEMENTED_fit_poly_max(max_degree, coeffs)

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_get_autorange(_from, to)

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*)

UNIMPLEMENTED_get_grain_bounding_boxes(ngrains, grains, bboxes)

Find bounding boxes of all grains.
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.

Since: 2.3

UNIMPLEMENTED_get_inclination(theta, phi)

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*)

UNIMPLEMENTED_get_value_format_xy(style, format)

Finds value format good for displaying coordinates of a data field.
Parameters:
style - Unit format style.Expected values: SI_UNIT_FORMAT_NONE, SI_UNIT_FORMAT_PLAIN, SI_UNIT_FORMAT_MARKUP, SI_UNIT_FORMAT_VFMARKUP, SI_UNIT_FORMAT_TEX, (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)

Finds value format good for displaying values of a data field.
Parameters:
style - Unit format style.Expected values: SI_UNIT_FORMAT_NONE, SI_UNIT_FORMAT_PLAIN, SI_UNIT_FORMAT_MARKUP, SI_UNIT_FORMAT_VFMARKUP, SI_UNIT_FORMAT_TEX, (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_grains_get_distribution(grain_field, distribution, ngrains, grains, quantity, nstats)

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)
ngrains - The number of grains as returned by DataField.number_grains(). Ignored in grains is NULL. (int)
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*)
quantity - The quantity to calculate.Expected values: GRAIN_VALUE_PROJECTED_AREA, GRAIN_VALUE_EQUIV_SQUARE_SIDE, GRAIN_VALUE_EQUIV_DISC_RADIUS, GRAIN_VALUE_SURFACE_AREA, GRAIN_VALUE_MAXIMUM, GRAIN_VALUE_MINIMUM, GRAIN_VALUE_MEAN, GRAIN_VALUE_MEDIAN, GRAIN_VALUE_HALF_HEIGHT_AREA, GRAIN_VALUE_FLAT_BOUNDARY_LENGTH, GRAIN_VALUE_MINIMUM_BOUND_SIZE, GRAIN_VALUE_MINIMUM_BOUND_ANGLE, GRAIN_VALUE_MAXIMUM_BOUND_SIZE, GRAIN_VALUE_MAXIMUM_BOUND_ANGLE, GRAIN_VALUE_CENTER_X, GRAIN_VALUE_CENTER_Y, GRAIN_VALUE_VOLUME_0, GRAIN_VALUE_VOLUME_MIN, GRAIN_VALUE_VOLUME_LAPLACE, GRAIN_VALUE_SLOPE_THETA, GRAIN_VALUE_SLOPE_PHI, GRAIN_VALUE_BOUNDARY_MAXIMUM, GRAIN_VALUE_BOUNDARY_MINIMUM, (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)

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 do 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 - An array of size ngrains+1 to put grain values to. It can be NULL to allocate and return a new array. (gdouble*)
ngrains - The number of grains as returned by DataField.number_grains(). (int)
grains - Grain numbers filled with DataField.number_grains(). (const-gint*)
quantity - The quantity to calculate.Expected values: GRAIN_VALUE_PROJECTED_AREA, GRAIN_VALUE_EQUIV_SQUARE_SIDE, GRAIN_VALUE_EQUIV_DISC_RADIUS, GRAIN_VALUE_SURFACE_AREA, GRAIN_VALUE_MAXIMUM, GRAIN_VALUE_MINIMUM, GRAIN_VALUE_MEAN, GRAIN_VALUE_MEDIAN, GRAIN_VALUE_HALF_HEIGHT_AREA, GRAIN_VALUE_FLAT_BOUNDARY_LENGTH, GRAIN_VALUE_MINIMUM_BOUND_SIZE, GRAIN_VALUE_MINIMUM_BOUND_ANGLE, GRAIN_VALUE_MAXIMUM_BOUND_SIZE, GRAIN_VALUE_MAXIMUM_BOUND_ANGLE, GRAIN_VALUE_CENTER_X, GRAIN_VALUE_CENTER_Y, GRAIN_VALUE_VOLUME_0, GRAIN_VALUE_VOLUME_MIN, GRAIN_VALUE_VOLUME_LAPLACE, GRAIN_VALUE_SLOPE_THETA, GRAIN_VALUE_SLOPE_PHI, GRAIN_VALUE_BOUNDARY_MAXIMUM, GRAIN_VALUE_BOUNDARY_MINIMUM, (GrainQuantity)
Returns:
values itself if it was not NULL, otherwise a newly allocated array that caller has to free.

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

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.

UNIMPLEMENTED_number_grains(grains)

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).

xdwt(wt_coefs, direction, minsize)

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.Expected values: TRANSFORM_DIRECTION_BACKWARD, TRANSFORM_DIRECTION_FORWARD, (TransformDirection)
minsize - size of minimal transform result block (int)

ydwt(wt_coefs, direction, minsize)

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.Expected values: TRANSFORM_DIRECTION_BACKWARD, TRANSFORM_DIRECTION_FORWARD, (TransformDirection)
minsize - size of minimal transform result block (int)

Generated by Epydoc 2.1 on Tue Dec 30 04:01:42 2008 http://epydoc.sf.net