darsia.WeightedGeometry#

class WeightedGeometry(weight, space_dim, num_voxels, dimensions=None, voxel_size=None, **kwargs)[source]#

Bases: Geometry

Geometry with weighted volume.

Constructor for extruded two-dimensional geometry.

Parameters:
weightfloat or array

Weight compatible with geometry.

space_dimint

See Geometry.

num_voxelstuple

See Geometry.

dimensionslist

See Geometry.

voxel_sizelist

See Geometry.

Raises:
ValueError

If weight has wrong dimensions.

Methods

integrate(data)

Integrate data over the entire geometry.

make_extensive(data)

Convert intensive values to integrated per-cell values on geometry grid.

normalize(img, img_ref[, return_ratio])

Normalize image with respect to another one, such that both have the same integral.

subregion(roi)

Extract subregion of the geometry.

Attributes

weight

Weight of the geometry, can be a scalar or an array.

voxel_volume

Effective voxel volume in 3d.

cached_voxel_volume

Internal copy of the voxel volume for efficient integration.

space_dim

Spatial dimension of geometry.

num_voxels

Number of voxels in each spatial direction.

voxel_size

Dimensions of a single voxel.

dimensions

Dimensions of geometry.

subregion(roi)[source]#

Extract subregion of the geometry.

Parameters:
roidarsia.CoordinateArray

Region of interest.

Returns:
WeightedGeometry

Subregion geometry.

cached_voxel_volume#

Internal copy of the voxel volume for efficient integration.

voxel_volume#

Effective voxel volume in 3d.

weight#

Weight of the geometry, can be a scalar or an array.