Image Based Sources
Image based Source Distributions
This simulates a source by using information in a file that contains integer  maps when generating decays in the phantom. In this way, very complex  source distributions can be simulated in a easy way. The dimension of each  map is 64x64 [two byte] but can easily be changed by the parameter  statement in the beginning of the source code. The number of images is  unlimited. The sources are normally centered around the origin but can be  shifted by Indices 16-18 in the CHANGE program. The routine simulates  decays randomly within the location corresponding to the location of the  particular source map cell. The number of decays from that location is  determined from the contents of the source map cell.
A pixel size is needed to convert to physical coordinates since otherwise a  location to a matrix cell is referred by the indices [i,j,k]. Note that this has  no connection to the pixel size that defines the projections being simulated.   The axial source length is defined by Index 2-4 depending on the desired  direction of the source. The routine reads the number of images stored in  the input file. The name of the file is defined by Index 14 in the MAIN MENU  of CHANGE. The default file extension is *. smi.
A start block can be define to avoid file headers and a limited number of  images can also be defined. The routine scans through the source maps  and obtains a scaling factor needed so that the number of photon histories  given in CHANGE can be simulated. The routine must be compiler and linked   to SIMIND in order to become active. Index 15 in  CHANGE must also be  equal to some arbitrary negative number.

A tumor file can be read into the source map and add count according to  the definition in the tumor file. One tumor is defined by one row in the file  as floating point values separated by a space. The first three values define  the center of the tumor in pixel units. The next three is the x,y,z axis also  in pixel units. The last value is the pixel value.
Note: The index 26 is not used when simulating source maps. Instead the  number of photon histories is determined by calculating the sum of the  pixel values in the source map. The ensure that the proper distribution is  sampled. If the number of histories is too low then the switch /NN  [described below] can be used to increase the number by multiplying with  a factor.
Switches
/PX:
Pixel size of the source maps in cm. This switch is needed for  proper function [cm]
/DI:
Direction of the source map. The direction is defined by an integer  [0-2] in the same way as the non- homogeneous phantom [Index  32 in CHANGE]. No switch means a direction when indices i,j  corresponds to y,z.
/TH:
The value sets the slice thickness for the images [cm]
/SB:
Start block [number of 512 bytes] when reading source maps from  the file. No value means starting from beginning of the file.
/1S
This switch gives the start image of the source map file. If  omitted, the first image is the first in the file.
/NN:
Multiplier that scale the number of counts in the source maps with  a integer. This is used to allow longer simulations with better  statistics using the same source map file. Note that at the end  the counts in the images does not depend on this value. The idea  is that the count levels in the images should reflect the activity  level of 1 MBq measured in one second regardless of the number of  photons simulated.
/IF
An input tumor file is read in. The file name shoud be equal to the  main input file name but with an extention *.inp. The format is the  same as for the jaszak.fso phantom  with the addition of an  optional density value [times 1000 according to the same logic as  the densities in the *.zub files] as the number 7 in the sequence.  If number 7 is absent or has a value equal to 0.0 then the tumor  density will be the same as the organ it occupies. Note that if a  tumor cross two organs the density of the tumor with have two  values if not explicit defined.
There are two types of tumors. Tumor type 1 has the center in  the pixel defined by value 4,5,6 in the *.inp file. If value 1,2,3 are  equal to zero then the tumor will be a single pixel. Tumor type 2  has the center at the surface of the pixel that is between i,j,x and    i-1,j- 1,k-1. Minimum size for this tumor is 8 pixels.
Note the following options
  • /IF = The tumor type defined in the simind.ini is used for all  tumors  defined in the *.inp file.
  • /IF:2 = Tumor type 2 is used for all tumors in the *.inp file 
  • /IF:-2 = Tumor type 2 is used for all tumors in the *.inp file  but  the background activity is set to zero 
  • /IF:2.3 = Tumor type 2 is used with the zubal background but  only  tumor corresponding to row 2 in the inp file is used.