Class which represents a voxel grid.
More...
#include <voxel_grid.h>
|
| VoxelGrid (std::string filename, bool is_python_environment=false) |
| Constructor for the VoxelGrid class.
|
|
Voxel & | getVoxel (const Eigen::Vector3i &voxel_index) |
| Gets the voxel at (i, j, k).
|
|
void | setVoxel (const Eigen::Vector3i &voxel_index, Voxel &value) |
| Sets the voxel at (i, j, k) to specified voxel.
|
|
Eigen::Vector3d | getVoxelPosition (const Eigen::Vector3i &voxel_index) |
| Gets the spatial position of the voxel at (i, j, k).
|
|
bool | withinGrid (const Eigen::Vector3d &position) const |
| Checks if a spatial position is within the voxel grid.
|
|
Eigen::Vector3i | getVoxelIndex (const Eigen::Vector3d &position) const |
| Gets the voxel index of a spatial position.
|
|
std::vector< std::string > | getMaterialNames () const |
| Gets vector of material names in voxel grid.
|
|
double | getTotalEnergyDeposited () |
| Gets the total energy deposited in the voxel grid.
|
|
std::unordered_map< int, VectorValue > | getEnergyDepositedInMaterials () |
| Gets the total energy deposited in the voxel grid by material.
|
|
void | addExit () |
| Adds to the number of photons that have exited the voxel grid.
|
|
int | getNumExits () const |
| Gets the number of photons that have exited the voxel grid.
|
|
Eigen::Vector3d | getDimSpace () const |
| Gets the spatial dimensions of the voxel grid.
|
|
|
void | initializeVoxels () |
|
int | voxelNumber (const Eigen::Vector3i &voxel_index) const |
|
void | handleOutOfBounds (const Eigen::Vector3d &position) const |
|
void | setVoxelProperties (const py::array_t< uint8_t > &array, const py::object &header) |
|
void | setDimVox (const py::array_t< uint8_t > &array) |
|
void | setUnits (const py::object &header) |
|
void | setSpacing (const py::object &header) |
|
void | setNumOfVoxels () |
|
void | setDimSpace () |
|
void | setVoxelMaterialIDs (const py::array_t< uint8_t > &array) |
|
|
static py::array_t< uint8_t > | getNumPyArrayFromImg (const py::object &img) |
|
Class which represents a voxel grid.
Stores the voxels and the properties of the voxel grid.
Definition at line 28 of file voxel_grid.h.
◆ VoxelGrid()
VoxelGrid::VoxelGrid |
( |
std::string | filename, |
|
|
bool | is_python_environment = false ) |
|
explicit |
Constructor for the VoxelGrid class.
- Parameters
-
dim_vox | The dimensions of the voxel grid in voxels. |
is_python_environment | Whether or not the VoxelGrid is being constructed in a Python environment. Only True for python wrapper only. |
◆ addExit()
void VoxelGrid::addExit |
( |
| ) |
|
|
inline |
Adds to the number of photons that have exited the voxel grid.
Definition at line 100 of file voxel_grid.h.
◆ getDimSpace()
Eigen::Vector3d VoxelGrid::getDimSpace |
( |
| ) |
const |
|
inline |
Gets the spatial dimensions of the voxel grid.
- Returns
- vector of spatial dimensions of the voxel grid
Definition at line 116 of file voxel_grid.h.
◆ getEnergyDepositedInMaterials()
std::unordered_map< int, VectorValue > VoxelGrid::getEnergyDepositedInMaterials |
( |
| ) |
|
Gets the total energy deposited in the voxel grid by material.
- Returns
- unordered map of material name to total energy deposited in the voxel grid by material (eV)
◆ getMaterialNames()
std::vector< std::string > VoxelGrid::getMaterialNames |
( |
| ) |
const |
Gets vector of material names in voxel grid.
- Returns
- vector of material names in voxel grid
◆ getNumExits()
int VoxelGrid::getNumExits |
( |
| ) |
const |
|
inline |
Gets the number of photons that have exited the voxel grid.
- Returns
- number of photons that have exited the voxel grid
Definition at line 108 of file voxel_grid.h.
◆ getTotalEnergyDeposited()
double VoxelGrid::getTotalEnergyDeposited |
( |
| ) |
|
Gets the total energy deposited in the voxel grid.
- Returns
- total energy deposited in the voxel grid (eV)
◆ getVoxel()
Voxel & VoxelGrid::getVoxel |
( |
const Eigen::Vector3i & | voxel_index | ) |
|
Gets the voxel at (i, j, k).
- Parameters
-
- Returns
◆ getVoxelIndex()
Eigen::Vector3i VoxelGrid::getVoxelIndex |
( |
const Eigen::Vector3d & | position | ) |
const |
Gets the voxel index of a spatial position.
- Parameters
-
- Returns
- voxel index of position
◆ getVoxelPosition()
Eigen::Vector3d VoxelGrid::getVoxelPosition |
( |
const Eigen::Vector3i & | voxel_index | ) |
|
Gets the spatial position of the voxel at (i, j, k).
- Parameters
-
- Returns
- vector of spatial position of voxel at (i, j, k)
◆ setVoxel()
void VoxelGrid::setVoxel |
( |
const Eigen::Vector3i & | voxel_index, |
|
|
Voxel & | value ) |
Sets the voxel at (i, j, k) to specified voxel.
- Parameters
-
◆ withinGrid()
bool VoxelGrid::withinGrid |
( |
const Eigen::Vector3d & | position | ) |
const |
Checks if a spatial position is within the voxel grid.
- Parameters
-
- Returns
- true if position is within voxel grid, false otherwise
◆ dim_space_
Eigen::Vector3d VoxelGrid::dim_space_ |
|
private |
◆ dim_vox_
Eigen::Vector3i VoxelGrid::dim_vox_ |
|
private |
◆ filename_
std::string VoxelGrid::filename_ |
|
private |
◆ is_python_environment_
bool VoxelGrid::is_python_environment_ |
|
private |
◆ numExits_
int VoxelGrid::numExits_ = 0 |
|
private |
◆ numOfVoxels_
int VoxelGrid::numOfVoxels_ = 0 |
|
private |
◆ spacing_
Eigen::Vector3d VoxelGrid::spacing_ |
|
private |
◆ units_
double VoxelGrid::units_ = 1.0 |
|
private |
◆ voxels_
std::vector<Voxel> VoxelGrid::voxels_ |
|
private |
The documentation for this class was generated from the following file: