CTL
0.6.1
Computed Tomography Library
|
The LinearDynamicVolume class is an implementation of AbstractDynamicVolumeData with a linear relation of the attenuation values of each voxel. More...
#include <lineardynamicvolume.h>
Public Member Functions | |
SpectralVolumeData * | clone () const override |
LinearDynamicVolume (float slope, float offset, const VoxelVolume< float >::Dimensions &nbVoxel, const VoxelVolume< float >::VoxelSize &voxelSize) | |
LinearDynamicVolume (VoxelVolume< float > slope, VoxelVolume< float > offset, const VoxelVolume< float >::VoxelSize &voxelSize) | |
LinearDynamicVolume (VoxelVolume< float > slope, VoxelVolume< float > offset) | |
XYDataSeries | timeCurve (uint x, uint y, uint z, const std::vector< float > &timePoints) override |
virtual XYDataSeries | timeCurve (uint x, uint y, uint z, const std::vector< float > &timePoints) |
XYDataSeries | timeCurve (uint x, uint y, uint z, float tStart, float tEnd, uint nbSamples) |
XYDataSeries | timeCurve (uint x, uint y, uint z, SamplingRange timeRange, uint nbSamples) |
![]() | |
AbstractDynamicVolumeData (const SpectralVolumeData &other) | |
void | setTime (double seconds) |
double | time () const |
XYDataSeries | timeCurve (uint x, uint y, uint z, float tStart, float tEnd, uint nbSamples) |
XYDataSeries | timeCurve (uint x, uint y, uint z, SamplingRange timeRange, uint nbSamples) |
![]() | |
SpectralVolumeData (VoxelVolume< float > muValues) | |
Constructs a SpectralVolumeData representing the attenuation coefficients muValues (in 1/mm). More... | |
SpectralVolumeData (VoxelVolume< float > muValues, std::shared_ptr< AbstractIntegrableDataModel > absorptionModel, float referenceEnergy, const QString &materialName=QString()) | |
Constructs a SpectralVolumeData representing the attenuation coefficients muValues (in 1/mm) with respect to the given referenceEnergy (in keV) for a material described by absorptionModel. More... | |
SpectralVolumeData (VoxelVolume< float > materialDensity, std::shared_ptr< AbstractIntegrableDataModel > absorptionModel, const QString &materialName=QString()) | |
Constructs a SpectralVolumeData representing the density values materialDensity (in g/cm^3) for a material described by absorptionModel. More... | |
std::shared_ptr< AbstractIntegrableDataModel > | absorptionModel () const |
std::unique_ptr< SpectralVolumeData > | densityVolume () const |
bool | hasSpectralInformation () const |
bool | isDensityVolume () const |
bool | isMuVolume () const |
float | massAttenuationCoeff (float atEnergy) const |
const QString & | materialName () const |
float | meanMassAttenuationCoeff (float centerEnergy, float binWidth) const |
std::unique_ptr< SpectralVolumeData > | muVolume (float referenceEnergy) const |
std::unique_ptr< SpectralVolumeData > | muVolume (float centerEnergy, float binWidth) const |
float | referenceEnergy () const |
float | referenceMassAttenuationCoeff () const |
void | replaceAbsorptionModel (AbstractIntegrableDataModel *absorptionModel) |
void | replaceAbsorptionModel (std::shared_ptr< AbstractIntegrableDataModel > absorptionModel) |
void | setDensity (VoxelVolume< float > density) |
void | setMaterialName (const QString &name) |
SpectralVolumeData (const SpectralVolumeData &)=default | |
SpectralVolumeData (SpectralVolumeData &&)=default | |
SpectralVolumeData & | operator= (const SpectralVolumeData &)=default |
SpectralVolumeData & | operator= (SpectralVolumeData &&)=default |
void | transformToAttenuationCoeff (float referenceEnergy) |
void | transformToDensity () |
![]() | |
iterator | begin () |
const_iterator | begin () const |
iterator | end () |
const_iterator | end () const |
const_iterator | cbegin () const |
const_iterator | cend () const |
reverse_iterator | rbegin () |
const_reverse_iterator | rbegin () const |
reverse_iterator | rend () |
const_reverse_iterator | rend () const |
const_reverse_iterator | crbegin () const |
const_reverse_iterator | crend () const |
VoxelVolume (const Dimensions &nbVoxels) | |
VoxelVolume (const Dimensions &nbVoxels, const VoxelSize &voxelSize) | |
VoxelVolume (uint nbVoxelX, uint nbVoxelY, uint nbVoxelZ) | |
VoxelVolume (uint nbVoxelX, uint nbVoxelY, uint nbVoxelZ, float xSize, float ySize, float zSize) | |
VoxelVolume (const Dimensions &nbVoxels, std::vector< float > data) | |
VoxelVolume (const Dimensions &nbVoxels, const VoxelSize &voxelSize, std::vector< float > data) | |
VoxelVolume (uint nbVoxelX, uint nbVoxelY, uint nbVoxelZ, std::vector< float > data) | |
VoxelVolume (uint nbVoxelX, uint nbVoxelY, uint nbVoxelZ, float xSize, float ySize, float zSize, std::vector< float > data) | |
VoxelVolume (const VoxelVolume &)=default | |
VoxelVolume (VoxelVolume &&)=default | |
VoxelVolume & | operator= (const VoxelVolume &)=default |
VoxelVolume & | operator= (VoxelVolume &&)=default |
size_t | allocatedElements () const |
const std::vector< float > & | constData () const |
const std::vector< float > & | data () const |
std::vector< float > & | data () |
const Dimensions & | dimensions () const |
bool | hasData () const |
const Dimensions & | nbVoxels () const |
const Offset & | offset () const |
float * | rawData () |
const float * | rawData () const |
size_t | totalVoxelCount () const |
const VoxelSize & | voxelSize () const |
void | setData (std::vector< float > &&data) |
void | setData (const std::vector< float > &data) |
void | setVolumeOffset (const Offset &offset) |
void | setVolumeOffset (float xOffset, float yOffset, float zOffset) |
void | setVoxelSize (const VoxelSize &size) |
void | setVoxelSize (float xSize, float ySize, float zSize) |
void | setVoxelSize (float isotropicSize) |
void | allocateMemory () |
void | allocateMemory (const float &initValue) |
VoxelCoordinates | coordinates (const VoxelIndex &index) const |
VoxelCoordinates | coordinates (uint x, uint y, uint z) const |
VoxelCoordinates | cornerVoxel () const |
VoxelIndex | index (const VoxelCoordinates &coordinates) const |
VoxelIndex | index (float x_mm, float y_mm, float z_mm) const |
bool | isIsotropic () const |
void | fill (const float &fillValue) |
void | freeMemory () |
float | max () const |
float | min () const |
VoxelVolume< float > | reslicedByX (bool reverse=false) const |
VoxelVolume< float > | reslicedByY (bool reverse=false) const |
VoxelVolume< float > | reslicedByZ (bool reverse=false) const |
Chunk2D< float > | sliceX (uint slice) const |
Chunk2D< float > | sliceY (uint slice) const |
Chunk2D< float > | sliceZ (uint slice) const |
float | smallestVoxelSize () const |
VoxelCoordinates | volumeCorner () const |
std::vector< float >::reference | operator() (uint x, uint y, uint z) |
std::vector< float >::const_reference | operator() (uint x, uint y, uint z) const |
std::vector< float >::reference | operator() (const VoxelIndex &index) |
std::vector< float >::const_reference | operator() (const VoxelIndex &index) const |
VoxelVolume< float > & | operator+= (const VoxelVolume< float > &other) |
VoxelVolume< float > & | operator+= (const float &additiveShift) |
VoxelVolume< float > & | operator-= (const VoxelVolume< float > &other) |
VoxelVolume< float > & | operator-= (const float &subtractiveShift) |
VoxelVolume< float > & | operator *= (const float &factor) |
VoxelVolume< float > & | operator/= (const float &divisor) |
VoxelVolume< float > | operator+ (const VoxelVolume< float > &other) const |
VoxelVolume< float > | operator+ (const float &additiveShift) const |
VoxelVolume< float > | operator- (const VoxelVolume< float > &other) const |
VoxelVolume< float > | operator- (const float &subtractiveShift) const |
VoxelVolume< float > | operator * (const float &factor) const |
VoxelVolume< float > | operator/ (const float &divisor) const |
Static Public Member Functions | |
static LinearDynamicVolume | ball (float radius, float voxelSize, float slope, float offset) |
static LinearDynamicVolume | cube (uint nbVoxel, float voxelSize, float slope, float offset) |
static LinearDynamicVolume | cylinderX (float radius, float height, float voxelSize, float slope, float offset) |
static LinearDynamicVolume | cylinderY (float radius, float height, float voxelSize, float slope, float offset) |
static LinearDynamicVolume | cylinderZ (float radius, float height, float voxelSize, float slope, float offset) |
![]() | |
static SpectralVolumeData | ball (float radius, float voxelSize, float density, std::shared_ptr< AbstractIntegrableDataModel > absorptionModel) |
static SpectralVolumeData | cube (uint nbVoxel, float voxelSize, float density, std::shared_ptr< AbstractIntegrableDataModel > absorptionModel) |
static SpectralVolumeData | cylinderX (float radius, float height, float voxelSize, float density, std::shared_ptr< AbstractIntegrableDataModel > absorptionModel) |
static SpectralVolumeData | cylinderY (float radius, float height, float voxelSize, float density, std::shared_ptr< AbstractIntegrableDataModel > absorptionModel) |
static SpectralVolumeData | cylinderZ (float radius, float height, float voxelSize, float density, std::shared_ptr< AbstractIntegrableDataModel > absorptionModel) |
static SpectralVolumeData | fromMuVolume (VoxelVolume< float > muValues, std::shared_ptr< AbstractIntegrableDataModel > absorptionModel, float referenceEnergy=50.0f) |
static SpectralVolumeData | fromHUVolume (VoxelVolume< float > HUValues, std::shared_ptr< AbstractIntegrableDataModel > absorptionModel, float referenceEnergy=50.0f) |
![]() | |
static VoxelVolume< float > | fromChunk2DStack (const std::vector< Chunk2D< float >> &stack) |
static VoxelVolume< float > | ball (float radius, float voxelSize, const float &fillValue) |
static VoxelVolume< float > | cube (uint nbVoxel, float voxelSize, const float &fillValue) |
static VoxelVolume< float > | cylinderX (float radius, float height, float voxelSize, const float &fillValue) |
static VoxelVolume< float > | cylinderY (float radius, float height, float voxelSize, const float &fillValue) |
static VoxelVolume< float > | cylinderZ (float radius, float height, float voxelSize, const float &fillValue) |
Protected Member Functions | |
void | updateVolume () override |
![]() | |
AbstractDynamicVolumeData (const AbstractDynamicVolumeData &)=default | |
AbstractDynamicVolumeData (AbstractDynamicVolumeData &&)=default | |
AbstractDynamicVolumeData & | operator= (const AbstractDynamicVolumeData &)=default |
AbstractDynamicVolumeData & | operator= (AbstractDynamicVolumeData &&)=default |
Private Attributes | |
VoxelVolume< float > | _lag |
VoxelVolume< float > | _slope |
Additional Inherited Members | |
![]() | |
using | Dimensions = VoxelVolumeDimensions |
using | VoxelSize = VoxelVolumeVoxelSize |
using | Offset = VoxelVolumeOffset |
using | iterator = VoxelIterator< typename std::vector< float >::iterator > |
using | const_iterator = VoxelIterator< typename std::vector< float >::const_iterator > |
using | reverse_iterator = std::reverse_iterator< iterator > |
using | const_reverse_iterator = std::reverse_iterator< const_iterator > |
![]() | |
Dimensions | _dim |
The dimensions of the volume. | |
VoxelSize | _size |
The size of individual voxels (in mm). | |
Offset | _offset |
The positional offset of the volume (in mm). | |
std::vector< float > | _data |
The internal data of the volume. | |
The LinearDynamicVolume class is an implementation of AbstractDynamicVolumeData with a linear relation of the attenuation values of each voxel.
The following example code shows how to create a ball whose attenuation values increase linearly over time as well as a cubic volume holding linearly decreasing values:
CTL::LinearDynamicVolume::LinearDynamicVolume | ( | VoxelVolume< float > | slope, |
VoxelVolume< float > | offset, | ||
const VoxelVolume< float >::VoxelSize & | voxelSize | ||
) |
Constructs a LinearDynamicVolume with linear relation for the attenuation coefficients in each voxel \(\mu(x,y,z)\) specified by slope and offset, corresponding to:
\( \mu(x,y,z) = t \cdot slope(x,y,z) + offset(x,y,z) \), where \(t\) denotes the time point set via setTime() in milliseconds.
The voxel size is set to voxelSize. Note that the number of voxels in slope and offset must be equal; throws an exception otherwise.
CTL::LinearDynamicVolume::LinearDynamicVolume | ( | VoxelVolume< float > | slope, |
VoxelVolume< float > | offset | ||
) |
Constructs a LinearDynamicVolume with linear relation for the attenuation coefficients in each voxel \(\mu(x,y,z)\) specified by slope and offset, corresponding to:
\( \mu(x,y,z) = t \cdot slope(x,y,z) + offset(x,y,z) \), where \(t\) denotes the time point set via setTime() in milliseconds.
The voxel size is taken from slope. Note that both the number of voxels and the voxel size in slope and offset must be equal; throws an exception otherwise.
|
static |
Constructs a LinearDynamicVolume volume with voxels of isotropic dimensions voxelSize (in mm) All voxels inside a ball of radius radius (in mm) around the center of the volume will follow a linear relation for their attenuation values of:
\( \mu(x,y,z) = t \cdot slope + offset \), where \(t\) denotes the time point set via setTime() in milliseconds.
The voxels surrounding the ball are filled with zeros.
The resulting volume will have \( \left\lceil 2\cdot radius/voxelSize\right\rceil \) voxels in each dimension.
|
static |
Constructs a cubic LinearDynamicVolume volume with nbVoxel x nbVoxel x nbVoxel voxels (voxel dimension: voxelSize x voxelSize x voxelSize). All voxels will follow a linear relation for their attenuation values of:
\( \mu(x,y,z) = t \cdot slope + offset \), where \(t\) denotes the time point set via setTime() in milliseconds.
|
static |
Constructs a LinearDynamicVolume volume with voxels of isotropic dimensions voxelSize (in mm) All voxels inside a cylinder of radius radius (in mm) and height height (in mm) aligned with the x-axis will follow a linear relation for their attenuation values of:
\( \mu(x,y,z) = t \cdot slope + offset \), where \(t\) denotes the time point set via setTime() in milliseconds.
The voxels surrounding the ball are filled with zeros.
The resulting volume will have \( \left\lceil 2\cdot radius/voxelSize\right\rceil \) voxels in y- and z-dimension and \( \left\lceil height/voxelSize\right\rceil \) in x-direction.
|
static |
Constructs a LinearDynamicVolume volume with voxels of isotropic dimensions voxelSize (in mm) All voxels inside a cylinder of radius radius (in mm) and height height (in mm) aligned with the y-axis will follow a linear relation for their attenuation values of:
\( \mu(x,y,z) = t \cdot slope + offset \), where \(t\) denotes the time point set via setTime() in milliseconds.
The voxels surrounding the ball are filled with zeros.
The resulting volume will have \( \left\lceil 2\cdot radius/voxelSize\right\rceil \) voxels in x- and z-dimension and \( \left\lceil height/voxelSize\right\rceil \) in y-direction.
|
static |
Constructs a LinearDynamicVolume volume with voxels of isotropic dimensions voxelSize (in mm) All voxels inside a cylinder of radius radius (in mm) and height height (in mm) aligned with the z-axis will follow a linear relation for their attenuation values of:
\( \mu(x,y,z) = t \cdot slope + offset \), where \(t\) denotes the time point set via setTime() in milliseconds.
The voxels surrounding the ball are filled with zeros.
The resulting volume will have \( \left\lceil 2\cdot radius/voxelSize\right\rceil \) voxels in x- and y-dimension and \( \left\lceil height/voxelSize\right\rceil \) in z-direction.
|
overridevirtual |
Returns the data series containing the data of voxel (x, y, z) at the time points specified in timePoints (to be specified in ms):
\( \mu(x,y,z;t) = t \cdot slope(x,y,z) + offset(x,y,z) \quad \forall t \in timePoints\)
Reimplemented from CTL::AbstractDynamicVolumeData.
|
inline |
Convenience alternative of timeCurve(uint, uint, uint, const std::vector<float>&).
Returns the time series sampled at nbSamples equally-spaced positions within the interval [tStart, tEnd] (in ms).
|
inline |
Returns the data series containing the data of voxel (x, y, z) at the time points specified in timePoints (to be specified in ms).
Note that this is a highly inefficient implementation that requires updating the entire volume for each requested time point using updateVolume(). Make sure to override this method in sub- classes to use more efficient ways of evaluating values of the requested voxel alone, if possible.
|
inline |
Convenience alternative of timeCurve(uint, uint, uint, const std::vector<float>&).
Returns the time series sampled at nbSamples equally-spaced positions within the interval specified by timeRange.
Same as:
|
overrideprotectedvirtual |
Sets the voxels to the values given by the linear relation:
\( \mu(x,y,z) = t \cdot slope(x,y,z) + offset(x,y,z) \), where \(t\) denotes the time point set via setTime() in milliseconds.
Implements CTL::AbstractDynamicVolumeData.