tomosipo.volume
- tomosipo.volume(*, shape=(1, 1, 1), pos=None, size=None, extent=None)[source]
Create an axis-aligned volume geometry
A VolumeGeometry is an axis-aligned cuboid centered on pos.
You may provide a combination of arguments to create a new volume geometry:
shape (size will equal shape)
shape and pos (size will equal shape)
shape and size (volume will be centered on the origin)
shape, pos, and size.
shape and extent
- Parameters:
shape (
int|Tuple[int,int,int] |Iterable[int]) – Shape of the voxel grid underlying the volume.pos (
float|Collection[float]) – Position of the center of the volume. By default, the volume is placed on the origin.size (
float|Tuple[float,float,float] |Iterable[float]) – The size of the volume in physical units. This determines the shape. If not provided, the size will equal the shape.extent (
Tuple[float,float] |Tuple[Tuple[float,float],Tuple[float,float],Tuple[float,float]]) – The minimal and maximal value of the volume in the (z, y, x) coordinate space. If only one minimal and maximal value is provided, then it is applied to all coordinates.
- Returns:
An axis-aligned volume geometry.
- Return type:
Examples
>>> ts.volume() ts.volume( shape=(1, 1, 1), pos=(0.0, 0.0, 0.0), size=(1.0, 1.0, 1.0), )
>>> ts.volume(shape=1, size=2.0, pos=(1, 1, 1)) ts.volume( shape=(1, 1, 1), pos=(1.0, 1.0, 1.0), size=(2.0, 2.0, 2.0), )