## GwyBrick

GwyBrick — Three-dimensional floating point data

## Functions

GwyBrick * | gwy_brick_new ()
GwyBrick * | gwy_brick_new_alike ()
GwyBrick * | gwy_brick_copy ()
void | gwy_brick_assign ()
void | gwy_brick_resize ()
void | gwy_brick_crop ()
GwyBrick * | gwy_brick_new_part ()
void | gwy_brick_data_changed ()
void | gwy_brick_copy_data ()
void | gwy_brick_resample ()
gint | gwy_brick_get_xres ()
gint | gwy_brick_get_yres ()
gint | gwy_brick_get_zres ()
gdouble | gwy_brick_get_xreal ()
gdouble | gwy_brick_get_yreal ()
gdouble | gwy_brick_get_zreal ()
gdouble | gwy_brick_get_xoffset ()
gdouble | gwy_brick_get_yoffset ()
gdouble | gwy_brick_get_zoffset ()
const gdouble * | gwy_brick_get_data_const ()
gdouble * | gwy_brick_get_data ()
gdouble * | gwy_brick_get_data_with_size ()
void | gwy_brick_set_data_with_size ()
void | gwy_brick_invalidate ()
void | gwy_brick_set_xreal ()
void | gwy_brick_set_yreal ()
void | gwy_brick_set_zreal ()
void | gwy_brick_set_xoffset ()
void | gwy_brick_set_yoffset ()
void | gwy_brick_set_zoffset ()
gdouble | gwy_brick_get_dx ()
gdouble | gwy_brick_get_dy ()
gdouble | gwy_brick_get_dz ()
GwyUnit * | gwy_brick_get_unit_x ()
GwyUnit * | gwy_brick_get_unit_y ()
GwyUnit * | gwy_brick_get_unit_z ()
GwyUnit * | gwy_brick_get_unit_w ()
gdouble | gwy_brick_min ()
gdouble | gwy_brick_max ()
void | gwy_brick_copy_units ()
GwyValueFormat * | gwy_brick_get_value_format_x ()
GwyValueFormat * | gwy_brick_get_value_format_y ()
GwyValueFormat * | gwy_brick_get_value_format_z ()
GwyValueFormat * | gwy_brick_get_value_format_w ()
gdouble | gwy_brick_itor ()
gdouble | gwy_brick_rtoi ()
gdouble | gwy_brick_jtor ()
gdouble | gwy_brick_rtoj ()
gdouble | gwy_brick_ktor ()
gdouble | gwy_brick_rtok ()
gdouble | gwy_brick_ktor_cal ()
gdouble | gwy_brick_rtok_cal ()
gdouble | gwy_brick_get_val ()
void | gwy_brick_set_val ()
gdouble | gwy_brick_get_val_real ()
void | gwy_brick_set_val_real ()
gdouble | gwy_brick_get_dval ()
gdouble | gwy_brick_get_dval_real ()
void | gwy_brick_clear ()
void | gwy_brick_fill ()
void | gwy_brick_multiply ()
void | gwy_brick_add ()
GwyField * | gwy_brick_new_field_like_xy_plane ()
void | gwy_brick_extract_plane ()
void | gwy_brick_extract_xy_plane ()
void | gwy_brick_sum_plane ()
void | gwy_brick_sum_xy_plane ()
void | gwy_brick_min_plane ()
void | gwy_brick_min_xy_plane ()
void | gwy_brick_max_plane ()
void | gwy_brick_max_xy_plane ()
void | gwy_brick_minpos_plane ()
void | gwy_brick_minpos_xy_plane ()
void | gwy_brick_maxpos_plane ()
void | gwy_brick_maxpos_xy_plane ()
void | gwy_brick_mean_plane ()
void | gwy_brick_mean_xy_plane ()
void | gwy_brick_rms_plane ()
void | gwy_brick_rms_xy_plane ()
void | gwy_brick_extract_line ()
void | gwy_brick_extract_z_line ()
GwyLine * | gwy_brick_get_zcalibration ()
void | gwy_brick_set_zcalibration ()
void | gwy_brick_copy_zcalibration ()
void | gwy_brick_transpose ()
void | gwy_brick_flip ()
void | gwy_brick_invert_value ()
void | gwy_brick_set_plane ()
void | gwy_brick_set_xy_plane ()
void | gwy_brick_add_to_xy_planes ()
void | gwy_brick_multiply_xy_planes ()
void | gwy_brick_add_to_z_lines ()
gint | gwy_brick_threshold ()

## Signals

void | data-changed | Run First

## Types and Values

enum | GwyBrickTransposeType
struct | GwyBrick
struct | GwyBrickClass

## Object Hierarchy

        GObject
        ╰── GwyBrick

## Implemented Interfaces

GwyBrick implements GwySerializable.

## Includes

    #include <libgwyddion/gwyddion.h>

## Description

GwyBrick is a regular three-dimensional floating point data array. It is typically useful for volume data obtained from SPMs, like in force volume measurements.

## Functions

### gwy_brick_new()

    GwyBrick *
    gwy_brick_new (gint xres,
                   gint yres,
                   gint zres,
                   gdouble xreal,
                   gdouble yreal,
                   gdouble zreal,
                   gboolean nullme);

Creates a new data brick.

[constructor]

#### Parameters

xres | X resolution, i.e., the number of samples in x direction |
yres | Y resolution, i.e., the number of samples in y direction |
zres | Z resolution, i.e., the number of samples in z direction |
xreal | Real physical dimension in x direction. |
yreal | Real physical dimension in y direction. |
zreal | Real physical dimension in z direction. |
nullme | Whether the data brick should be initialized to zeroes. If `FALSE`, the data will not be initialized. |

#### Returns

A newly created data brick.

[transfer full]

### gwy_brick_new_alike()

    GwyBrick *
    gwy_brick_new_alike (GwyBrick *model,
                         gboolean nullme);

Creates a new data brick similar to an existing one.

Use `gwy_brick_duplicate()` if you want to copy a data brick including data.

#### Parameters

model | A data brick to take resolutions and units from. |
nullme | Whether the data brick should be initialized to zeroes. If `FALSE`, the data will not be initialized. |

#### Returns

A newly created data brick.

[transfer full]

### gwy_brick_copy()

    GwyBrick *
    gwy_brick_copy (GwyBrick *brick);

Create a new data brick as a copy of an existing one.

This function is a convenience `gwy_serializable_copy()` wrapper.

#### Parameters

brick | A data brick to duplicate. |

#### Returns

A copy of the data brick.

[transfer full]

### gwy_brick_assign()

    void
    gwy_brick_assign (GwyBrick *destination,
                      GwyBrick *source);

Makes one data brick equal to another.

This function is a convenience `gwy_serializable_assign()` wrapper.

#### Parameters

destination | Target data brick. |
source | Source data brick. |

### gwy_brick_resize()

    void
    gwy_brick_resize (GwyBrick *brick,
                      gint xres,
                      gint yres,
                      gint zres);

Resizes a data brick to a different size, discarding data.

The real dimensions and offsets are unchanged. Z-calibration, if present, is discarded. The brick contents becomes undefined. The function just makes sure `brick` has the correct pixel dimensions.

#### Parameters

brick | A data brick to be resized. |
xres | Desired X resolution. |
yres | Desired Y resolution. |
zres | Desired Z resolution. |

### gwy_brick_crop()

    void
    gwy_brick_crop (GwyBrick *brick,
                    gint xpos,
                    gint ypos,
                    gint zpos,
                    gint width,
                    gint height,
                    gint depth);

Crops a new data brick to a smaller size.

The real dimensions are recalculated and calibration, if present, is cropped to match the new `z` . Offsets are reset to zero.

#### Parameters

brick | A data brick. |
xpos | X position where to start from. |
ypos | Y position where to start from. |
zpos | Z position where to start from. |
width | X resolution (width) to be extracted. |
height | Y resolution (height) to be extracted. |
depth | Z resolution (depth) to be extracted. |

### gwy_brick_new_part()

    GwyBrick *
    gwy_brick_new_part (GwyBrick *brick,
                        gint xpos,
                        gint ypos,
                        gint zpos,
                        gint width,
                        gint height,
                        gint depth,
                        gboolean keep_offsets);

Creates a new data brick as a part of existing one.

Use `gwy_brick_duplicate()` if you want to copy a whole data brick.

#### Parameters

brick | A data brick. |
xpos | X position where to start from. |
ypos | Y position where to start from. |
zpos | Z position where to start from. |
width | X resolution (width) to be extracted. |
height | Y resolution (height) to be extracted. |
depth | Z resolution (depth) to be extracted. |
keep_offsets | `TRUE` to keep offsets of data during extraction. |

#### Returns

A newly created data brick.

[transfer full]

### gwy_brick_data_changed()

    void
    gwy_brick_data_changed (GwyBrick *brick);

Emits signal "data_changed" on a data brick.

#### Parameters

brick | A data brick. |

### gwy_brick_copy_data()

    void
    gwy_brick_copy_data (GwyBrick *src,
                         GwyBrick *dest);

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

Only the data are copied. To make a data brick completely identical to another, including units and change of dimensions, you can use `gwy_brick_assign()`.

#### Parameters

src | Source brick. |
dest | Destination brick. |

### gwy_brick_resample()

    void
    gwy_brick_resample (GwyBrick *brick,
                        gint xres,
                        gint yres,
                        gint zres,
                        GwyInterpolationType interpolation);

Resamples a data brick.

In other words changes the size of three dimensional field related with data brick. The original values are used for resampling using a requested interpolation alorithm.

#### Parameters

brick | A data brick. |
xres | Desired x resolution. |
yres | Desired y resolution. |
zres | Desired z resolution. |
interpolation | Interpolation method to use. |

### gwy_brick_get_xres()

    gint
    gwy_brick_get_xres (GwyBrick *brick);

Gets the x resolution of a data brick.

#### Parameters

brick | A data brick. |

#### Returns

Resolution (number of data points).

### gwy_brick_get_yres()

    gint
    gwy_brick_get_yres (GwyBrick *brick);

Gets the y resolution of a data brick.

#### Parameters

brick | A data brick. |

#### Returns

Resolution (number of data points).

### gwy_brick_get_zres()

    gint
    gwy_brick_get_zres (GwyBrick *brick);

Gets the z resolution of a data brick.

#### Parameters

brick | A data line. |

#### Returns

Resolution (number of data points).

### gwy_brick_get_xreal()

    gdouble
    gwy_brick_get_xreal (GwyBrick *brick);

Gets the physical size of a data brick in the x direction.

#### Parameters

brick | A data brick. |

#### Returns

Real size of a data brick the x direction.

### gwy_brick_get_yreal()

    gdouble
    gwy_brick_get_yreal (GwyBrick *brick);

Gets the physical size of a data brick in the y direction.

#### Parameters

brick | A data brick. |

#### Returns

Real size of a data brick the y direction.

### gwy_brick_get_zreal()

    gdouble
    gwy_brick_get_zreal (GwyBrick *brick);

Gets the physical size of a data brick in the z direction.

#### Parameters

brick | A data brick. |

#### Returns

Real size of a data brick the z direction.

### gwy_brick_get_xoffset()

    gdouble
    gwy_brick_get_xoffset (GwyBrick *brick);

Gets the offset of data brick origin in x direction.

#### Parameters

brick | A data brick. |

#### Returns

Offset value.

### gwy_brick_get_yoffset()

    gdouble
    gwy_brick_get_yoffset (GwyBrick *brick);

Gets the offset of data brick origin in y direction.

#### Parameters

brick | A data brick. |

#### Returns

Offset value.

### gwy_brick_get_zoffset()

    gdouble
    gwy_brick_get_zoffset (GwyBrick *brick);

Gets the offset of data brick origin in z direction.

#### Parameters

brick | A data brick. |

#### Returns

Offset value.

### gwy_brick_get_data_const()

    const gdouble *
    gwy_brick_get_data_const (GwyBrick *brick);

Gets the raw data buffer of a data brick, read-only.

The returned buffer is not guaranteed to be valid through whole data brick life time. Some function may change it, most notably `gwy_brick_resample()`.

Use `gwy_brick_get_data()` if you want to change the data.

#### Parameters

brick | A data brick. |

#### Returns

The data as an array of doubles of length `xres` *`yres` *`zres` .

### gwy_brick_get_data()

    gdouble *
    gwy_brick_get_data (GwyBrick *brick);

Gets the raw data buffer of a data brick.

The returned buffer is not guaranteed to be valid through whole data brick life time. Some function may change it, most notably `gwy_brick_resample()`.

This function invalidates any cached information, use `gwy_brick_get_data_const()` if you are not going to change the data.

#### Parameters

brick | A data brick. |

#### Returns

The data as an array of doubles of length `xres` *`yres` *`zres` .

### gwy_brick_get_data_with_size()

    gdouble *
    gwy_brick_get_data_with_size (GwyBrick *brick,
                                  gsize *out_count);

Gets the raw data buffer of a data brick. Used for gobject-introspection bindings.

The returned buffer is not guaranteed to be valid through whole data brick life time. Some function may change it, most notably `gwy_brick_resample()`.

This function invalidates any cached information.

#### Parameters

brick | A data brick. |
out_count | Number of items in the returned buffer. | [out]

#### Returns

The data as an array of doubles of length `xres` *`yres` *`zres` .

[transfer none][array length=out_count]

### gwy_brick_set_data_with_size()

    void
    gwy_brick_set_data_with_size (GwyBrick *brick,
                                  gdouble *data,
                                  gsize data_count);

Sets new values to the raw data buffer of a data brick. Used for gobject-introspection bindings.

This function invalidates any cached information.

#### Parameters

brick | A data brick. |
data | The data to be set as a pointer to an array of `data_len` gdoubles. | [array length=data_count]
data_count | Number of items in `data` . It has to be equal to `gwy_brick_get_xres()`*gwy_brick_get_yres()*gwy_brick_get_zres(), else the function does nothing. |

### gwy_brick_invalidate()

    void
    gwy_brick_invalidate (GwyBrick *brick);

Invalidates cached data brick stats.

User code should rarely need this macro, as all GwyBrick methods do proper invalidation when they change data, as well as `gwy_brick_get_data()` does.

However, if you get raw data with `gwy_brick_get_data()` and then mix direct changes to it with calls to methods like `gwy_brick_max()`, you may need to explicitely invalidate cached values to let `gwy_brick_max()` know it has to recompute the maximum.

#### Parameters

brick | A data brick to invalidate. |

### gwy_brick_set_xreal()

    void
    gwy_brick_set_xreal (GwyBrick *brick,
                         gdouble xreal);

Sets the real x dimension of a brick.

#### Parameters

brick | A data brick. |
xreal | New real x dimensions value |

### gwy_brick_set_yreal()

    void
    gwy_brick_set_yreal (GwyBrick *brick,
                         gdouble yreal);

Sets the real y dimension of a brick.

#### Parameters

brick | A data brick. |
yreal | New real y dimensions value |

### gwy_brick_set_zreal()

    void
    gwy_brick_set_zreal (GwyBrick *brick,
                         gdouble zreal);

Sets the real z dimension of a brick.

#### Parameters

brick | A data brick. |
zreal | New real z dimensions value |

### gwy_brick_set_xoffset()

    void
    gwy_brick_set_xoffset (GwyBrick *brick,
                           gdouble xoffset);

Sets the offset of a data brick origin in the x direction.

Note offsets don't affect any calculation, nor functions like `gwy_brick_rtoi()`.

#### Parameters

brick | A data brick. |
xoffset | New offset value. |

### gwy_brick_set_yoffset()

    void
    gwy_brick_set_yoffset (GwyBrick *brick,
                           gdouble yoffset);

Sets the offset of a data brick origin in the y direction.

Note offsets don't affect any calculation, nor functions like `gwy_brick_rtoi()`.

#### Parameters

brick | A data brick. |
yoffset | New offset value. |

### gwy_brick_set_zoffset()

    void
    gwy_brick_set_zoffset (GwyBrick *brick,
                           gdouble zoffset);

Sets the offset of a data brick origin in the z direction.

Note offsets don't affect any calculation, nor functions like `gwy_brick_rtoi()`.

#### Parameters

brick | A data brick. |
zoffset | New offset value. |

### gwy_brick_get_dx()

    gdouble
    gwy_brick_get_dx (GwyBrick *brick);

Gets the horizontal (X) voxel size of a brick in real units.

The result is the same as gwy_brick_get_xreal(brick)/gwy_brick_get_xres(brick).

#### Parameters

brick | A data brick. |

#### Returns

Horizontal voxel size.

### gwy_brick_get_dy()

    gdouble
    gwy_brick_get_dy (GwyBrick *brick);

Gets the vertical (Y) voxel size of a brick in real units.

The result is the same as gwy_brick_get_yreal(brick)/gwy_brick_get_yres(brick).

#### Parameters

brick | A data brick. |

#### Returns

Vertical voxel size.

### gwy_brick_get_dz()

    gdouble
    gwy_brick_get_dz (GwyBrick *brick);

Gets the level-wise (Z) voxel size of a brick in real units.

The result is the same as gwy_brick_get_zreal(brick)/gwy_brick_get_zres(brick).

Note that it cannot -- and hence does not -- take into account any attached Z calibration.

#### Parameters

brick | A data brick. |

#### Returns

Level-wise voxel size.

### gwy_brick_get_unit_x()

    GwyUnit *
    gwy_brick_get_unit_x (GwyBrick *brick);

Returns x direction SI unit of a data brick.

The returned object can be modified to change the brick x units.

#### Parameters

brick | A data brick. |

#### Returns

SI unit corresponding to the lateral (X) dimension of the data brick. Its reference count is not incremented.

[transfer none]

### gwy_brick_get_unit_y()

    GwyUnit *
    gwy_brick_get_unit_y (GwyBrick *brick);

Returns y direction SI unit of a data brick.

The returned object can be modified to change the brick y units.

#### Parameters

brick | A data brick. |

#### Returns

SI unit corresponding to the lateral (Y) dimension of the data brick. Its reference count is not incremented.

[transfer none]

### gwy_brick_get_unit_z()

    GwyUnit *
    gwy_brick_get_unit_z (GwyBrick *brick);

Returns z direction SI unit of a data brick.

The returned object can be modified to change the brick z units (not taking into account z-calibration).

#### Parameters

brick | A data brick. |

#### Returns

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

[transfer none]

### gwy_brick_get_unit_w()

    GwyUnit *
    gwy_brick_get_unit_w (GwyBrick *brick);

Returns value SI unit of a data brick.

The returned object can be modified to change the brick value units.

#### Parameters

brick | A data brick. |

#### Returns

SI unit corresponding to the "value" of the data brick. Its reference count is not incremented.

[transfer none]

### gwy_brick_min()

    gdouble
    gwy_brick_min (GwyBrick *brick);

Find the minimum value in a data brick.

#### Parameters

brick | A data brick. |

#### Returns

The minimum value within the brick.

### gwy_brick_max()

    gdouble
    gwy_brick_max (GwyBrick *brick);

Find the maximum value in a data brick.

#### Parameters

brick | A data brick. |

#### Returns

The maximum value within the brick.

### gwy_brick_copy_units()

    void
    gwy_brick_copy_units (GwyBrick *brick,
                          GwyBrick *target);

Sets lateral and value units of a data brick to match another data brick.

#### Parameters

brick | A data brick. |
target | Target data brick. |

### gwy_brick_get_value_format_x()

    GwyValueFormat *
    gwy_brick_get_value_format_x (GwyBrick *brick,
                                  GwyUnitFormatStyle style,
                                  GwyValueFormat *format);

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

#### Parameters

brick | A data brick. |
style | Unit format style. |
format | A SI value format to modify, or `NULL` to allocate a new one. | [nullable]

#### Returns

The value format. If `format` is `NULL`, a newly allocated format is returned, otherwise (modified) `format` itself is returned.

### gwy_brick_get_value_format_y()

    GwyValueFormat *
    gwy_brick_get_value_format_y (GwyBrick *brick,
                                  GwyUnitFormatStyle style,
                                  GwyValueFormat *format);

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

#### Parameters

brick | A data brick. |
style | Unit format style. |
format | A SI value format to modify, or `NULL` to allocate a new one. | [nullable]

#### Returns

The value format. If `format` is `NULL`, a newly allocated format is returned, otherwise (modified) `format` itself is returned.

### gwy_brick_get_value_format_z()

    GwyValueFormat *
    gwy_brick_get_value_format_z (GwyBrick *brick,
                                  GwyUnitFormatStyle style,
                                  GwyValueFormat *format);

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

#### Parameters

brick | A data brick. |
style | Unit format style. |
format | A SI value format to modify, or `NULL` to allocate a new one. | [nullable]

#### Returns

The value format. If `format` is `NULL`, a newly allocated format is returned, otherwise (modified) `format` itself is returned.

### gwy_brick_get_value_format_w()

    GwyValueFormat *
    gwy_brick_get_value_format_w (GwyBrick *brick,
                                  GwyUnitFormatStyle style,
                                  GwyValueFormat *format);

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

Note this functions searches for minimum and maximum value in `brick` , therefore it's relatively slow.

#### Parameters

brick | A data brick. |
style | Unit format style. |
format | A SI value format to modify, or `NULL` to allocate a new one. | [nullable]

#### Returns

The value format. If `format` is `NULL`, a newly allocated format is returned, otherwise (modified) `format` itself is returned.

### gwy_brick_itor()

    gdouble
    gwy_brick_itor (GwyBrick *brick,
                    gdouble pixpos);

Transforms pixel coordinate to real (physical) coordinate in x direction.

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

#### Parameters

brick | A data brick. |
pixpos | Pixel coordinate. |

#### Returns

`pixpos` in real coordinates.

### gwy_brick_rtoi()

    gdouble
    gwy_brick_rtoi (GwyBrick *brick,
                    gdouble realpos);

Transforms real (physical) coordinate to pixel coordinate in x axis.

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

#### Parameters

brick | A data brick. |
realpos | Real coordinate. |

#### Returns

`realpos` in pixel coordinates.

### gwy_brick_jtor()

    gdouble
    gwy_brick_jtor (GwyBrick *brick,
                    gdouble pixpos);

Transforms pixel coordinate to real (physical) coordinate in y direction.

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

#### Parameters

brick | A data brick. |
pixpos | Pixel coordinate. |

#### Returns

`pixpos` in real coordinates.

### gwy_brick_rtoj()

    gdouble
    gwy_brick_rtoj (GwyBrick *brick,
                    gdouble realpos);

Transforms real (physical) coordinate to pixel coordinate in y axis.

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

#### Parameters

brick | A data brick. |
realpos | Real coordinate. |

#### Returns

`realpos` in pixel coordinates.

### gwy_brick_ktor()

    gdouble
    gwy_brick_ktor (GwyBrick *brick,
                    gdouble pixpos);

Transforms pixel coordinate to real (physical) coordinate in z direction.

That is it maps range [0..z resolution] to range [0..z real-size]. It is not suitable for conversion of matrix indices to physical coordinates, you have to use gwy_brick_itor(`brick` , `pixpos` + 0.5) for that.

#### Parameters

brick | A data brick. |
pixpos | Pixel coordinate. |

#### Returns

`pixpos` in real coordinates.

### gwy_brick_rtok()

    gdouble
    gwy_brick_rtok (GwyBrick *brick,
                    gdouble realpos);

Transforms real (physical) coordinate to pixel coordinate in z axis.

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

#### Parameters

brick | A data brick. |
realpos | Real coordinate. |

#### Returns

`realpos` in pixel coordinates.

### gwy_brick_ktor_cal()

    gdouble
    gwy_brick_ktor_cal (GwyBrick *brick,
                        gdouble pixpos);

Transforms pixel coordinate to real (physical) coordinate in z direction, taking into account calibration.

Unlike `gwy_brick_ktor()`, this function takes into account the `z` calibration and, if calibration is not present, the `z` axis offset. Since the calibration is available only for discrete pixel coordinates, the values are interpolated between and clamped if outside the range.

The values in the calibration are assumed to correspond to pixel centres. This convention is also kept when no calibration is present.

#### Parameters

brick | A data brick. |
pixpos | Pixel coordinate. |

#### Returns

`pixpos` in real coordinates.

### gwy_brick_rtok_cal()

    gdouble
    gwy_brick_rtok_cal (GwyBrick *brick,
                        gdouble realpos);

Transforms real (physical) coordinate to pixel coordinate in z axis, taking into account calibration.

Unlike `gwy_brick_rtok()`, this function takes into account the `z` calibration and, if calibration is not present, the `z` axis offset. Since the calibration is available only for discrete pixel coordinates, the values are interpolated between and clamped if outside the range.

The values in the calibration are assumed to correspond to pixel centres. This convention is also kept when no calibration is present.

#### Parameters

brick | A data brick. |
realpos | Real coordinate. |

#### Returns

`realpos` in pixel coordinates.

### gwy_brick_get_val()

    gdouble
    gwy_brick_get_val (GwyBrick *brick,
                       gint col,
                       gint row,
                       gint lev);

Gets value at given position in a data brick.

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

#### Parameters

brick | A data brick. |
col | Position in the brick (column index). |
row | Position in the brick (row index). |
lev | Position in the brick (level index). |

#### Returns

Value at given index.

### gwy_brick_set_val()

    void
    gwy_brick_set_val (GwyBrick *brick,
                       gint col,
                       gint row,
                       gint lev,
                       gdouble value);

Sets value at given position in a data brick.

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

#### Parameters

brick | A data brick. |
col | Position in the brick (column index). |
row | Position in the brick (row index). |
lev | Position in the brick (level index). |
value | Value to be set. |

### gwy_brick_get_val_real()

    gdouble
    gwy_brick_get_val_real (GwyBrick *brick,
                            gdouble x,
                            gdouble y,
                            gdouble z);

Gets value at given position in a data brick, in real coordinates.

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

#### Parameters

brick | A data brick. |
x | Position in the brick (x direction). |
y | Position in the brick (y direction). |
z | Position in the brick (z direction). |

#### Returns

Value at given index.

### gwy_brick_set_val_real()

    void
    gwy_brick_set_val_real (GwyBrick *brick,
                            gdouble x,
                            gdouble y,
                            gdouble z,
                            gdouble value);

Sets value at given position in a data brick.

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

#### Parameters

brick | A data brick. |
x | Position in the brick (x direction). |
y | Position in the brick (y direction). |
z | Position in the brick (z direction). |
value | Value to be set. |

### gwy_brick_get_dval()

    gdouble
    gwy_brick_get_dval (GwyBrick *brick,
                        gdouble x,
                        gdouble y,
                        gdouble z,
                        GwyInterpolationType interpolation);

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

Note that pixel values are centered in intervals [`i` , `i` +1]. See also `gwy_brick_get_dval_real()` that does the same, but takes real coordinates.

#### Parameters

brick | A data brick. |
x | Position in data brick in range [0, x-resolution]. If the value is outside this range, the nearest border value is returned. |
y | Position in data brick in range [0, y-resolution]. If the value is outside this range, the nearest border value is returned. |
z | Position in data brick in range [0, z-resolution]. If the value is outside this range, the nearest border value is returned. |
interpolation | Interpolation method to use. |

#### Returns

Value interpolated in the data brick.

### gwy_brick_get_dval_real()

    gdouble
    gwy_brick_get_dval_real (GwyBrick *brick,
                             gdouble x,
                             gdouble y,
                             gdouble z,
                             GwyInterpolationType interpolation);

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

Note pixel values are centered in intervals [`j` , `j` +1]. See also `gwy_brick_get_dval()` that does the same, but takes pixel coordinates.

#### Parameters

brick | A data brick. |
x | X postion in real coordinates. |
y | Y postition in real coordinates. |
z | Z postition in real coordinates. Z-calibration is not taken into account. |
interpolation | Interpolation method to use. |

#### Returns

Value interpolated in the data brick.

### gwy_brick_clear()

    void
    gwy_brick_clear (GwyBrick *brick);

Fills a data brick with zeroes.

#### Parameters

brick | A data brick. |

### gwy_brick_fill()

    void
    gwy_brick_fill (GwyBrick *brick,
                    gdouble value);

Fills a data brick with specified value.

#### Parameters

brick | A data brick. |
value | Value to fill data brick with. |

### gwy_brick_multiply()

    void
    gwy_brick_multiply (GwyBrick *brick,
                        gdouble value);

Multiplies all values in a data brick with a specified value.

#### Parameters

brick | A data brick. |
value | Value to multiply data brick with. |

### gwy_brick_add()

    void
    gwy_brick_add (GwyBrick *brick,
                   gdouble value);

Adds a specified value to all values in a data brick.

#### Parameters

brick | A data brick. |
value | Value to be added. |

### gwy_brick_new_field_like_xy_plane()

    GwyField *
    gwy_brick_new_field_like_xy_plane (GwyBrick *brick,
                                       gboolean nullme);

Creates a new data field matching one XY plane of a data brick.

The pixel dimensions, physical dimensions, offsets and units will match the brick plane. The brick should have identical `x` and `y` units.

There are a number of functions which create similar fields already filled with useful data, for example `gwy_brick_extract_xy_plane()` or `gwy_brick_sum_xy_plane()`.

#### Parameters

brick | A data brick. |
nullme | Whether the data field should be initialized to zeros. If `FALSE`, the data will not be initialized. |

#### Returns

A new data field matching one `brick` plane.

[transfer full]

### gwy_brick_extract_plane()

    void
    gwy_brick_extract_plane (GwyBrick *brick,
                             GwyField *target,
                             gint istart,
                             gint jstart,
                             gint kstart,
                             gint width,
                             gint height,
                             gint depth,
                             gboolean keep_offsets);

Extracts a plane from a data brick.

One value of set (`width` , `height` , `depth` ) needs to be -1, determining the plane orientation.

Use `gwy_brick_extract_xy_plane()` to simply extract one entire XY plane.

#### Parameters

brick | A data brick. |
target | Datafield to be filled by extracted plane. It will be resized if necessary. |
istart | Column where to start (pixel coordinates). |
jstart | Row where to start (pixel coordinates). |
kstart | Level where to start (pixel coordinates). |
width | Pixel width of extracted plane. If `width` is -1, the yz plane will be extracted. |
height | Pixel height of extracted plane. If `height` is -1, the xz plane will be extracted |
depth | Pixel depth of extracted plane. If `depth` is -1, the xy plane will be extracted |
keep_offsets | Keep the physical offsets in extracted field. |

### gwy_brick_extract_xy_plane()

    void
    gwy_brick_extract_xy_plane (GwyBrick *brick,
                                GwyField *target,
                                gint lev);

Extracts one full XY plane of a data brick to a data field.

#### Parameters

brick | A data brick. |
target | Datafield to be filled by extracted plane. It will be resized if necessary. |
lev | Position in the brick (level index). |

### gwy_brick_sum_plane()

    void
    gwy_brick_sum_plane (GwyBrick *brick,
                         GwyField *target,
                         gint istart,
                         gint jstart,
                         gint kstart,
                         gint width,
                         gint height,
                         gint depth,
                         gboolean keep_offsets);

Sums planes in certain direction

One value of set (`width` , `height` , `depth` ) needs to be -1, determining the plane orientation. In contrast to gwy_brick_extract_plane, the appropriate start coordinate (e.g. `istart` if `width` = -1) is not used for single plane extraction, but the planes are accumulated in whole range (0..xres for given example).

#### Parameters

brick | A data brick. |
target | Datafield to be filled by summed plane. It will be resized if necessary. |
istart | Column where to start (pixel coordinates). |
jstart | Row where to start (pixel coordinates). |
kstart | Level where to start (pixel coordinates). |
width | Pixel width of summed plane. If `width` is -1, the yz planes will be summed. |
height | Pixel height of summed plane. If `height` is -1, the xz planes will be summed |
depth | Pixel depth of summed plane. If `depth` is -1, the xy planes will be summed |
keep_offsets | Keep the physical offsets in extracted field. |

### gwy_brick_sum_xy_plane()

    void
    gwy_brick_sum_xy_plane (GwyBrick *brick,
                            GwyField *target);

Sums all z-profiles of a data brick to a data field.

The result is an xy plane and can be alternatively imagined as the sum of all xy planes.

#### Parameters

brick | A data brick. |
target | Datafield to be filled by the summary data. It will be resized if necessary. |

### gwy_brick_min_plane()

    void
    gwy_brick_min_plane (GwyBrick *brick,
                         GwyField *target,
                         gint istart,
                         gint jstart,
                         gint kstart,
                         gint width,
                         gint height,
                         gint depth,
                         gboolean keep_offsets);

Finds minima of profiles in certain direction.

One value of set (`width` , `height` , `depth` ) needs to be -1, determining the plane orientation. In contrast to gwy_brick_extract_plane, the appropriate start coordinate (e.g. `istart` if `width` = -1) is not used for single plane extraction, but the planes are accumulated in whole range (0..xres for given example).

#### Parameters

brick | A data brick. |
target | Datafield to be filled by the minima plane. It will be resized if necessary. |
istart | Column where to start (pixel coordinates). |
jstart | Row where to start (pixel coordinates). |
kstart | Level where to start (pixel coordinates). |
width | Pixel width of summarized plane. If `width` is -1, the yz planes will be summarized. |
height | Pixel height of summarized plane. If `height` is -1, the xz planes will be summarized. |
depth | Pixel depth of summarized plane. If `depth` is -1, the xy planes will be summarized |
keep_offsets | Keep the physical offsets in extracted field. |

### gwy_brick_min_xy_plane()

    void
    gwy_brick_min_xy_plane (GwyBrick *brick,
                            GwyField *target);

Computes the minima along z-axis of a data brick to a data field.

The result is an xy plane.

#### Parameters

brick | A data brick. |
target | Datafield to be filled by the summary data. It will be resized if necessary. |

### gwy_brick_max_plane()

    void
    gwy_brick_max_plane (GwyBrick *brick,
                         GwyField *target,
                         gint istart,
                         gint jstart,
                         gint kstart,
                         gint width,
                         gint height,
                         gint depth,
                         gboolean keep_offsets);

Finds minima of profiles in certain direction.

One value of set (`width` , `height` , `depth` ) needs to be -1, determining the plane orientation. In contrast to gwy_brick_extract_plane, the appropriate start coordinate (e.g. `istart` if `width` = -1) is not used for single plane extraction, but the planes are accumulated in whole range (0..xres for given example).

#### Parameters

brick | A data brick. |
target | Datafield to be filled by the maxima plane. It will be resized if necessary. |
istart | Column where to start (pixel coordinates). |
jstart | Row where to start (pixel coordinates). |
kstart | Level where to start (pixel coordinates). |
width | Pixel width of summarized plane. If `width` is -1, the yz planes will be summarized. |
height | Pixel height of summarized plane. If `height` is -1, the xz planes will be summarized. |
depth | Pixel depth of extracted plane. If `depth` is -1, the xy planes will be summarized |
keep_offsets | Keep the physical offsets in extracted field. |

### gwy_brick_max_xy_plane()

    void
    gwy_brick_max_xy_plane (GwyBrick *brick,
                            GwyField *target);

Computes the maxima along z-axis of a data brick to a data field.

The result is an xy plane.

#### Parameters

brick | A data brick. |
target | Datafield to be filled by the summary data. It will be resized if necessary. |

### gwy_brick_minpos_plane()

    void
    gwy_brick_minpos_plane (GwyBrick *brick,
                            GwyField *target,
                            gint istart,
                            gint jstart,
                            gint kstart,
                            gint width,
                            gint height,
                            gint depth,
                            gboolean keep_offsets);

Finds minima coordinates in profiles in certain direction.

One value of set (`width` , `height` , `depth` ) needs to be -1, determining the plane orientation. In contrast to gwy_brick_extract_plane, the appropriate start coordinate (e.g. `istart` if `width` = -1) is not used for single plane extraction, but the planes are accumulated in whole range (0..xres for given example)

#### Parameters

brick | A data brick. |
target | Datafield to be filled by the minima positions plane. It will be resized if necessary. |
istart | Column where to start (pixel coordinates). |
jstart | Row where to start (pixel coordinates). |
kstart | Level where to start (pixel coordinates). |
width | Pixel width of summarized plane. If `width` is -1, the yz planes will be summarized. |
height | Pixel height of summarized plane. If `height` is -1, the xz planes will be summarized. |
depth | Pixel depth of summarized plane. If `depth` is -1, the xy planes will be summarized |
keep_offsets | Keep the physical offsets in summarized field. |

### gwy_brick_minpos_xy_plane()

    void
    gwy_brick_minpos_xy_plane (GwyBrick *brick,
                               GwyField *target);

Computes the location of minima along z-axis of a data brick to a data field.

The result is an xy plane.

#### Parameters

brick | A data brick. |
target | Datafield to be filled by the summary data. It will be resized if necessary. |

### gwy_brick_maxpos_plane()

    void
    gwy_brick_maxpos_plane (GwyBrick *brick,
                            GwyField *target,
                            gint istart,
                            gint jstart,
                            gint kstart,
                            gint width,
                            gint height,
                            gint depth,
                            gboolean keep_offsets);

Finds maxima coordinates of profiles in certain direction.

One value of set (`width` , `height` , `depth` ) needs to be -1, determining the plane orientation. In contrast to gwy_brick_extract_plane, the appropriate start coordinate (e.g. `istart` if `width` = -1) is not used for single plane extraction, but the planes are accumulated in whole range (0..xres for given example).

#### Parameters

brick | A data brick. |
target | Datafield to be filled by the maxima positions plane. It will be resized if necessary. |
istart | Column where to start (pixel coordinates). |
jstart | Row where to start (pixel coordinates). |
kstart | Level where to start (pixel coordinates). |
width | Pixel width of summarized plane. If `width` is -1, the yz planes will be summarized. |
height | Pixel height of summarized plane. If `height` is -1, the xz planes will be summarized |
depth | Pixel depth of summarized plane. If `depth` is -1, the xy planes will be summarized |
keep_offsets | Keep the physical offsets in summarized field. Not implemented. |

### gwy_brick_maxpos_xy_plane()

    void
    gwy_brick_maxpos_xy_plane (GwyBrick *brick,
                               GwyField *target);

Computes the location of maxima along z-axis of a data brick to a data field.

The result is an xy plane.

#### Parameters

brick | A data brick. |
target | Datafield to be filled by the summary data. It will be resized if necessary. |

### gwy_brick_mean_plane()

    void
    gwy_brick_mean_plane (GwyBrick *brick,
                          GwyField *target,
                          gint istart,
                          gint jstart,
                          gint kstart,
                          gint width,
                          gint height,
                          gint depth,
                          gboolean keep_offsets);

Finds mean of planes in certain direction.

One value of set (`width` , `height` , `depth` ) needs to be -1, determining the plane orientation. In contrast to gwy_brick_extract_plane, the appropriate start coordinate (e.g. `istart` if `width` = -1) is not used for single plane extraction, but the planes are accumulated in whole range (0..xres for given example).

#### Parameters

brick | A data brick. |
target | Datafield to be filled by the mean plane. It will be resized if necessary. |
istart | Column where to start (pixel coordinates). |
jstart | Row where to start (pixel coordinates). |
kstart | Level where to start (pixel coordinates). |
width | Pixel width of summarized plane. If `width` is -1, the yz planes will be summarized. |
height | Pixel height of summarized plane. If `height` is -1, the xz planes will be summarized. |
depth | Pixel depth of summarized plane. If `depth` is -1, the xy planes will be summarized. |
keep_offsets | Keep the physical offsets in summarized field. |

### gwy_brick_mean_xy_plane()

    void
    gwy_brick_mean_xy_plane (GwyBrick *brick,
                             GwyField *target);

Calculates mean values of all z-profiles of a data brick to a data field.

The result is an xy plane and can be alternatively imagined as the average of all xy planes.

#### Parameters

brick | A data brick. |
target | Datafield to be filled by the summary data. It will be resized if necessary. |

### gwy_brick_rms_plane()

    void
    gwy_brick_rms_plane (GwyBrick *brick,
                         GwyField *target,
                         gint istart,
                         gint jstart,
                         gint kstart,
                         gint width,
                         gint height,
                         gint depth,
                         gboolean keep_offsets);

Finds rms of planes in certain direction and extract the result (GwyField). One value of set (`width` , `height` , `depth` ) needs to be -1, determining the plane orientation. In contrast to gwy_brick_extract_plane, the appropriate start coordinate (e.g. `istart` if `width` = -1) is not used for single plane extraction, but the planes are accumulated in whole range (0..xres for given example)

#### Parameters

brick | A data brick. |
target | Datafield to be filled by the rms plane. It will be resized if necessary. |
istart | Column where to start (pixel coordinates). |
jstart | Row where to start (pixel coordinates). |
kstart | Level where to start (pixel coordinates). |
width | Pixel width of summarized plane. If `width` is -1, the yz planes will be summarized. |
height | Pixel height of summarized plane. If `height` is -1, the xz planes will be summarized. |
depth | Pixel depth of summarized plane. If `depth` is -1, the xy planes will be summarized. |
keep_offsets | Keep the physical offsets in extracted field. |

### gwy_brick_rms_xy_plane()

    void
    gwy_brick_rms_xy_plane (GwyBrick *brick,
                            GwyField *target);

Calculates rms values of all z-profiles of a data brick to a data field.

The result is an xy plane and can be alternatively imagined as the variation among xy planes.

#### Parameters

brick | A data brick. |
target | Datafield to be filled by the summary data. It will be resized if necessary. |

### gwy_brick_extract_line()

    void
    gwy_brick_extract_line (GwyBrick *brick,
                            GwyLine *target,
                            gint istart,
                            gint jstart,
                            gint kstart,
                            gint iend,
                            gint jend,
                            gint kend,
                            gboolean keep_offsets);

Extracts a line (GwyLine) from the brick.

Only line orientations parallel to coordinate axes are supported now, i.e. two of the start coordinates need to be same as end ones.

#### Parameters

brick | A data brick. |
target | Dataline to be filled by extracted line. It will be resized if necessary. |
istart | Column where to start (pixel coordinates). |
jstart | Row where to start (pixel coordinates). |
kstart | Level where to start (pixel coordinates). |
iend | Column where to end, exclusive (pixel coordinates). |
jend | Row where to end, exclusive (pixel coordinates). |
kend | Level where to end, exclusive (pixel coordinates). |
keep_offsets | Keep physical offsets in extracted line. |

### gwy_brick_extract_z_line()

    void
    gwy_brick_extract_z_line (GwyBrick *brick,
                              GwyLine *target,
                              gint i,
                              gint j);

Extracts one full Z profile of a data brick to a data line.

#### Parameters

brick | A data brick. |
target | Dataline to be filled by extracted line. It will be resized if necessary. |
i | Column index. |
j | Row index. |

### gwy_brick_get_zcalibration()

    GwyLine *
    gwy_brick_get_zcalibration (GwyBrick *brick);

Gets the z-axis non-linear calibration of a data brick.

#### Parameters

brick | A data brick. |

#### Returns

Z Calibration (non-linear Z-axis values as ordinates).

[transfer none]

### gwy_brick_set_zcalibration()

    void
    gwy_brick_set_zcalibration (GwyBrick *brick,
                                GwyLine *calibration);

Sets the z-axis non-linear calibration of a data brick.

#### Parameters

brick | A data brick. |
calibration | GwyLine pointer with z-axis non-linear calibration of a data brick (values are stored as ordinates). It can also be `NULL` to unset the calibration. | [nullable][transfer none]

### gwy_brick_copy_zcalibration()

    void
    gwy_brick_copy_zcalibration (GwyBrick *brick,
                                 GwyBrick *target);

Copies non-linear z-axis calibration between two data bricks.

Both bricks must have the same Z resolution. For a meaningful usage, they should also have the same Z real sizes and units (uncalibrated).

If `brick` has no z-axis calibration, existing `targets` ' calibration is deleted.

#### Parameters

brick | A data brick. |
target | Target data brick. |

### gwy_brick_transpose()

    void
    gwy_brick_transpose (GwyBrick *brick,
                         GwyBrick *target,
                         GwyBrickTransposeType type,
                         gboolean xflipped,
                         gboolean yflipped,
                         gboolean zflipped);

Transposes a data brick, exchanging and/or flipping axes.

Real dimensions and units are updated. Since real sizes cannot go backward, flipping an axis results in the corresponding offset being reset (the real dimension stays positive). If the Z axis is preserved its calibration is copied to the target; otherwise the target will have no Z axis calibration.

#### Parameters

brick | A data brick. |
target | Destination data brick. It cannot be `brick` itself and will be resized as needed. |
type | Basic transposition type (which axes are swapped). |
xflipped | `TRUE` to reflect X, i.e. rows within XY planes. |
yflipped | `TRUE` to reflect Y, i.e. columns within XY planes. |
zflipped | `TRUE` to reflect Z, i.e. the XY plane order. |

### gwy_brick_flip()

    void
    gwy_brick_flip (GwyBrick *brick,
                    gboolean xflipped,
                    gboolean yflipped,
                    gboolean zflipped);

Reflects a data brick in place.

Since real sizes cannot go backward, flipping an axis results in the corresponding offset being reset (the real dimension stays positive).

#### Parameters

brick | A data brick. |
xflipped | `TRUE` to reflect X, i.e. rows within XY planes. The image in each Z plane will be left–right mirrored. |
yflipped | `TRUE` to reflect Y, i.e. columns within XY planes. The image in each Z plane will be flipped upside down. |
zflipped | `TRUE` to reflect Z, i.e. the XY plane order. The order in the image Z-stack will be reversed. |

### gwy_brick_invert_value()

    void
    gwy_brick_invert_value (GwyBrick *brick);

Inverts a data brick data in place.

The values are inverted about the mean value. Use `gwy_brick_multiply()` to change the sings of all values.

#### Parameters

brick | A data brick. |

### gwy_brick_set_plane()

    void
    gwy_brick_set_plane (GwyBrick *brick,
                         GwyField *plane,
                         gint istart,
                         gint jstart,
                         gint kstart,
                         gint width,
                         gint height,
                         gint depth);

Fill a single plane in the brick by a two-dimensional data (GwyField).

One value of set (`width` , `height` , `depth` ) needs to be -1, determining the plane orientation.

#### Parameters

brick | A data brick. |
plane | Datafield to be inserted into brick. It must have the appropriate size. |
istart | Column where to start (pixel coordinates). |
jstart | Row where to start (pixel coordinates). |
kstart | Level where to start (pixel coordinates). |
width | Pixel width of the inserted plane. If `width` is -1, the yz plane will be filled. |
height | Pixel height of insered plane. If `height` is -1, the xz plane will be filled. |
depth | Pixel depth of inserted plane. If `depth` is -1, the xy plane will be filled. |

### gwy_brick_set_xy_plane()

    void
    gwy_brick_set_xy_plane (GwyBrick *brick,
                            GwyField *plane,
                            gint lev);

Sets one full single XY plane in a data brick from data field values.

#### Parameters

brick | A data brick. |
plane | Datafield to be inserted into brick. It must have dimensions `xres` by `yres` . |
lev | Position in the brick (level index). |

### gwy_brick_add_to_xy_planes()

    void
    gwy_brick_add_to_xy_planes (GwyBrick *brick,
                                GwyField *plane);

Adds a data field to all brick XY planes.

#### Parameters

brick | A data brick. |
plane | Datafield to be added to all brick XY planes. It must have dimensions `xres` by `yres` . |

### gwy_brick_multiply_xy_planes()

    void
    gwy_brick_multiply_xy_planes (GwyBrick *brick,
                                  GwyField *plane);

Multiplies all brick XY planes by a datafield.

#### Parameters

brick | A data brick. |
plane | Datafield to multiply all brick XY planes with. It must have dimensions `xres` by `yres` . |

### gwy_brick_add_to_z_lines()

    void
    gwy_brick_add_to_z_lines (GwyBrick *brick,
                              GwyLine *line);

Adds a data line to all brick Z lines.

#### Parameters

brick | A data brick. |
line | Data line to add to each Z lines. It must have dimension `zres` . |

### gwy_brick_threshold()

    gint
    gwy_brick_threshold (GwyBrick *brick,
                         gdouble threshold,
                         gdouble below,
                         gdouble above);

Tresholds values of a brick.

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

#### Parameters

brick | A data brick. |
threshold | Threshold value. |
below | Lower replacement value. |
above | Upper replacement value. |

#### Returns

The total number of values above threshold.

## Types and Values

### enum GwyBrickTransposeType

Type of volume data transposition.

The enum values names spell which old axis becomes which new axes.

#### Members

GWY_BRICK_TRANSPOSE_XYZ | No change (useful with axis flipping). |
GWY_BRICK_TRANSPOSE_XZY | Axes Z and Y are swapped. |
GWY_BRICK_TRANSPOSE_YXZ | Axes Y and Z are swapped. |
GWY_BRICK_TRANSPOSE_YZX | Axis X becomes Y, Y becomes Z and Z becomes X. |
GWY_BRICK_TRANSPOSE_ZXY | Axis X becomes Z, Y becomes X and Z becomes Y. |
GWY_BRICK_TRANSPOSE_ZYX | Axes X and Z are swapped. |

### struct GwyBrick

    struct GwyBrick;

The GwyBrick struct contains private data only and should be accessed using the functions below.

### struct GwyBrickClass

    struct GwyBrickClass {
        GObjectClass parent_class;

        void (*data_changed)(GwyBrick *brick);
    };

## Signal Details

### The `“data-changed”` signal

    void
    user_function (GwyBrick *gwyline,
                   gpointer  user_data)

The ::data-changed signal is never emitted by the object itself. It is intended as a means to notify object users they should update themselves, usually when a computation modifying the data is finished.

#### Parameters

gwyline | The GwyBrick which received the signal. |
user_data | user data set when the signal handler was connected. |

Flags: Run First