MIDSX 0.1
A x-ray transport code system for dosimetry
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | Private Member Functions | Static Private Member Functions | Private Attributes | List of all members
ComputationalDomain Class Reference

Class which represents the computational domain. More...

#include <computational_domain.h>

Collaboration diagram for ComputationalDomain:

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.
 
VoxelgetVoxel (const Eigen::Vector3d &position)
 Returns the voxel at the given position.
 
VoxelGridgetVoxelGridN (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_
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ ComputationalDomain()

ComputationalDomain::ComputationalDomain ( const std::string & json_file_path,
bool is_python_environment = false )
explicit

Constructor for the ComputationalDomain class.

Parameters
json_file_pathThe path to the JSON file which defines the computational domain.
is_python_environmentTrue if the simulation is being run in a Python environment, false otherwise.

Member Function Documentation

◆ getBackgroundMaterialName()

std::string ComputationalDomain::getBackgroundMaterialName ( ) const
private

Returns the name of the background material.

Returns
The name of the background material.

◆ getInteractionData()

InteractionData ComputationalDomain::getInteractionData ( ) const

Returns the interaction data generated by the materials in the computational domain.

Returns
The interaction data generated by the materials in the computational domain.

◆ getMaterialNames()

std::vector< std::string > ComputationalDomain::getMaterialNames ( ) const
private

Returns the names of the materials in the computational domain.

Returns
The names of the materials in the computational domain.

◆ getNIFTIFilePaths()

static void ComputationalDomain::getNIFTIFilePaths ( const json & voxel_grid_json,
const std::string & json_directory_path,
std::vector< std::string > & nifti_file_paths )
staticprivate

Adds NIFTI file paths to the given vector.

Parameters
voxel_grid_jsonThe JSON object which defines the voxel grid.
json_directory_pathThe path to the directory containing the JSON file.
nifti_file_pathsThe vector to add the NIFTI file paths to.

◆ getNumVoxelGrids()

int ComputationalDomain::getNumVoxelGrids ( ) const

Returns the number of voxel grids in the computational domain.

Returns
The number of voxel grids in the computational domain.

◆ getOrigins()

static void ComputationalDomain::getOrigins ( const json & voxel_grid_json,
std::vector< Eigen::Vector3d > & origins )
staticprivate

Adds origins of voxel grids to the given vector.

Parameters
voxel_grid_jsonThe JSON object which defines the voxel grid.
originsThe vector to add the origins to.

◆ getVoxel()

Voxel & ComputationalDomain::getVoxel ( const Eigen::Vector3d & position)

Returns the voxel at the given position.

Parameters
positionThe position of the voxel.
Returns
The voxel at the given position.

◆ getVoxelGridDimSpaceN()

Eigen::Vector3d ComputationalDomain::getVoxelGridDimSpaceN ( int N)

Returns the spatial dimensions of the voxel grid at index N.

Parameters
NThe index of the voxel grid.
Returns
The dimensions of the voxel grid at index N.

◆ getVoxelGridN()

VoxelGrid & ComputationalDomain::getVoxelGridN ( int N)

Returns the voxel grid at index N.

Parameters
NThe index of the voxel grid.
Returns
The voxel grid at index N.

◆ getVoxelGridOriginN()

Eigen::Vector3d ComputationalDomain::getVoxelGridOriginN ( int N)

Returns the origin of the voxel grid at index N.

Parameters
NThe index of the voxel grid.
Returns
The origin of the voxel grid at index N.

◆ initializeCompDomain()

void ComputationalDomain::initializeCompDomain ( const std::string & json_file_path)
private

Runs the initialization of the computational domain.

Parameters
json_file_pathThe path to the JSON file which defines the computational domain.

◆ isInComputationalDomain()

bool ComputationalDomain::isInComputationalDomain ( const Eigen::Vector3d & position) const

Returns true if the position is within the computational domain, false otherwise.

Parameters
positionThe position to check.
Returns
True if the position is within the computational domain, false otherwise.

◆ isJSON()

static bool ComputationalDomain::isJSON ( const std::string & file_path)
staticprivate

Checks if the given file path is a JSON file.

Parameters
file_pathThe file path to check.
Returns
True if the file path is a JSON file, false otherwise.

◆ isNIFTI()

static bool ComputationalDomain::isNIFTI ( const std::string & file_path)
staticprivate

Checks if the given file path is a NIFTI file.

Parameters
file_path
Returns
True if the file path is a NIFTI file, false otherwise.

◆ setCompProperties()

void ComputationalDomain::setCompProperties ( const json & json_object)
private

Sets the properties of the computational domain.

Parameters
json_objectThe JSON object which defines the computational domain.

◆ setVoxelGrids()

void ComputationalDomain::setVoxelGrids ( const json & json_object,
const std::string & json_directory_path )
private

Sets the voxel grids of the computational domain.

Parameters
json_objectThe JSON object which defines the computational domain.
json_directory_pathThe path to the directory containing the JSON file.

Member Data Documentation

◆ background_voxel

Voxel ComputationalDomain::background_voxel

Voxel which represents the background material.

Definition at line 90 of file computational_domain.h.

◆ dim_space_

Eigen::Vector3d ComputationalDomain::dim_space_
private

Definition at line 93 of file computational_domain.h.

◆ is_python_environment_

bool ComputationalDomain::is_python_environment_
private

Definition at line 94 of file computational_domain.h.

◆ voxel_grids_

std::vector<std::pair<VoxelGrid, Eigen::Vector3d> > ComputationalDomain::voxel_grids_
private

Definition at line 92 of file computational_domain.h.


The documentation for this class was generated from the following file: