[Gate-users] Incorporate X-Ray Spectrum generated with SpekCalc in GATE simulation

Simon Schlesinger schlesinger at uni-wuppertal.de
Mon Mar 23 07:45:45 CET 2015


Am 19.03.2015 um 17:00 schrieb André Miguel Monteiro:
>
> Dear gate users,
>
>
> I am using SpekCalc to generate a X-Ray spectrum with photons with 
> energies between 35 and 80 keV, 1.8mmAl and0.2mm Cu​ filtration for a 
> CT simulation, but I don't know how to put it in a GATE CT simulation. 
> How do I put that in a "source.mac" file?
>
>
> Below is the output of a previous simulation using a spectrum 
> extracted from the CT example and below that is the output of SpekCalc.
>
>
> Thank you in advance.
>
>
> Best regards,
>
>
> André Miguel Monteiro
>
>
>
> /gate/source/addSource xraygun
> /gate/source/verbose 0
> /gate/source/xraygun/setActivity 10000000. becquerel
> /gate/source/xraygun/gps/verbose 0
> /gate/source/xraygun/gps/particle gamma
> /gate/source/xraygun/gps/energytype Arb
> /gate/source/xraygun/gps/histname arb
> /gate/source/xraygun/gps/emin 10.00 keV
> /gate/source/xraygun/gps/emax 40.00 keV
> /gate/source/xraygun/gps/histpoint  0.0100  7
> /gate/source/xraygun/gps/histpoint  0.0102  4
> /gate/source/xraygun/gps/histpoint  0.0104  4
> /gate/source/xraygun/gps/histpoint  0.0105  4
> /gate/source/xraygun/gps/histpoint  0.0106  6
> /gate/source/xraygun/gps/histpoint  0.0107  3
> /gate/source/xraygun/gps/histpoint  0.0108  6
> /gate/source/xraygun/gps/histpoint  0.0109  5
> /gate/source/xraygun/gps/histpoint  0.0110  7
> /gate/source/xraygun/gps/histpoint  0.0112  6
> /gate/source/xraygun/gps/histpoint  0.0114  8
> /gate/source/xraygun/gps/histpoint  0.0115  7
> /gate/source/xraygun/gps/histpoint  0.0116  7
> /gate/source/xraygun/gps/histpoint  0.0117  10
> /gate/source/xraygun/gps/histpoint  0.0118  9
> /gate/source/xraygun/gps/histpoint  0.0119  11
> /gate/source/xraygun/gps/histpoint  0.0120  11
> /gate/source/xraygun/gps/histpoint  0.0122  8
> /gate/source/xraygun/gps/histpoint  0.0123  7
> /gate/source/xraygun/gps/histpoint  0.0124  10
> /gate/source/xraygun/gps/histpoint  0.0125  15
> /gate/source/xraygun/gps/histpoint  0.0126  19
> /gate/source/xraygun/gps/histpoint  0.0127  17
> /gate/source/xraygun/gps/histpoint  0.0128  18
> /gate/source/xraygun/gps/histpoint  0.0129  21
> /gate/source/xraygun/gps/histpoint  0.0130  24
> /gate/source/xraygun/gps/histpoint  0.0132  19
> /gate/source/xraygun/gps/histpoint  0.0133  33
> /gate/source/xraygun/gps/histpoint  0.0134  32
> /gate/source/xraygun/gps/histpoint  0.0135  34
> /gate/source/xraygun/gps/histpoint  0.0136  36
> /gate/source/xraygun/gps/histpoint  0.0137  34
> /gate/source/xraygun/gps/histpoint  0.0138  33
> /gate/source/xraygun/gps/histpoint  0.0139  38
> /gate/source/xraygun/gps/histpoint  0.0140  34
> /gate/source/xraygun/gps/histpoint  0.0142  32
> /gate/source/xraygun/gps/histpoint  0.0143  42
> /gate/source/xraygun/gps/histpoint  0.0144  37
> /gate/source/xraygun/gps/histpoint  0.0145  39
> /gate/source/xraygun/gps/histpoint  0.0146  49
> /gate/source/xraygun/gps/histpoint  0.0147  53
> /gate/source/xraygun/gps/histpoint  0.0148  48
> /gate/source/xraygun/gps/histpoint  0.0149  50
> /gate/source/xraygun/gps/histpoint  0.0150  62
> /gate/source/xraygun/gps/histpoint  0.0152  69
> /gate/source/xraygun/gps/histpoint  0.0153  51
> /gate/source/xraygun/gps/histpoint  0.0154  63
> /gate/source/xraygun/gps/histpoint  0.0155  80
> /gate/source/xraygun/gps/histpoint  0.0156  64
> /gate/source/xraygun/gps/histpoint  0.0157  77
> /gate/source/xraygun/gps/histpoint  0.0158  90
> /gate/source/xraygun/gps/histpoint  0.0159  73
> /gate/source/xraygun/gps/histpoint  0.0160  81
> /gate/source/xraygun/gps/histpoint  0.0162  74
> /gate/source/xraygun/gps/histpoint  0.0163  80
> /gate/source/xraygun/gps/histpoint  0.0164  81
> /gate/source/xraygun/gps/histpoint  0.0165  88
> /gate/source/xraygun/gps/histpoint  0.0166  97
> /gate/source/xraygun/gps/histpoint  0.0167  94
> /gate/source/xraygun/gps/histpoint  0.0168  104
> /gate/source/xraygun/gps/histpoint  0.0169  151
> /gate/source/xraygun/gps/histpoint  0.0170  287
> /gate/source/xraygun/gps/histpoint  0.0172  1056
> /gate/source/xraygun/gps/histpoint  0.0173  1489
> /gate/source/xraygun/gps/histpoint  0.0174  1676
> /gate/source/xraygun/gps/histpoint  0.0175  1520
> /gate/source/xraygun/gps/histpoint  0.0176  1055
> /gate/source/xraygun/gps/histpoint  0.0177  550
> /gate/source/xraygun/gps/histpoint  0.0178  296
> /gate/source/xraygun/gps/histpoint  0.0179  159
> /gate/source/xraygun/gps/histpoint  0.0180  105
> /gate/source/xraygun/gps/histpoint  0.0182  111
> /gate/source/xraygun/gps/histpoint  0.0183  114
> /gate/source/xraygun/gps/histpoint  0.0184  112
> /gate/source/xraygun/gps/histpoint  0.0185  129
> /gate/source/xraygun/gps/histpoint  0.0186  112
> /gate/source/xraygun/gps/histpoint  0.0187  119
> /gate/source/xraygun/gps/histpoint  0.0188  121
> /gate/source/xraygun/gps/histpoint  0.0189  91
> /gate/source/xraygun/gps/histpoint  0.0190  66
> /gate/source/xraygun/gps/histpoint  0.0192  15
> /gate/source/xraygun/gps/histpoint  0.0193  7
> /gate/source/xraygun/gps/histpoint  0.0194  6
> /gate/source/xraygun/gps/histpoint  0.0195  6
> /gate/source/xraygun/gps/histpoint  0.0196  9
> /gate/source/xraygun/gps/histpoint  0.0197  10
> /gate/source/xraygun/gps/histpoint  0.0198  4
> /gate/source/xraygun/gps/histpoint  0.0199  6
> /gate/source/xraygun/gps/histpoint  0.0200  3
> /gate/source/xraygun/gps/histpoint  0.0202  1
> /gate/source/xraygun/gps/histpoint  0.0203  1
> /gate/source/xraygun/gps/histpoint  0.0204  1
> /gate/source/xraygun/gps/histpoint  0.0205  0
> /gate/source/xraygun/gps/histpoint  0.0206  0
> /gate/source/xraygun/gps/histpoint  0.0207  0
> /gate/source/xraygun/gps/histpoint  0.0208  2
> /gate/source/xraygun/gps/histpoint  0.0209  0
> /gate/source/xraygun/gps/histpoint  0.0210  0
> /gate/source/xraygun/gps/histpoint  0.0212  1
> /gate/source/xraygun/gps/histpoint  0.0214  0
> /gate/source/xraygun/gps/histpoint  0.0215  0
> /gate/source/xraygun/gps/histpoint  0.0216  1
> /gate/source/xraygun/gps/histpoint  0.0217  0
> /gate/source/xraygun/gps/histpoint  0.0218  2
> /gate/source/xraygun/gps/histpoint  0.0219  1
> /gate/source/xraygun/gps/histpoint  0.0220  1
> /gate/source/xraygun/gps/histpoint  0.0222  2
> /gate/source/xraygun/gps/histpoint  0.0224  1
> /gate/source/xraygun/gps/histpoint  0.0225  2
> /gate/source/xraygun/gps/histpoint  0.0226  1
> /gate/source/xraygun/gps/histpoint  0.0227  0
> /gate/source/xraygun/gps/histpoint  0.0228  1
> /gate/source/xraygun/gps/histpoint  0.0229  1
> /gate/source/xraygun/gps/histpoint  0.0230  3
> /gate/source/xraygun/gps/histpoint  0.0232  3
> /gate/source/xraygun/gps/histpoint  0.0233  3
> /gate/source/xraygun/gps/histpoint  0.0234  3
> /gate/source/xraygun/gps/histpoint  0.0235  1
> /gate/source/xraygun/gps/histpoint  0.0236  3
> /gate/source/xraygun/gps/histpoint  0.0237  3
> /gate/source/xraygun/gps/histpoint  0.0238  2
> /gate/source/xraygun/gps/histpoint  0.0239  1
> /gate/source/xraygun/gps/histpoint  0.0240  3
> /gate/source/xraygun/gps/histpoint  0.0242  6
> /gate/source/xraygun/gps/histpoint  0.0243  4
> /gate/source/xraygun/gps/histpoint  0.0244  1
> /gate/source/xraygun/gps/histpoint  0.0245  1
> /gate/source/xraygun/gps/histpoint  0.0246  2
> /gate/source/xraygun/gps/histpoint  0.0247  7
> /gate/source/xraygun/gps/histpoint  0.0248  6
> /gate/source/xraygun/gps/histpoint  0.0249  4
> /gate/source/xraygun/gps/histpoint  0.0250  8
> /gate/source/xraygun/gps/histpoint  0.0252  5
> /gate/source/xraygun/gps/histpoint  0.0254  3
> /gate/source/xraygun/gps/histpoint  0.0255  2
> /gate/source/xraygun/gps/histpoint  0.0256  6
> /gate/source/xraygun/gps/histpoint  0.0257  5
> /gate/source/xraygun/gps/histpoint  0.0258  6
> /gate/source/xraygun/gps/histpoint  0.0259  2
> /gate/source/xraygun/gps/histpoint  0.0260  9
> /gate/source/xraygun/gps/histpoint  0.0262  5
> /gate/source/xraygun/gps/histpoint  0.0264  6
> /gate/source/xraygun/gps/histpoint  0.0265  5
> /gate/source/xraygun/gps/histpoint  0.0266  6
> /gate/source/xraygun/gps/histpoint  0.0267  7
> /gate/source/xraygun/gps/histpoint  0.0268  8
> /gate/source/xraygun/gps/histpoint  0.0269  4
> /gate/source/xraygun/gps/histpoint  0.0270  7
> /gate/source/xraygun/gps/histpoint  0.0272  7
> /gate/source/xraygun/gps/histpoint  0.0274  8
> /gate/source/xraygun/gps/histpoint  0.0275  9
> /gate/source/xraygun/gps/histpoint  0.0276  8
> /gate/source/xraygun/gps/histpoint  0.0277  7
> /gate/source/xraygun/gps/histpoint  0.0278  7
> /gate/source/xraygun/gps/histpoint  0.0279  10
> /gate/source/xraygun/gps/histpoint  0.0280  15
> /gate/source/xraygun/gps/histpoint  0.0282  3
> /gate/source/xraygun/gps/histpoint  0.0283  11
> /gate/source/xraygun/gps/histpoint  0.0284  10
> /gate/source/xraygun/gps/histpoint  0.0285  9
> /gate/source/xraygun/gps/histpoint  0.0286  11
> /gate/source/xraygun/gps/histpoint  0.0287  8
> /gate/source/xraygun/gps/histpoint  0.0288  6
> /gate/source/xraygun/gps/histpoint  0.0289  9
> /gate/source/xraygun/gps/histpoint  0.0290  14
> /gate/source/xraygun/gps/histpoint  0.0292  6
> /gate/source/xraygun/gps/histpoint  0.0293  8
> /gate/source/xraygun/gps/histpoint  0.0294  8
> /gate/source/xraygun/gps/histpoint  0.0295  9
> /gate/source/xraygun/gps/histpoint  0.0296  9
> /gate/source/xraygun/gps/histpoint  0.0297  8
> /gate/source/xraygun/gps/histpoint  0.0298  5
> /gate/source/xraygun/gps/histpoint  0.0299  7
> /gate/source/xraygun/gps/histpoint  0.0300  8
> /gate/source/xraygun/gps/histpoint  0.0302  11
> /gate/source/xraygun/gps/histpoint  0.0304  12
> /gate/source/xraygun/gps/histpoint  0.0305  10
> /gate/source/xraygun/gps/histpoint  0.0306  12
> /gate/source/xraygun/gps/histpoint  0.0307  11
> /gate/source/xraygun/gps/histpoint  0.0308  14
> /gate/source/xraygun/gps/histpoint  0.0309  8
> /gate/source/xraygun/gps/histpoint  0.0310  15
> /gate/source/xraygun/gps/histpoint  0.0312  12
> /gate/source/xraygun/gps/histpoint  0.0314  12
> /gate/source/xraygun/gps/histpoint  0.0315  19
> /gate/source/xraygun/gps/histpoint  0.0316  13
> /gate/source/xraygun/gps/histpoint  0.0317  16
> /gate/source/xraygun/gps/histpoint  0.0318  10
> /gate/source/xraygun/gps/histpoint  0.0319  8
> /gate/source/xraygun/gps/histpoint  0.0320  11
> /gate/source/xraygun/gps/histpoint  0.0321  8
> /gate/source/xraygun/gps/histpoint  0.0322  11
> /gate/source/xraygun/gps/histpoint  0.0324  15
> /gate/source/xraygun/gps/histpoint  0.0325  11
> /gate/source/xraygun/gps/histpoint  0.0326  9
> /gate/source/xraygun/gps/histpoint  0.0327  13
> /gate/source/xraygun/gps/histpoint  0.0328  9
> /gate/source/xraygun/gps/histpoint  0.0329  11
> /gate/source/xraygun/gps/histpoint  0.0330  11
> /gate/source/xraygun/gps/histpoint  0.0332  11
> /gate/source/xraygun/gps/histpoint  0.0333  14
> /gate/source/xraygun/gps/histpoint  0.0334  12
> /gate/source/xraygun/gps/histpoint  0.0335  10
> /gate/source/xraygun/gps/histpoint  0.0336  11
> /gate/source/xraygun/gps/histpoint  0.0337  9
> /gate/source/xraygun/gps/histpoint  0.0338  12
> /gate/source/xraygun/gps/histpoint  0.0339  6
> /gate/source/xraygun/gps/histpoint  0.0340  13
> /gate/source/xraygun/gps/histpoint  0.0342  12
> /gate/source/xraygun/gps/histpoint  0.0343  8
> /gate/source/xraygun/gps/histpoint  0.0344  13
> /gate/source/xraygun/gps/histpoint  0.0345  14
> /gate/source/xraygun/gps/histpoint  0.0346  11
> /gate/source/xraygun/gps/histpoint  0.0347  12
> /gate/source/xraygun/gps/histpoint  0.0348  13
> /gate/source/xraygun/gps/histpoint  0.0349  9
> /gate/source/xraygun/gps/histpoint  0.0350  8
> /gate/source/xraygun/gps/histpoint  0.0352  11
> /gate/source/xraygun/gps/histpoint  0.0354  10
> /gate/source/xraygun/gps/histpoint  0.0355  12
> /gate/source/xraygun/gps/histpoint  0.0356  18
> /gate/source/xraygun/gps/histpoint  0.0357  11
> /gate/source/xraygun/gps/histpoint  0.0358  14
> /gate/source/xraygun/gps/histpoint  0.0359  12
> /gate/source/xraygun/gps/histpoint  0.0360  17
> /gate/source/xraygun/gps/histpoint  0.0362  14
> /gate/source/xraygun/gps/histpoint  0.0364  10
> /gate/source/xraygun/gps/histpoint  0.0365  7
> /gate/source/xraygun/gps/histpoint  0.0366  15
> /gate/source/xraygun/gps/histpoint  0.0367  14
> /gate/source/xraygun/gps/histpoint  0.0368  15
> /gate/source/xraygun/gps/histpoint  0.0369  11
> /gate/source/xraygun/gps/histpoint  0.0370  11
> /gate/source/xraygun/gps/histpoint  0.0372  13
> /gate/source/xraygun/gps/histpoint  0.0374  5
> /gate/source/xraygun/gps/histpoint  0.0375  12
> /gate/source/xraygun/gps/histpoint  0.0376  11
> /gate/source/xraygun/gps/histpoint  0.0377  12
> /gate/source/xraygun/gps/histpoint  0.0378  15
> /gate/source/xraygun/gps/histpoint  0.0379  9
> /gate/source/xraygun/gps/histpoint  0.0380  10
> /gate/source/xraygun/gps/histpoint  0.0382  6
> /gate/source/xraygun/gps/histpoint  0.0384  6
> /gate/source/xraygun/gps/histpoint  0.0385  6
> /gate/source/xraygun/gps/histpoint  0.0386  7
> /gate/source/xraygun/gps/histpoint  0.0387  5
> /gate/source/xraygun/gps/histpoint  0.0388  5
> /gate/source/xraygun/gps/histpoint  0.0389  4
> /gate/source/xraygun/gps/histpoint  0.0390  6
> /gate/source/xraygun/gps/histpoint  0.0392  9
> /gate/source/xraygun/gps/histpoint  0.0394  5
> /gate/source/xraygun/gps/histpoint  0.0395  4
> /gate/source/xraygun/gps/histpoint  0.0396  0
> /gate/source/xraygun/gps/histpoint  0.0397  0
> /gate/source/xraygun/gps/histpoint  0.0398  0
> /gate/source/xraygun/gps/histpoint  0.0399  0
> /gate/source/xraygun/gps/histpoint  0.0400  0
> /gate/source/xraygun/gps/arbint Lin
> /gate/source/xraygun/gps/type Plane
> /gate/source/xraygun/gps/shape Rectangle
> /gate/source/xraygun/gps/halfx 0.5 mm
> /gate/source/xraygun/gps/halfy 0.5 mm
> /gate/source/xraygun/gps/mintheta 0  deg
> /gate/source/xraygun/gps/maxtheta  20 deg
> /gate/source/xraygun/gps/centre 0. 0 -30. cm
> /gate/source/xraygun/gps/angtype iso
> /gate/source/list
>
>
>
> **** COMMENT ****
>
> **** INPUTS ****
> kVp [kV] hvMIN [keV] Dhv [keV]
> 80  35  1
> Angle [deg.]
> 20
> t_AIR t_BE t_AL t_CU t_SN t_W t_Wa [mm]
> 1000  0  1.8  0.2  0  0  0
> Nf P
> 0.68  0.33
> ****CALCULATED OUTPUTS ****
> Brem[uGy/mAs at 1m] Char[uGy/mAs at 1m]
> 18.27917  0.5059507
> HVL1[cm AL] HVL2[cm AL] HVL1[cmCu] HVL2[cmCu] MeanE[keV] EffEAl[keV] 
> EffECu[keV]
> 0.6468978  0.7113056  0.0274761  0.0345901  52.70842  47.94336  48.65286
> **** CALCULATED SPECTRUM ****
> Energy[keV]  N[keV cm^2 mAs]^-1 @ 1 meter
> 35  1.187381e+6
> 36  1.280875e+6
> 37  1.364120e+6
> 38  1.438492e+6
> 39  1.499967e+6
> 40  1.553381e+6
> 41  1.594962e+6
> 42  1.629092e+6
> 43  1.652779e+6
> 44  1.669283e+6
> 45  1.675181e+6
> 46  1.676172e+6
> 47  1.669860e+6
> 48  1.657938e+6
> 49  1.640536e+6
> 50  1.618250e+6
> 51  1.591554e+6
> 52  1.558279e+6
> 53  1.525396e+6
> 54  1.488330e+6
> 55  1.450930e+6
> 56  1.407308e+6
> 57  1.364181e+6
> 58  1.804551e+6
> 59  2.125239e+6
> 60  1.226175e+6
> 61  1.177968e+6
> 62  1.127134e+6
> 63  1.076617e+6
> 64  1.026495e+6
> 65  974002.7
> 66  922461.9
> 67  1.174642e+6
> 68  815959.8
> 69  844593.3
> 70  687849.9
> 71  635229.3
> 72  583219.2
> 73  529320.2
> 74  474595.1
> 75  418300.2
> 76  356307.2
> 77  294032.1
> 78  231207.9
> 79  128305.2
> 80  0
>
>
>
>
>
>
>
> --------------------------------
> MSc Student in Biomedical and Biophysics Engineering at Faculty of 
> Sciences of the University of Lisbon
>
> Instituteof Biophysics andBiomedical Engineering
> Facultyof Sciences, Universityof Lisbon
> Campo Grande
> 1749-016 Lisbon
>
> Room Office: 1.02
> Extension: 20509
> Email: ammonteiro at fc.ul.pt
> LinkedIn Profile: http://linkedin.com/in/andremmonteiro
> Website: http://www.ibeb.fc.ul.pt/
>
>
> _______________________________________________
> Gate-users mailing list
> Gate-users at lists.opengatecollaboration.org
> http://lists.opengatecollaboration.org/mailman/listinfo/gate-users


Dear André Miguel Monteiro,

you can simply replace the histogram values in the CT-example by any 
histogram values you like.
Keep in mind that:
     - Unit of energy values = MeV
     - Max. number of histogram points = 1024

It might be useful to generate the histpoint lines by a script.
Assuming the file "SpekCalc.dat" contains the SpekCalc simulation result 
in ASCII file format,
you can use Matlab/Octave for instance:

    /spec_in = load('SpekCalc.dat');/ /  %output of SpekCalc simulation;
    assumed to be an ASCII file/
    /energ = spec_in(:,1)/1000;           %keV->MeV/
    /intens = spec_in(:,2);/
    /fileID = fopen('source_tmp.txt','w');/
    /for i = 1 : length(energ)/
    /    str = ['fprintf(fid,''/gate/source/xraygun/gps/histpoint ',
    num2str(energ(i)),' ', num2str(intens(i)),' \n'');'];/
    /    fprintf(fileID,'%s\n',str);/
    /end/
    /fclose(fileID);/


Best regards,
Simon Schlesinger

-- 
Dipl.-Phys. Simon Schlesinger
Bergische Universität Wuppertal
FB C - Physik, G11.07a

Tel.: 0202 / 439 - 2804
Mobil: 0151 / 401 21 890
Mail: schlesinger at uni-wuppertal.de
Web: http://www.techphys.uni-wuppertal.de

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opengatecollaboration.org/mailman/private/gate-users/attachments/20150323/6ae18039/attachment-0001.html>


More information about the Gate-users mailing list