Description:

Added ability to (1) read run configuration, settings, and parameters from file, (2) pass location of config (config.cfg) file and relaxation parameter as command line execution arguments and accessed via main function through argc/argv argument, and (3) algorithm to generate a nonrepeating and exhaustive cylic ordering to the histories applied to image reconstruction.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

Details:

(1) Config file supplied as a set of key = value pairs, where the keys correspond directly to the name of the corresponding #define used in previous versions.  The values are taken to be strings (char*), integers (int), or floating point values (double).  The values in the config file are surrounded with quotes if they are to be taken as a string, a '.' if a double, and a series of 0-9 digits if an integer.  The type of input value is not known a priori so a struct called generic_type_container was defined so function has a single return type.  This struct has a char* key element specifying which program variable the value is to be assigned to.  It also has char*/double/int elements for string/FPV/integer inputs values, and an int type_ID specifying which type it actually is.  Each input key-value pair results in 1 of the 3 type elements being assigned and the others remaining unassigned.  The type_ID can then be accessed later to specify which of the 3 is assigned a value.

Each possible key is assigned a unique integer value using a std::map and each integer has an associated case inside a switch statement.  Input keys are then compared to the set of possible keys and the case corresponding to its unique integer mapping assigns value to the program variable corresponding to that key. The integer map is required because char* variable cannot be used to control switch statements.  This process is repeated until all key-value pairs have been read and all program variables have been assigned their corresponding values.
(2)When the program is executed from the command line the location of the config file and the value to use for lambda in ART are passed as arguments, i.e. these can be passed when the program is ran from the command line using the command:

$ ./pct_reconstruction [.cfg file address] [lambda value]

These are then accessed in the main function through its argc/argv function parameters.

(3) The ordering of the histories is determined using an approximation of the golden section search.  If the # of histories N is not a prime number, limited precision and rounding will result in repetition of histories before all have been used so the prime number P closest to Phi*N is used instead as the offest instead of just Phi*N (Phi=Golden Ration).  i.e.

his(i+1) = his(i) + Phi*N (mod N) -> his(i+1) = his(i) + P (mod N)

  The corresponding function generates an N element array with all integers 0-(N-1) appearing exactly once. These integers then specify the order in which the histories are to be used in ART.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%