Carna  Version 3.3.2
Public Types | Public Member Functions | Static Public Member Functions | Protected Attributes | List of all members
Carna::base::BufferedHUVolume< VoxelType, BufferType > Class Template Reference

Implements HUVolume generically for a particular VoxelType. More...

#include <BufferedHUVolume.h>

+ Inheritance diagram for Carna::base::BufferedHUVolume< VoxelType, BufferType >:
+ Collaboration diagram for Carna::base::BufferedHUVolume< VoxelType, BufferType >:

Public Types

typedef BufferType Buffer
 Holds the used buffer type.
 
typedef VoxelType Voxel
 Holds the type used to store the value of a single voxel.
 
- Public Types inherited from Carna::base::math::VectorField< HUV >
typedef HUV Value
 Holds the co-domain type of the vector field.
 

Public Member Functions

 BufferedHUVolume (const math::Vector3ui &size, Association< BufferType > *buffer)
 Instantiates \(D \to \left[-1024, 3071\right]\) with \(D = [0, s_x) \times [0, s_y) \times [0, s_z)\), where \(s_x, s_y, s_z\) is size. More...
 
 BufferedHUVolume (const math::Vector3ui &size)
 
HUV operator() (unsigned int x, unsigned int y, unsigned int z) const
 Returns HUV of specified voxel.
 
HUV operator() (const math::Vector3ui &at) const
 Returns HUV of specified voxel.
 
void setVoxel (unsigned int x, unsigned int y, unsigned int z, HUV huv)
 Sets the HUV of a voxel.
 
void setVoxel (const math::Vector3ui &at, HUV huv)
 Sets the HUV of a voxel.
 
BufferType & buffer ()
 References the underlying buffer.
 
const BufferType & buffer () const
 References the underlying buffer.
 
- Public Member Functions inherited from Carna::base::HUVolume
 HUVolume ()
 Instantiates.
 
 HUVolume (const math::Vector3ui &size)
 Instantiates.
 
- Public Member Functions inherited from Carna::base::math::VectorField< HUV >
virtual ~VectorField ()
 Does nothing.
 

Static Public Member Functions

static HUV bufferValueToHUV (VoxelType bufferValue)
 Returns the HU value corresponding to bufferValue.
 
static VoxelType HUVToBufferValue (HUV huValue)
 Returns the buffer value corresponding to huValue.
 

Protected Attributes

const std::unique_ptr< Association< BufferType > > myBuffer
 Holds the underlying buffer. More...
 

Additional Inherited Members

- Public Attributes inherited from Carna::base::HUVolume
math::Vector3ui size
 Holds the resolution.
 

Detailed Description

template<typename VoxelType, typename BufferType>
class Carna::base::BufferedHUVolume< VoxelType, BufferType >

Implements HUVolume generically for a particular VoxelType.

Invariant
sizeof(VoxelType) >= 2
Parameters
VoxelTypeis the data type used to store the value of a single voxel.
BufferTypeis the data type used as voxel container.
Author
Leonid Kostrykin
Date
2011 - 2015

Definition at line 49 of file BufferedHUVolume.h.

Constructor & Destructor Documentation

◆ BufferedHUVolume() [1/2]

template<typename VoxelType , typename BufferType >
Carna::base::BufferedHUVolume< VoxelType, BufferType >::BufferedHUVolume ( const math::Vector3ui size,
Association< BufferType > *  buffer 
)
inline

Instantiates \(D \to \left[-1024, 3071\right]\) with \(D = [0, s_x) \times [0, s_y) \times [0, s_z)\), where \(s_x, s_y, s_z\) is size.

Precondition
buffer != nullptr && buffer->get() != nullptr
(**buffer).size() >= size.x * size.y * size.z

Definition at line 72 of file BufferedHUVolume.h.

◆ BufferedHUVolume() [2/2]

template<typename VoxelType , typename BufferType >
Carna::base::BufferedHUVolume< VoxelType, BufferType >::BufferedHUVolume ( const math::Vector3ui size)
inlineexplicit

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 81 of file BufferedHUVolume.h.

Member Data Documentation

◆ myBuffer

template<typename VoxelType , typename BufferType >
const std::unique_ptr< Association< BufferType > > Carna::base::BufferedHUVolume< VoxelType, BufferType >::myBuffer
protected

Holds the underlying buffer.

The voxels are written \(x\)- \(y\)-plane wise, each plane \(x\)-row wise. To compute the index of some voxel \(\left(x, y, z\right)\), use the following computation rule:

\[ x + \mathrm{width} \cdot y + \mathrm{height} \cdot \mathrm{width} \cdot z \]

Definition at line 168 of file BufferedHUVolume.h.


The documentation for this class was generated from the following file: