#include <VolumeData.h>
Public Member Functions | |
const std::vector< unsigned char > & | get2dHistogram () const |
int | get2dHistogramSize () const |
const unsigned short * | getData () const |
const std::vector< int > & | getGradientHistogram () const |
GLuint | getGradientTexture () const |
const std::vector< int > & | getHistogram () const |
int | getMaxDimension () const |
int | getMaxGradientHistogramValue () const |
int | getMaxHistogramValue () const |
const Eigen::Vector< int, 3 > & | getOriginalDimension () const |
GLuint | getTexture () const |
const Eigen::Vector< int, 3 > & | getTextureDimension () const |
unsigned short | getValueAt (int x, int y, int z) const |
unsigned short | getValueAt (Eigen::Vector< int, 3 > &pos) const |
bool | isEmpty () const |
void | load (const std::string &filePath, QProgressBar *progressBar=0) |
VolumeData () | |
~VolumeData () |
VolVis::VolumeRendering::VolumeData::VolumeData | ( | ) |
Constructor. Sets the dimensions and data to zero.
VolVis::VolumeRendering::VolumeData::~VolumeData | ( | ) |
Destructor. Deletes the texture in gpu and the volume data.
const std::vector<unsigned char>& VolVis::VolumeRendering::VolumeData::get2dHistogram | ( | ) | const |
Returns the values of the 2d histogram which are sorted to intensity values and gradient magnitude values.
int VolVis::VolumeRendering::VolumeData::get2dHistogramSize | ( | ) | const |
Returns the resolution of the 2d histogram (which is the same for both directions)
const unsigned short* VolVis::VolumeRendering::VolumeData::getData | ( | ) | const |
Returns a pointer to the array containing the data.
const std::vector<int>& VolVis::VolumeRendering::VolumeData::getGradientHistogram | ( | ) | const |
Returns the 2dimensional histogram. x-axis = intensity, y-axis = gradient
GLuint VolVis::VolumeRendering::VolumeData::getGradientTexture | ( | ) | const |
Returns the texture id of the gradient texture (3d texture)
const std::vector<int>& VolVis::VolumeRendering::VolumeData::getHistogram | ( | ) | const |
Returns the vector containing the histogram values (4096 values)
int VolVis::VolumeRendering::VolumeData::getMaxDimension | ( | ) | const |
The dimension of the longest side.
int VolVis::VolumeRendering::VolumeData::getMaxGradientHistogramValue | ( | ) | const |
Returns the maximum value of the histogram for the gradient magnitude values.
int VolVis::VolumeRendering::VolumeData::getMaxHistogramValue | ( | ) | const |
Returns the maximum value of the histogram, which is the number of occurences of the popular density value in the volume.
const Eigen::Vector<int,3>& VolVis::VolumeRendering::VolumeData::getOriginalDimension | ( | ) | const |
Returns the dimensions of the volume in x,y and z-direction like stored in a volume file.
GLuint VolVis::VolumeRendering::VolumeData::getTexture | ( | ) | const |
Returns the texture id of the 3d-texture
const Eigen::Vector<int,3>& VolVis::VolumeRendering::VolumeData::getTextureDimension | ( | ) | const |
Returns the dimensions of the texture representing the volume. 2^n
unsigned short VolVis::VolumeRendering::VolumeData::getValueAt | ( | int | x, | |
int | y, | |||
int | z | |||
) | const |
Returns the value of a voxel at the specified position.
x | x-coordinate | |
y | y-coordinate | |
z | z-coordinate |
unsigned short VolVis::VolumeRendering::VolumeData::getValueAt | ( | Eigen::Vector< int, 3 > & | pos | ) | const |
Returns the value of a voxel at the specified position.
pos | 3d-coordinate of the voxel. |
bool VolVis::VolumeRendering::VolumeData::isEmpty | ( | ) | const |
Checks if volume data is loaded.
void VolVis::VolumeRendering::VolumeData::load | ( | const std::string & | filePath, | |
QProgressBar * | progressBar = 0 | |||
) |
Loads the volume data from a file. Extracts the dimension of the volume and the voxel data itself. The voxel data is stored in an unsigned short array and is mapped to a 2^n-sized 3d-texture. This method also extracts the histogram and stores it in an array with all possible 4096 values. If already a volume is stored in the object, it will be deleted before loading the new one.
filePath | path to the file containing the volume data | |
progressBar | the QT progress bar which should be updated from 0 at beginning to 100 percent when the file is fully loaded |