MIDSX 0.1
A x-ray transport code system for dosimetry
|
Class which represents the computational domain. More...
#include <computational_domain.h>
Public Member Functions | |
ComputationalDomain (const std::string &json_file_path, bool is_python_environment=false) | |
Constructor for the ComputationalDomain class. | |
InteractionData | getInteractionData () const |
Returns the interaction data generated by the materials in the computational domain. | |
bool | isInComputationalDomain (const Eigen::Vector3d &position) const |
Returns true if the position is within the computational domain, false otherwise. | |
Voxel & | getVoxel (const Eigen::Vector3d &position) |
Returns the voxel at the given position. | |
VoxelGrid & | getVoxelGridN (int N) |
Returns the voxel grid at index N. | |
Eigen::Vector3d | getVoxelGridOriginN (int N) |
Returns the origin of the voxel grid at index N. | |
Eigen::Vector3d | getVoxelGridDimSpaceN (int N) |
Returns the spatial dimensions of the voxel grid at index N. | |
int | getNumVoxelGrids () const |
Returns the number of voxel grids in the computational domain. | |
Public Attributes | |
Voxel | background_voxel |
Voxel which represents the background material. | |
Private Member Functions | |
void | initializeCompDomain (const std::string &json_file_path) |
Runs the initialization of the computational domain. | |
void | setCompProperties (const json &json_object) |
Sets the properties of the computational domain. | |
void | setVoxelGrids (const json &json_object, const std::string &json_directory_path) |
Sets the voxel grids of the computational domain. | |
std::vector< std::string > | getMaterialNames () const |
Returns the names of the materials in the computational domain. | |
std::string | getBackgroundMaterialName () const |
Returns the name of the background material. | |
Static Private Member Functions | |
static bool | isJSON (const std::string &file_path) |
Checks if the given file path is a JSON file. | |
static void | getNIFTIFilePaths (const json &voxel_grid_json, const std::string &json_directory_path, std::vector< std::string > &nifti_file_paths) |
Adds NIFTI file paths to the given vector. | |
static void | getOrigins (const json &voxel_grid_json, std::vector< Eigen::Vector3d > &origins) |
Adds origins of voxel grids to the given vector. | |
static bool | isNIFTI (const std::string &file_path) |
Checks if the given file path is a NIFTI file. | |
Private Attributes | |
std::vector< std::pair< VoxelGrid, Eigen::Vector3d > > | voxel_grids_ |
Eigen::Vector3d | dim_space_ |
bool | is_python_environment_ |
Class which represents the computational domain.
The computational domain is the space in which the simulation is run. It is composed of a set of voxel grids. The domain is defined by a JSON file which specifies the voxel grid NIFTI files, origins, and dimensions. In addition, the JSON file specifies the background material and dimensions of the computational domain.
Definition at line 22 of file computational_domain.h.
|
explicit |
Constructor for the ComputationalDomain class.
json_file_path | The path to the JSON file which defines the computational domain. |
is_python_environment | True if the simulation is being run in a Python environment, false otherwise. |
|
private |
Returns the name of the background material.
InteractionData ComputationalDomain::getInteractionData | ( | ) | const |
Returns the interaction data generated by the materials in the computational domain.
|
private |
Returns the names of the materials in the computational domain.
|
staticprivate |
Adds NIFTI file paths to the given vector.
voxel_grid_json | The JSON object which defines the voxel grid. |
json_directory_path | The path to the directory containing the JSON file. |
nifti_file_paths | The vector to add the NIFTI file paths to. |
int ComputationalDomain::getNumVoxelGrids | ( | ) | const |
Returns the number of voxel grids in the computational domain.
|
staticprivate |
Adds origins of voxel grids to the given vector.
voxel_grid_json | The JSON object which defines the voxel grid. |
origins | The vector to add the origins to. |
Voxel & ComputationalDomain::getVoxel | ( | const Eigen::Vector3d & | position | ) |
Returns the voxel at the given position.
position | The position of the voxel. |
Eigen::Vector3d ComputationalDomain::getVoxelGridDimSpaceN | ( | int | N | ) |
Returns the spatial dimensions of the voxel grid at index N.
N | The index of the voxel grid. |
VoxelGrid & ComputationalDomain::getVoxelGridN | ( | int | N | ) |
Returns the voxel grid at index N.
N | The index of the voxel grid. |
Eigen::Vector3d ComputationalDomain::getVoxelGridOriginN | ( | int | N | ) |
Returns the origin of the voxel grid at index N.
N | The index of the voxel grid. |
|
private |
Runs the initialization of the computational domain.
json_file_path | The path to the JSON file which defines the computational domain. |
bool ComputationalDomain::isInComputationalDomain | ( | const Eigen::Vector3d & | position | ) | const |
Returns true if the position is within the computational domain, false otherwise.
position | The position to check. |
|
staticprivate |
Checks if the given file path is a JSON file.
file_path | The file path to check. |
|
staticprivate |
Checks if the given file path is a NIFTI file.
file_path |
|
private |
Sets the properties of the computational domain.
json_object | The JSON object which defines the computational domain. |
|
private |
Sets the voxel grids of the computational domain.
json_object | The JSON object which defines the computational domain. |
json_directory_path | The path to the directory containing the JSON file. |
Voxel ComputationalDomain::background_voxel |
Voxel which represents the background material.
Definition at line 90 of file computational_domain.h.
|
private |
Definition at line 93 of file computational_domain.h.
|
private |
Definition at line 94 of file computational_domain.h.
|
private |
Definition at line 92 of file computational_domain.h.