|
Public Types |
enum | NeighborEnum {
LEFT,
RIGHT,
FRONT,
BACK,
BELOW,
ABOVE,
NUM_NEIGHBORS = 6
} |
| Which neightbor cell/voxel are we talking about. In order then are x-axis less, x more, y less, y more, z less, z more. More...
|
Public Member Functions |
| Density () |
| Contructor that does almost nothing. FIX: Can we get rid of this?
|
| Density (const size_t width, const size_t height, const size_t depth, const float minX, const float maxX, const float minY, const float maxY, const float minZ, const float maxZ) |
| Create a voxel space of widht,height, and depth number of cells.
|
| Density (const std::string &filename, bool &ok) |
| Load a vol file from disk.
|
void | resize (const size_t width, const size_t height, const size_t depth, const float minX, const float maxX, const float minY, const float maxY, const float minZ, const float maxZ) |
| Change the volumes size. Dumps all counts. Does not shrink memory footprint if smaller.
|
void | rescale (const float minX, const float maxX, const float minY, const float maxY, const float minZ, const float maxZ) |
| Change the volume range/scale. Does not destroy the data. Just where we think it lives.
|
bool | addPoint (const float x, const float y, const float z) |
void | addPoints (const size_t index, const size_t count) |
| Add points to a cell at index.
|
void | printCellCounts () const |
| Print to stdout the cell number and the count.
|
size_t | getWidth () const |
| num of cells wide
|
size_t | getHeight () const |
| num of cells tall
|
size_t | getDepth () const |
| num of cell front to back
|
size_t | getSize () const |
| How many voxels in this density space?
|
size_t | getCountInside () const |
| How many points so far have been added that actually fall in the voxels' volumes.
|
size_t | getCountOutside () const |
| How many points failed to get added with addPoint().
|
size_t | getCell (const float x, const float y, const float z) const |
| Which cell number a point in space goes to.
|
bool | isValidCell (const size_t i) const |
size_t | getCellX (const float x) const |
size_t | getCellY (const float y) const |
size_t | getCellZ (const float z) const |
void | getCellXYZ (const size_t index, size_t &cx, size_t &cy, size_t &cz) const |
size_t | getCellFromWHD (const size_t xIndex, const size_t yIndex, const size_t zIndex) const |
size_t | getCellNeighbor (const size_t i, NeighborEnum which) const |
| returns badValue if the neighbor is outside of the volume
|
void | getCellCenter (const size_t cellNum, float &x, float &y, float &z) const |
| Given a cell index number, what is the location of the center?
|
size_t | getCellCount (size_t i) const |
| How many points have been added to a cell?
|
float | getDX () const |
| How wide is one cell.
|
float | getDY () const |
| How heigh is one cell.
|
float | getDZ () const |
| How deep is one cell.
|
bool | writeVolScale (const std::string &filename) const |
| Write out a vol formatted file for SIM Voleon in uchar format.
|
size_t | scaleValue (const size_t value, const PackType p, const size_t bitsPerVoxel) const |
| Compress data based on PackType.
|
bool | writeVol (const std::string &filename, const size_t bitsPerPixel, const PackType p) const |
| Write out a Voleon style voxel 3D cell file.
|
bool | writeVol (const std::string &filename, const size_t bitsPerVoxel, const PackType p, const float scaleX, const float scaleY, const float scaleZ, const float rotX=0.f, const float rotY=0.f, const float rotZ=0.f) const |
| Write out a Voleon style voxel 3D cell file.
|
unsigned char | scaleCount (const size_t i, const size_t min, const size_t max) const |
| Return a number scaled between 0 and 255.
|
bool | buildCDF (std::vector< float > &cdfpercent) const |
| fill two vectors with the count and the percent. Both will be of size getMaxCount()
|
size_t | getMaxCount () const |
| What is the maximum count in one cell across the whole count vector?
|
size_t | getMinCount () const |
| What is the minimum count in one cell across the whole count vector?
|
Static Public Member Functions |
static size_t | badValue () |
| This is the value for an unknown or bad entry. Should be a huge number that we would never encounter.
|
Private Member Functions |
void | invalidateCache () |
void | computeMinMax () const |
Private Attributes |
bool | stale |
| set to true when max and min have to be recomputed
|
size_t | maxCache |
size_t | minCache |
size_t | width |
| width in number of cells
|
size_t | height |
| height in number of cells
|
size_t | depth |
| depth in number of cells
|
float | dx |
| Cell size.
|
float | dy |
| Cell size.
|
float | dz |
| Cell size.
|
float | xR [2] |
| min,max x Range of the voxel bounding box
|
float | yR [2] |
| min,max y Range of the voxel bounding box
|
float | zR [2] |
| min,max z Range of the voxel bounding box
|
std::vector< size_t > | counts |
| number of points in each voxel
|
size_t | totalPointsInside |
| Does not include points that were outside!
|
size_t | totalPointsOutside |
| How many points have failed to add since they were outside the volume.
|