65#include "egs_functions.h"
68#include "egs_shapes.h"
74#include "egs_autoenvelope/egs_sobol.h"
250 egsFatal(
"%s volume correction requested but failed. %s\n", extra.c_str(),
status.c_str());
253 egsInformation(
"%s volume correction not requested.\n", extra.c_str());
257 egsInformation(
"Time taken = %.2G s\n",
time);
259 egsInformation(
"Density of points used = %.0E points/cm^-3\n",
density);
260 egsInformation(
"Number of source points used = %G\n",
npoints);
261 egsInformation(
"Bounding shape volume = %.4E cm^3\n",
bounds_volume);
263 egsInformation(
"Volume of %-10s = %.4E cm^3\n", extra.c_str(),
other_volume);
291 egsFatal(
"File volume correction requested but failed: %s.\n",
status.c_str());
294 egsInformation(
"File volume correction not requested.\n");
297 egsInformation(
"Time taken = %.2G s\n",
time);
298 for (map<string, int>::iterator it=
nreg.begin(); it !=
nreg.end(); it++) {
299 string phant_name = it->first;
300 int npoints = it->second;
303 egsInformation(
"Read %d voxel volumes for '%s' from %s\n", npoints, phant_name.c_str(), file_name.c_str());
340 GeomInfo *geom_info, vector<EGS_AffineTransform *>
transforms = vector<EGS_AffineTransform *>()):
372 timer.
addTimer(
"VolumeCorrector::runSourceCorrection");
377 results.
status =
"Invalid source correction options";
382 results.
status =
"Not requested";
387 clock_t start_time = clock();
389 clock_t end_time = clock();
390 results.
time = (end_time-start_time)/(
double)CLOCKS_PER_SEC;
393 results.
status =
"Completed";
400 timer.
addTimer(
"VolumeCorrector::runGeneralCorrection");
405 results.
status =
"Invalid general correction options";
410 results.
status =
"Not requested";
415 clock_t start_time = clock();
417 clock_t end_time = clock();
419 results.
time = (end_time-start_time)/(
double)CLOCKS_PER_SEC;
420 results.
status =
"Completed";
428 timer.
addTimer(
"VolumeCorrector::runFileCorrection");
429 vector<int> nreg_corrected;
434 results.
status =
"Not requested";
439 clock_t start_time = clock();
441 clock_t end_time = clock();
442 results.
time = (end_time-start_time)/(
double)CLOCKS_PER_SEC;
444 results.
status =
"Completed";
void addTimer(string name)
a container for organizing meta data about the geometries
Volume correction initialization helper class.
static const unsigned long DEFAULT_RAND_POINT_DENSITY
EGS_Float covered_threshold
int setBoundsShape()
create bounding shape from the shape input and calculate its volume
void setCoveredThreshold()
EGS_Vector getRandomPoint()
void setMode()
read mode from input
EGS_RandomGenerator * rng
map< string, int > loadFileVolumeCorrections()
Results runSourceCorrection(EB_TimingTree &timer)
EGS_BaseGeometry * base_geom
vector< EGS_AffineTransform * > transforms
void applyVolumeCorrections(Options *options, HitCounterT hit_counter)
EGS_AffineTransform * base_transform_inv
Results runGeneralCorrection(EB_TimingTree &timer)
double correctPhantomVolumesForSources()
VolumeCorrector(EGS_Input *volcor_input, vector< EB_Phantom * > phantoms, EGS_BaseGeometry *base_geom, GeomInfo *geom_info, vector< EGS_AffineTransform * > transforms=vector< EGS_AffineTransform * >())
vector< EB_Phantom * > phantoms
FileResults runFileCorrection(EB_TimingTree &timer)
EGS_AffineTransform * base_transform
double correctGeneralVolumes()
map< string, string > phantom_files
ginfo contains classes for organizing information about the geometries present in an egs_brachy simul...
pair< int, int > PhantRegT
PhantRegT is a pair of the form (PhantomNumber, PhantomRegion) e.g. a pair of (2, 12) would represent...
std::map< PhantRegT, EGS_I64 > HitCounterT
HitCounterT is used for counting how many random points land in a given phantoms region.
EGS_Float getShapeVolume(EGS_Input *shape_inp)
get shape volume from a shape input item
Header file for phantom objects.
map< string, string > phantom_files
FileResults(map< string, string > phant_files)
RegVolumeT sruct with members (ir=RegionNumber, vol=Volume, unc=Unc)
Struct used to collect and output results about a volume correction run.
EGS_Float covered_threshold_pct
void outputResults(string extra="")
map< int, vector< int > > regions_corrected