|
We have developed a set of small utilities that can help in the analysis of data produced by SimSET. The page lists all of the utilities that we distribute together with a brief description.
[addrandoms] [attncorrect] [bcomp] [bin] [buildatt] [buildcoh] [calcattenuation] [collapse] [collapse3d] [combinebin] [combinehist] [convert] [convertheader] [correlate] [displayheader] [extract] [extractlines] [line3d] [MakeIndexFile] [migrate] [phgswap] [printheader] [reorder] [reversebytes] [scale] [stripheader] [timesort] [ttest]
addrandoms | Adds random events to a time-sorted detector history file. Description and usage are given on the Randoms Simulation page. |
attncorrect | Applies a calculated attenuation map to simulated emission data to correct for attenuation effects. |
bcomp | Performs a comparison of two binary files. |
bin |
This program is the stand-alone binning module. It reads in a PHG history file and "bins" the photons up according to the parameters specified in the "bin params" file. Usage: bin -X param_file where param_file is the same parameters file given to the PHG when the simulation is done (see PHG page) and the flag -X is -p for PHG history files (photons have been tracked through the object only), -c is for collimator history files, and -d is for detector history files. Note that in order to have bin do anything you must specify a path name to the "bin_params_file" parameter (described in the binning page). |
buildatt | This program creates the necessary "attenuation" tables for the PHG. It is not normally required that you run this program since the attenuation tables are in text format, and one is supplied with the PHG. However if you lose that file or want to modify the values created you can use this program. There are no arguments to this program. The output file is always named "phg.attenuation". |
buildcoh | Takes a list of attenuation data tables, one for each material, and combines them into a master table. |
calcattenuation | Calculates an attenuation image based on an attenuation index file for use in reconstructions. |
collapse | Collapses two dimensional data into one, prompting the user to specify which dimension is to be collapsed. |
collapse3d | Collapses three dimensional data into two, prompting the user to specify which dimension is to be collapsed. |
combinebin |
This program combines two or more "images" (or "histograms) created by the binning module into a single output file. This allows you to combine the results of multiple simulations. This program uses the information in the image header to scale the events appropriately. Usage: combinebin file1, file2, .... It is important to note that the result of the combining is stored in file1. Hence you must make a copy of file1 ahead of time to preserve. it. The program prompts you for the option to delete the remaining files automatically. |
combinehist |
This program concatenates two or more photon history files. The result is stored in the last argument, which is a file that will be created from scratch. The header from the first argument is used for the results with the appropriate fields updated. Usage: combinehist file1, file2, file3, ..., outputFile |
convert |
This program is used to convert binary files from one format to another (eg, 8 byte double to 4 byte integer). It handles a wide variety of formats including ASCII. It will skip over a header or include it in the output file. Note that using ASCII as the input format, is only supported when the output is also ASCII. In this case, the conversion is assumed to be new-line to carriage return or vice-versa. The program simply checks each character for being either a new-line or a carriage return and swaps it to the other. Usage: convert -i in_form -o out_form [-s header_size -h -n num_per_line ] input_file output_file -i: The format of the input data. in_form is a numerical code. Supported types are listed below:
-o: The format of the output data. out_form is a numerical code. This is the same as in_form except ASCII is a supported output type. Note that you may use the -n option with ASCII to specify how many numbers are printed per line. For example if you specify -3, a new-line will be inserted after every 3rd number is converted to ASCII. Supported types are listed below:
-s: The size of the file's header to be skipped. This portion of the file will not be converted. -h: Copy the header. If this flag is included the header that is skipped due to the -s option is copied to the front of the converted file. -n: The number of ASCII conversion per line of ASCII output. For example if you specify -3, a new-line will be inserted after every 3rd number is converted to ASCII. input_file: The source file that will be converted. output_file: The output file that will be created. |
convertheader | Converts headers on history or histogram files created with version of SimSET prior to 2.5 to the new 2.5 style header. |
correlate | Performs an auto-correlation test on two histogram files. |
displayheader |
This program displays the data in the header of a history or bin file produced by the PHG (or the stand-alone modules). This is for old-style (pre-2.5) headers only (see printheader) Usage: displayheader file |
extract | Separates a block of data from a file, storing it into a new file. The user specifies the starting byte and number of bytes to be extracted. |
extractlines | Separates a user specified number of lines from a text file into a new file. |
line3d | Extracts a "line" from 3D histogram data. The user specifies the (x,y) coordinate and the program extracts one value for each axial slice from that (x,y) bin. |
MakeIndexFile |
This program is referred to as the "Object Editor" in the PHG manual. It creates index files for the activity and attenuation objects. Usage: MakeIndexFile param_file param_file: This is the same PHG parameter file that will be used for the simulation. Hence, it contains the definition of the object geometry and the path names to the index files. |
migrate |
This program simply converts end of line formats from UNIX (carriage return) to Macintosh (Line Feed) format. Usage: migrate -u | -m [-i] file1 [file2, ...] -u Make all end of line markers UNIX format. -m Make all end of line markers Macintosh format. -i Perform migration "in-place". This means the file will be converted without being copied to a second file. Hence there are two modes to run the utility, when using "in-place" migration each file passed to the utility is converted. When not using "in-place" migration, the user must specify two file name arguments, the first is the source file and the second is the destination file. If the destination file exists it is deleted and recreated. |
phgbin | Processes a PHG history file by reading in the data and sending it throughthe binning module. |
phgswap |
This program is like "reversebytes" except that it knows about the PHG header and will actually swap all of the fields in the header. The file being swapped must have been created with the same byte orientation as the machine it is being converted on (ie you must run phgswap before moving the file to a machine which has the opposite byte orientation). Usage: phgswap file1, file2, ... NOTE: the swapping is done in-place. Hence file1 will have its contents swapped and stored in file1. The program takes a variable number of input files to support batch processing. |
printheader |
This program displays the data in the header of a history or bin file produced by the PHG (or the stand-alone modules). This is for new-style (2.5) headers only (see displayheader) Usage: printheader file |
reorder | Changes the order of 3D data, for instance if the data is [i, j, k] the user can specify to produce [j, k, i]. |
reversebytes |
This program does byte swapping for moving binary files from one system to the other where the binary byte ordering is different. It prompts for a header size which is skipped, and not stored in the resulting output. Usage: reversebytes inputFile, outputFile, numBytes inputFile is the source file, outputFile is the result file and numBytes is the size of the elements to be swapped. All elements must be the same size. For instance a file might be all four byte integers, eight byte reals, etc. One byte data doesn't need to be swapped :). |
scale | Scales a histogram file. |
stripheader | Removes a header from any file, the user specifies the header size. |
timesort | Sorts the decays in a history file by their time stamps. Description and usage are given on the Randoms Simulation page. |
ttest |
This program is for diagnostics. It performs a large sample t-test on two different simulations. You must bin up the counts, weights, and weights squared for both simulations. The program prompts for the names of all six of these files. It runs through the count images and finds all bins which contain 30 or more counts in both simulations. For these bins it performs a t-test using the weight and weight squared values. It will print out the resulting t-tests, and offers the option of binning them up. The result of this binning should be a gaussian. If you have a large number of valid bins it is not reasonable to look at all of the t-test results, so you can bin them up and compare the results with a gaussian. Usage: ttest |
Last revised by: Robert Harrison Revision date: 9 March 2009