I need to store a floating number (the scattering-density) for each of my 3D voxel. The number of voxels along coordinate axis are about 200 (x), 200 (y), 100 (x), for a total of 200x200x100 voxels.
Then I need to play with density for analysis (e.g. find the local maximum, the mean in 3x3 voxels, etc).
What's the best way to store the variables?
Creating a multidimensional array, like
float voxels[200][200][100];
and then store values:
voxel[x][y][z]=density
is not the best solution, in term of performance.....
If there are some known patterns in the voxel distribution, then we may go for storing the common blocks in a compressed format. For example, if the nature of the distribution is known to be sparse, then we can go for a sparse matrix representation.
I don't think this trivial answer helps in any manner. Just tried! :)
"An octree is a tree data structure in which each internal node has up to eight children. Octrees are most often used to partition a three dimensional space by recursively subdividing it into eight octants. Octrees are the three-dimensional analog of quadtrees. The name is formed from oct + tree, and normally written "octree", not "octtree"."
From Wikipedia, the free encyclopedia