EGS Brachy
An egs++ user code for rapid brachytherapy calculations
|
A class to represent a single phantom for scoring dose in egs_brachy. More...
#include <phantom.h>
Public Types | |
enum | GeomDirections { XDIR , YDIR , ZDIR } |
Public Member Functions | |
EB_Phantom (EGS_Application *, EGS_BaseGeometry *, set< int > global_regions, int nsource, Publisher *publisher) | |
EB_Phantom constructor. | |
~EB_Phantom () | |
EB_Phantom destructor. | |
void | scoreTlen (int ir, EGS_Float dose, EGS_Particle *p) |
add tracklength dose to region ir | |
void | scoreEdep (int ir, EGS_Float dose) |
add energy deposition dose to region ir | |
void | getCurrentScore (int ireg, double &sum, double &sum2) |
get current tlen score for region | |
double | getTlenNorm (int ireg) |
void | setDoseScale (EGS_Float) |
set dose scaling factor for output | |
void | update (EB_Message message, void *data) |
bool | hasVolCor (int ireg) |
EGS_Float | getCorrectedVolume (int ireg) |
get uncorrected volume for a given region | |
EGS_Float | getVolumeUncertainty (int ireg) |
get volume unc | |
EGS_Float | getUncorrectedVolume (int ireg) |
get corrected volume for a given region | |
vector< int > | getRegionsWithCorrections () |
return a vector of all regions which were corrected | |
void | setCorrectedVolume (int ir, double fraction, double unc=0) |
Allow user to tell phantom what the actual volume of a region is. | |
void | enableTLenScoring () |
enableTLenScoring must be called before simulation begins if you want to score dose with tracklength estimator in addition to tracklength scoring | |
void | enableInteractionScoring () |
enableInteractionScoring must be called before simulation begins if you want to score dose with interaction scoring in addition to tracklength scoring | |
void | enableScatterScoring () |
enableInteractionScoring must be called before simulation begins if you want to score dose with interaction scoring in addition to tracklength scoring | |
void | setHistory (EGS_I64 current_case) |
set current history on scoring arrays for proper statistics | |
void | setEffectiveHistories (EGS_Float current_case) |
set number of effective histories for normalizing scoring arrays | |
EGS_Float | avgVoxelVol () |
return average voxel volume | |
void | outputVoxelInfo (string format) |
write voxel volumes, mass, desnity etc | |
void | writeVoxelInfo (ostream &) |
write voxel info file | |
void | outputVolumeCorrection (string format) |
intialize and output write voxel volumes to file | |
void | writeVolumeCorrection (ostream &) |
write voxel volumes to file | |
void | outputResults (int top_n=20, string output_3ddose="text", string output_egsphant="text", string output_voxinfo="text", string output_volcor="text") |
tell phantom to output its results. | |
bool | globalRegIsInPhant (int global_reg) |
check whether a global region falls within this phantom | |
int | globalToLocal (int global_reg) |
convert global region to local phantom region | |
int | outputData (ostream *ofile) |
int | readData (istream *ifile) |
void | resetCounter () |
int | addState (istream &ifile) |
EGS_Float | getRealRho (int ireg) |
return actual density for region | |
EGS_Float | getRealMass (int ireg) |
return (corrected) real mass for region | |
EGS_Float | getUncorrectedMass (int ireg) |
return uncorrected for region | |
void | getResult (EGS_ScoringArray *, int ireg, string type, EGS_Float &r, EGS_Float &dr) |
get result for region from scoring array and normalize based on the type requested. | |
![]() | |
virtual | ~Subscriber () |
Static Public Member Functions | |
static bool | needsUserVolumes (const string &geom_type) |
function for checking whether a given geometry type requires user specified volumes | |
static bool | canWrite3ddose (const string &geom_type) |
function for checking whether a given geometry type can output 3ddose files | |
Public Attributes | |
EGS_BaseGeometry * | geometry |
the phantom geometry object | |
set< int > | global_regions |
the set of all global regions contained in this phantom | |
int | global_reg_start |
starting global region index for this phantom | |
int | global_reg_stop |
ending global region index for this phantom | |
bool | needs_user_geoms |
this phantom requires user specified geometries | |
bool | can_write_3ddose |
this phantom can output 3ddose files | |
Private Member Functions | |
void | outputDoseStats (EGS_ScoringArray *score, string type) |
write some stats about dose arrays | |
void | outputTopDoses (int top_n, vector< RegionResult > region_results) |
write the top_n doses to console | |
void | output3ddoseResults (string) |
write the phantom boundaries, doses and uncertainties to 3ddose file | |
void | output3DDoses (ostream &out, EGS_ScoringArray *score, string type) |
write input scoring array to 3ddose file | |
void | output3DBounds (ostream &out) |
write the phantom bounds to 3ddose file | |
void | outputEGSPhant (string) |
initialize and write an egsphant file for this phantom | |
void | writeEGSPhant (ostream &) |
write actual egsphant data to file for this phantom | |
string | medIndex (int medium) |
get medium index 1-9A-Z | |
vector< RegionResult > | getRegionResults () |
create a vector of RegionResult structs which can then be sorted by dose value. used for output routines | |
void | getScoringArrays (vector< EGS_ScoringArray * > &scores, vector< string > &types, vector< string > &descriptions) |
get all active scoring arrays, their types and descriptions | |
void | getEGSdatScoringArrays (vector< EGS_ScoringArray * > &scores) |
get all active scoring arrays for writing to egsdat file | |
Private Attributes | |
EGS_Application * | app |
Parent application instance. Required for constructing filenames. | |
EGS_ScoringArray * | tlen_score |
Tracklength dose scoring array. | |
EGS_ScoringArray * | edep_score |
Interaction scored dose scoring array. | |
EGS_ScoringArray * | prim_score |
Tracklenth scored dose from primary particles. | |
EGS_ScoringArray * | sscat_score |
Tracklenth scored dose from single scattered particles. | |
EGS_ScoringArray * | mscat_score |
Tracklenth scored dose from multiple scattered particles. | |
int | nsources |
EGS_Float | dose_scale |
EGS_Float | total_radiant_e |
EGS_I64 | cur_history |
EGS_Float | effective_histories |
Publisher * | publisher |
std::map< int, double > | corrected_volumes |
Corrected volume in a given region. | |
std::map< int, double > | volume_uncertainty |
Static Private Attributes | |
static const string | autovol_phantom_geom_types [] = {"EGS_cSpheres", "EGS_cSphericalShell", "EGS_XYZGeometry", "EGS_XYZGeometryT", "EGS_RZ"} |
static const string | threeddose_geom_types [] = {"EGS_cSpheres", "EGS_cSphericalShell", "EGS_XYZGeometry", "EGS_XYZGeometryT", "EGS_RZ"} |
A class to represent a single phantom for scoring dose in egs_brachy.
A simulation may have an arbitrary number of these phantoms. This class handles scoring both tracklength and interaction scoring, outputing the top N doses to the console and output to 3ddose files.
Region numbers are all 'local' region numbers. That is the phantom does not know anything about its global region number. egs_brachy should convert to local region number before calling any method taking a region number as input.
EB_Phantom::EB_Phantom | ( | EGS_Application * | parent, |
EGS_BaseGeometry * | geom, | ||
set< int > | global_regions, | ||
int | nsource, | ||
Publisher * | publisher | ||
) |
EB_Phantom constructor.
Definition at line 104 of file phantom.cpp.
|
inline |
EB_Phantom destructor.
int EB_Phantom::addState | ( | istream & | ifile | ) |
Definition at line 996 of file phantom.cpp.
EGS_Float EB_Phantom::avgVoxelVol | ( | ) |
return average voxel volume
Definition at line 855 of file phantom.cpp.
|
static |
function for checking whether a given geometry type can output 3ddose files
Definition at line 180 of file phantom.cpp.
void EB_Phantom::enableInteractionScoring | ( | ) |
enableInteractionScoring must be called before simulation begins if you want to score dose with interaction scoring in addition to tracklength scoring
Definition at line 215 of file phantom.cpp.
void EB_Phantom::enableScatterScoring | ( | ) |
enableInteractionScoring must be called before simulation begins if you want to score dose with interaction scoring in addition to tracklength scoring
Definition at line 222 of file phantom.cpp.
void EB_Phantom::enableTLenScoring | ( | ) |
enableTLenScoring must be called before simulation begins if you want to score dose with tracklength estimator in addition to tracklength scoring
Definition at line 208 of file phantom.cpp.
EGS_Float EB_Phantom::getCorrectedVolume | ( | int | ireg | ) |
get uncorrected volume for a given region
Definition at line 314 of file phantom.cpp.
void EB_Phantom::getCurrentScore | ( | int | ireg, |
double & | sum, | ||
double & | sum2 | ||
) |
get current tlen score for region
Definition at line 332 of file phantom.cpp.
|
private |
get all active scoring arrays for writing to egsdat file
Definition at line 668 of file phantom.cpp.
EGS_Float EB_Phantom::getRealMass | ( | int | ireg | ) |
return (corrected) real mass for region
Definition at line 291 of file phantom.cpp.
EGS_Float EB_Phantom::getRealRho | ( | int | ireg | ) |
return actual density for region
Definition at line 285 of file phantom.cpp.
|
private |
create a vector of RegionResult structs which can then be sorted by dose value. used for output routines
Definition at line 377 of file phantom.cpp.
vector< int > EB_Phantom::getRegionsWithCorrections | ( | ) |
return a vector of all regions which were corrected
Definition at line 194 of file phantom.cpp.
void EB_Phantom::getResult | ( | EGS_ScoringArray * | score, |
int | ireg, | ||
string | type, | ||
EGS_Float & | r, | ||
EGS_Float & | dr | ||
) |
get result for region from scoring array and normalize based on the type requested.
Definition at line 349 of file phantom.cpp.
|
private |
get all active scoring arrays, their types and descriptions
Definition at line 636 of file phantom.cpp.
double EB_Phantom::getTlenNorm | ( | int | ireg | ) |
Definition at line 344 of file phantom.cpp.
EGS_Float EB_Phantom::getUncorrectedMass | ( | int | ireg | ) |
return uncorrected for region
Definition at line 298 of file phantom.cpp.
EGS_Float EB_Phantom::getUncorrectedVolume | ( | int | ireg | ) |
get corrected volume for a given region
Definition at line 302 of file phantom.cpp.
EGS_Float EB_Phantom::getVolumeUncertainty | ( | int | ireg | ) |
get volume unc
Definition at line 323 of file phantom.cpp.
|
inline |
|
inline |
bool EB_Phantom::hasVolCor | ( | int | ireg | ) |
Definition at line 310 of file phantom.cpp.
|
private |
get medium index 1-9A-Z
Definition at line 823 of file phantom.cpp.
|
static |
function for checking whether a given geometry type requires user specified volumes
Definition at line 166 of file phantom.cpp.
|
private |
write the phantom bounds to 3ddose file
Definition at line 735 of file phantom.cpp.
|
private |
write the phantom boundaries, doses and uncertainties to 3ddose file
Definition at line 688 of file phantom.cpp.
|
private |
write input scoring array to 3ddose file
Definition at line 758 of file phantom.cpp.
int EB_Phantom::outputData | ( | ostream * | ofile | ) |
Definition at line 958 of file phantom.cpp.
|
private |
write some stats about dose arrays
Definition at line 408 of file phantom.cpp.
|
private |
initialize and write an egsphant file for this phantom
Definition at line 833 of file phantom.cpp.
void EB_Phantom::outputResults | ( | int | top_n = 20 , |
string | output_3ddose = "text" , |
||
string | output_egsphant = "text" , |
||
string | output_voxinfo = "text" , |
||
string | output_volcor = "text" |
||
) |
tell phantom to output its results.
Definition at line 259 of file phantom.cpp.
|
private |
write the top_n doses to console
Definition at line 567 of file phantom.cpp.
void EB_Phantom::outputVolumeCorrection | ( | string | format | ) |
intialize and output write voxel volumes to file
Definition at line 934 of file phantom.cpp.
void EB_Phantom::outputVoxelInfo | ( | string | format | ) |
write voxel volumes, mass, desnity etc
Definition at line 897 of file phantom.cpp.
int EB_Phantom::readData | ( | istream * | ifile | ) |
Definition at line 977 of file phantom.cpp.
void EB_Phantom::resetCounter | ( | ) |
Definition at line 1022 of file phantom.cpp.
void EB_Phantom::scoreEdep | ( | int | ir, |
EGS_Float | dose | ||
) |
add energy deposition dose to region ir
Definition at line 155 of file phantom.cpp.
void EB_Phantom::scoreTlen | ( | int | ir, |
EGS_Float | dose, | ||
EGS_Particle * | p | ||
) |
add tracklength dose to region ir
Definition at line 133 of file phantom.cpp.
void EB_Phantom::setCorrectedVolume | ( | int | ir, |
double | fraction, | ||
double | unc = 0 |
||
) |
Allow user to tell phantom what the actual volume of a region is.
Definition at line 202 of file phantom.cpp.
void EB_Phantom::setDoseScale | ( | EGS_Float | scale | ) |
set dose scaling factor for output
add energy deposition dose to region ir
Definition at line 162 of file phantom.cpp.
void EB_Phantom::setEffectiveHistories | ( | EGS_Float | current_case | ) |
set number of effective histories for normalizing scoring arrays
Definition at line 253 of file phantom.cpp.
void EB_Phantom::setHistory | ( | EGS_I64 | current_case | ) |
set current history on scoring arrays for proper statistics
Definition at line 234 of file phantom.cpp.
|
virtual |
Implements Subscriber.
Definition at line 124 of file phantom.cpp.
|
private |
write actual egsphant data to file for this phantom
Definition at line 781 of file phantom.cpp.
void EB_Phantom::writeVolumeCorrection | ( | ostream & | out | ) |
write voxel volumes to file
Definition at line 922 of file phantom.cpp.
void EB_Phantom::writeVoxelInfo | ( | ostream & | out | ) |
write voxel info file
Definition at line 865 of file phantom.cpp.
|
private |
|
staticprivate |
bool EB_Phantom::can_write_3ddose |
|
private |
|
private |
EGS_BaseGeometry* EB_Phantom::geometry |
int EB_Phantom::global_reg_start |
int EB_Phantom::global_reg_stop |
set<int> EB_Phantom::global_regions |
|
private |
bool EB_Phantom::needs_user_geoms |
|
private |
|
private |
|
staticprivate |
|
private |
|
private |