Volume

../../../_images/steno3d_volume.png

Steno3D Volumes are 3D resources. The steps to construct the volume resource pictured above can be found online in the example notebooks.

class steno3d.volume.Volume(project=None, **kwargs)[source]

Contains all the information about a 3D volume

Required Properties:

  • mesh (Mesh3DGrid): Mesh, an instance of Mesh3DGrid, Default: new instance of Mesh3DGrid
  • opts (_VolumeOptions): Options, an instance of _VolumeOptions, Default: new instance of _VolumeOptions
  • project (a list of Project): Project containing the resource, a list (each item is an instance of Project)

Optional Properties:

  • data (a list of _VolumeBinder): Data, a list (each item is an instance of _VolumeBinder)
  • description (String): Description of the model., a unicode string
  • title (String): Title of the model., a unicode string

Meshes

class steno3d.volume.Mesh3DGrid(**metadata)[source]

Contains spatial information of a 3D grid volume.

Required Properties:

  • O (Vector3): Origin vector, a 3D Vector of <type ‘float’> with shape (3), Default: [0.0, 0.0, 0.0]
  • U (Vector3): Orientation of h1 axis, a 3D Vector of <type ‘float’> with shape (3), Default: X
  • V (Vector3): Orientation of h2 axis, a 3D Vector of <type ‘float’> with shape (3), Default: Y
  • W (Vector3): Orientation of h3 axis, a 3D Vector of <type ‘float’> with shape (3), Default: Z
  • h1 (Array): Tensor cell widths, x-direction, a list or numpy array of <type ‘float’>, <type ‘int’> with shape (*)
  • h2 (Array): Tensor cell widths, y-direction, a list or numpy array of <type ‘float’>, <type ‘int’> with shape (*)
  • h3 (Array): Tensor cell widths, z-direction, a list or numpy array of <type ‘float’>, <type ‘int’> with shape (*)
  • opts (_Mesh3DOptions): Mesh3D Options, an instance of _Mesh3DOptions, Default: new instance of _Mesh3DOptions

Optional Properties:

  • description (String): Description of the model., a unicode string
  • title (String): Title of the model., a unicode string

Other Properties:

  • x0: This property has been renamed ‘O’ and may be removed in the future.

Data

The intended method of binding data to volumes is simply using a dictionary containing location (cell centers, ‘CC’, is the only available location for volumes) and data, a DataArray.

>> ...
>> my_volume = steno3d.Volume(...)
>> ...
>> my_data = steno3d.DataArray(
       title='Six Numbers',
       array=[0.0, 1.0, 2.0, 3.0, 4.0, 5.0]
   )
>> my_volume.data = [dict(
       location='N',
       data=my_data
   )]

Under the surface, this dictionary becomes a _VolumeBinder.

When binding data to a Volume, you may specify data order; the default is C-style, row-major ordering, but Fortran-style, column-major ordering is also available. For more details see the DataArray documentation.

class steno3d.volume._VolumeBinder(**metadata)[source]

Contains the data on a 3D volume with location information

Required Properties:

  • data (DataArray): Data, an instance of DataArray, Default: new instance of DataArray
  • location (StringChoice): Location of the data on mesh, any of “CC”, Default: CC

Options

Similar to data, options are intended to be constructed simply as a dictionary.

>> ...
>> my_volume = steno3d.Volume(...)
>> ...
>> my_volume.opts = dict(
       color='red',
       opacity=0.75
   )

This dictionary then becomes _VolumeOptions.

class steno3d.volume._VolumeOptions(**metadata)[source]

Optional Properties:

  • color (Color): Solid color, a color, Default: random
  • opacity (Float): Opacity, a float in range [0.0, 1.0], Default: 1.0
class steno3d.volume._Mesh3DOptions(**metadata)[source]

Optional Properties:

  • wireframe (Bool): Wireframe, a boolean, Default: False