Inviwo 0.9.12-pre
Inviwo documentation
Loading...
Searching...
No Matches
inviwo::Volume Class Reference

#include <inviwo/core/datastructures/volume/volume.h>

Inheritance diagram for inviwo::Volume:

Public Types

using Config = VolumeConfig
Public Types inherited from inviwo::Data< Volume, VolumeRepresentation >
using repr
using self

Public Member Functions

HistogramCache::Result calculateHistograms (const std::function< void(const std::vector< Histogram1D > &)> &whenDone) const
virtual Volume * clone () const override
VolumeConfig config () const
void discardHistograms ()
virtual const AxisgetAxis (size_t index) const override
const DataFormatBasegetDataFormat () const
virtual size3_t getDimensions () const override
Document getInfo () const
InterpolationType getInterpolation () const
template<typename Kind>
const representation_traits< Volume, Kind >::type * getRep () const
SwizzleMask getSwizzleMask () const
vec3 getWorldSpaceGradientSpacing () const
 Computes the spacing to be used for gradient computation. Also works for volume with non-orthogonal basis.
Wrapping3D getWrapping () const
Volume & operator= (const Volume &that)=default
Volume & operator= (Volume &&that)=default
void setDataFormat (const DataFormatBase *format)
virtual void setDimensions (const size3_t &dim)
void setInterpolation (InterpolationType interpolation)
void setSwizzleMask (const SwizzleMask &mask)
 update the swizzle mask of the color channels when sampling the volume
void setWrapping (const Wrapping3D &wrapping)
 Volume (const Volume &)=default
 Volume (const Volume &rhs, NoData noData, const VolumeConfig &config={})
 Volume (const VolumeConfig &config)
 Volume (size3_t defaultDimensions=VolumeConfig::defaultDimensions, const DataFormatBase *defaultFormat=VolumeConfig::defaultFormat, const SwizzleMask &defaultSwizzleMask=VolumeConfig::defaultSwizzleMask, InterpolationType interpolation=VolumeConfig::defaultInterpolation, const Wrapping3D &wrapping=VolumeConfig::defaultWrapping)
 Volume (std::shared_ptr< VolumeRepresentation >)
 Volume (Volume &&)=default
Public Member Functions inherited from inviwo::Data< Volume, VolumeRepresentation >
void addRepresentation (std::shared_ptr< VolumeRepresentation > representation)
void clearRepresentations ()
T * getEditableRepresentation ()
const T * getRepresentation () const
std::shared_ptr< const T > getRepresentationShared () const
bool hasRepresentation () const
bool hasRepresentations () const
void invalidateAllOther (const VolumeRepresentation *repr)
void removeOtherRepresentations (const VolumeRepresentation *representation)
void removeRepresentation (const VolumeRepresentation *representation)
void updateResource (const ResourceMeta &meta) const
Public Member Functions inherited from inviwo::StructuredGridEntity< 3 >
virtual const StructuredCoordinateTransformergetCoordinateTransformer () const override
glm::mat4 getIndexMatrix () const
StructuredGridEntity< N > & operator= (const StructuredGridEntity< N > &that)=default
Public Member Functions inherited from inviwo::SpatialEntity
glm::mat3 getBasis () const
virtual const SpatialCameraCoordinateTransformergetCoordinateTransformer (const Camera &camera) const
glm::mat4 getModelMatrix () const
glm::vec3 getOffset () const
glm::mat4 getWorldMatrix () const
SpatialEntity & operator= (const SpatialEntity &that)
void setBasis (const glm::mat3 &basis)
void setModelMatrix (const glm::mat4 &modelMatrix)
void setOffset (const glm::vec3 &offset)
void setWorldMatrix (const glm::mat4 &worldMatrix)
 SpatialEntity (const glm::mat4 &modelMatrix)
 SpatialEntity (const glm::mat4 &modelMatrix, const glm::mat4 &worldMatrix)
 SpatialEntity (const SpatialEntity &rhs)
Public Member Functions inherited from inviwo::MetaDataOwner
void copyMetaDataFrom (const MetaDataOwner &src)
void copyMetaDataTo (MetaDataOwner &dst)
template<typename T>
requires std::derived_from<T, MetaData>
T * createMetaData (std::string_view key)
void deserialize (Deserializer &d)
template<typename T>
requires std::derived_from<T, MetaData>
T * getMetaData (std::string_view key)
template<typename T>
requires std::derived_from<T, MetaData>
const T * getMetaData (std::string_view key) const
template<typename T, typename U>
requires std::derived_from<T, MetaData> && Gettable<T, U>
getMetaData (std::string_view key, U val) const
MetaDataMapgetMetaDataMap ()
const MetaDataMapgetMetaDataMap () const
template<typename T>
requires std::derived_from<T, MetaData>
bool hasMetaData (std::string_view key) const
bool hasMetaData (std::string_view key) const
 MetaDataOwner (const MetaDataOwner &rhs)=default
 MetaDataOwner (MetaDataOwner &rhs)=default
MetaDataOwner & operator= (const MetaDataOwner &rhs)=default
MetaDataOwner & operator= (MetaDataOwner &)=default
void serialize (Serializer &s) const
template<typename T, typename U>
requires std::derived_from<T, MetaData> && Settable<T, U>
void setMetaData (std::string_view key, U value)
template<typename T>
requires std::derived_from<T, MetaData>
bool unsetMetaData (std::string_view key)
 unset, i.e. remove the metadata entry matching the given key and type

Public Attributes

std::array< Axis, 3 > axes
DataMapper dataMap

Static Public Attributes

static constexpr std::string_view classIdentifier {"org.inviwo.Volume"}
static constexpr uvec3 colorCode {188, 101, 101}
static constexpr std::string_view dataName {"Volume"}

Protected Attributes

const DataFormatBasedefaultDataFormat_
size3_t defaultDimensions_
InterpolationType defaultInterpolation_
SwizzleMask defaultSwizzleMask_
Wrapping3D defaultWrapping_
HistogramCache histograms_
Protected Attributes inherited from inviwo::SpatialEntity
std::unique_ptr< SpatialCameraCoordinateTransformercameraTransformer_
glm::mat4 modelMatrix_
std::unique_ptr< SpatialCoordinateTransformertransformer_
glm::mat4 worldMatrix_
Protected Attributes inherited from inviwo::MetaDataOwner
MetaDataMap metaData_

Additional Inherited Members

Protected Member Functions inherited from inviwo::Data< Volume, VolumeRepresentation >
decltype(auto) getLastOr (F &&f, T &&fallback) const
Data< Volume, VolumeRepresentation > & operator= (const Data< Volume, VolumeRepresentation > &that)
void setLastAndInvalidateOther (F &&f, T &&value)

Detailed Description

Data structure for volumetric data in form of a structured three-dimensional grid. Basis and offset determine the position and extent of the volume in model space. Skewed volumes are represented by providing a non-orthogonal basis.

In case a volume was loaded via VolumeSource or Volume, the filename of the source data is available via MetaData.

Constructor & Destructor Documentation

◆ Volume()

inviwo::Volume::Volume ( const Volume & rhs,
NoData noData,
const VolumeConfig & config = {} )

Create a volume based on rhs without copying any data. State from rhs can be overridden by the config

Parameters
rhssource volume providing the necessary information like dimensions, swizzle masks, interpolation, spatial transformations, etc.
noDataTag type to indicate that representations should not be copied from rhs
configcustom parameters overriding values from rhs

Member Function Documentation

◆ clone()

virtual Volume * inviwo::Volume::clone ( ) const
overridevirtual

◆ getAxis()

virtual const Axis * inviwo::Volume::getAxis ( size_t index) const
overridevirtual

returns the axis information corresponding to index

Returns
nullptr if there is no axis for index

Implements inviwo::SpatialEntity.

◆ getDimensions()

virtual size3_t inviwo::Volume::getDimensions ( ) const
overridevirtual

◆ getWorldSpaceGradientSpacing()

vec3 inviwo::Volume::getWorldSpaceGradientSpacing ( ) const

Computes the spacing to be used for gradient computation. Also works for volume with non-orthogonal basis.

For orthogonal lattices this will be equal to the world space voxel spacing. For non-orthogonal lattices it will be the longest of the axes projected onto the world space axes.

   World space

    b ^           ^
     /            |

y ^ / dy | / Voxel | | /__________>a \/ | <-—dx---> |____________> x

The actual gradient spacing vectors are given by mat3{ gradientSpacing.x, 0, 0, 0, gradientSpacing.y, 0, 0, 0, gradientSpacing.z } However, we do not return the zeroes.

To get the spacing in texture space use: mat3(glm::scale(worldToTextureMatrix, getWorldSpaceGradientSpacing()));

Returns
Step size for gradient computation in world space.

◆ setDataFormat()

void inviwo::Volume::setDataFormat ( const DataFormatBase * format)

Set the default data format. Existing representations will not be affected.

Note
Only useful before any representations have been created.
See also
DataFormatBase
Parameters
formatThe format of the data.

◆ setDimensions()

virtual void inviwo::Volume::setDimensions ( const size3_t & dim)
virtual

Resize to dimension. This is destructive, the data will not be preserved.

Note
Resizes the last valid representation and erases all representations. Last valid representation will remain valid after changing the dimension.

◆ setSwizzleMask()

void inviwo::Volume::setSwizzleMask ( const SwizzleMask & mask)

update the swizzle mask of the color channels when sampling the volume

Parameters
masknew swizzle mask

The documentation for this class was generated from the following file:
  • include/inviwo/core/datastructures/volume/volume.h