diff --git a/.gitignore b/.gitignore
index 1e8d53e0a..d65a3c5cf 100644
--- a/.gitignore
+++ b/.gitignore
@@ -4,5 +4,9 @@ testresults.xml
coverage.xml
coverage.json
*.asv
-build/
.DS_Store
+build/
+/MCNP/runfiles_tmp
+/MCNP/logFile
+MCNP/matRad_MCNPConfig.m
+
diff --git a/MCNP/KERMA_factors/README.txt b/MCNP/KERMA_factors/README.txt
new file mode 100644
index 000000000..08e8c5fa5
--- /dev/null
+++ b/MCNP/KERMA_factors/README.txt
@@ -0,0 +1,45 @@
+---------------------------------------------------
+Neutron KERMA Factors taken from ICRU Report 46
+---------------------------------------------------
+Note: In ICRU 46 data from ICRU-33 and -44 are
+given. I.e.:
+---------------------------------------------------
+
+Air: set to zero for all energies
+Lung: ICRU-44
+Soft Tissue: ICRU-33
+Bone: ICRU-44
+
+---------------------------------------------------
+Format: 1st column: Energy in MeV
+ 2nd column: Kerma Factors in Gy m^2
+
+---------------------------------------------------
+Photon KERMA Factors calculated from ICRU Report 46
+---------------------------------------------------
+Note A: Bremsstrahlungsloss is neglected
+Note B: In ICRU 46 data from ICRU-33 and -44 are
+given. I.e.:
+---------------------------------------------------
+
+Air: set to zero for all energies
+Lung: ICRU-44
+Soft Tissue: ICRU-33
+Bone: ICRU-44
+
+---------------------------------------------------
+Format: 1st column: Energy in MeV
+ 2nd column: Kerma Factors in Gy m^2
+
+---------------------------------------------------
+---------------------------------------------------
+---------------------------------------------------
+Last Number in filenames has to be equal to
+material index set in the variable
+'binIntervals' and read to
+'ct.tissueBin.matIndex'.
+
+Air: neutronKERMA_1.txt
+Lung: neutronKERMA_2.txt
+Soft Tissue: neutronKERMA_3.txt
+Bone: neutronKERMA_4.txt
\ No newline at end of file
diff --git a/MCNP/KERMA_factors/comparisonKermaFactors_neutrons.eps b/MCNP/KERMA_factors/comparisonKermaFactors_neutrons.eps
new file mode 100644
index 000000000..e36a96338
--- /dev/null
+++ b/MCNP/KERMA_factors/comparisonKermaFactors_neutrons.eps
@@ -0,0 +1,6322 @@
+%!PS-Adobe-3.0 EPSF-3.0
+%%Creator: (MATLAB, The Mathworks, Inc. Version 9.7.0.1216025 \(R2019b\) Update 1. Operating System: Windows 10)
+%%Title: ./comparisonKermaFactors_neutrons.eps
+%%CreationDate: 2021-12-06T16:41:41
+%%Pages: (atend)
+%%BoundingBox: 48 1 729 527
+%%LanguageLevel: 3
+%%EndComments
+%%BeginProlog
+%%BeginResource: procset (Apache XML Graphics Std ProcSet) 1.2 0
+%%Version: 1.2 0
+%%Copyright: (Copyright 2001-2003,2010 The Apache Software Foundation. License terms: http://www.apache.org/licenses/LICENSE-2.0)
+/bd{bind def}bind def
+/ld{load def}bd
+/GR/grestore ld
+/GS/gsave ld
+/RM/rmoveto ld
+/C/curveto ld
+/t/show ld
+/L/lineto ld
+/ML/setmiterlimit ld
+/CT/concat ld
+/f/fill ld
+/N/newpath ld
+/S/stroke ld
+/CC/setcmykcolor ld
+/A/ashow ld
+/cp/closepath ld
+/RC/setrgbcolor ld
+/LJ/setlinejoin ld
+/GC/setgray ld
+/LW/setlinewidth ld
+/M/moveto ld
+/re {4 2 roll M
+1 index 0 rlineto
+0 exch rlineto
+neg 0 rlineto
+cp } bd
+/_ctm matrix def
+/_tm matrix def
+/BT { _ctm currentmatrix pop matrix _tm copy pop 0 0 moveto } bd
+/ET { _ctm setmatrix } bd
+/iTm { _ctm setmatrix _tm concat } bd
+/Tm { _tm astore pop iTm 0 0 moveto } bd
+/ux 0.0 def
+/uy 0.0 def
+/F {
+ /Tp exch def
+ /Tf exch def
+ Tf findfont Tp scalefont setfont
+ /cf Tf def /cs Tp def
+} bd
+/ULS {currentpoint /uy exch def /ux exch def} bd
+/ULE {
+ /Tcx currentpoint pop def
+ gsave
+ newpath
+ cf findfont cs scalefont dup
+ /FontMatrix get 0 get /Ts exch def /FontInfo get dup
+ /UnderlinePosition get Ts mul /To exch def
+ /UnderlineThickness get Ts mul /Tt exch def
+ ux uy To add moveto Tcx uy To add lineto
+ Tt setlinewidth stroke
+ grestore
+} bd
+/OLE {
+ /Tcx currentpoint pop def
+ gsave
+ newpath
+ cf findfont cs scalefont dup
+ /FontMatrix get 0 get /Ts exch def /FontInfo get dup
+ /UnderlinePosition get Ts mul /To exch def
+ /UnderlineThickness get Ts mul /Tt exch def
+ ux uy To add cs add moveto Tcx uy To add cs add lineto
+ Tt setlinewidth stroke
+ grestore
+} bd
+/SOE {
+ /Tcx currentpoint pop def
+ gsave
+ newpath
+ cf findfont cs scalefont dup
+ /FontMatrix get 0 get /Ts exch def /FontInfo get dup
+ /UnderlinePosition get Ts mul /To exch def
+ /UnderlineThickness get Ts mul /Tt exch def
+ ux uy To add cs 10 mul 26 idiv add moveto Tcx uy To add cs 10 mul 26 idiv add lineto
+ Tt setlinewidth stroke
+ grestore
+} bd
+/QT {
+/Y22 exch store
+/X22 exch store
+/Y21 exch store
+/X21 exch store
+currentpoint
+/Y21 load 2 mul add 3 div exch
+/X21 load 2 mul add 3 div exch
+/X21 load 2 mul /X22 load add 3 div
+/Y21 load 2 mul /Y22 load add 3 div
+/X22 load /Y22 load curveto
+} bd
+/SSPD {
+dup length /d exch dict def
+{
+/v exch def
+/k exch def
+currentpagedevice k known {
+/cpdv currentpagedevice k get def
+v cpdv ne {
+/upd false def
+/nullv v type /nulltype eq def
+/nullcpdv cpdv type /nulltype eq def
+nullv nullcpdv or
+{
+/upd true def
+} {
+/sametype v type cpdv type eq def
+sametype {
+v type /arraytype eq {
+/vlen v length def
+/cpdvlen cpdv length def
+vlen cpdvlen eq {
+0 1 vlen 1 sub {
+/i exch def
+/obj v i get def
+/cpdobj cpdv i get def
+obj cpdobj ne {
+/upd true def
+exit
+} if
+} for
+} {
+/upd true def
+} ifelse
+} {
+v type /dicttype eq {
+v {
+/dv exch def
+/dk exch def
+/cpddv cpdv dk get def
+dv cpddv ne {
+/upd true def
+exit
+} if
+} forall
+} {
+/upd true def
+} ifelse
+} ifelse
+} if
+} ifelse
+upd true eq {
+d k v put
+} if
+} if
+} if
+} forall
+d length 0 gt {
+d setpagedevice
+} if
+} bd
+/RE { % /NewFontName [NewEncodingArray] /FontName RE -
+ findfont dup length dict begin
+ {
+ 1 index /FID ne
+ {def} {pop pop} ifelse
+ } forall
+ /Encoding exch def
+ /FontName 1 index def
+ currentdict definefont pop
+ end
+} bind def
+%%EndResource
+%%BeginResource: procset (Apache XML Graphics EPS ProcSet) 1.0 0
+%%Version: 1.0 0
+%%Copyright: (Copyright 2002-2003 The Apache Software Foundation. License terms: http://www.apache.org/licenses/LICENSE-2.0)
+/BeginEPSF { %def
+/b4_Inc_state save def % Save state for cleanup
+/dict_count countdictstack def % Count objects on dict stack
+/op_count count 1 sub def % Count objects on operand stack
+userdict begin % Push userdict on dict stack
+/showpage { } def % Redefine showpage, { } = null proc
+0 setgray 0 setlinecap % Prepare graphics state
+1 setlinewidth 0 setlinejoin
+10 setmiterlimit [ ] 0 setdash newpath
+/languagelevel where % If level not equal to 1 then
+{pop languagelevel % set strokeadjust and
+1 ne % overprint to their defaults.
+{false setstrokeadjust false setoverprint
+} if
+} if
+} bd
+/EndEPSF { %def
+count op_count sub {pop} repeat % Clean up stacks
+countdictstack dict_count sub {end} repeat
+b4_Inc_state restore
+} bd
+%%EndResource
+%FOPBeginFontDict
+%%IncludeResource: font Courier-Oblique
+%%IncludeResource: font Courier-BoldOblique
+%%IncludeResource: font Courier-Bold
+%%IncludeResource: font ZapfDingbats
+%%IncludeResource: font Symbol
+%%IncludeResource: font Helvetica
+%%IncludeResource: font Helvetica-Oblique
+%%IncludeResource: font Helvetica-Bold
+%%IncludeResource: font Helvetica-BoldOblique
+%%IncludeResource: font Times-Roman
+%%IncludeResource: font Times-Italic
+%%IncludeResource: font Times-Bold
+%%IncludeResource: font Times-BoldItalic
+%%IncludeResource: font Courier
+%FOPEndFontDict
+%%BeginResource: encoding WinAnsiEncoding
+/WinAnsiEncoding [
+/.notdef /.notdef /.notdef /.notdef /.notdef
+/.notdef /.notdef /.notdef /.notdef /.notdef
+/.notdef /.notdef /.notdef /.notdef /.notdef
+/.notdef /.notdef /.notdef /.notdef /.notdef
+/.notdef /.notdef /.notdef /.notdef /.notdef
+/.notdef /.notdef /.notdef /.notdef /.notdef
+/.notdef /.notdef /space /exclam /quotedbl
+/numbersign /dollar /percent /ampersand /quotesingle
+/parenleft /parenright /asterisk /plus /comma
+/hyphen /period /slash /zero /one
+/two /three /four /five /six
+/seven /eight /nine /colon /semicolon
+/less /equal /greater /question /at
+/A /B /C /D /E
+/F /G /H /I /J
+/K /L /M /N /O
+/P /Q /R /S /T
+/U /V /W /X /Y
+/Z /bracketleft /backslash /bracketright /asciicircum
+/underscore /quoteleft /a /b /c
+/d /e /f /g /h
+/i /j /k /l /m
+/n /o /p /q /r
+/s /t /u /v /w
+/x /y /z /braceleft /bar
+/braceright /asciitilde /bullet /Euro /bullet
+/quotesinglbase /florin /quotedblbase /ellipsis /dagger
+/daggerdbl /circumflex /perthousand /Scaron /guilsinglleft
+/OE /bullet /Zcaron /bullet /bullet
+/quoteleft /quoteright /quotedblleft /quotedblright /bullet
+/endash /emdash /asciitilde /trademark /scaron
+/guilsinglright /oe /bullet /zcaron /Ydieresis
+/space /exclamdown /cent /sterling /currency
+/yen /brokenbar /section /dieresis /copyright
+/ordfeminine /guillemotleft /logicalnot /sfthyphen /registered
+/macron /degree /plusminus /twosuperior /threesuperior
+/acute /mu /paragraph /middot /cedilla
+/onesuperior /ordmasculine /guillemotright /onequarter /onehalf
+/threequarters /questiondown /Agrave /Aacute /Acircumflex
+/Atilde /Adieresis /Aring /AE /Ccedilla
+/Egrave /Eacute /Ecircumflex /Edieresis /Igrave
+/Iacute /Icircumflex /Idieresis /Eth /Ntilde
+/Ograve /Oacute /Ocircumflex /Otilde /Odieresis
+/multiply /Oslash /Ugrave /Uacute /Ucircumflex
+/Udieresis /Yacute /Thorn /germandbls /agrave
+/aacute /acircumflex /atilde /adieresis /aring
+/ae /ccedilla /egrave /eacute /ecircumflex
+/edieresis /igrave /iacute /icircumflex /idieresis
+/eth /ntilde /ograve /oacute /ocircumflex
+/otilde /odieresis /divide /oslash /ugrave
+/uacute /ucircumflex /udieresis /yacute /thorn
+/ydieresis
+] def
+%%EndResource
+%FOPBeginFontReencode
+/Courier-Oblique findfont
+dup length dict begin
+ {1 index /FID ne {def} {pop pop} ifelse} forall
+ /Encoding WinAnsiEncoding def
+ currentdict
+end
+/Courier-Oblique exch definefont pop
+/Courier-BoldOblique findfont
+dup length dict begin
+ {1 index /FID ne {def} {pop pop} ifelse} forall
+ /Encoding WinAnsiEncoding def
+ currentdict
+end
+/Courier-BoldOblique exch definefont pop
+/Courier-Bold findfont
+dup length dict begin
+ {1 index /FID ne {def} {pop pop} ifelse} forall
+ /Encoding WinAnsiEncoding def
+ currentdict
+end
+/Courier-Bold exch definefont pop
+/Helvetica findfont
+dup length dict begin
+ {1 index /FID ne {def} {pop pop} ifelse} forall
+ /Encoding WinAnsiEncoding def
+ currentdict
+end
+/Helvetica exch definefont pop
+/Helvetica-Oblique findfont
+dup length dict begin
+ {1 index /FID ne {def} {pop pop} ifelse} forall
+ /Encoding WinAnsiEncoding def
+ currentdict
+end
+/Helvetica-Oblique exch definefont pop
+/Helvetica-Bold findfont
+dup length dict begin
+ {1 index /FID ne {def} {pop pop} ifelse} forall
+ /Encoding WinAnsiEncoding def
+ currentdict
+end
+/Helvetica-Bold exch definefont pop
+/Helvetica-BoldOblique findfont
+dup length dict begin
+ {1 index /FID ne {def} {pop pop} ifelse} forall
+ /Encoding WinAnsiEncoding def
+ currentdict
+end
+/Helvetica-BoldOblique exch definefont pop
+/Times-Roman findfont
+dup length dict begin
+ {1 index /FID ne {def} {pop pop} ifelse} forall
+ /Encoding WinAnsiEncoding def
+ currentdict
+end
+/Times-Roman exch definefont pop
+/Times-Italic findfont
+dup length dict begin
+ {1 index /FID ne {def} {pop pop} ifelse} forall
+ /Encoding WinAnsiEncoding def
+ currentdict
+end
+/Times-Italic exch definefont pop
+/Times-Bold findfont
+dup length dict begin
+ {1 index /FID ne {def} {pop pop} ifelse} forall
+ /Encoding WinAnsiEncoding def
+ currentdict
+end
+/Times-Bold exch definefont pop
+/Times-BoldItalic findfont
+dup length dict begin
+ {1 index /FID ne {def} {pop pop} ifelse} forall
+ /Encoding WinAnsiEncoding def
+ currentdict
+end
+/Times-BoldItalic exch definefont pop
+/Courier findfont
+dup length dict begin
+ {1 index /FID ne {def} {pop pop} ifelse} forall
+ /Encoding WinAnsiEncoding def
+ currentdict
+end
+/Courier exch definefont pop
+%FOPEndFontReencode
+%%EndProlog
+%%Page: 1 1
+%%PageBoundingBox: 0 0 794 539
+%%BeginPageSetup
+[1 0 0 -1 0 539] CT
+%%EndPageSetup
+GS
+[0.75019 0 0 0.75012 0 0.41736] CT
+1 GC
+N
+0 0 1058 718 re
+f
+GR
+GS
+[0.75019 0 0 0.75012 0 0.41736] CT
+1 GC
+N
+0 0 1058 718 re
+f
+GR
+GS
+[0.75019 0 0 0.75012 0 0.41736] CT
+1 GC
+N
+138 630 M
+957 630 L
+957 54 L
+138 54 L
+cp
+f
+GR
+GS
+[0.75019 0 0 0.75012 0 0.41736] CT
+0.149 GC
+2 setlinecap
+1 LJ
+1.333 LW
+N
+138 630 M
+957 630 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 0 0.41736] CT
+0.149 GC
+2 setlinecap
+1 LJ
+1.333 LW
+N
+138 54 M
+957 54 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 0 0.41736] CT
+0.149 GC
+2 setlinecap
+1 LJ
+1.333 LW
+N
+138 630 M
+138 621.81 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 0 0.41736] CT
+0.149 GC
+2 setlinecap
+1 LJ
+1.333 LW
+N
+301.8 630 M
+301.8 621.81 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 0 0.41736] CT
+0.149 GC
+2 setlinecap
+1 LJ
+1.333 LW
+N
+465.6 630 M
+465.6 621.81 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 0 0.41736] CT
+0.149 GC
+2 setlinecap
+1 LJ
+1.333 LW
+N
+629.4 630 M
+629.4 621.81 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 0 0.41736] CT
+0.149 GC
+2 setlinecap
+1 LJ
+1.333 LW
+N
+793.2 630 M
+793.2 621.81 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 0 0.41736] CT
+0.149 GC
+2 setlinecap
+1 LJ
+1.333 LW
+N
+957 630 M
+957 621.81 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 0 0.41736] CT
+0.149 GC
+2 setlinecap
+1 LJ
+1.333 LW
+N
+138 54 M
+138 62.19 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 0 0.41736] CT
+0.149 GC
+2 setlinecap
+1 LJ
+1.333 LW
+N
+301.8 54 M
+301.8 62.19 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 0 0.41736] CT
+0.149 GC
+2 setlinecap
+1 LJ
+1.333 LW
+N
+465.6 54 M
+465.6 62.19 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 0 0.41736] CT
+0.149 GC
+2 setlinecap
+1 LJ
+1.333 LW
+N
+629.4 54 M
+629.4 62.19 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 0 0.41736] CT
+0.149 GC
+2 setlinecap
+1 LJ
+1.333 LW
+N
+793.2 54 M
+793.2 62.19 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 0 0.41736] CT
+0.149 GC
+2 setlinecap
+1 LJ
+1.333 LW
+N
+957 54 M
+957 62.19 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 103.52619 479.39085] CT
+0.149 GC
+/Helvetica 29.333 F
+GS
+[1 0 0 1 0 0] CT
+-8.5 30 moveto
+1 -1 scale
+(0) t
+GR
+GR
+GS
+[0.75019 0 0 0.75012 226.40727 479.39085] CT
+0.149 GC
+/Helvetica 29.333 F
+GS
+[1 0 0 1 0 0] CT
+-8.5 30 moveto
+1 -1 scale
+(2) t
+GR
+GR
+GS
+[0.75019 0 0 0.75012 349.28837 479.39085] CT
+0.149 GC
+/Helvetica 29.333 F
+GS
+[1 0 0 1 0 0] CT
+-8.5 30 moveto
+1 -1 scale
+(4) t
+GR
+GR
+GS
+[0.75019 0 0 0.75012 472.16948 479.39085] CT
+0.149 GC
+/Helvetica 29.333 F
+GS
+[1 0 0 1 0 0] CT
+-8.5 30 moveto
+1 -1 scale
+(6) t
+GR
+GR
+GS
+[0.75019 0 0 0.75012 595.05056 479.39085] CT
+0.149 GC
+/Helvetica 29.333 F
+GS
+[1 0 0 1 0 0] CT
+-8.5 30 moveto
+1 -1 scale
+(8) t
+GR
+GR
+GS
+[0.75019 0 0 0.75012 717.93164 479.39085] CT
+0.149 GC
+/Helvetica 29.333 F
+GS
+[1 0 0 1 0 0] CT
+-16.5 30 moveto
+1 -1 scale
+(10) t
+GR
+GR
+GS
+[0.75019 0 0 0.75012 410.72919 508.14524] CT
+0.149 GC
+/Helvetica 32.267 F
+GS
+[1 0 0 1 0 0] CT
+-98 33 moveto
+1 -1 scale
+(Energy [MeV]) t
+GR
+GR
+GS
+[0.75019 0 0 0.75012 0 0.41736] CT
+0.149 GC
+2 setlinecap
+1 LJ
+1.333 LW
+N
+138 630 M
+138 54 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 0 0.41736] CT
+0.149 GC
+2 setlinecap
+1 LJ
+1.333 LW
+N
+957 630 M
+957 54 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 0 0.41736] CT
+0.149 GC
+2 setlinecap
+1 LJ
+1.333 LW
+N
+138 630 M
+146.19 630 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 0 0.41736] CT
+0.149 GC
+2 setlinecap
+1 LJ
+1.333 LW
+N
+138 534 M
+146.19 534 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 0 0.41736] CT
+0.149 GC
+2 setlinecap
+1 LJ
+1.333 LW
+N
+138 438 M
+146.19 438 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 0 0.41736] CT
+0.149 GC
+2 setlinecap
+1 LJ
+1.333 LW
+N
+138 342 M
+146.19 342 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 0 0.41736] CT
+0.149 GC
+2 setlinecap
+1 LJ
+1.333 LW
+N
+138 246 M
+146.19 246 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 0 0.41736] CT
+0.149 GC
+2 setlinecap
+1 LJ
+1.333 LW
+N
+138 150 M
+146.19 150 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 0 0.41736] CT
+0.149 GC
+2 setlinecap
+1 LJ
+1.333 LW
+N
+138 54 M
+146.19 54 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 0 0.41736] CT
+0.149 GC
+2 setlinecap
+1 LJ
+1.333 LW
+N
+957 630 M
+948.81 630 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 0 0.41736] CT
+0.149 GC
+2 setlinecap
+1 LJ
+1.333 LW
+N
+957 534 M
+948.81 534 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 0 0.41736] CT
+0.149 GC
+2 setlinecap
+1 LJ
+1.333 LW
+N
+957 438 M
+948.81 438 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 0 0.41736] CT
+0.149 GC
+2 setlinecap
+1 LJ
+1.333 LW
+N
+957 342 M
+948.81 342 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 0 0.41736] CT
+0.149 GC
+2 setlinecap
+1 LJ
+1.333 LW
+N
+957 246 M
+948.81 246 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 0 0.41736] CT
+0.149 GC
+2 setlinecap
+1 LJ
+1.333 LW
+N
+957 150 M
+948.81 150 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 0 0.41736] CT
+0.149 GC
+2 setlinecap
+1 LJ
+1.333 LW
+N
+957 54 M
+948.81 54 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 97.12457 472.98987] CT
+0.149 GC
+/Helvetica 29.333 F
+GS
+[1 0 0 1 0 0] CT
+-17 11.5 moveto
+1 -1 scale
+(0) t
+GR
+GR
+GS
+[0.75019 0 0 0.75012 97.12457 400.97882] CT
+0.149 GC
+/Helvetica 29.333 F
+GS
+[1 0 0 1 0 0] CT
+-17 11.5 moveto
+1 -1 scale
+(1) t
+GR
+GR
+GS
+[0.75019 0 0 0.75012 97.12457 328.96777] CT
+0.149 GC
+/Helvetica 29.333 F
+GS
+[1 0 0 1 0 0] CT
+-17 11.5 moveto
+1 -1 scale
+(2) t
+GR
+GR
+GS
+[0.75019 0 0 0.75012 97.12457 256.95672] CT
+0.149 GC
+/Helvetica 29.333 F
+GS
+[1 0 0 1 0 0] CT
+-17 11.5 moveto
+1 -1 scale
+(3) t
+GR
+GR
+GS
+[0.75019 0 0 0.75012 97.12457 184.94566] CT
+0.149 GC
+/Helvetica 29.333 F
+GS
+[1 0 0 1 0 0] CT
+-17 11.5 moveto
+1 -1 scale
+(4) t
+GR
+GR
+GS
+[0.75019 0 0 0.75012 97.12457 112.93463] CT
+0.149 GC
+/Helvetica 29.333 F
+GS
+[1 0 0 1 0 0] CT
+-17 11.5 moveto
+1 -1 scale
+(5) t
+GR
+GR
+GS
+[0.75019 0 0 0.75012 97.12457 40.92357] CT
+0.149 GC
+/Helvetica 29.333 F
+GS
+[1 0 0 1 0 0] CT
+-17 11.5 moveto
+1 -1 scale
+(6) t
+GR
+GR
+GS
+[0 -0.75012 0.75019 0 75.01898 388.97698] CT
+0.149 GC
+/Helvetica 32.267 F
+GS
+[1 0 0 1 0 0] CT
+0 0 moveto
+1 -1 scale
+(KERMA Factors [Gy m) t
+GR
+GR
+GS
+[0 -0.75012 0.75019 0 63.01594 143.68934] CT
+0.149 GC
+/Helvetica 25.813 F
+GS
+[1 0 0 1 0 0] CT
+0 0 moveto
+1 -1 scale
+(2) t
+GR
+GR
+GS
+[0 -0.75012 0.75019 0 75.01898 132.43762] CT
+0.149 GC
+/Helvetica 32.267 F
+GS
+[1 0 0 1 0 0] CT
+0 0 moveto
+1 -1 scale
+(]) t
+GR
+GR
+GS
+[0.75019 0 0 0.75012 103.52619 35.67277] CT
+0.149 GC
+N
+4.266 -0.828 M
+4.266 -1.063 4.406 -1.25 QT
+10.438 -7.25 L
+4.406 -13.281 L
+4.266 -13.422 4.266 -13.672 QT
+4.266 -13.875 4.438 -14.063 QT
+4.609 -14.25 4.844 -14.25 QT
+5.047 -14.25 5.281 -14.063 QT
+11.281 -8.063 L
+17.266 -14.063 L
+17.5 -14.25 17.688 -14.25 QT
+17.922 -14.25 18.094 -14.078 QT
+18.266 -13.906 18.266 -13.672 QT
+18.266 -13.422 18.125 -13.281 QT
+12.094 -7.25 L
+18.125 -1.25 L
+18.266 -1.063 18.266 -0.828 QT
+18.266 -0.594 18.094 -0.422 QT
+17.922 -0.25 17.688 -0.25 QT
+17.469 -0.25 17.266 -0.469 QT
+11.281 -6.438 L
+5.281 -0.469 L
+5.063 -0.25 4.844 -0.25 QT
+4.609 -0.25 4.438 -0.438 QT
+4.266 -0.625 4.266 -0.828 QT
+cp
+f
+GR
+GS
+[0.75019 0 0 0.75012 120.78056 35.67277] CT
+0.149 GC
+/Helvetica 29.333 F
+GS
+[1 0 0 1 0 0] CT
+0 0 moveto
+1 -1 scale
+(10) t
+GR
+GR
+GS
+[0.75019 0 0 0.75012 145.53682 25.17116] CT
+0.149 GC
+/Helvetica 23.467 F
+GS
+[1 0 0 1 0 0] CT
+0 0 moveto
+1 -1 scale
+(-15) t
+GR
+GR
+GS
+[0.75019 0 0 0.75012 0 0.41736] CT
+0 0.447 0.741 RC
+1 LJ
+1.333 LW
+N
+138 628.003 M
+138 628.31 L
+138 628.723 L
+138 629.03 L
+138 629.281 L
+138 629.464 L
+138 629.594 L
+138 629.693 L
+138 629.771 L
+138 629.827 L
+138.001 629.866 L
+138.001 629.892 L
+138.002 629.908 L
+138.003 629.911 L
+138.005 629.898 L
+138.009 629.863 L
+138.016 629.782 L
+138.029 629.632 L
+138.052 629.376 L
+138.09 628.925 L
+138.164 628.07 L
+138.295 626.554 L
+138.516 624.086 L
+138.901 620.016 L
+139.638 612.624 L
+140.948 601.296 L
+143.16 585.36 L
+144.716 576.048 L
+145.043 574.224 L
+145.371 572.496 L
+145.699 570.768 L
+146.026 569.04 L
+146.6 566.16 L
+147.419 562.224 L
+148.238 558.48 L
+149.057 554.928 L
+149.876 551.472 L
+150.695 548.304 L
+151.514 545.232 L
+152.333 542.16 L
+153.152 539.376 L
+153.971 536.592 L
+155.199 532.08 L
+156.837 527.28 L
+158.475 522.48 L
+160.113 517.68 L
+161.751 512.88 L
+163.389 508.08 L
+165.027 504.24 L
+166.665 499.44 L
+168.303 494.64 L
+169.941 487.92 L
+172.398 475.44 L
+175.674 473.52 L
+178.95 478.32 L
+182.226 472.56 L
+185.502 466.8 L
+188.778 461.04 L
+192.054 455.28 L
+195.33 450.48 L
+198.606 445.68 L
+201.882 439.92 L
+205.158 435.12 L
+208.434 430.32 L
+211.71 423.6 L
+214.986 414 L
+218.262 395.76 L
+223.995 392.88 L
+232.185 395.76 L
+240.375 386.16 L
+248.565 378.48 L
+256.755 373.68 L
+264.945 366.96 L
+273.135 356.4 L
+281.325 353.52 L
+289.515 342 L
+297.705 340.08 L
+309.99 332.4 L
+326.37 327.6 L
+342.75 316.08 L
+359.13 301.68 L
+375.51 289.2 L
+391.89 275.76 L
+408.27 244.08 L
+424.65 236.4 L
+441.03 226.8 L
+457.41 233.52 L
+481.98 221.04 L
+514.74 221.04 L
+547.5 197.04 L
+580.26 208.56 L
+613.02 188.4 L
+645.78 177.84 L
+678.54 165.36 L
+711.3 144.24 L
+744.06 118.32 L
+776.82 126.96 L
+809.58 130.8 L
+842.34 113.52 L
+875.1 105.84 L
+907.86 102 L
+940.62 88.56 L
+957.098 84.697 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 103.52619 471.49202] CT
+0 0.447 0.741 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 103.52619 471.7225] CT
+0 0.447 0.741 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 103.52619 472.03213] CT
+0 0.447 0.741 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 103.5262 472.26256] CT
+0 0.447 0.741 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 103.5262 472.4505] CT
+0 0.447 0.741 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 103.52621 472.58803] CT
+0 0.447 0.741 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 103.52623 472.68527] CT
+0 0.447 0.741 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 103.52626 472.75944] CT
+0 0.447 0.741 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 103.52632 472.81777] CT
+0 0.447 0.741 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 103.52641 472.86026] CT
+0 0.447 0.741 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 103.52658 472.88906] CT
+0 0.447 0.741 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 103.52687 472.9092] CT
+0 0.447 0.741 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 103.52742 472.92115] CT
+0 0.447 0.741 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 103.5284 472.92326] CT
+0 0.447 0.741 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 103.53006 472.91355] CT
+0 0.447 0.741 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 103.53295 472.8869] CT
+0 0.447 0.741 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 103.53847 472.82642] CT
+0 0.447 0.741 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 103.54831 472.71407] CT
+0 0.447 0.741 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 103.56489 472.52178] CT
+0 0.447 0.741 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 103.59378 472.18335] CT
+0 0.447 0.741 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 103.64908 471.54243] CT
+0 0.447 0.741 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 103.74738 470.40467] CT
+0 0.447 0.741 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 103.91327 468.55401] CT
+0 0.447 0.741 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 104.20203 465.50072] CT
+0 0.447 0.741 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 104.755 459.95589] CT
+0 0.447 0.741 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 105.73805 451.45858] CT
+0 0.447 0.741 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 107.39695 439.50472] CT
+0 0.447 0.741 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 108.56432 432.51964] CT
+0 0.447 0.741 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 108.81008 431.15145] CT
+0 0.447 0.741 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 109.05584 429.85523] CT
+0 0.447 0.741 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 109.3016 428.55906] CT
+0 0.447 0.741 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 109.54736 427.26284] CT
+0 0.447 0.741 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 109.97745 425.1025] CT
+0 0.447 0.741 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 110.59186 422.15007] CT
+0 0.447 0.741 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 111.20626 419.34162] CT
+0 0.447 0.741 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 111.82067 416.67721] CT
+0 0.447 0.741 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 112.43507 414.08482] CT
+0 0.447 0.741 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 113.04948 411.70848] CT
+0 0.447 0.741 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 113.66388 409.40411] CT
+0 0.447 0.741 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 114.27829 407.09974] CT
+0 0.447 0.741 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 114.8927 405.01142] CT
+0 0.447 0.741 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 115.5071 402.9231] CT
+0 0.447 0.741 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 116.42871 399.53861] CT
+0 0.447 0.741 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 117.65752 395.93807] CT
+0 0.447 0.741 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 118.88633 392.33748] CT
+0 0.447 0.741 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 120.11514 388.73694] CT
+0 0.447 0.741 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 121.34394 385.13639] CT
+0 0.447 0.741 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 122.57276 381.53583] CT
+0 0.447 0.741 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 123.80157 378.65539] CT
+0 0.447 0.741 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 125.03038 375.05485] CT
+0 0.447 0.741 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 126.25919 371.4543] CT
+0 0.447 0.741 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 127.488 366.41351] CT
+0 0.447 0.741 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 129.33122 357.05208] CT
+0 0.447 0.741 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 131.78884 355.61185] CT
+0 0.447 0.741 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 134.24646 359.21242] CT
+0 0.447 0.741 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 136.70408 354.89175] CT
+0 0.447 0.741 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 139.16171 350.57108] CT
+0 0.447 0.741 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 141.61933 346.25043] CT
+0 0.447 0.741 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 144.07695 341.92976] CT
+0 0.447 0.741 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 146.53457 338.32922] CT
+0 0.447 0.741 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 148.9922 334.72865] CT
+0 0.447 0.741 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 151.44982 330.40798] CT
+0 0.447 0.741 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 153.90744 326.80744] CT
+0 0.447 0.741 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 156.36506 323.20689] CT
+0 0.447 0.741 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 158.82269 318.16612] CT
+0 0.447 0.741 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 161.2803 310.96501] CT
+0 0.447 0.741 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 163.73792 297.28292] CT
+0 0.447 0.741 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 168.03876 295.12258] CT
+0 0.447 0.741 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 174.18282 297.28292] CT
+0 0.447 0.741 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 180.32687 290.08181] CT
+0 0.447 0.741 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 186.47093 284.32093] CT
+0 0.447 0.741 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 192.61499 280.72036] CT
+0 0.447 0.741 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 198.75904 275.67959] CT
+0 0.447 0.741 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 204.9031 267.75838] CT
+0 0.447 0.741 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 211.04715 265.59806] CT
+0 0.447 0.741 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 217.19121 256.95672] CT
+0 0.447 0.741 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 223.33524 255.51651] CT
+0 0.447 0.741 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 232.55133 249.75564] CT
+0 0.447 0.741 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 244.83944 246.15507] CT
+0 0.447 0.741 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 257.12755 237.51373] CT
+0 0.447 0.741 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 269.41567 226.71208] CT
+0 0.447 0.741 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 281.70376 217.35065] CT
+0 0.447 0.741 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 293.99189 207.26911] CT
+0 0.447 0.741 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 306.28 183.50544] CT
+0 0.447 0.741 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 318.56809 177.74456] CT
+0 0.447 0.741 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 330.85621 170.54347] CT
+0 0.447 0.741 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 343.1443 175.58424] CT
+0 0.447 0.741 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 361.57646 166.22281] CT
+0 0.447 0.741 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 386.15269 166.22281] CT
+0 0.447 0.741 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 410.72891 148.22004] CT
+0 0.447 0.741 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 435.30514 156.86136] CT
+0 0.447 0.741 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 459.88132 141.73905] CT
+0 0.447 0.741 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 484.45759 133.81781] CT
+0 0.447 0.741 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 509.03381 124.45639] CT
+0 0.447 0.741 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 533.60999 108.61398] CT
+0 0.447 0.741 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 558.18622 89.17098] CT
+0 0.447 0.741 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 582.7624 95.65197] CT
+0 0.447 0.741 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 607.33867 98.53242] CT
+0 0.447 0.741 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 631.91489 85.57043] CT
+0 0.447 0.741 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 656.49107 79.80953] CT
+0 0.447 0.741 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 681.0673 76.92909] CT
+0 0.447 0.741 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 705.64352 66.84755] CT
+0 0.447 0.741 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 0 0.41736] CT
+0.851 0.325 0.098 RC
+1 LJ
+1.333 LW
+N
+138 627.6 M
+138 627.965 L
+138 628.464 L
+138 628.838 L
+138 629.138 L
+138 629.358 L
+138 629.513 L
+138 629.632 L
+138 629.724 L
+138 629.794 L
+138.001 629.841 L
+138.001 629.873 L
+138.002 629.893 L
+138.003 629.9 L
+138.005 629.889 L
+138.009 629.854 L
+138.016 629.773 L
+138.029 629.617 L
+138.052 629.359 L
+138.09 628.906 L
+138.164 628.032 L
+138.295 626.486 L
+138.516 623.971 L
+138.901 619.824 L
+139.638 612.24 L
+140.948 600.72 L
+143.16 584.496 L
+144.716 575.088 L
+145.043 573.168 L
+145.371 571.44 L
+145.699 569.616 L
+146.026 567.984 L
+146.6 565.008 L
+147.419 560.976 L
+148.238 557.232 L
+149.057 553.584 L
+149.876 550.128 L
+150.695 546.768 L
+151.514 543.696 L
+152.333 540.528 L
+153.152 537.744 L
+153.971 534.864 L
+155.199 531.12 L
+156.837 525.36 L
+158.475 520.56 L
+160.113 515.76 L
+161.751 510.96 L
+163.389 506.16 L
+165.027 502.32 L
+166.665 497.52 L
+168.303 492.72 L
+169.941 486 L
+172.398 472.56 L
+175.674 471.6 L
+178.95 475.44 L
+182.226 469.68 L
+185.502 463.92 L
+188.778 458.16 L
+192.054 452.4 L
+195.33 447.6 L
+198.606 442.8 L
+201.882 437.04 L
+205.158 432.24 L
+208.434 427.44 L
+211.71 420.72 L
+214.986 410.16 L
+218.262 392.88 L
+223.995 389.04 L
+232.185 391.92 L
+240.375 382.32 L
+248.565 373.68 L
+256.755 369.84 L
+264.945 363.12 L
+273.135 352.56 L
+281.325 348.72 L
+289.515 337.2 L
+297.705 335.28 L
+309.99 326.64 L
+326.37 322.8 L
+342.75 310.32 L
+359.13 295.92 L
+375.51 283.44 L
+391.89 269.04 L
+408.27 237.36 L
+424.65 229.68 L
+441.03 220.08 L
+457.41 226.8 L
+481.98 213.36 L
+514.74 213.36 L
+547.5 189.36 L
+580.26 200.88 L
+613.02 180.72 L
+645.78 170.16 L
+678.54 156.72 L
+711.3 136.56 L
+744.06 110.64 L
+776.82 119.28 L
+809.58 122.16 L
+842.34 105.84 L
+875.1 97.2 L
+907.86 94.32 L
+940.62 80.88 L
+957.098 77.017 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 103.52619 471.18958] CT
+0.851 0.325 0.098 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 103.52619 471.46322] CT
+0.851 0.325 0.098 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 103.52619 471.83769] CT
+0.851 0.325 0.098 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 103.5262 472.11852] CT
+0.851 0.325 0.098 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 103.5262 472.34323] CT
+0.851 0.325 0.098 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 103.52621 472.50814] CT
+0.851 0.325 0.098 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 103.52623 472.62479] CT
+0.851 0.325 0.098 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 103.52626 472.71407] CT
+0.851 0.325 0.098 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 103.52632 472.7832] CT
+0.851 0.325 0.098 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 103.52641 472.83503] CT
+0.851 0.325 0.098 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 103.52658 472.87033] CT
+0.851 0.325 0.098 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 103.52687 472.89482] CT
+0.851 0.325 0.098 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 103.52742 472.90993] CT
+0.851 0.325 0.098 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 103.5284 472.91497] CT
+0.851 0.325 0.098 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 103.53006 472.90632] CT
+0.851 0.325 0.098 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 103.53295 472.8804] CT
+0.851 0.325 0.098 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 103.53847 472.81992] CT
+0.851 0.325 0.098 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 103.54831 472.70253] CT
+0.851 0.325 0.098 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 103.56489 472.50883] CT
+0.851 0.325 0.098 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 103.59378 472.16893] CT
+0.851 0.325 0.098 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 103.64908 471.51363] CT
+0.851 0.325 0.098 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 103.74738 470.35426] CT
+0.851 0.325 0.098 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 103.91327 468.46757] CT
+0.851 0.325 0.098 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 104.20203 465.35668] CT
+0.851 0.325 0.098 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 104.755 459.66782] CT
+0.851 0.325 0.098 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 105.73805 451.02648] CT
+0.851 0.325 0.098 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 107.39695 438.85661] CT
+0.851 0.325 0.098 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 108.56432 431.79956] CT
+0.851 0.325 0.098 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 108.81008 430.35931] CT
+0.851 0.325 0.098 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 109.05584 429.06313] CT
+0.851 0.325 0.098 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 109.3016 427.69494] CT
+0.851 0.325 0.098 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 109.54736 426.47074] CT
+0.851 0.325 0.098 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 109.97745 424.23839] CT
+0.851 0.325 0.098 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 110.59186 421.21394] CT
+0.851 0.325 0.098 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 111.20626 418.40549] CT
+0.851 0.325 0.098 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 111.82067 415.66906] CT
+0.851 0.325 0.098 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 112.43507 413.07667] CT
+0.851 0.325 0.098 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 113.04948 410.5563] CT
+0.851 0.325 0.098 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 113.66388 408.25193] CT
+0.851 0.325 0.098 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 114.27829 405.87558] CT
+0.851 0.325 0.098 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 114.8927 403.78727] CT
+0.851 0.325 0.098 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 115.5071 401.62693] CT
+0.851 0.325 0.098 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 116.42871 398.81849] CT
+0.851 0.325 0.098 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 117.65752 394.49782] CT
+0.851 0.325 0.098 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 118.88633 390.89727] CT
+0.851 0.325 0.098 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 120.11514 387.29673] CT
+0.851 0.325 0.098 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 121.34394 383.69616] CT
+0.851 0.325 0.098 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 122.57276 380.09562] CT
+0.851 0.325 0.098 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 123.80157 377.21518] CT
+0.851 0.325 0.098 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 125.03038 373.61461] CT
+0.851 0.325 0.098 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 126.25919 370.01407] CT
+0.851 0.325 0.098 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 127.488 364.9733] CT
+0.851 0.325 0.098 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 129.33122 354.89175] CT
+0.851 0.325 0.098 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 131.78884 354.17164] CT
+0.851 0.325 0.098 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 134.24646 357.05208] CT
+0.851 0.325 0.098 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 136.70408 352.73141] CT
+0.851 0.325 0.098 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 139.16171 348.41077] CT
+0.851 0.325 0.098 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 141.61933 344.0901] CT
+0.851 0.325 0.098 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 144.07695 339.76942] CT
+0.851 0.325 0.098 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 146.53457 336.16888] CT
+0.851 0.325 0.098 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 148.9922 332.56834] CT
+0.851 0.325 0.098 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 151.44982 328.24767] CT
+0.851 0.325 0.098 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 153.90744 324.6471] CT
+0.851 0.325 0.098 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 156.36506 321.04656] CT
+0.851 0.325 0.098 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 158.82269 316.00578] CT
+0.851 0.325 0.098 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 161.2803 308.08457] CT
+0.851 0.325 0.098 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 163.73792 295.12258] CT
+0.851 0.325 0.098 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 168.03876 292.24214] CT
+0.851 0.325 0.098 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 174.18282 294.40248] CT
+0.851 0.325 0.098 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 180.32687 287.20137] CT
+0.851 0.325 0.098 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 186.47093 280.72036] CT
+0.851 0.325 0.098 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 192.61499 277.83992] CT
+0.851 0.325 0.098 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 198.75904 272.79915] CT
+0.851 0.325 0.098 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 204.9031 264.87794] CT
+0.851 0.325 0.098 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 211.04715 261.9975] CT
+0.851 0.325 0.098 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 217.19121 253.35618] CT
+0.851 0.325 0.098 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 223.33524 251.91595] CT
+0.851 0.325 0.098 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 232.55133 245.43497] CT
+0.851 0.325 0.098 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 244.83944 242.5545] CT
+0.851 0.325 0.098 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 257.12755 233.19308] CT
+0.851 0.325 0.098 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 269.41567 222.39143] CT
+0.851 0.325 0.098 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 281.70376 213.02998] CT
+0.851 0.325 0.098 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 293.99189 202.22833] CT
+0.851 0.325 0.098 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 306.28 178.46468] CT
+0.851 0.325 0.098 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 318.56809 172.7038] CT
+0.851 0.325 0.098 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 330.85621 165.5027] CT
+0.851 0.325 0.098 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 343.1443 170.54347] CT
+0.851 0.325 0.098 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 361.57646 160.46191] CT
+0.851 0.325 0.098 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 386.15269 160.46191] CT
+0.851 0.325 0.098 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 410.72891 142.45917] CT
+0.851 0.325 0.098 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 435.30514 151.10048] CT
+0.851 0.325 0.098 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 459.88132 135.97817] CT
+0.851 0.325 0.098 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 484.45759 128.05694] CT
+0.851 0.325 0.098 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 509.03381 117.9754] CT
+0.851 0.325 0.098 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 533.60999 102.85307] CT
+0.851 0.325 0.098 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 558.18622 83.4101] CT
+0.851 0.325 0.098 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 582.7624 89.89109] CT
+0.851 0.325 0.098 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 607.33867 92.05142] CT
+0.851 0.325 0.098 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 631.91489 79.80953] CT
+0.851 0.325 0.098 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 656.49107 73.32854] CT
+0.851 0.325 0.098 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 681.0673 71.16821] CT
+0.851 0.325 0.098 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 705.64352 61.08667] CT
+0.851 0.325 0.098 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 0 0.41736] CT
+0.929 0.694 0.125 RC
+1 LJ
+1.333 LW
+N
+138 629.956 M
+138 629.906 L
+138 629.933 L
+138 629.954 L
+138 629.945 L
+138 629.956 L
+138 629.954 L
+138 629.956 L
+138 629.958 L
+138 629.958 L
+138.001 629.959 L
+138.001 629.959 L
+138.002 629.959 L
+138.003 629.958 L
+138.005 629.957 L
+138.009 629.956 L
+138.016 629.953 L
+138.029 629.949 L
+138.052 629.94 L
+138.09 629.925 L
+138.164 629.897 L
+138.295 629.848 L
+138.516 629.766 L
+138.901 629.627 L
+139.638 629.377 L
+140.948 628.963 L
+143.16 628.339 L
+144.716 627.926 L
+145.043 627.811 L
+145.371 627.706 L
+145.699 627.715 L
+146.026 627.638 L
+146.6 627.504 L
+147.419 627.35 L
+148.238 627.187 L
+149.057 626.64 L
+149.876 626.669 L
+150.695 626.477 L
+151.514 626.342 L
+152.333 626.333 L
+153.152 626.035 L
+153.971 625.968 L
+155.199 625.45 L
+156.837 625.229 L
+158.475 624.25 L
+160.113 624.269 L
+161.751 623.971 L
+163.389 623.731 L
+165.027 622.723 L
+166.665 622.205 L
+168.303 621.168 L
+169.941 620.016 L
+172.398 614.928 L
+175.674 616.848 L
+178.95 622.512 L
+182.226 622.848 L
+185.502 622.042 L
+188.778 621.293 L
+192.054 621.226 L
+195.33 620.928 L
+198.606 620.525 L
+201.882 619.92 L
+205.158 619.536 L
+208.434 618.288 L
+211.71 616.368 L
+214.986 612.912 L
+218.262 605.616 L
+223.995 607.728 L
+232.185 613.584 L
+240.375 612.72 L
+248.565 612.912 L
+256.755 614.544 L
+264.945 613.68 L
+273.135 611.472 L
+281.325 613.008 L
+289.515 610.032 L
+297.705 612.048 L
+309.99 611.76 L
+326.37 614.064 L
+342.75 610.992 L
+359.13 607.056 L
+375.51 603.6 L
+391.89 596.784 L
+408.27 582.864 L
+424.65 580.656 L
+441.03 575.472 L
+457.41 579.696 L
+481.98 573.168 L
+514.74 573.936 L
+547.5 563.472 L
+580.26 572.016 L
+613.02 563.568 L
+645.78 561.168 L
+678.54 552.624 L
+711.3 541.968 L
+744.06 530.16 L
+776.82 538.512 L
+809.58 537.936 L
+842.34 527.28 L
+875.1 524.4 L
+907.86 525.36 L
+940.62 515.76 L
+957.098 513.277 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 103.52619 472.95718] CT
+0.929 0.694 0.125 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 103.52619 472.91936] CT
+0.929 0.694 0.125 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 103.52619 472.93974] CT
+0.929 0.694 0.125 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 103.5262 472.95544] CT
+0.929 0.694 0.125 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 103.5262 472.94839] CT
+0.929 0.694 0.125 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 103.52621 472.95682] CT
+0.929 0.694 0.125 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 103.52623 472.95517] CT
+0.929 0.694 0.125 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 103.52626 472.95718] CT
+0.929 0.694 0.125 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 103.52632 472.95842] CT
+0.929 0.694 0.125 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 103.52641 472.95869] CT
+0.929 0.694 0.125 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 103.52658 472.9592] CT
+0.929 0.694 0.125 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 103.52687 472.9591] CT
+0.929 0.694 0.125 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 103.52742 472.95892] CT
+0.929 0.694 0.125 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 103.5284 472.95856] CT
+0.929 0.694 0.125 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 103.53006 472.95796] CT
+0.929 0.694 0.125 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 103.53295 472.95691] CT
+0.929 0.694 0.125 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 103.53847 472.95489] CT
+0.929 0.694 0.125 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 103.54831 472.95128] CT
+0.929 0.694 0.125 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 103.56489 472.94487] CT
+0.929 0.694 0.125 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 103.59378 472.9337] CT
+0.929 0.694 0.125 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 103.64908 472.91282] CT
+0.929 0.694 0.125 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 103.74738 472.8761] CT
+0.929 0.694 0.125 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 103.91327 472.81415] CT
+0.929 0.694 0.125 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 104.20203 472.70977] CT
+0.929 0.694 0.125 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 104.755 472.52251] CT
+0.929 0.694 0.125 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 105.73805 472.21215] CT
+0.929 0.694 0.125 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 107.39695 471.74406] CT
+0.929 0.694 0.125 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 108.56432 471.43443] CT
+0.929 0.694 0.125 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 108.81008 471.34803] CT
+0.929 0.694 0.125 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 109.05584 471.26883] CT
+0.929 0.694 0.125 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 109.3016 471.27602] CT
+0.929 0.694 0.125 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 109.54736 471.21842] CT
+0.929 0.694 0.125 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 109.97745 471.11761] CT
+0.929 0.694 0.125 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 110.59186 471.00237] CT
+0.929 0.694 0.125 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 111.20626 470.87994] CT
+0.929 0.694 0.125 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 111.82067 470.4695] CT
+0.929 0.694 0.125 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 112.43507 470.49111] CT
+0.929 0.694 0.125 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 113.04948 470.34707] CT
+0.929 0.694 0.125 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 113.66388 470.24626] CT
+0.929 0.694 0.125 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 114.27829 470.23907] CT
+0.929 0.694 0.125 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 114.8927 470.01583] CT
+0.929 0.694 0.125 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 115.5071 469.96542] CT
+0.929 0.694 0.125 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 116.42871 469.57654] CT
+0.929 0.694 0.125 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 117.65752 469.41094] CT
+0.929 0.694 0.125 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 118.88633 468.67639] CT
+0.929 0.694 0.125 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 120.11514 468.69081] CT
+0.929 0.694 0.125 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 121.34394 468.46757] CT
+0.929 0.694 0.125 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 122.57276 468.28755] CT
+0.929 0.694 0.125 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 123.80157 467.53144] CT
+0.929 0.694 0.125 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 125.03038 467.14255] CT
+0.929 0.694 0.125 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 126.25919 466.36488] CT
+0.929 0.694 0.125 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 127.488 465.50072] CT
+0.929 0.694 0.125 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 129.33122 461.68412] CT
+0.929 0.694 0.125 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 131.78884 463.12437] CT
+0.929 0.694 0.125 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 134.24646 467.37303] CT
+0.929 0.694 0.125 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 136.70408 467.62506] CT
+0.929 0.694 0.125 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 139.16171 467.02017] CT
+0.929 0.694 0.125 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 141.61933 466.45846] CT
+0.929 0.694 0.125 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 144.07695 466.40805] CT
+0.929 0.694 0.125 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 146.53457 466.18481] CT
+0.929 0.694 0.125 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 148.9922 465.88237] CT
+0.929 0.694 0.125 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 151.44982 465.4287] CT
+0.929 0.694 0.125 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 153.90744 465.14067] CT
+0.929 0.694 0.125 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 156.36506 464.20454] CT
+0.929 0.694 0.125 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 158.82269 462.76429] CT
+0.929 0.694 0.125 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 161.2803 460.17189] CT
+0.929 0.694 0.125 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 163.73792 454.69909] CT
+0.929 0.694 0.125 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 168.03876 456.28333] CT
+0.929 0.694 0.125 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 174.18282 460.67597] CT
+0.929 0.694 0.125 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 180.32687 460.02786] CT
+0.929 0.694 0.125 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 186.47093 460.17189] CT
+0.929 0.694 0.125 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 192.61499 461.3961] CT
+0.929 0.694 0.125 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 198.75904 460.74799] CT
+0.929 0.694 0.125 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 204.9031 459.09173] CT
+0.929 0.694 0.125 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 211.04715 460.24391] CT
+0.929 0.694 0.125 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 217.19121 458.01156] CT
+0.929 0.694 0.125 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 223.33524 459.52379] CT
+0.929 0.694 0.125 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 232.55133 459.30778] CT
+0.929 0.694 0.125 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 244.83944 461.03606] CT
+0.929 0.694 0.125 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 257.12755 458.73169] CT
+0.929 0.694 0.125 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 269.41567 455.77925] CT
+0.929 0.694 0.125 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 281.70376 453.18681] CT
+0.929 0.694 0.125 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 293.99189 448.07405] CT
+0.929 0.694 0.125 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 306.28 437.63246] CT
+0.929 0.694 0.125 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 318.56809 435.9762] CT
+0.929 0.694 0.125 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 330.85621 432.08758] CT
+0.929 0.694 0.125 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 343.1443 435.25607] CT
+0.929 0.694 0.125 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 361.57646 430.35931] CT
+0.929 0.694 0.125 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 386.15269 430.9354] CT
+0.929 0.694 0.125 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 410.72891 423.0862] CT
+0.929 0.694 0.125 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 435.30514 429.49519] CT
+0.929 0.694 0.125 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 459.88132 423.15822] CT
+0.929 0.694 0.125 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 484.45759 421.35797] CT
+0.929 0.694 0.125 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 509.03381 414.94898] CT
+0.929 0.694 0.125 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 533.60999 406.95575] CT
+0.929 0.694 0.125 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 558.18622 398.09836] CT
+0.929 0.694 0.125 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 582.7624 404.36336] CT
+0.929 0.694 0.125 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 607.33867 403.93126] CT
+0.929 0.694 0.125 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 631.91489 395.93807] CT
+0.929 0.694 0.125 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 656.49107 393.77774] CT
+0.929 0.694 0.125 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 681.0673 394.49782] CT
+0.929 0.694 0.125 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 705.64352 387.29673] CT
+0.929 0.694 0.125 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 0 0.41736] CT
+1 GC
+N
+907 318 M
+907 214 L
+724 214 L
+724 318 L
+cp
+f
+GR
+GS
+[0.75019 0 0 0.75012 578.39633 174.81912] CT
+/Helvetica 26.4 F
+GS
+[1 0 0 1 0 0] CT
+0 10.5 moveto
+1 -1 scale
+(Soft Tissue) t
+GR
+GR
+GS
+[0.75019 0 0 0.75012 0 0.41736] CT
+0 0.447 0.741 RC
+1 LJ
+1.333 LW
+N
+728 232.5 M
+768 232.5 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 561.14197 174.81912] CT
+0 0.447 0.741 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 578.39633 199.94797] CT
+/Helvetica 26.4 F
+GS
+[1 0 0 1 0 0] CT
+0 10.5 moveto
+1 -1 scale
+(Lung) t
+GR
+GR
+GS
+[0.75019 0 0 0.75012 0 0.41736] CT
+0.851 0.325 0.098 RC
+1 LJ
+1.333 LW
+N
+728 266 M
+768 266 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 561.14197 199.94797] CT
+0.851 0.325 0.098 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 578.39633 225.07683] CT
+/Helvetica 26.4 F
+GS
+[1 0 0 1 0 0] CT
+0 10.5 moveto
+1 -1 scale
+(Bone) t
+GR
+GR
+GS
+[0.75019 0 0 0.75012 0 0.41736] CT
+0.929 0.694 0.125 RC
+1 LJ
+1.333 LW
+N
+728 299.5 M
+768 299.5 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 561.14197 225.07683] CT
+0.929 0.694 0.125 RC
+10.0 ML
+1.333 LW
+N
+0 -3 M
+0 3 L
+-3 0 M
+3 0 L
+-1.886 -1.886 M
+1.886 1.886 L
+-1.886 1.886 M
+1.886 -1.886 L
+S
+GR
+GS
+[0.75019 0 0 0.75012 0 0.41736] CT
+0.149 GC
+10.0 ML
+1.333 LW
+N
+724 318 M
+724 214 L
+907 214 L
+907 318 L
+cp
+S
+GR
+%%Trailer
+%%Pages: 1
+%%EOF
diff --git a/MCNP/KERMA_factors/comparisonKermaFactors_neutrons.fig b/MCNP/KERMA_factors/comparisonKermaFactors_neutrons.fig
new file mode 100644
index 000000000..c80046cc4
Binary files /dev/null and b/MCNP/KERMA_factors/comparisonKermaFactors_neutrons.fig differ
diff --git a/MCNP/KERMA_factors/comparisonKermaFactors_neutrons.png b/MCNP/KERMA_factors/comparisonKermaFactors_neutrons.png
new file mode 100644
index 000000000..50b98fa03
Binary files /dev/null and b/MCNP/KERMA_factors/comparisonKermaFactors_neutrons.png differ
diff --git a/MCNP/KERMA_factors/neutronKERMA_1.txt b/MCNP/KERMA_factors/neutronKERMA_1.txt
new file mode 100644
index 000000000..9c6bf3a17
--- /dev/null
+++ b/MCNP/KERMA_factors/neutronKERMA_1.txt
@@ -0,0 +1,117 @@
+2.53E-08 0
+3.60E-08 0
+6.30E-08 0
+1.10E-07 0
+2.00E-07 0
+3.60E-07 0
+6.30E-07 0
+1.10E-06 0
+2.00E-06 0
+3.60E-06 0
+6.30E-06 0
+1.10E-05 0
+2.00E-05 0
+3.60E-05 0
+6.30E-05 0
+1.10E-04 0
+2.00E-04 0
+3.60E-04 0
+6.30E-04 0
+1.10E-03 0
+2.00E-03 0
+3.60E-03 0
+6.30E-03 0
+1.10E-02 0
+2.00E-02 0
+3.60E-02 0
+6.30E-02 0
+8.20E-02 0
+8.60E-02 0
+9.00E-02 0
+9.40E-02 0
+9.80E-02 0
+1.05E-01 0
+1.15E-01 0
+1.25E-01 0
+1.35E-01 0
+1.45E-01 0
+1.55E-01 0
+1.65E-01 0
+1.75E-01 0
+1.85E-01 0
+1.95E-01 0
+2.10E-01 0
+2.30E-01 0
+2.50E-01 0
+2.70E-01 0
+2.90E-01 0
+3.10E-01 0
+3.30E-01 0
+3.50E-01 0
+3.70E-01 0
+3.90E-01 0
+4.20E-01 0
+4.60E-01 0
+5.00E-01 0
+5.40E-01 0
+5.80E-01 0
+6.20E-01 0
+6.60E-01 0
+7.00E-01 0
+7.40E-01 0
+7.80E-01 0
+8.20E-01 0
+8.60E-01 0
+9.00E-01 0
+9.40E-01 0
+9.80E-01 0
+1.05E+00 0
+1.15E+00 0
+1.25E+00 0
+1.35E+00 0
+1.45E+00 0
+1.55E+00 0
+1.65E+00 0
+1.75E+00 0
+1.85E+00 0
+1.95E+00 0
+2.10E+00 0
+2.30E+00 0
+2.50E+00 0
+2.70E+00 0
+2.90E+00 0
+3.10E+00 0
+3.30E+00 0
+3.50E+00 0
+3.70E+00 0
+3.90E+00 0
+4.20E+00 0
+4.60E+00 0
+5.00E+00 0
+5.40E+00 0
+5.80E+00 0
+6.20E+00 0
+6.60E+00 0
+7.00E+00 0
+7.40E+00 0
+7.80E+00 0
+8.20E+00 0
+8.60E+00 0
+9.00E+00 0
+9.40E+00 0
+9.80E+00 0
+1.05E+01 0
+1.15E+01 0
+1.25E+01 0
+1.35E+01 0
+1.45E+01 0
+1.55E+01 0
+1.65E+01 0
+1.75E+01 0
+1.85E+01 0
+1.95E+01 0
+2.10E+01 0
+2.30E+01 0
+2.50E+01 0
+2.70E+01 0
+2.90E+01 0
diff --git a/MCNP/KERMA_factors/neutronKERMA_2.txt b/MCNP/KERMA_factors/neutronKERMA_2.txt
new file mode 100644
index 000000000..7647c0cbb
--- /dev/null
+++ b/MCNP/KERMA_factors/neutronKERMA_2.txt
@@ -0,0 +1,117 @@
+2.53E-08 2.50E-17
+3.60E-08 2.12E-17
+6.30E-08 1.60E-17
+1.10E-07 1.21E-17
+2.00E-07 8.98E-18
+3.60E-07 6.69E-18
+6.30E-07 5.07E-18
+1.10E-06 3.83E-18
+2.00E-06 2.87E-18
+3.60E-06 2.15E-18
+6.30E-06 1.66E-18
+1.10E-05 1.32E-18
+2.00E-05 1.11E-18
+3.60E-05 1.04E-18
+6.30E-05 1.16E-18
+1.10E-04 1.52E-18
+2.00E-04 2.36E-18
+3.60E-04 3.99E-18
+6.30E-04 6.68E-18
+1.10E-03 1.14E-17
+2.00E-03 2.05E-17
+3.60E-03 3.66E-17
+6.30E-03 6.28E-17
+1.10E-02 1.06E-16
+2.00E-02 1.85E-16
+3.60E-02 3.05E-16
+6.30E-02 4.74E-16
+8.20E-02 5.72E-16
+8.60E-02 5.92E-16
+9.00E-02 6.10E-16
+9.40E-02 6.29E-16
+9.80E-02 6.46E-16
+1.05E-01 6.77E-16
+1.15E-01 7.19E-16
+1.25E-01 7.58E-16
+1.35E-01 7.96E-16
+1.45E-01 8.32E-16
+1.55E-01 8.67E-16
+1.65E-01 8.99E-16
+1.75E-01 9.32E-16
+1.85E-01 9.61E-16
+1.95E-01 9.91E-16
+2.10E-01 1.03E-15
+2.30E-01 1.09E-15
+2.50E-01 1.14E-15
+2.70E-01 1.19E-15
+2.90E-01 1.24E-15
+3.10E-01 1.29E-15
+3.30E-01 1.33E-15
+3.50E-01 1.38E-15
+3.70E-01 1.43E-15
+3.90E-01 1.50E-15
+4.20E-01 1.64E-15
+4.60E-01 1.65E-15
+5.00E-01 1.61E-15
+5.40E-01 1.67E-15
+5.80E-01 1.73E-15
+6.20E-01 1.79E-15
+6.60E-01 1.85E-15
+7.00E-01 1.90E-15
+7.40E-01 1.95E-15
+7.80E-01 2.01E-15
+8.20E-01 2.06E-15
+8.60E-01 2.11E-15
+9.00E-01 2.18E-15
+9.40E-01 2.29E-15
+9.80E-01 2.47E-15
+1.05E+00 2.51E-15
+1.15E+00 2.48E-15
+1.25E+00 2.58E-15
+1.35E+00 2.67E-15
+1.45E+00 2.71E-15
+1.55E+00 2.78E-15
+1.65E+00 2.89E-15
+1.75E+00 2.93E-15
+1.85E+00 3.05E-15
+1.95E+00 3.07E-15
+2.10E+00 3.16E-15
+2.30E+00 3.20E-15
+2.50E+00 3.33E-15
+2.70E+00 3.48E-15
+2.90E+00 3.61E-15
+3.10E+00 3.76E-15
+3.30E+00 4.09E-15
+3.50E+00 4.17E-15
+3.70E+00 4.27E-15
+3.90E+00 4.20E-15
+4.20E+00 4.34E-15
+4.60E+00 4.34E-15
+5.00E+00 4.59E-15
+5.40E+00 4.47E-15
+5.80E+00 4.68E-15
+6.20E+00 4.79E-15
+6.60E+00 4.93E-15
+7.00E+00 5.14E-15
+7.40E+00 5.41E-15
+7.80E+00 5.32E-15
+8.20E+00 5.29E-15
+8.60E+00 5.46E-15
+9.00E+00 5.55E-15
+9.40E+00 5.58E-15
+9.80E+00 5.72E-15
+1.05E+01 5.86E-15
+1.15E+01 6.28E-15
+1.25E+01 6.25E-15
+1.35E+01 6.49E-15
+1.45E+01 6.74E-15
+1.55E+01 6.89E-15
+1.65E+01 6.98E-15
+1.75E+01 7.06E-15
+1.85E+01 7.17E-15
+1.95E+01 7.29E-15
+2.10E+01 7.43E-15
+2.30E+01 7.40E-15
+2.50E+01 7.35E-15
+2.70E+01 7.37E-15
+2.90E+01 7.23E-15
diff --git a/MCNP/KERMA_factors/neutronKERMA_3.txt b/MCNP/KERMA_factors/neutronKERMA_3.txt
new file mode 100644
index 000000000..336cf1080
--- /dev/null
+++ b/MCNP/KERMA_factors/neutronKERMA_3.txt
@@ -0,0 +1,117 @@
+2.53E-08 2.08E-17
+3.60E-08 1.76E-17
+6.30E-08 1.33E-17
+1.10E-07 1.01E-17
+2.00E-07 7.49E-18
+3.60E-07 5.58E-18
+6.30E-07 4.23E-18
+1.10E-06 3.20E-18
+2.00E-06 2.39E-18
+3.60E-06 1.80E-18
+6.30E-06 1.40E-18
+1.10E-05 1.12E-18
+2.00E-05 9.54E-19
+3.60E-05 9.25E-19
+6.30E-05 1.06E-18
+1.10E-04 1.43E-18
+2.00E-04 2.27E-18
+3.60E-04 3.83E-18
+6.30E-04 6.50E-18
+1.10E-03 1.12E-17
+2.00E-03 2.01E-17
+3.60E-03 3.59E-17
+6.30E-03 6.16E-17
+1.10E-02 1.04E-16
+2.00E-02 1.81E-16
+3.60E-02 2.99E-16
+6.30E-02 4.65E-16
+8.20E-02 5.62E-16
+8.60E-02 5.81E-16
+9.00E-02 5.99E-16
+9.40E-02 6.17E-16
+9.80E-02 6.35E-16
+1.05E-01 6.65E-16
+1.15E-01 7.06E-16
+1.25E-01 7.45E-16
+1.35E-01 7.82E-16
+1.45E-01 8.18E-16
+1.55E-01 8.51E-16
+1.65E-01 8.83E-16
+1.75E-01 9.15E-16
+1.85E-01 9.44E-16
+1.95E-01 9.73E-16
+2.10E-01 1.02E-15
+2.30E-01 1.07E-15
+2.50E-01 1.12E-15
+2.70E-01 1.17E-15
+2.90E-01 1.22E-15
+3.10E-01 1.27E-15
+3.30E-01 1.31E-15
+3.50E-01 1.36E-15
+3.70E-01 1.41E-15
+3.90E-01 1.48E-15
+4.20E-01 1.61E-15
+4.60E-01 1.63E-15
+5.00E-01 1.58E-15
+5.40E-01 1.64E-15
+5.80E-01 1.70E-15
+6.20E-01 1.76E-15
+6.60E-01 1.82E-15
+7.00E-01 1.87E-15
+7.40E-01 1.92E-15
+7.80E-01 1.98E-15
+8.20E-01 2.03E-15
+8.60E-01 2.08E-15
+9.00E-01 2.15E-15
+9.40E-01 2.25E-15
+9.80E-01 2.44E-15
+1.05E+00 2.47E-15
+1.15E+00 2.44E-15
+1.25E+00 2.54E-15
+1.35E+00 2.62E-15
+1.45E+00 2.67E-15
+1.55E+00 2.74E-15
+1.65E+00 2.85E-15
+1.75E+00 2.88E-15
+1.85E+00 3.00E-15
+1.95E+00 3.02E-15
+2.10E+00 3.10E-15
+2.30E+00 3.15E-15
+2.50E+00 3.27E-15
+2.70E+00 3.42E-15
+2.90E+00 3.55E-15
+3.10E+00 3.69E-15
+3.30E+00 4.02E-15
+3.50E+00 4.10E-15
+3.70E+00 4.20E-15
+3.90E+00 4.13E-15
+4.20E+00 4.26E-15
+4.60E+00 4.26E-15
+5.00E+00 4.51E-15
+5.40E+00 4.39E-15
+5.80E+00 4.60E-15
+6.20E+00 4.71E-15
+6.60E+00 4.84E-15
+7.00E+00 5.06E-15
+7.40E+00 5.33E-15
+7.80E+00 5.24E-15
+8.20E+00 5.20E-15
+8.60E+00 5.38E-15
+9.00E+00 5.46E-15
+9.40E+00 5.50E-15
+9.80E+00 5.64E-15
+1.05E+01 5.78E-15
+1.15E+01 6.20E-15
+1.25E+01 6.17E-15
+1.35E+01 6.41E-15
+1.45E+01 6.66E-15
+1.55E+01 6.81E-15
+1.65E+01 6.90E-15
+1.75E+01 6.99E-15
+1.85E+01 7.10E-15
+1.95E+01 7.23E-15
+2.10E+01 7.37E-15
+2.30E+01 7.34E-15
+2.50E+01 7.28E-15
+2.70E+01 7.31E-15
+2.90E+01 7.17E-15
diff --git a/MCNP/KERMA_factors/neutronKERMA_4.txt b/MCNP/KERMA_factors/neutronKERMA_4.txt
new file mode 100644
index 000000000..da3d52830
--- /dev/null
+++ b/MCNP/KERMA_factors/neutronKERMA_4.txt
@@ -0,0 +1,117 @@
+2.53E-08 4.54E-19
+3.60E-08 9.79E-19
+6.30E-08 6.96E-19
+1.10E-07 4.78E-19
+2.00E-07 5.76E-19
+3.60E-07 4.59E-19
+6.30E-07 4.82E-19
+1.10E-06 4.54E-19
+2.00E-06 4.37E-19
+3.60E-06 4.33E-19
+6.30E-06 4.26E-19
+1.10E-05 4.27E-19
+2.00E-05 4.30E-19
+3.60E-05 4.35E-19
+6.30E-05 4.43E-19
+1.10E-04 4.58E-19
+2.00E-04 4.86E-19
+3.60E-04 5.36E-19
+6.30E-04 6.25E-19
+1.10E-03 7.80E-19
+2.00E-03 1.07E-18
+3.60E-03 1.58E-18
+6.30E-03 2.44E-18
+1.10E-02 3.89E-18
+2.00E-02 6.49E-18
+3.60E-02 1.08E-17
+6.30E-02 1.73E-17
+8.20E-02 2.16E-17
+8.60E-02 2.28E-17
+9.00E-02 2.39E-17
+9.40E-02 2.38E-17
+9.80E-02 2.46E-17
+1.05E-01 2.60E-17
+1.15E-01 2.76E-17
+1.25E-01 2.93E-17
+1.35E-01 3.50E-17
+1.45E-01 3.47E-17
+1.55E-01 3.67E-17
+1.65E-01 3.81E-17
+1.75E-01 3.82E-17
+1.85E-01 4.13E-17
+1.95E-01 4.20E-17
+2.10E-01 4.74E-17
+2.30E-01 4.97E-17
+2.50E-01 5.99E-17
+2.70E-01 5.97E-17
+2.90E-01 6.28E-17
+3.10E-01 6.53E-17
+3.30E-01 7.58E-17
+3.50E-01 8.12E-17
+3.70E-01 9.20E-17
+3.90E-01 1.04E-16
+4.20E-01 1.57E-16
+4.60E-01 1.37E-16
+5.00E-01 7.80E-17
+5.40E-01 7.45E-17
+5.80E-01 8.29E-17
+6.20E-01 9.07E-17
+6.60E-01 9.14E-17
+7.00E-01 9.45E-17
+7.40E-01 9.87E-17
+7.80E-01 1.05E-16
+8.20E-01 1.09E-16
+8.60E-01 1.22E-16
+9.00E-01 1.42E-16
+9.40E-01 1.78E-16
+9.80E-01 2.54E-16
+1.05E+00 2.32E-16
+1.15E+00 1.71E-16
+1.25E+00 1.80E-16
+1.35E+00 1.78E-16
+1.45E+00 1.61E-16
+1.55E+00 1.70E-16
+1.65E+00 1.93E-16
+1.75E+00 1.77E-16
+1.85E+00 2.08E-16
+1.95E+00 1.87E-16
+2.10E+00 1.90E-16
+2.30E+00 1.66E-16
+2.50E+00 1.98E-16
+2.70E+00 2.39E-16
+2.90E+00 2.75E-16
+3.10E+00 3.46E-16
+3.30E+00 4.91E-16
+3.50E+00 5.14E-16
+3.70E+00 5.68E-16
+3.90E+00 5.24E-16
+4.20E+00 5.92E-16
+4.60E+00 5.84E-16
+5.00E+00 6.93E-16
+5.40E+00 6.04E-16
+5.80E+00 6.92E-16
+6.20E+00 7.17E-16
+6.60E+00 8.06E-16
+7.00E+00 9.17E-16
+7.40E+00 1.04E-15
+7.80E+00 9.53E-16
+8.20E+00 9.59E-16
+8.60E+00 1.07E-15
+9.00E+00 1.10E-15
+9.40E+00 1.09E-15
+9.80E+00 1.19E-15
+1.05E+01 1.28E-15
+1.15E+01 1.53E-15
+1.25E+01 1.52E-15
+1.35E+01 1.65E-15
+1.45E+01 1.75E-15
+1.55E+01 1.82E-15
+1.65E+01 1.80E-15
+1.75E+01 1.82E-15
+1.85E+01 1.85E-15
+1.95E+01 1.92E-15
+2.10E+01 2.05E-15
+2.30E+01 2.18E-15
+2.50E+01 2.32E-15
+2.70E+01 2.52E-15
+2.90E+01 2.62E-15
diff --git a/MCNP/KERMA_factors/neutronKERMA_5.txt b/MCNP/KERMA_factors/neutronKERMA_5.txt
new file mode 100644
index 000000000..180d1191e
--- /dev/null
+++ b/MCNP/KERMA_factors/neutronKERMA_5.txt
@@ -0,0 +1,117 @@
+2.53E-08 3.36E-17
+3.60E-08 2.85E-17
+6.30E-08 2.15E-17
+1.10E-07 1.63E-17
+2.00E-07 1.21E-17
+3.60E-07 8.99E-18
+6.30E-07 6.81E-18
+1.10E-06 5.15E-18
+2.00E-06 3.85E-18
+3.60E-06 2.88E-18
+6.30E-06 2.21E-18
+1.10E-05 1.74E-18
+2.00E-05 1.41E-18
+3.60E-05 1.27E-18
+6.30E-05 1.31E-18
+1.10E-04 1.62E-18
+2.00E-04 2.40E-18
+3.60E-04 3.97E-18
+6.30E-04 6.57E-18
+1.10E-03 1.12E-17
+2.00E-03 2.00E-17
+3.60E-03 3.57E-17
+6.30E-03 6.13E-17
+1.10E-02 1.03E-16
+2.00E-02 1.80E-16
+3.60E-02 2.98E-16
+6.30E-02 4.62E-16
+8.20E-02 5.58E-16
+8.60E-02 5.78E-16
+9.00E-02 5.96E-16
+9.40E-02 6.14E-16
+9.80E-02 6.31E-16
+1.05E-01 6.61E-16
+1.15E-01 7.02E-16
+1.25E-01 7.40E-16
+1.35E-01 7.77E-16
+1.45E-01 8.13E-16
+1.55E-01 8.47E-16
+1.65E-01 8.78E-16
+1.75E-01 9.10E-16
+1.85E-01 9.39E-16
+1.95E-01 9.68E-16
+2.10E-01 1.01E-15
+2.30E-01 1.06E-15
+2.50E-01 1.11E-15
+2.70E-01 1.17E-15
+2.90E-01 1.21E-15
+3.10E-01 1.26E-15
+3.30E-01 1.30E-15
+3.50E-01 1.35E-15
+3.70E-01 1.39E-15
+3.90E-01 1.46E-15
+4.20E-01 1.58E-15
+4.60E-01 1.60E-15
+5.00E-01 1.58E-15
+5.40E-01 1.63E-15
+5.80E-01 1.69E-15
+6.20E-01 1.75E-15
+6.60E-01 1.81E-15
+7.00E-01 1.86E-15
+7.40E-01 1.91E-15
+7.80E-01 1.97E-15
+8.20E-01 2.02E-15
+8.60E-01 2.07E-15
+9.00E-01 2.13E-15
+9.40E-01 2.22E-15
+9.80E-01 2.39E-15
+1.05E+00 2.43E-15
+1.15E+00 2.42E-15
+1.25E+00 2.52E-15
+1.35E+00 2.61E-15
+1.45E+00 2.65E-15
+1.55E+00 2.72E-15
+1.65E+00 2.83E-15
+1.75E+00 2.87E-15
+1.85E+00 2.98E-15
+1.95E+00 3.00E-15
+2.10E+00 3.10E-15
+2.30E+00 3.15E-15
+2.50E+00 3.28E-15
+2.70E+00 3.43E-15
+2.90E+00 3.58E-15
+3.10E+00 3.69E-15
+3.30E+00 4.03E-15
+3.50E+00 4.12E-15
+3.70E+00 4.21E-15
+3.90E+00 4.16E-15
+4.20E+00 4.27E-15
+4.60E+00 4.26E-15
+5.00E+00 4.47E-15
+5.40E+00 4.38E-15
+5.80E+00 4.57E-15
+6.20E+00 4.70E-15
+6.60E+00 4.79E-15
+7.00E+00 4.98E-15
+7.40E+00 5.26E-15
+7.80E+00 5.25E-15
+8.20E+00 5.17E-15
+8.60E+00 5.31E-15
+9.00E+00 5.44E-15
+9.40E+00 5.51E-15
+9.80E+00 5.60E-15
+1.05E+01 5.73E-15
+1.15E+01 6.12E-15
+1.25E+01 6.15E-15
+1.35E+01 6.38E-15
+1.45E+01 6.64E-15
+1.55E+01 6.84E-15
+1.65E+01 6.95E-15
+1.75E+01 7.04E-15
+1.85E+01 7.15E-15
+1.95E+01 7.28E-15
+2.10E+01 7.44E-15
+2.30E+01 7.44E-15
+2.50E+01 7.41E-15
+2.70E+01 7.45E-15
+2.90E+01 7.35E-15
\ No newline at end of file
diff --git a/MCNP/KERMA_factors/photonKERMA_1.txt b/MCNP/KERMA_factors/photonKERMA_1.txt
new file mode 100644
index 000000000..958886305
--- /dev/null
+++ b/MCNP/KERMA_factors/photonKERMA_1.txt
@@ -0,0 +1,33 @@
+0.010 0
+0.015 0
+0.020 0
+0.030 0
+0.040 0
+0.050 0
+0.060 0
+0.080 0
+0.100 0
+0.150 0
+0.200 0
+0.300 0
+0.400 0
+0.500 0
+0.600 0
+0.800 0
+1.000 0
+1.500 0
+2.000 0
+3.000 0
+4.000 0
+5.000 0
+6.000 0
+8.000 0
+10.000 0
+15.000 0
+20.000 0
+30.000 0
+40.000 0
+50.000 0
+60.000 0
+80.000 0
+100.000 0
diff --git a/MCNP/KERMA_factors/photonKERMA_2.txt b/MCNP/KERMA_factors/photonKERMA_2.txt
new file mode 100644
index 000000000..ebbacdc7c
--- /dev/null
+++ b/MCNP/KERMA_factors/photonKERMA_2.txt
@@ -0,0 +1,33 @@
+0.01 7.9468e-16
+0.015 3.3405e-16
+0.02 1.7944e-16
+0.03 7.6904e-17
+0.04 4.5758e-17
+0.05 3.4607e-17
+0.06 3.1146e-17
+0.08 3.3453e-17
+0.1 4.0695e-17
+0.15 6.609e-17
+0.2 9.4208e-17
+0.3 1.5237e-16
+0.4 2.0828e-16
+0.5 2.6196e-16
+0.6 3.1339e-16
+0.8 4.0759e-16
+1 4.9347e-16
+1.5 6.7532e-16
+2 8.2672e-16
+3 1.0863e-15
+4 1.3138e-15
+5 1.5221e-15
+6 1.7207e-15
+8 2.1021e-15
+10 2.4834e-15
+15 3.4367e-15
+20 4.39e-15
+30 6.2966e-15
+40 8.2672e-15
+50 1.0174e-14
+60 1.192e-14
+80 1.5637e-14
+100 1.9226e-14
diff --git a/MCNP/KERMA_factors/photonKERMA_3.txt b/MCNP/KERMA_factors/photonKERMA_3.txt
new file mode 100644
index 000000000..7fbab3673
--- /dev/null
+++ b/MCNP/KERMA_factors/photonKERMA_3.txt
@@ -0,0 +1,33 @@
+0.01 7.1617e-16
+0.015 2.956e-16
+0.02 1.583e-16
+0.03 6.7291e-17
+0.04 4.0631e-17
+0.05 3.1403e-17
+0.06 2.9031e-17
+0.08 3.23e-17
+0.1 3.9894e-17
+0.15 6.5609e-17
+0.2 9.4208e-17
+0.3 1.5189e-16
+0.4 2.0828e-16
+0.5 2.6196e-16
+0.6 3.1242e-16
+0.8 4.0631e-16
+1 4.9187e-16
+1.5 6.7291e-16
+2 8.2672e-16
+3 1.0815e-15
+4 1.3074e-15
+5 1.5141e-15
+6 1.7111e-15
+8 2.1021e-15
+10 2.4674e-15
+15 3.4126e-15
+20 4.3579e-15
+30 6.2485e-15
+40 8.2031e-15
+50 1.0094e-14
+60 1.192e-14
+80 1.5509e-14
+100 1.9066e-14
diff --git a/MCNP/KERMA_factors/photonKERMA_4.txt b/MCNP/KERMA_factors/photonKERMA_4.txt
new file mode 100644
index 000000000..d2791b656
--- /dev/null
+++ b/MCNP/KERMA_factors/photonKERMA_4.txt
@@ -0,0 +1,33 @@
+0.01 7.0175e-15
+0.015 3.3165e-15
+0.02 1.913e-15
+0.03 8.5556e-16
+0.04 4.7809e-16
+0.05 3.0602e-16
+0.06 2.1533e-16
+0.08 1.3202e-16
+0.1 9.9655e-17
+0.15 8.6037e-17
+0.2 9.9655e-17
+0.3 1.4372e-16
+0.4 1.9162e-16
+0.5 2.3872e-16
+0.6 2.8455e-16
+0.8 3.6786e-16
+1 4.438e-16
+1.5 6.0803e-16
+2 7.4982e-16
+3 1.0046e-15
+4 1.2497e-15
+5 1.498e-15
+6 1.7496e-15
+8 2.2559e-15
+10 2.7878e-15
+15 4.1576e-15
+20 5.6076e-15
+30 8.3634e-15
+40 1.1215e-14
+50 1.3939e-14
+60 1.6438e-14
+80 2.1405e-14
+100 2.6276e-14
diff --git a/MCNP/KERMA_factors/photonKERMA_5.txt b/MCNP/KERMA_factors/photonKERMA_5.txt
new file mode 100644
index 000000000..3fa00713b
--- /dev/null
+++ b/MCNP/KERMA_factors/photonKERMA_5.txt
@@ -0,0 +1,33 @@
+0.01 7.16E-16
+0.015 3.00E-16
+0.02 1.61E-16
+0.03 6.92E-17
+0.04 4.16E-17
+0.05 3.20E-17
+0.06 2.94E-17
+0.08 3.26E-17
+0.1 4.01E-17
+0.15 6.56E-17
+0.2 9.39E-17
+0.3 1.52E-16
+0.4 2.08E-16
+0.5 2.61E-16
+0.6 3.12E-16
+0.8 4.06E-16
+1 4.92E-16
+1.5 6.73E-16
+2 8.27E-16
+3 1.08E-15
+4 1.31E-15
+5 1.51E-15
+6 1.71E-15
+8 2.09E-15
+10 2.47E-15
+15 3.39E-15
+20 4.33E-15
+30 6.20E-15
+40 8.14E-15
+50 1.00E-14
+60 1.17E-14
+80 1.54E-14
+100 1.89E-14
diff --git a/MCNP/KERMA_factors/plotKERMAcomparison.mlx b/MCNP/KERMA_factors/plotKERMAcomparison.mlx
new file mode 100644
index 000000000..afa5cdec9
Binary files /dev/null and b/MCNP/KERMA_factors/plotKERMAcomparison.mlx differ
diff --git a/MCNP/RBEfactors/MCDS_3HeIntraTrack_intraT_aerobic.txt b/MCNP/RBEfactors/MCDS_3HeIntraTrack_intraT_aerobic.txt
new file mode 100644
index 000000000..25974d659
--- /dev/null
+++ b/MCNP/RBEfactors/MCDS_3HeIntraTrack_intraT_aerobic.txt
@@ -0,0 +1,92 @@
+0.1 0.9494
+0.125 3.3822
+0.15 4.0218
+0.175 4.6759
+0.2 5.2922
+0.225 5.9174
+0.25 6.5298
+0.275 7.124
+0.3 7.721
+0.35 8.8705
+0.4 9.9711
+0.45 11.0224
+0.5 12.0291
+0.55 12.961
+0.6 13.8152
+0.65 14.5917
+0.7 15.3122
+0.75 15.9025
+0.8 16.3794
+0.85 16.7657
+0.9 17.033
+0.95 17.2042
+1 17.2708
+1.25 16.2802
+1.5 14.2919
+1.75 12.4501
+2 10.9328
+2.25 9.7009
+2.5 8.6935
+2.75 7.8305
+3 7.1188
+3.5 5.9577
+4 5.0844
+4.5 4.3877
+5 3.8324
+5.5 3.3809
+6 3.0042
+6.5 2.696
+7 2.4339
+7.5 2.21
+8 2.0146
+8.5 1.8543
+9 1.7087
+9.5 1.5816
+10 1.4693
+12.5 1.0611
+15 0.8156
+17.5 0.6527
+20 0.5408
+25 0.3966
+27.5 0.3486
+30 0.3097
+35 0.2527
+40 0.2123
+45 0.1837
+50 0.1615
+55 0.144
+60 0.1298
+65 0.1181
+70 0.1087
+75 0.1004
+80 0.0937
+85 0.0878
+90 0.0825
+95 0.0777
+100 0.0736
+125 0.0586
+150 0.0488
+175 0.0422
+200 0.0373
+225 0.0335
+250 0.0306
+275 0.0285
+300 0.0261
+350 0.0231
+400 0.0207
+450 0.019
+500 0.0175
+550 0.0163
+600 0.0154
+650 0.0146
+700 0.0138
+750 0.0132
+800 0.0127
+850 0.0122
+900 0.0118
+950 0.0115
+1000 0.0111
+2000 0.008
+5000 0.0064
+7500 0.0061
+10000 0.006
diff --git a/MCNP/RBEfactors/MCDS_3HeIntraTrack_intraT_anoxic.txt b/MCNP/RBEfactors/MCDS_3HeIntraTrack_intraT_anoxic.txt
new file mode 100644
index 000000000..d531ec06f
--- /dev/null
+++ b/MCNP/RBEfactors/MCDS_3HeIntraTrack_intraT_anoxic.txt
@@ -0,0 +1,92 @@
+0.1 8.003
+0.125 28.4127
+0.15 33.8013
+0.175 39.2099
+0.2 44.379
+0.225 49.5161
+0.25 54.5221
+0.275 59.5121
+0.3 64.3612
+0.35 73.7883
+0.4 82.5779
+0.45 91.0901
+0.5 98.9264
+0.55 106.1366
+0.6 112.8532
+0.65 118.6742
+0.7 123.9428
+0.75 128.116
+0.8 131.3319
+0.85 133.8504
+0.9 134.9742
+0.95 135.6765
+1 135.5118
+1.25 123.6604
+1.5 104.3501
+1.75 86.9217
+2 72.7414
+2.25 61.2827
+2.5 51.883
+2.75 44.2407
+3 37.9305
+3.5 27.9604
+4 21.1603
+4.5 16.2385
+5 12.6518
+5.5 10.1006
+6 8.187
+6.5 6.7254
+7 5.6218
+7.5 4.7542
+8 4.0708
+8.5 3.5356
+9 3.1156
+9.5 2.74
+10 2.4488
+12.5 1.5236
+15 1.0705
+17.5 0.805
+20 0.6402
+25 0.4454
+27.5 0.3852
+30 0.3377
+35 0.27
+40 0.2248
+45 0.1919
+50 0.1676
+55 0.1491
+60 0.1333
+65 0.121
+70 0.1114
+75 0.1028
+80 0.0956
+85 0.0893
+90 0.0838
+95 0.079
+100 0.0746
+125 0.0593
+150 0.0489
+175 0.0424
+200 0.0375
+225 0.0336
+250 0.0306
+275 0.0285
+300 0.0261
+350 0.0231
+400 0.0207
+450 0.019
+500 0.0174
+550 0.0163
+600 0.0153
+650 0.0145
+700 0.0138
+750 0.0132
+800 0.0127
+850 0.0122
+900 0.0118
+950 0.0114
+1000 0.0112
+2000 0.008
+5000 0.0064
+7500 0.0061
+10000 0.006
diff --git a/MCNP/RBEfactors/MCDS_3HeRBE_DSB_aerobic.txt b/MCNP/RBEfactors/MCDS_3HeRBE_DSB_aerobic.txt
new file mode 100644
index 000000000..1c0564c92
--- /dev/null
+++ b/MCNP/RBEfactors/MCDS_3HeRBE_DSB_aerobic.txt
@@ -0,0 +1,93 @@
+0.1 3.3714
+0.125 3.354
+0.15 3.347
+0.175 3.347
+0.2 3.339
+0.225 3.336
+0.25 3.332
+0.275 3.326
+0.3 3.323
+0.35 3.314
+0.4 3.305
+0.45 3.296
+0.5 3.288
+0.55 3.28
+0.6 3.269
+0.65 3.259
+0.7 3.251
+0.75 3.241
+0.8 3.23
+0.85 3.22
+0.9 3.21
+0.95 3.201
+1 3.192
+1.25 3.143
+1.5 3.094
+1.75 3.046
+2 2.995
+2.25 2.946
+2.5 2.9
+2.75 2.851
+3 2.808
+3.5 2.722
+4 2.645
+4.5 2.57
+5 2.502
+5.5 2.437
+6 2.376
+6.5 2.323
+7 2.271
+7.5 2.223
+8 2.178
+8.5 2.139
+9 2.1
+9.5 2.064
+10 2.031
+12.5 1.885
+15 1.777
+17.5 1.691
+20 1.624
+25 1.521
+27.5 1.482
+30 1.447
+35 1.392
+40 1.347
+45 1.313
+50 1.285
+55 1.261
+60 1.24
+65 1.223
+70 1.208
+75 1.195
+80 1.185
+85 1.175
+90 1.165
+95 1.156
+100 1.149
+125 1.12
+150 1.099
+175 1.087
+200 1.076
+225 1.067
+250 1.061
+275 1.054
+300 1.05
+350 1.044
+375 1.041
+400 1.038
+450 1.035
+500 1.029
+550 1.027
+600 1.026
+650 1.023
+700 1.022
+750 1.02
+800 1.02
+850 1.018
+900 1.018
+950 1.016
+1000 1.015
+2000 1.007
+5000 1.004
+7500 1.004
+10000 1
diff --git a/MCNP/RBEfactors/MCDS_3HeRBE_DSB_anoxic.txt b/MCNP/RBEfactors/MCDS_3HeRBE_DSB_anoxic.txt
new file mode 100644
index 000000000..28ff57f11
--- /dev/null
+++ b/MCNP/RBEfactors/MCDS_3HeRBE_DSB_anoxic.txt
@@ -0,0 +1,92 @@
+0.1 9.7915
+0.125 9.721
+0.15 9.7
+0.175 9.692
+0.2 9.666
+0.225 9.647
+0.25 9.625
+0.275 9.61
+0.3 9.591
+0.35 9.555
+0.4 9.508
+0.45 9.472
+0.5 9.426
+0.55 9.383
+0.6 9.34
+0.65 9.291
+0.7 9.25
+0.75 9.196
+0.8 9.143
+0.85 9.095
+0.9 9.033
+0.95 8.986
+1 8.939
+1.25 8.659
+1.5 8.358
+1.75 8.046
+2 7.723
+2.25 7.402
+2.5 7.083
+2.75 6.775
+3 6.48
+3.5 5.895
+4 5.395
+4.5 4.943
+5 4.544
+5.5 4.212
+6 3.922
+6.5 3.667
+7 3.451
+7.5 3.26
+8 3.094
+8.5 2.953
+9 2.835
+9.5 2.717
+10 2.62
+12.5 2.258
+15 2.036
+17.5 1.878
+20 1.767
+25 1.612
+27.5 1.558
+30 1.511
+35 1.438
+40 1.385
+45 1.342
+50 1.309
+55 1.283
+60 1.257
+65 1.238
+70 1.224
+75 1.208
+80 1.196
+85 1.184
+90 1.174
+95 1.165
+100 1.156
+125 1.127
+150 1.1
+175 1.088
+200 1.078
+225 1.068
+250 1.061
+275 1.055
+300 1.049
+350 1.044
+400 1.037
+450 1.035
+500 1.028
+550 1.025
+600 1.024
+650 1.02
+700 1.021
+750 1.019
+800 1.019
+850 1.016
+900 1.015
+950 1.014
+1000 1.016
+2000 1.004
+5000 1.003
+7500 1.003
+10000 0.9996
diff --git a/MCNP/RBEfactors/MCDS_alphaIntraTrack_intraT_aerobic.txt b/MCNP/RBEfactors/MCDS_alphaIntraTrack_intraT_aerobic.txt
new file mode 100644
index 000000000..042ad7c55
--- /dev/null
+++ b/MCNP/RBEfactors/MCDS_alphaIntraTrack_intraT_aerobic.txt
@@ -0,0 +1,92 @@
+0.1 0.9471
+0.125 3.3631
+0.15 3.9949
+0.175 4.6377
+0.2 5.242
+0.225 5.8529
+0.25 6.4509
+0.275 7.0288
+0.3 7.6083
+0.35 8.72
+0.4 9.7842
+0.45 10.7996
+0.5 11.7695
+0.55 12.6704
+0.6 13.4944
+0.65 14.2516
+0.7 14.9735
+0.75 15.5661
+0.8 16.0766
+0.85 16.5064
+0.9 16.8577
+0.95 17.1529
+1 17.3625
+1.25 17.3378
+1.5 16.0832
+1.75 14.4462
+2 12.8806
+2.25 11.5421
+2.5 10.4188
+2.75 9.4272
+3 8.6085
+3.5 7.2494
+4 6.2158
+4.5 5.3839
+5 4.7163
+5.5 4.1708
+6 3.7138
+6.5 3.3382
+7 3.0182
+7.5 2.7431
+8 2.5037
+8.5 2.3067
+9 2.1272
+9.5 1.9705
+10 1.8315
+12.5 1.326
+15 1.0205
+17.5 0.8176
+20 0.6781
+25 0.4976
+27.5 0.4377
+30 0.3891
+35 0.3176
+40 0.2671
+45 0.231
+50 0.2033
+55 0.1811
+60 0.1632
+65 0.1486
+70 0.1367
+75 0.1263
+80 0.1179
+85 0.1103
+90 0.1037
+95 0.0976
+100 0.0925
+125 0.0735
+150 0.0612
+175 0.0528
+200 0.0465
+225 0.0417
+250 0.0381
+275 0.0353
+300 0.0323
+350 0.0284
+400 0.0254
+450 0.0232
+500 0.0213
+550 0.0198
+600 0.0186
+650 0.0175
+700 0.0166
+750 0.0158
+800 0.0152
+850 0.0145
+900 0.014
+950 0.0135
+1000 0.0131
+2000 0.009
+5000 0.0067
+7500 0.0063
+10000 0.0061
diff --git a/MCNP/RBEfactors/MCDS_alphaIntraTrack_intraT_anoxic.txt b/MCNP/RBEfactors/MCDS_alphaIntraTrack_intraT_anoxic.txt
new file mode 100644
index 000000000..3ded56cab
--- /dev/null
+++ b/MCNP/RBEfactors/MCDS_alphaIntraTrack_intraT_anoxic.txt
@@ -0,0 +1,92 @@
+0.1 7.9837
+0.125 28.2519
+0.15 33.5752
+0.175 38.8902
+0.2 43.958
+0.225 48.9756
+0.25 53.8635
+0.275 58.7168
+0.3 63.4217
+0.35 72.536
+0.4 81.0301
+0.45 89.2486
+0.5 96.7913
+0.55 103.7565
+0.6 110.2328
+0.65 115.9083
+0.7 121.2019
+0.75 125.4063
+0.8 128.9045
+0.85 131.7797
+0.9 133.5853
+0.95 135.2722
+1 136.2317
+1.25 131.6942
+1.5 117.4289
+1.75 100.8577
+2 85.701
+2.25 72.9138
+2.5 62.1793
+2.75 53.2617
+3 45.8681
+3.5 34.0222
+4 25.8691
+4.5 19.925
+5 15.5699
+5.5 12.4606
+6 10.121
+6.5 8.3273
+7 6.9715
+7.5 5.9013
+8 5.0591
+8.5 4.3983
+9 3.8786
+9.5 3.4138
+10 3.0524
+12.5 1.9041
+15 1.3394
+17.5 1.0084
+20 0.8027
+25 0.5589
+27.5 0.4837
+30 0.4243
+35 0.3394
+40 0.2828
+45 0.2413
+50 0.2109
+55 0.1875
+60 0.1678
+65 0.1522
+70 0.1401
+75 0.1293
+80 0.1203
+85 0.1122
+90 0.1053
+95 0.0993
+100 0.0938
+125 0.0744
+150 0.0613
+175 0.053
+200 0.0468
+225 0.0418
+250 0.0381
+275 0.0353
+300 0.0323
+350 0.0285
+400 0.0254
+450 0.0232
+500 0.0212
+550 0.0197
+600 0.0185
+650 0.0174
+700 0.0166
+750 0.0158
+800 0.0152
+850 0.0145
+900 0.014
+950 0.0135
+1000 0.0131
+2000 0.0089
+5000 0.0067
+7500 0.0063
+10000 0.0061
diff --git a/MCNP/RBEfactors/MCDS_alphaRBE_DSB_aerobic.txt b/MCNP/RBEfactors/MCDS_alphaRBE_DSB_aerobic.txt
new file mode 100644
index 000000000..4c2563118
--- /dev/null
+++ b/MCNP/RBEfactors/MCDS_alphaRBE_DSB_aerobic.txt
@@ -0,0 +1,93 @@
+0.1 3.3727
+0.125 3.358
+0.15 3.355
+0.175 3.352
+0.2 3.349
+0.225 3.345
+0.25 3.342
+0.275 3.338
+0.3 3.334
+0.35 3.329
+0.4 3.323
+0.45 3.317
+0.5 3.309
+0.55 3.303
+0.6 3.294
+0.65 3.289
+0.7 3.283
+0.75 3.276
+0.8 3.27
+0.85 3.263
+0.9 3.253
+0.95 3.247
+1 3.239
+1.25 3.204
+1.5 3.165
+1.75 3.129
+2 3.092
+2.25 3.055
+2.5 3.018
+2.75 2.979
+3 2.945
+3.5 2.869
+4 2.804
+4.5 2.739
+5 2.679
+5.5 2.622
+6 2.567
+6.5 2.513
+7 2.466
+7.5 2.417
+8 2.373
+8.5 2.332
+9 2.291
+9.5 2.255
+10 2.222
+12.5 2.07
+15 1.948
+17.5 1.852
+20 1.774
+25 1.654
+27.5 1.607
+30 1.566
+35 1.5
+40 1.444
+45 1.402
+50 1.367
+55 1.338
+60 1.311
+65 1.288
+70 1.271
+75 1.254
+80 1.24
+85 1.224
+90 1.216
+95 1.204
+100 1.195
+125 1.158
+150 1.131
+175 1.115
+200 1.1
+225 1.088
+250 1.079
+275 1.072
+300 1.067
+350 1.057
+375 1.053
+400 1.051
+450 1.044
+500 1.041
+550 1.037
+600 1.031
+650 1.032
+700 1.029
+750 1.027
+800 1.027
+850 1.024
+900 1.022
+950 1.02
+1000 1.02
+2000 1.01
+5000 1.004
+7500 1.004
+10000 1.002
diff --git a/MCNP/RBEfactors/MCDS_alphaRBE_DSB_anoxic.txt b/MCNP/RBEfactors/MCDS_alphaRBE_DSB_anoxic.txt
new file mode 100644
index 000000000..0c52e2e2c
--- /dev/null
+++ b/MCNP/RBEfactors/MCDS_alphaRBE_DSB_anoxic.txt
@@ -0,0 +1,93 @@
+0.1 9.7969
+0.125 9.742
+0.15 9.723
+0.175 9.713
+0.2 9.705
+0.225 9.685
+0.25 9.677
+0.275 9.653
+0.3 9.642
+0.35 9.619
+0.4 9.592
+0.45 9.563
+0.5 9.53
+0.55 9.501
+0.6 9.467
+0.65 9.442
+0.7 9.402
+0.75 9.372
+0.8 9.344
+0.85 9.303
+0.9 9.264
+0.95 9.226
+1 9.191
+1.25 8.996
+1.5 8.787
+1.75 8.574
+2 8.344
+2.25 8.114
+2.5 7.871
+2.75 7.627
+3 7.388
+3.5 6.912
+4 6.457
+4.5 6.015
+5 5.619
+5.5 5.255
+6 4.925
+6.5 4.619
+7 4.357
+7.5 4.119
+8 3.898
+8.5 3.713
+9 3.543
+9.5 3.389
+10 3.25
+12.5 2.74
+15 2.405
+17.5 2.19
+20 2.03
+25 1.816
+27.5 1.736
+30 1.676
+35 1.582
+40 1.507
+45 1.455
+50 1.405
+55 1.372
+60 1.339
+65 1.313
+70 1.293
+75 1.274
+80 1.258
+85 1.24
+90 1.23
+95 1.221
+100 1.21
+125 1.167
+150 1.137
+175 1.121
+200 1.101
+225 1.088
+250 1.079
+275 1.074
+300 1.067
+350 1.059
+375 1.054
+400 1.049
+450 1.042
+500 1.039
+550 1.035
+600 1.031
+650 1.033
+700 1.027
+750 1.026
+800 1.027
+850 1.023
+900 1.022
+950 1.02
+1000 1.019
+2000 1.006
+5000 1.002
+7500 1.002
+10000 1
diff --git a/MCNP/RBEfactors/MCDS_deuteronIntraTrack_intraT_aerobic.txt b/MCNP/RBEfactors/MCDS_deuteronIntraTrack_intraT_aerobic.txt
new file mode 100644
index 000000000..aadc591e4
--- /dev/null
+++ b/MCNP/RBEfactors/MCDS_deuteronIntraTrack_intraT_aerobic.txt
@@ -0,0 +1,28 @@
+0.1 0.8725
+0.2 4.2515
+0.3 5.1176
+0.5 4.1924
+0.9 2.2962
+1 2.0234
+1.1 1.7987
+1.3 1.4586
+1.5 1.2071
+2 0.8147
+2.5 0.597
+3 0.4654
+3.5 0.3749
+4 0.312
+5 0.2331
+6 0.1827
+7.5 0.1391
+10 0.0981
+15 0.0622
+25 0.0368
+50 0.0189
+75 0.0132
+100 0.0104
+150 0.0074
+200 0.006
+250 0.0051
+500 0.0032
+1000 0.0023
diff --git a/MCNP/RBEfactors/MCDS_deuteronIntraTrack_intraT_anoxic.txt b/MCNP/RBEfactors/MCDS_deuteronIntraTrack_intraT_anoxic.txt
new file mode 100644
index 000000000..99be03a06
--- /dev/null
+++ b/MCNP/RBEfactors/MCDS_deuteronIntraTrack_intraT_anoxic.txt
@@ -0,0 +1,28 @@
+0.1 7.1123
+0.2 31.2886
+0.3 33.888
+0.5 21.1986
+0.9 6.7827
+1 5.3448
+1.1 4.3121
+1.3 2.967
+1.5 2.1661
+2 1.1922
+2.5 0.7748
+3 0.567
+3.5 0.4389
+4 0.3536
+5 0.2536
+6 0.1946
+7.5 0.1449
+10 0.1003
+15 0.0631
+25 0.0371
+50 0.019
+75 0.0132
+100 0.0103
+150 0.0074
+200 0.0059
+250 0.005
+500 0.0032
+1000 0.0023
diff --git a/MCNP/RBEfactors/MCDS_deuteronRBE_DSB_aerobic.txt b/MCNP/RBEfactors/MCDS_deuteronRBE_DSB_aerobic.txt
new file mode 100644
index 000000000..a1a47f625
--- /dev/null
+++ b/MCNP/RBEfactors/MCDS_deuteronRBE_DSB_aerobic.txt
@@ -0,0 +1,28 @@
+0.1 3.3122
+0.2 3.106
+0.3 2.988
+0.5 2.771
+0.9 2.428
+1 2.359
+1.1 2.296
+1.3 2.189
+1.5 2.094
+2 1.908
+2.5 1.774
+3 1.678
+3.5 1.597
+4 1.534
+5 1.446
+6 1.375
+7.5 1.311
+10 1.235
+15 1.159
+25 1.097
+50 1.044
+75 1.028
+100 1.02
+150 1.009
+200 1.006
+250 1.003
+500 0.9985
+1000 0.9967
diff --git a/MCNP/RBEfactors/MCDS_deuteronRBE_DSB_anoxic.txt b/MCNP/RBEfactors/MCDS_deuteronRBE_DSB_anoxic.txt
new file mode 100644
index 000000000..21afdca32
--- /dev/null
+++ b/MCNP/RBEfactors/MCDS_deuteronRBE_DSB_anoxic.txt
@@ -0,0 +1,28 @@
+0.1 9.5338
+0.2 8.426
+0.3 7.689
+0.5 6.231
+0.9 4.173
+1 3.834
+1.1 3.555
+1.3 3.122
+1.5 2.805
+2 2.308
+2.5 2.021
+3 1.852
+3.5 1.728
+4 1.633
+5 1.508
+6 1.419
+7.5 1.338
+10 1.249
+15 1.167
+25 1.102
+50 1.047
+75 1.028
+100 1.016
+150 1.008
+200 1.004
+250 1.002
+500 0.9973
+1000 0.9937
diff --git a/MCNP/RBEfactors/MCDS_electronIntraTrack_intraT_aerobic.txt b/MCNP/RBEfactors/MCDS_electronIntraTrack_intraT_aerobic.txt
new file mode 100644
index 000000000..7621b19ac
--- /dev/null
+++ b/MCNP/RBEfactors/MCDS_electronIntraTrack_intraT_aerobic.txt
@@ -0,0 +1,14 @@
+0.05 0.0077
+0.06 0.0049
+0.07 0.0044
+0.08 0.004
+0.09 0.0037
+0.1 0.0034
+0.2 0.0023
+0.3 0.0019
+0.4 0.0017
+0.5 0.0016
+1 0.0015
+10 0.0016
+100 0.0018
+1000 0.0019
diff --git a/MCNP/RBEfactors/MCDS_electronIntraTrack_intraT_anoxic.txt b/MCNP/RBEfactors/MCDS_electronIntraTrack_intraT_anoxic.txt
new file mode 100644
index 000000000..250dd2a82
--- /dev/null
+++ b/MCNP/RBEfactors/MCDS_electronIntraTrack_intraT_anoxic.txt
@@ -0,0 +1,14 @@
+0.05 0.0113
+0.06 0.0049
+0.07 0.0043
+0.08 0.004
+0.09 0.0037
+0.1 0.0034
+0.2 0.0023
+0.3 0.0019
+0.4 0.0017
+0.5 0.0016
+1 0.0015
+10 0.0016
+100 0.0018
+1000 0.0019
diff --git a/MCNP/RBEfactors/MCDS_electronRBE_DSB_aerobic.txt b/MCNP/RBEfactors/MCDS_electronRBE_DSB_aerobic.txt
new file mode 100644
index 000000000..b26781795
--- /dev/null
+++ b/MCNP/RBEfactors/MCDS_electronRBE_DSB_aerobic.txt
@@ -0,0 +1,22 @@
+0.05 1.9949
+0.06 1.006
+0.07 1.002
+0.08 1.002
+0.09 1.002
+0.1 0.9989
+0.2 0.9959
+0.3 0.9952
+0.4 0.9945
+0.5 0.9941
+1 0.9921
+10 0.9907
+100 0.9943
+150 0.9943
+200 0.9943
+300 0.9943
+400 0.9943
+500 0.9943
+600 0.9943
+800 0.9943
+900 0.9943
+1000 0.9943
diff --git a/MCNP/RBEfactors/MCDS_electronRBE_DSB_anoxic.txt b/MCNP/RBEfactors/MCDS_electronRBE_DSB_anoxic.txt
new file mode 100644
index 000000000..9707f256c
--- /dev/null
+++ b/MCNP/RBEfactors/MCDS_electronRBE_DSB_anoxic.txt
@@ -0,0 +1,22 @@
+0.05 3.9814
+0.06 1.001
+0.07 1.001
+0.08 1
+0.09 1.002
+0.1 0.9969
+0.2 0.9941
+0.3 0.9945
+0.4 0.991
+0.5 0.9933
+1 0.9913
+10 0.9887
+100 0.994
+150 0.994
+200 0.994
+300 0.994
+400 0.994
+500 0.994
+600 0.994
+800 0.994
+900 0.994
+1000 0.994
diff --git a/MCNP/RBEfactors/MCDS_heavyIonsIntraTrack_intraT_aerobic.txt b/MCNP/RBEfactors/MCDS_heavyIonsIntraTrack_intraT_aerobic.txt
new file mode 100644
index 000000000..f99d549dc
--- /dev/null
+++ b/MCNP/RBEfactors/MCDS_heavyIonsIntraTrack_intraT_aerobic.txt
@@ -0,0 +1,41 @@
+0.1 1.0461
+0.2 5.600020284375
+0.3 8.32836499275
+0.5 13.6604011775
+0.9 23.87728589125
+1 26.34098957875
+1.1 28.76661123875
+1.3 33.50520734
+1.5 38.08435312
+2 48.82392092875
+2.5 58.51841325
+3 67.27916914125
+3.5 75.2410745625
+4 82.470555035
+5 94.5693023825
+6 103.84242143
+7.5 113.96976977375
+10 125.76996565375
+15 139.4119072225
+25 141.36975948975
+35 134.329075755875
+50 124.02139011625
+100 99.984988211625
+200 74.19003967375
+300 59.8193069375
+400 50.4299955542625
+500 43.753787347325
+750 33.170315152975
+1000 26.9326025970375
+2000 15.9597518460875
+3000 11.75043342605
+4000 9.515300393225
+5000 8.1262322769375
+7500 6.21215544565
+10000 5.2275533457125
+20000 3.7305488446875
+30000 3.2442282719
+40000 3.0145732969
+50000 2.8862063404625
+75000 2.736030882475
+100000 2.6767537357
diff --git a/MCNP/RBEfactors/MCDS_heavyIonsIntraTrack_intraT_anoxic.txt b/MCNP/RBEfactors/MCDS_heavyIonsIntraTrack_intraT_anoxic.txt
new file mode 100644
index 000000000..281e59d51
--- /dev/null
+++ b/MCNP/RBEfactors/MCDS_heavyIonsIntraTrack_intraT_anoxic.txt
@@ -0,0 +1,41 @@
+0.1 8.8705
+0.2 47.487503559375
+0.3 70.62354101475
+0.5 115.8385713975
+0.9 202.47653422125
+1 223.36844740875
+1.1 243.93742954875
+1.3 284.12015886
+1.5 322.95076848
+2 414.02102155875
+2.5 496.22915925
+3 570.51932347125
+3.5 638.0353310625
+4 699.340462515
+5 801.9363958425
+6 880.57133847
+7.5 966.45004356375
+10 1066.51429608375
+15 1182.1963322025
+25 1198.79868572775
+35 1139.09452808288
+50 1051.68658424625
+100 847.860765224625
+200 629.12268066375
+300 507.2605824375
+400 427.640342672363
+500 371.026893989925
+750 281.280313088775
+1000 228.385255185338
+2000 135.336790602787
+3000 99.64227285045
+4000 80.688611531025
+5000 68.9094797124375
+7500 52.67833665885
+10000 44.3290283794125
+20000 31.6346089021875
+30000 27.5106684951
+40000 25.5632217201
+50000 24.4746852521625
+75000 23.201215294275
+100000 22.6985521653
diff --git a/MCNP/RBEfactors/MCDS_lithiumIntraTrack_intraT_aerobic.txt b/MCNP/RBEfactors/MCDS_lithiumIntraTrack_intraT_aerobic.txt
new file mode 100644
index 000000000..69f38b921
--- /dev/null
+++ b/MCNP/RBEfactors/MCDS_lithiumIntraTrack_intraT_aerobic.txt
@@ -0,0 +1,41 @@
+0.1 1.0205
+0.2 5.407
+0.3 7.964
+0.5 12.79
+0.9 21.32
+1 23.15
+1.1 24.86
+1.3 27.84
+1.5 30.23
+2 33.74
+2.5 33.79
+3 31.96
+3.5 29.63
+4 27.4
+5 23.61
+6 20.72
+7.5 17.38
+10 13.48
+15 8.918
+25 4.84
+35 3.078
+50 1.855
+100 0.6803
+200 0.2663
+300 0.1632
+400 0.1175
+500 0.09313
+750 0.06287
+1000 0.04888
+2000 0.02914
+3000 0.023
+4000 0.02003
+5000 0.01823
+7500 0.01612
+10000 0.01514
+20000 0.01398
+30000 0.01377
+40000 0.01373
+50000 0.01372
+75000 0.01381
+100000 0.01388
diff --git a/MCNP/RBEfactors/MCDS_lithiumIntraTrack_intraT_anoxic.txt b/MCNP/RBEfactors/MCDS_lithiumIntraTrack_intraT_anoxic.txt
new file mode 100644
index 000000000..f4912026b
--- /dev/null
+++ b/MCNP/RBEfactors/MCDS_lithiumIntraTrack_intraT_anoxic.txt
@@ -0,0 +1,41 @@
+0.1 8.6217
+0.2 45.68
+0.3 67.16
+0.5 107.9
+0.9 179.4
+1 194.4
+1.1 208.8
+1.3 233.4
+1.5 252.8
+2 281
+2.5 280.3
+3 263.4
+3.5 242.5
+4 222.2
+5 187.9
+6 161.3
+7.5 130.2
+10 92.96
+15 49.96
+25 17.02
+35 7.491
+50 3.229
+100 0.8154
+200 0.2812
+300 0.1685
+400 0.1199
+500 0.09438
+750 0.06353
+1000 0.04883
+2000 0.02917
+3000 0.023
+4000 0.02004
+5000 0.01825
+7500 0.01603
+10000 0.01511
+20000 0.01396
+30000 0.01373
+40000 0.01368
+50000 0.0137
+75000 0.01377
+100000 0.01384
diff --git a/MCNP/RBEfactors/MCDS_lithiumRBE_DSB_aerobic.txt b/MCNP/RBEfactors/MCDS_lithiumRBE_DSB_aerobic.txt
new file mode 100644
index 000000000..9472075a7
--- /dev/null
+++ b/MCNP/RBEfactors/MCDS_lithiumRBE_DSB_aerobic.txt
@@ -0,0 +1,41 @@
+0.1 3.3840
+0.2 3.378
+0.3 3.375
+0.5 3.369
+0.9 3.358
+1 3.354
+1.1 3.351
+1.3 3.345
+1.5 3.338
+2 3.325
+2.5 3.306
+3 3.291
+3.5 3.275
+4 3.256
+5 3.217
+6 3.183
+7.5 3.127
+10 3.03
+15 2.845
+25 2.54
+35 2.31
+50 2.066
+100 1.655
+200 1.371
+300 1.263
+400 1.201
+500 1.165
+750 1.115
+1000 1.09
+2000 1.05
+3000 1.038
+4000 1.032
+5000 1.026
+7500 1.022
+10000 1.02
+20000 1.016
+30000 1.015
+40000 1.015
+50000 1.015
+75000 1.016
+100000 1.016
diff --git a/MCNP/RBEfactors/MCDS_lithiumRBE_DSB_anoxic.txt b/MCNP/RBEfactors/MCDS_lithiumRBE_DSB_anoxic.txt
new file mode 100644
index 000000000..cab09206c
--- /dev/null
+++ b/MCNP/RBEfactors/MCDS_lithiumRBE_DSB_anoxic.txt
@@ -0,0 +1,41 @@
+0.1 9.8353
+0.2 9.817
+0.3 9.801
+0.5 9.783
+0.9 9.743
+1 9.72
+1.1 9.713
+1.3 9.685
+1.5 9.653
+2 9.596
+2.5 9.522
+3 9.447
+3.5 9.368
+4 9.274
+5 9.076
+6 8.88
+7.5 8.558
+10 7.958
+15 6.734
+25 4.763
+35 3.603
+50 2.726
+100 1.812
+200 1.409
+300 1.283
+400 1.213
+500 1.173
+750 1.121
+1000 1.09
+2000 1.051
+3000 1.038
+4000 1.032
+5000 1.026
+7500 1.019
+10000 1.018
+20000 1.016
+30000 1.014
+40000 1.013
+50000 1.014
+75000 1.014
+100000 1.015
diff --git a/MCNP/RBEfactors/MCDS_protonIntraTrack_intraT_aerobic.txt b/MCNP/RBEfactors/MCDS_protonIntraTrack_intraT_aerobic.txt
new file mode 100644
index 000000000..e05bd49f0
--- /dev/null
+++ b/MCNP/RBEfactors/MCDS_protonIntraTrack_intraT_aerobic.txt
@@ -0,0 +1,28 @@
+0.1 0.8352
+0.2 3.632
+0.3 3.789
+0.5 2.156
+0.9 0.9674
+1 0.8307
+1.1 0.7276
+1.3 0.5731
+1.5 0.4697
+2 0.3144
+2.5 0.2336
+3 0.1845
+3.5 0.1517
+4 0.1285
+5 0.09884
+6 0.07986
+7.5 0.06226
+10 0.04581
+15 0.03059
+25 0.01899
+50 0.01041
+75 0.007456
+100 0.005977
+150 0.004434
+200 0.003683
+250 0.003211
+500 0.002275
+1000 0.001823
diff --git a/MCNP/RBEfactors/MCDS_protonIntraTrack_intraT_anoxic.txt b/MCNP/RBEfactors/MCDS_protonIntraTrack_intraT_anoxic.txt
new file mode 100644
index 000000000..2528ba1f3
--- /dev/null
+++ b/MCNP/RBEfactors/MCDS_protonIntraTrack_intraT_anoxic.txt
@@ -0,0 +1,28 @@
+0.1 6.5078
+0.2 21.15
+0.3 16.57
+0.5 5.719
+0.9 1.518
+1 1.221
+1.1 1.014
+1.3 0.7361
+1.5 0.5716
+2 0.3541
+2.5 0.2554
+3 0.1967
+3.5 0.1592
+4 0.1348
+5 0.1014
+6 0.08161
+7.5 0.06333
+10 0.04635
+15 0.03069
+25 0.01884
+50 0.01039
+75 0.0074
+100 0.005952
+150 0.004402
+200 0.003665
+250 0.003198
+500 0.002261
+1000 0.001813
diff --git a/MCNP/RBEfactors/MCDS_protonRBE_DSB_aerobic.txt b/MCNP/RBEfactors/MCDS_protonRBE_DSB_aerobic.txt
new file mode 100644
index 000000000..1de12c8b5
--- /dev/null
+++ b/MCNP/RBEfactors/MCDS_protonRBE_DSB_aerobic.txt
@@ -0,0 +1,28 @@
+0.1 3.2839
+0.2 2.889
+0.3 2.687
+0.5 2.37
+0.9 1.986
+1 1.916
+1.1 1.86
+1.3 1.76
+1.5 1.685
+2 1.542
+2.5 1.451
+3 1.386
+3.5 1.336
+4 1.297
+5 1.244
+6 1.204
+7.5 1.164
+10 1.123
+15 1.083
+25 1.051
+50 1.026
+75 1.016
+100 1.012
+150 1.004
+200 1.004
+250 1.003
+500 1.001
+1000 0.9995
diff --git a/MCNP/RBEfactors/MCDS_protonRBE_DSB_anoxic.txt b/MCNP/RBEfactors/MCDS_protonRBE_DSB_anoxic.txt
new file mode 100644
index 000000000..553dad2e1
--- /dev/null
+++ b/MCNP/RBEfactors/MCDS_protonRBE_DSB_anoxic.txt
@@ -0,0 +1,28 @@
+0.1 9.3631
+0.2 6.98
+0.3 5.626
+0.5 3.864
+0.9 2.49
+1 2.326
+1.1 2.198
+1.3 1.997
+1.5 1.86
+2 1.638
+2.5 1.518
+3 1.432
+3.5 1.37
+4 1.33
+5 1.261
+6 1.218
+7.5 1.175
+10 1.13
+15 1.086
+25 1.047
+50 1.026
+75 1.013
+100 1.011
+150 1.002
+200 1.002
+250 1.002
+500 0.9993
+1000 0.9977
diff --git a/MCNP/RBEfactors/MCDS_tritonIntraTrack_intraT_aerobic.txt b/MCNP/RBEfactors/MCDS_tritonIntraTrack_intraT_aerobic.txt
new file mode 100644
index 000000000..750fdad63
--- /dev/null
+++ b/MCNP/RBEfactors/MCDS_tritonIntraTrack_intraT_aerobic.txt
@@ -0,0 +1,28 @@
+0.1 0.8801
+0.2 4.4006
+0.3 5.4986
+0.5 5.2755
+0.9 3.4346
+1 3.1114
+1.1 2.8132
+1.3 2.3525
+1.5 1.9923
+2 1.3893
+2.5 1.0344
+3 0.8077
+3.5 0.6517
+4 0.5425
+5 0.3984
+6 0.3115
+7.5 0.2315
+10 0.16
+15 0.0982
+25 0.0558
+50 0.0277
+75 0.0188
+100 0.0146
+150 0.0103
+200 0.0082
+250 0.0068
+500 0.0041
+1000 0.0027
diff --git a/MCNP/RBEfactors/MCDS_tritonIntraTrack_intraT_anoxic.txt b/MCNP/RBEfactors/MCDS_tritonIntraTrack_intraT_anoxic.txt
new file mode 100644
index 000000000..c30411263
--- /dev/null
+++ b/MCNP/RBEfactors/MCDS_tritonIntraTrack_intraT_anoxic.txt
@@ -0,0 +1,28 @@
+0.1 7.2596
+0.2 34.3613
+0.3 40.4786
+0.5 33.4382
+0.9 15.0371
+1 12.3695
+1.1 10.1915
+1.3 7.2212
+1.5 5.2695
+2 2.7597
+2.5 1.7103
+3 1.1872
+3.5 0.8737
+4 0.6844
+5 0.4724
+6 0.3534
+7.5 0.2519
+10 0.167
+15 0.1011
+25 0.0566
+50 0.0278
+75 0.0188
+100 0.0146
+150 0.0102
+200 0.0081
+250 0.0068
+500 0.0041
+1000 0.0027
diff --git a/MCNP/RBEfactors/MCDS_tritonRBE_DSB_aerobic.txt b/MCNP/RBEfactors/MCDS_tritonRBE_DSB_aerobic.txt
new file mode 100644
index 000000000..f50b954d6
--- /dev/null
+++ b/MCNP/RBEfactors/MCDS_tritonRBE_DSB_aerobic.txt
@@ -0,0 +1,28 @@
+0.1 3.3268
+0.2 3.185
+0.3 3.107
+0.5 2.95
+0.9 2.673
+1 2.617
+1.1 2.556
+1.3 2.456
+1.5 2.363
+2 2.169
+2.5 2.022
+3 1.907
+3.5 1.812
+4 1.737
+5 1.619
+6 1.535
+7.5 1.443
+10 1.343
+15 1.237
+25 1.146
+50 1.072
+75 1.041
+100 1.03
+150 1.019
+200 1.012
+250 1.007
+500 1.001
+1000 0.9965
diff --git a/MCNP/RBEfactors/MCDS_tritonRBE_DSB_anoxic.txt b/MCNP/RBEfactors/MCDS_tritonRBE_DSB_anoxic.txt
new file mode 100644
index 000000000..65de6cf19
--- /dev/null
+++ b/MCNP/RBEfactors/MCDS_tritonRBE_DSB_anoxic.txt
@@ -0,0 +1,28 @@
+0.1 9.6037
+0.2 8.9
+0.3 8.43
+0.5 7.427
+0.9 5.593
+1 5.218
+1.1 4.865
+1.3 4.303
+1.5 3.843
+2 3.057
+2.5 2.6
+3 2.312
+3.5 2.098
+4 1.951
+5 1.763
+6 1.635
+7.5 1.505
+10 1.372
+15 1.255
+25 1.154
+50 1.073
+75 1.041
+100 1.03
+150 1.014
+200 1.011
+250 1.004
+500 0.9995
+1000 0.9979
diff --git a/MCNP/RBEfactors/README.txt b/MCNP/RBEfactors/README.txt
new file mode 100644
index 000000000..ab2dc00c3
--- /dev/null
+++ b/MCNP/RBEfactors/README.txt
@@ -0,0 +1,22 @@
+---------------------------------------------------
+Neutron RBE Data
+---------------------------------------------------
+A) Constant factor for neutron RBE in file 'neutronRBE_constFactor.txt' is
+ loaded using the plan variable:
+ pln.propOpt.bioOptimization = 'const_RBExD_n'.
+ Ref.: The value is set to 3 taken from Specht et al. (2015) p. 2.
+---------------------------------------------------
+B) Tabulated values are taken from ICRP 103 and should actually not be
+ used for therapeutic dose calculations but for radiation protection
+ purposes. With this weighting factors the equivalent dose is calcuated.
+ In tabulated form, RBE values have to be given for the same energy
+ intervals like the used KERMA values. Otherwise result will be wrong.
+ Variable neutron RBE in file 'neutronRBE_ICRP103.txt' is
+ loaded using the plan variable:
+ pln.propOpt.bioOptimization = 'var_RBExD_n_ICRP103'.
+ Ref.: ICRP Publication 103
+---------------------------------------------------
+C) Tabulated values for RBE are taken from plot in Steward et al. 2015.
+ Values are interpolated in order to match KERMA dose intervals given
+ by predefined KERMA values. Note that reasonable cut-off energies
+ were defined s.th. tabulated values below cut-off were averaged.
\ No newline at end of file
diff --git a/MCNP/RBEfactors/additionalMat/MCDS_data/alpha.txt b/MCNP/RBEfactors/additionalMat/MCDS_data/alpha.txt
new file mode 100644
index 000000000..c1c774dd0
--- /dev/null
+++ b/MCNP/RBEfactors/additionalMat/MCDS_data/alpha.txt
@@ -0,0 +1,292 @@
+4He DOSE-RESPONSE FUNCTIONS FOR USE IN MCNPX (August 23, 2013)
+Data generated by RDS using MCDS Version 3.10A 05-DEC-2011
+
+C
+C *** ============================================================
+C *** 4He-Alpha (4He2+) DOSE, RBE AND RELATED TALLIES
+C *** ------------------------------------------------------------
+FC5016 4He-Alpha (4He2+) Absorbed Dose
+F5016:A 3
+FM5016 0.1602
+C
+FC5026 RBE-weighted 4He-Alpha (4He2+) dose; DSB induction (aerobic)
+F5026:A 3
+FM5026 0.1602
+DE5026 1.000E-03 1.500E-03 2.000E-03 2.500E-03 3.000E-03 4.000E-03
+ 5.000E-03 6.000E-03 7.000E-03 8.000E-03 9.000E-03 1.000E-02
+ 1.250E-02 1.500E-02 1.750E-02 2.000E-02 2.250E-02 2.500E-02
+ 2.750E-02 3.000E-02 3.500E-02 4.000E-02 4.500E-02 5.000E-02
+ 5.500E-02 6.000E-02 6.500E-02 7.000E-02 7.500E-02 8.000E-02
+ 8.500E-02 9.000E-02 9.500E-02 1.000E-01 1.250E-01 1.500E-01
+ 1.750E-01 2.000E-01 2.250E-01 2.500E-01 2.750E-01 3.000E-01
+ 3.500E-01 4.000E-01 4.500E-01 5.000E-01 5.500E-01 6.000E-01
+ 6.500E-01 7.000E-01 7.500E-01 8.000E-01 8.500E-01 9.000E-01
+ 9.500E-01 1.000E+00 1.250E+00 1.500E+00 1.750E+00 2.000E+00
+ 2.250E+00 2.500E+00 2.750E+00 3.000E+00 3.500E+00 4.000E+00
+ 4.500E+00 5.000E+00 5.500E+00 6.000E+00 6.500E+00 7.000E+00
+ 7.500E+00 8.000E+00 8.500E+00 9.000E+00 9.500E+00 1.000E+01
+ 1.250E+01 1.500E+01 1.750E+01 2.000E+01 2.500E+01 2.750E+01
+ 3.000E+01 3.500E+01 4.000E+01 4.500E+01 5.000E+01 5.500E+01
+ 6.000E+01 6.500E+01 7.000E+01 7.500E+01 8.000E+01 8.500E+01
+ 9.000E+01 9.500E+01 1.000E+02 1.250E+02 1.500E+02 1.750E+02
+ 2.000E+02 2.250E+02 2.500E+02 2.750E+02 3.000E+02 3.500E+02
+ 4.000E+02 4.500E+02 5.000E+02 5.500E+02 6.000E+02 6.500E+02
+ 7.000E+02 7.500E+02 8.000E+02 8.500E+02 9.000E+02 9.500E+02
+ 1.000E+03 2.000E+03 5.000E+03 7.500E+03 1.000E+04
+C
+DF5026 3.382E+00 3.382E+00 3.382E+00 3.381E+00 3.380E+00 3.381E+00
+ 3.378E+00 3.381E+00 3.378E+00 3.378E+00 3.377E+00 3.376E+00
+ 3.377E+00 3.377E+00 3.375E+00 3.375E+00 3.374E+00 3.374E+00
+ 3.372E+00 3.373E+00 3.372E+00 3.370E+00 3.368E+00 3.369E+00
+ 3.367E+00 3.366E+00 3.365E+00 3.364E+00 3.365E+00 3.363E+00
+ 3.363E+00 3.363E+00 3.359E+00 3.358E+00 3.356E+00 3.348E+00
+ 3.349E+00 3.340E+00 3.337E+00 3.333E+00 3.327E+00 3.324E+00
+ 3.315E+00 3.306E+00 3.297E+00 3.289E+00 3.281E+00 3.270E+00
+ 3.260E+00 3.253E+00 3.242E+00 3.231E+00 3.221E+00 3.211E+00
+ 3.202E+00 3.193E+00 3.144E+00 3.095E+00 3.047E+00 2.996E+00
+ 2.947E+00 2.901E+00 2.852E+00 2.809E+00 2.723E+00 2.646E+00
+ 2.571E+00 2.502E+00 2.438E+00 2.377E+00 2.323E+00 2.272E+00
+ 2.224E+00 2.178E+00 2.140E+00 2.101E+00 2.065E+00 2.031E+00
+ 1.886E+00 1.778E+00 1.692E+00 1.625E+00 1.522E+00 1.483E+00
+ 1.448E+00 1.392E+00 1.347E+00 1.314E+00 1.286E+00 1.262E+00
+ 1.241E+00 1.223E+00 1.209E+00 1.195E+00 1.185E+00 1.175E+00
+ 1.166E+00 1.156E+00 1.149E+00 1.121E+00 1.100E+00 1.087E+00
+ 1.076E+00 1.067E+00 1.062E+00 1.062E+00 1.050E+00 1.044E+00
+ 1.038E+00 1.035E+00 1.030E+00 1.027E+00 1.027E+00 1.024E+00
+ 1.022E+00 1.020E+00 1.020E+00 1.018E+00 1.018E+00 1.016E+00
+ 1.016E+00 1.008E+00 1.004E+00 1.004E+00 1.001E+00
+C
+FC5036 RBE-weighted 4He-Alpha (4He2+) dose; DSB induction (anoxic)
+F5036:A 3
+FM5036 0.1602
+DE5036 1.000E-03 1.500E-03 2.000E-03 2.500E-03 3.000E-03 4.000E-03
+ 5.000E-03 6.000E-03 7.000E-03 8.000E-03 9.000E-03 1.000E-02
+ 1.250E-02 1.500E-02 1.750E-02 2.000E-02 2.250E-02 2.500E-02
+ 2.750E-02 3.000E-02 3.500E-02 4.000E-02 4.500E-02 5.000E-02
+ 5.500E-02 6.000E-02 6.500E-02 7.000E-02 7.500E-02 8.000E-02
+ 8.500E-02 9.000E-02 9.500E-02 1.000E-01 1.250E-01 1.500E-01
+ 1.750E-01 2.000E-01 2.250E-01 2.500E-01 2.750E-01 3.000E-01
+ 3.500E-01 4.000E-01 4.500E-01 5.000E-01 5.500E-01 6.000E-01
+ 6.500E-01 7.000E-01 7.500E-01 8.000E-01 8.500E-01 9.000E-01
+ 9.500E-01 1.000E+00 1.250E+00 1.500E+00 1.750E+00 2.000E+00
+ 2.250E+00 2.500E+00 2.750E+00 3.000E+00 3.500E+00 4.000E+00
+ 4.500E+00 5.000E+00 5.500E+00 6.000E+00 6.500E+00 7.000E+00
+ 7.500E+00 8.000E+00 8.500E+00 9.000E+00 9.500E+00 1.000E+01
+ 1.250E+01 1.500E+01 1.750E+01 2.000E+01 2.500E+01 2.750E+01
+ 3.000E+01 3.500E+01 4.000E+01 4.500E+01 5.000E+01 5.500E+01
+ 6.000E+01 6.500E+01 7.000E+01 7.500E+01 8.000E+01 8.500E+01
+ 9.000E+01 9.500E+01 1.000E+02 1.250E+02 1.500E+02 1.750E+02
+ 2.000E+02 2.250E+02 2.500E+02 2.750E+02 3.000E+02 3.500E+02
+ 4.000E+02 4.500E+02 5.000E+02 5.500E+02 6.000E+02 6.500E+02
+ 7.000E+02 7.500E+02 8.000E+02 8.500E+02 9.000E+02 9.500E+02
+ 1.000E+03 2.000E+03 5.000E+03 7.500E+03 1.000E+04
+DF5036 9.833E+00 9.832E+00 9.832E+00 9.830E+00 9.827E+00 9.829E+00
+ 9.821E+00 9.829E+00 9.823E+00 9.822E+00 9.817E+00 9.816E+00
+ 9.820E+00 9.819E+00 9.804E+00 9.803E+00 9.802E+00 9.800E+00
+ 9.798E+00 9.794E+00 9.794E+00 9.790E+00 9.784E+00 9.786E+00
+ 9.779E+00 9.778E+00 9.766E+00 9.760E+00 9.764E+00 9.759E+00
+ 9.760E+00 9.760E+00 9.749E+00 9.745E+00 9.727E+00 9.706E+00
+ 9.698E+00 9.672E+00 9.653E+00 9.631E+00 9.616E+00 9.597E+00
+ 9.561E+00 9.514E+00 9.478E+00 9.432E+00 9.389E+00 9.346E+00
+ 9.297E+00 9.255E+00 9.202E+00 9.149E+00 9.101E+00 9.039E+00
+ 8.992E+00 8.944E+00 8.665E+00 8.363E+00 8.051E+00 7.728E+00
+ 7.407E+00 7.087E+00 6.779E+00 6.484E+00 5.899E+00 5.398E+00
+ 4.946E+00 4.546E+00 4.214E+00 3.924E+00 3.669E+00 3.453E+00
+ 3.262E+00 3.096E+00 2.955E+00 2.837E+00 2.718E+00 2.622E+00
+ 2.260E+00 2.037E+00 1.879E+00 1.768E+00 1.613E+00 1.559E+00
+ 1.512E+00 1.439E+00 1.386E+00 1.343E+00 1.310E+00 1.284E+00
+ 1.258E+00 1.238E+00 1.224E+00 1.209E+00 1.197E+00 1.185E+00
+ 1.175E+00 1.166E+00 1.157E+00 1.128E+00 1.101E+00 1.089E+00
+ 1.079E+00 1.068E+00 1.062E+00 1.062E+00 1.050E+00 1.045E+00
+ 1.037E+00 1.036E+00 1.028E+00 1.026E+00 1.024E+00 1.021E+00
+ 1.021E+00 1.019E+00 1.020E+00 1.017E+00 1.016E+00 1.015E+00
+ 1.017E+00 1.004E+00 1.004E+00 1.003E+00 1.000E+00
+C
+FC5046 4He-Alpha (4He2+) intra-track RMF interaction term (aerobic cells)
+F5046:A 3
+FM5046 0.1602
+DE5046 1.000E-03 1.500E-03 2.000E-03 2.500E-03 3.000E-03 4.000E-03
+ 5.000E-03 6.000E-03 7.000E-03 8.000E-03 9.000E-03 1.000E-02
+ 1.250E-02 1.500E-02 1.750E-02 2.000E-02 2.250E-02 2.500E-02
+ 2.750E-02 3.000E-02 3.500E-02 4.000E-02 4.500E-02 5.000E-02
+ 5.500E-02 6.000E-02 6.500E-02 7.000E-02 7.500E-02 8.000E-02
+ 8.500E-02 9.000E-02 9.500E-02 1.000E-01 1.250E-01 1.500E-01
+ 1.750E-01 2.000E-01 2.250E-01 2.500E-01 2.750E-01 3.000E-01
+ 3.500E-01 4.000E-01 4.500E-01 5.000E-01 5.500E-01 6.000E-01
+ 6.500E-01 7.000E-01 7.500E-01 8.000E-01 8.500E-01 9.000E-01
+ 9.500E-01 1.000E+00 1.250E+00 1.500E+00 1.750E+00 2.000E+00
+ 2.250E+00 2.500E+00 2.750E+00 3.000E+00 3.500E+00 4.000E+00
+ 4.500E+00 5.000E+00 5.500E+00 6.000E+00 6.500E+00 7.000E+00
+ 7.500E+00 8.000E+00 8.500E+00 9.000E+00 9.500E+00 1.000E+01
+ 1.250E+01 1.500E+01 1.750E+01 2.000E+01 2.500E+01 2.750E+01
+ 3.000E+01 3.500E+01 4.000E+01 4.500E+01 5.000E+01 5.500E+01
+ 6.000E+01 6.500E+01 7.000E+01 7.500E+01 8.000E+01 8.500E+01
+ 9.000E+01 9.500E+01 1.000E+02 1.250E+02 1.500E+02 1.750E+02
+ 2.000E+02 2.250E+02 2.500E+02 2.750E+02 3.000E+02 3.500E+02
+ 4.000E+02 4.500E+02 5.000E+02 5.500E+02 6.000E+02 6.500E+02
+ 7.000E+02 7.500E+02 8.000E+02 8.500E+02 9.000E+02 9.500E+02
+ 1.000E+03 2.000E+03 5.000E+03 7.500E+03 1.000E+04
+DF5046 1.937E+00 2.901E+00 3.874E+00 4.838E+00 5.800E+00 7.736E+00
+ 9.670E+00 1.159E+01 1.353E+01 1.546E+01 1.737E+01 1.930E+01
+ 2.413E+01 2.892E+01 3.369E+01 3.850E+01 4.328E+01 4.801E+01
+ 5.275E+01 5.754E+01 6.707E+01 7.646E+01 8.596E+01 9.545E+01
+ 1.047E+02 1.141E+02 1.236E+02 1.326E+02 1.420E+02 1.513E+02
+ 1.605E+02 1.697E+02 1.787E+02 1.880E+02 2.330E+02 2.777E+02
+ 3.216E+02 3.647E+02 4.072E+02 4.490E+02 4.897E+02 5.298E+02
+ 6.088E+02 6.844E+02 7.568E+02 8.246E+02 8.886E+02 9.479E+02
+ 1.004E+03 1.055E+03 1.100E+03 1.140E+03 1.173E+03 1.198E+03
+ 1.221E+03 1.236E+03 1.247E+03 1.164E+03 1.054E+03 9.500E+02
+ 8.586E+02 7.805E+02 7.119E+02 6.550E+02 5.569E+02 4.831E+02
+ 4.228E+02 3.743E+02 3.339E+02 2.998E+02 2.705E+02 2.461E+02
+ 2.243E+02 2.057E+02 1.896E+02 1.751E+02 1.627E+02 1.517E+02
+ 1.106E+02 8.476E+01 6.783E+01 5.595E+01 4.068E+01 3.558E+01
+ 3.152E+01 2.553E+01 2.126E+01 1.822E+01 1.589E+01 1.408E+01
+ 1.261E+01 1.141E+01 1.046E+01 9.623E+00 8.930E+00 8.291E+00
+ 7.806E+00 7.334E+00 6.928E+00 5.430E+00 4.474E+00 3.844E+00
+ 3.368E+00 3.003E+00 2.722E+00 2.528E+00 2.310E+00 2.017E+00
+ 1.804E+00 1.635E+00 1.506E+00 1.397E+00 1.299E+00 1.232E+00
+ 1.165E+00 1.109E+00 1.063E+00 1.017E+00 9.772E-01 9.425E-01
+ 9.124E-01 6.239E-01 4.630E-01 4.345E-01 4.214E-01
+C
+FC5056 4He-Alpha (4He2+) intra-track RMF interaction term (anoxic cells)
+F5056:A 3
+FM5056 0.1602
+DE5056 1.000E-03 1.500E-03 2.000E-03 2.500E-03 3.000E-03 4.000E-03
+ 5.000E-03 6.000E-03 7.000E-03 8.000E-03 9.000E-03 1.000E-02
+ 1.250E-02 1.500E-02 1.750E-02 2.000E-02 2.250E-02 2.500E-02
+ 2.750E-02 3.000E-02 3.500E-02 4.000E-02 4.500E-02 5.000E-02
+ 5.500E-02 6.000E-02 6.500E-02 7.000E-02 7.500E-02 8.000E-02
+ 8.500E-02 9.000E-02 9.500E-02 1.000E-01 1.250E-01 1.500E-01
+ 1.750E-01 2.000E-01 2.250E-01 2.500E-01 2.750E-01 3.000E-01
+ 3.500E-01 4.000E-01 4.500E-01 5.000E-01 5.500E-01 6.000E-01
+ 6.500E-01 7.000E-01 7.500E-01 8.000E-01 8.500E-01 9.000E-01
+ 9.500E-01 1.000E+00 1.250E+00 1.500E+00 1.750E+00 2.000E+00
+ 2.250E+00 2.500E+00 2.750E+00 3.000E+00 3.500E+00 4.000E+00
+ 4.500E+00 5.000E+00 5.500E+00 6.000E+00 6.500E+00 7.000E+00
+ 7.500E+00 8.000E+00 8.500E+00 9.000E+00 9.500E+00 1.000E+01
+ 1.250E+01 1.500E+01 1.750E+01 2.000E+01 2.500E+01 2.750E+01
+ 3.000E+01 3.500E+01 4.000E+01 4.500E+01 5.000E+01 5.500E+01
+ 6.000E+01 6.500E+01 7.000E+01 7.500E+01 8.000E+01 8.500E+01
+ 9.000E+01 9.500E+01 1.000E+02 1.250E+02 1.500E+02 1.750E+02
+ 2.000E+02 2.250E+02 2.500E+02 2.750E+02 3.000E+02 3.500E+02
+ 4.000E+02 4.500E+02 5.000E+02 5.500E+02 6.000E+02 6.500E+02
+ 7.000E+02 7.500E+02 8.000E+02 8.500E+02 9.000E+02 9.500E+02
+ 1.000E+03 2.000E+03 5.000E+03 7.500E+03 1.000E+04
+DF5056 1.933E+00 2.896E+00 3.867E+00 4.829E+00 5.789E+00 7.723E+00
+ 9.653E+00 1.157E+01 1.351E+01 1.544E+01 1.734E+01 1.927E+01
+ 2.409E+01 2.887E+01 3.363E+01 3.843E+01 4.312E+01 4.783E+01
+ 5.255E+01 5.734E+01 6.682E+01 7.618E+01 8.565E+01 9.510E+01
+ 1.043E+02 1.137E+02 1.231E+02 1.321E+02 1.415E+02 1.508E+02
+ 1.596E+02 1.687E+02 1.777E+02 1.869E+02 2.318E+02 2.756E+02
+ 3.191E+02 3.620E+02 4.033E+02 4.448E+02 4.840E+02 5.237E+02
+ 6.006E+02 6.736E+02 7.432E+02 8.082E+02 8.690E+02 9.252E+02
+ 9.779E+02 1.023E+03 1.064E+03 1.100E+03 1.126E+03 1.148E+03
+ 1.165E+03 1.177E+03 1.161E+03 1.061E+03 9.357E+02 8.172E+02
+ 7.156E+02 6.274E+02 5.515E+02 4.871E+02 3.820E+02 3.028E+02
+ 2.410E+02 1.946E+02 1.585E+02 1.304E+02 1.079E+02 9.078E+01
+ 7.695E+01 6.561E+01 5.681E+01 4.947E+01 4.340E+01 3.836E+01
+ 2.289E+01 1.527E+01 1.120E+01 8.652E+00 5.795E+00 4.906E+00
+ 4.262E+00 3.357E+00 2.734E+00 2.318E+00 1.985E+00 1.750E+00
+ 1.555E+00 1.401E+00 1.278E+00 1.175E+00 1.087E+00 1.005E+00
+ 9.437E-01 8.902E-01 8.387E-01 6.517E-01 5.344E-01 4.591E-01
+ 3.988E-01 3.549E-01 3.213E-01 2.984E-01 2.731E-01 2.392E-01
+ 2.124E-01 1.923E-01 1.772E-01 1.642E-01 1.534E-01 1.459E-01
+ 1.372E-01 1.307E-01 1.256E-01 1.200E-01 1.154E-01 1.113E-01
+ 1.077E-01 7.322E-02 5.449E-02 5.113E-02 4.967E-02
+C
+FC5066 Dose-weighted frequency-mean specific energy (ndia=5 um)
+F5066:A 3
+FM5066 0.1602
+DE5066 1.000E-03 1.500E-03 2.000E-03 2.500E-03 3.000E-03 4.000E-03
+ 5.000E-03 6.000E-03 7.000E-03 8.000E-03 9.000E-03 1.000E-02
+ 1.250E-02 1.500E-02 1.750E-02 2.000E-02 2.250E-02 2.500E-02
+ 2.750E-02 3.000E-02 3.500E-02 4.000E-02 4.500E-02 5.000E-02
+ 5.500E-02 6.000E-02 6.500E-02 7.000E-02 7.500E-02 8.000E-02
+ 8.500E-02 9.000E-02 9.500E-02 1.000E-01 1.250E-01 1.500E-01
+ 1.750E-01 2.000E-01 2.250E-01 2.500E-01 2.750E-01 3.000E-01
+ 3.500E-01 4.000E-01 4.500E-01 5.000E-01 5.500E-01 6.000E-01
+ 6.500E-01 7.000E-01 7.500E-01 8.000E-01 8.500E-01 9.000E-01
+ 9.500E-01 1.000E+00 1.250E+00 1.500E+00 1.750E+00 2.000E+00
+ 2.250E+00 2.500E+00 2.750E+00 3.000E+00 3.500E+00 4.000E+00
+ 4.500E+00 5.000E+00 5.500E+00 6.000E+00 6.500E+00 7.000E+00
+ 7.500E+00 8.000E+00 8.500E+00 9.000E+00 9.500E+00 1.000E+01
+ 1.250E+01 1.500E+01 1.750E+01 2.000E+01 2.500E+01 2.750E+01
+ 3.000E+01 3.500E+01 4.000E+01 4.500E+01 5.000E+01 5.500E+01
+ 6.000E+01 6.500E+01 7.000E+01 7.500E+01 8.000E+01 8.500E+01
+ 9.000E+01 9.500E+01 1.000E+02 1.250E+02 1.500E+02 1.750E+02
+ 2.000E+02 2.250E+02 2.500E+02 2.750E+02 3.000E+02 3.500E+02
+ 4.000E+02 4.500E+02 5.000E+02 5.500E+02 6.000E+02 6.500E+02
+ 7.000E+02 7.500E+02 8.000E+02 8.500E+02 9.000E+02 9.500E+02
+ 1.000E+03 2.000E+03 5.000E+03 7.500E+03 1.000E+04
+DF5066 2.448E-03 3.671E-03 4.895E-03 6.119E-03 7.342E-03 9.789E-03
+ 1.224E-02 1.468E-02 1.713E-02 1.957E-02 2.201E-02 2.445E-02
+ 3.056E-02 3.665E-02 4.274E-02 4.882E-02 5.490E-02 6.097E-02
+ 6.704E-02 7.310E-02 8.520E-02 9.728E-02 1.093E-01 1.214E-01
+ 1.334E-01 1.453E-01 1.573E-01 1.692E-01 1.811E-01 1.930E-01
+ 2.048E-01 2.166E-01 2.284E-01 2.402E-01 2.986E-01 3.564E-01
+ 4.135E-01 4.699E-01 5.256E-01 5.807E-01 6.350E-01 6.886E-01
+ 7.935E-01 8.952E-01 9.935E-01 1.088E+00 1.177E+00 1.262E+00
+ 1.341E+00 1.415E+00 1.481E+00 1.540E+00 1.591E+00 1.635E+00
+ 1.673E+00 1.703E+00 1.754E+00 1.679E+00 1.556E+00 1.435E+00
+ 1.329E+00 1.238E+00 1.159E+00 1.091E+00 9.777E-01 8.878E-01
+ 8.145E-01 7.534E-01 7.017E-01 6.573E-01 6.186E-01 5.847E-01
+ 5.546E-01 5.278E-01 5.037E-01 4.819E-01 4.621E-01 4.440E-01
+ 3.728E-01 3.228E-01 2.856E-01 2.568E-01 2.148E-01 1.990E-01
+ 1.856E-01 1.639E-01 1.472E-01 1.338E-01 1.229E-01 1.137E-01
+ 1.060E-01 9.932E-02 9.353E-02 8.844E-02 8.394E-02 7.991E-02
+ 7.630E-02 7.303E-02 7.006E-02 5.851E-02 5.054E-02 4.469E-02
+ 4.020E-02 3.664E-02 3.375E-02 3.134E-02 2.932E-02 2.608E-02
+ 2.360E-02 2.165E-02 2.006E-02 1.875E-02 1.765E-02 1.671E-02
+ 1.590E-02 1.519E-02 1.457E-02 1.402E-02 1.352E-02 1.308E-02
+ 1.268E-02 8.837E-03 6.632E-03 6.230E-03 6.067E-03
+C
+FC5076 Dose-weighted 4He-Alpha (4He2+) stopping power (keV/um)
+F5076:A 3
+FM5076 0.1602
+DE5076 1.000E-03 1.500E-03 2.000E-03 2.500E-03 3.000E-03 4.000E-03
+ 5.000E-03 6.000E-03 7.000E-03 8.000E-03 9.000E-03 1.000E-02
+ 1.250E-02 1.500E-02 1.750E-02 2.000E-02 2.250E-02 2.500E-02
+ 2.750E-02 3.000E-02 3.500E-02 4.000E-02 4.500E-02 5.000E-02
+ 5.500E-02 6.000E-02 6.500E-02 7.000E-02 7.500E-02 8.000E-02
+ 8.500E-02 9.000E-02 9.500E-02 1.000E-01 1.250E-01 1.500E-01
+ 1.750E-01 2.000E-01 2.250E-01 2.500E-01 2.750E-01 3.000E-01
+ 3.500E-01 4.000E-01 4.500E-01 5.000E-01 5.500E-01 6.000E-01
+ 6.500E-01 7.000E-01 7.500E-01 8.000E-01 8.500E-01 9.000E-01
+ 9.500E-01 1.000E+00 1.250E+00 1.500E+00 1.750E+00 2.000E+00
+ 2.250E+00 2.500E+00 2.750E+00 3.000E+00 3.500E+00 4.000E+00
+ 4.500E+00 5.000E+00 5.500E+00 6.000E+00 6.500E+00 7.000E+00
+ 7.500E+00 8.000E+00 8.500E+00 9.000E+00 9.500E+00 1.000E+01
+ 1.250E+01 1.500E+01 1.750E+01 2.000E+01 2.500E+01 2.750E+01
+ 3.000E+01 3.500E+01 4.000E+01 4.500E+01 5.000E+01 5.500E+01
+ 6.000E+01 6.500E+01 7.000E+01 7.500E+01 8.000E+01 8.500E+01
+ 9.000E+01 9.500E+01 1.000E+02 1.250E+02 1.500E+02 1.750E+02
+ 2.000E+02 2.250E+02 2.500E+02 2.750E+02 3.000E+02 3.500E+02
+ 4.000E+02 4.500E+02 5.000E+02 5.500E+02 6.000E+02 6.500E+02
+ 7.000E+02 7.500E+02 8.000E+02 8.500E+02 9.000E+02 9.500E+02
+ 1.000E+03 2.000E+03 5.000E+03 7.500E+03 1.000E+04
+DF5076 3.298E+01 3.310E+01 3.329E+01 3.359E+01 3.397E+01 3.494E+01
+ 3.609E+01 3.734E+01 3.865E+01 4.000E+01 4.135E+01 4.270E+01
+ 4.602E+01 4.923E+01 5.231E+01 5.526E+01 5.809E+01 6.079E+01
+ 6.339E+01 6.588E+01 7.060E+01 7.501E+01 7.914E+01 8.304E+01
+ 8.674E+01 9.027E+01 9.364E+01 9.687E+01 9.998E+01 1.030E+02
+ 1.059E+02 1.087E+02 1.114E+02 1.141E+02 1.265E+02 1.377E+02
+ 1.480E+02 1.576E+02 1.665E+02 1.747E+02 1.823E+02 1.892E+02
+ 2.011E+02 2.104E+02 2.174E+02 2.223E+02 2.255E+02 2.272E+02
+ 2.277E+02 2.273E+02 2.262E+02 2.245E+02 2.223E+02 2.199E+02
+ 2.172E+02 2.143E+02 1.993E+02 1.848E+02 1.718E+02 1.604E+02
+ 1.503E+02 1.415E+02 1.336E+02 1.266E+02 1.148E+02 1.050E+02
+ 9.694E+01 9.008E+01 8.419E+01 7.908E+01 7.460E+01 7.064E+01
+ 6.711E+01 6.395E+01 6.110E+01 5.851E+01 5.615E+01 5.399E+01
+ 4.545E+01 3.941E+01 3.491E+01 3.140E+01 2.629E+01 2.436E+01
+ 2.272E+01 2.007E+01 1.802E+01 1.639E+01 1.505E+01 1.393E+01
+ 1.299E+01 1.217E+01 1.146E+01 1.084E+01 1.029E+01 9.793E+00
+ 9.350E+00 8.950E+00 8.586E+00 7.171E+00 6.194E+00 5.477E+00
+ 4.927E+00 4.491E+00 4.136E+00 3.842E+00 3.593E+00 3.196E+00
+ 2.893E+00 2.653E+00 2.459E+00 2.299E+00 2.164E+00 2.048E+00
+ 1.949E+00 1.862E+00 1.786E+00 1.718E+00 1.657E+00 1.603E+00
+ 1.554E+00 1.083E+00 8.129E-01 7.635E-01 7.436E-01
+C *** ------------------------------------------------------------
+
+
+
+
diff --git a/MCNP/RBEfactors/additionalMat/MCDS_data/deuteron.txt b/MCNP/RBEfactors/additionalMat/MCDS_data/deuteron.txt
new file mode 100644
index 000000000..781f4e750
--- /dev/null
+++ b/MCNP/RBEfactors/additionalMat/MCDS_data/deuteron.txt
@@ -0,0 +1,132 @@
+2H DOSE-RESPONSE FUNCTIONS FOR USE IN MCNPX August 23, 2013)
+Data generated by RDS using MCDS Version 3.10A 05-DEC-2011
+
+C *** ============================================================
+C *** Deuteron (2H+) DOSE, RBE AND RELATED TALLIES
+C *** ------------------------------------------------------------
+FC2016 Deuteron (2H+) Absorbed Dose
+F2016:D 3
+FM2016 0.1602
+C
+FC2026 RBE-weighted Deuteron (2H+) dose; DSB induction (aerobic)
+F2026:D 3
+FM2026 0.1602
+DE2026 1.000E-03 2.000E-03 3.000E-03 4.000E-03 5.000E-03 6.470E-03
+ 7.500E-03 1.000E-02 2.000E-02 3.000E-02 4.000E-02 5.000E-02
+ 6.000E-02 7.000E-02 8.000E-02 9.000E-02 1.000E-01 2.000E-01
+ 3.000E-01 5.000E-01 9.000E-01 1.000E+00 1.100E+00 1.300E+00
+ 1.500E+00 2.000E+00 2.500E+00 3.000E+00 3.500E+00 4.000E+00
+ 5.000E+00 6.000E+00 7.500E+00 1.000E+01 1.500E+01 2.500E+01
+ 5.000E+01 7.500E+01 1.000E+02 1.500E+02 2.000E+02 2.500E+02
+ 5.000E+02 1.000E+03
+DF2026 3.361E+00 3.360E+00 3.355E+00 3.352E+00 3.354E+00 3.346E+00
+ 3.348E+00 3.344E+00 3.325E+00 3.316E+00 3.304E+00 3.286E+00
+ 3.277E+00 3.262E+00 3.252E+00 3.241E+00 3.225E+00 3.106E+00
+ 2.988E+00 2.771E+00 2.428E+00 2.359E+00 2.296E+00 2.189E+00
+ 2.094E+00 1.908E+00 1.774E+00 1.678E+00 1.597E+00 1.534E+00
+ 1.446E+00 1.375E+00 1.311E+00 1.235E+00 1.159E+00 1.097E+00
+ 1.044E+00 1.028E+00 1.020E+00 1.009E+00 1.006E+00 1.003E+00
+ 9.985E-01 9.967E-01
+C
+FC2036 RBE-weighted Deuteron (2H+) dose; DSB induction (anoxic)
+F2036:D 3
+FM2036 0.1602
+DE2036 1.000E-03 2.000E-03 3.000E-03 4.000E-03 5.000E-03 6.470E-03
+ 7.500E-03 1.000E-02 2.000E-02 3.000E-02 4.000E-02 5.000E-02
+ 6.000E-02 7.000E-02 8.000E-02 9.000E-02 1.000E-01 2.000E-01
+ 3.000E-01 5.000E-01 9.000E-01 1.000E+00 1.100E+00 1.300E+00
+ 1.500E+00 2.000E+00 2.500E+00 3.000E+00 3.500E+00 4.000E+00
+ 5.000E+00 6.000E+00 7.500E+00 1.000E+01 1.500E+01 2.500E+01
+ 5.000E+01 7.500E+01 1.000E+02 1.500E+02 2.000E+02 2.500E+02
+ 5.000E+02 1.000E+03
+DF2036 9.754E+00 9.750E+00 9.727E+00 9.716E+00 9.724E+00 9.689E+00
+ 9.697E+00 9.685E+00 9.610E+00 9.552E+00 9.498E+00 9.425E+00
+ 9.378E+00 9.303E+00 9.251E+00 9.189E+00 9.126E+00 8.426E+00
+ 7.689E+00 6.231E+00 4.173E+00 3.834E+00 3.555E+00 3.122E+00
+ 2.805E+00 2.308E+00 2.021E+00 1.852E+00 1.728E+00 1.633E+00
+ 1.508E+00 1.419E+00 1.338E+00 1.249E+00 1.167E+00 1.102E+00
+ 1.047E+00 1.028E+00 1.016E+00 1.008E+00 1.004E+00 1.002E+00
+ 9.973E-01 9.937E-01
+C
+FC2046 Deuteron (2H+) intra-track RMF interaction term (aerobic cells)
+F2046:D 3
+FM2046 0.1602
+DE2046 1.000E-03 2.000E-03 3.000E-03 4.000E-03 5.000E-03 6.470E-03
+ 7.500E-03 1.000E-02 2.000E-02 3.000E-02 4.000E-02 5.000E-02
+ 6.000E-02 7.000E-02 8.000E-02 9.000E-02 1.000E-01 2.000E-01
+ 3.000E-01 5.000E-01 9.000E-01 1.000E+00 1.100E+00 1.300E+00
+ 1.500E+00 2.000E+00 2.500E+00 3.000E+00 3.500E+00 4.000E+00
+ 5.000E+00 6.000E+00 7.500E+00 1.000E+01 1.500E+01 2.500E+01
+ 5.000E+01 7.500E+01 1.000E+02 1.500E+02 2.000E+02 2.500E+02
+ 5.000E+02 1.000E+03
+DF2046 1.913E+00 3.822E+00 5.717E+00 7.604E+00 9.518E+00 1.225E+01
+ 1.422E+01 1.889E+01 3.725E+01 5.540E+01 7.315E+01 9.017E+01
+ 1.072E+02 1.235E+02 1.397E+02 1.555E+02 1.703E+02 2.941E+02
+ 3.541E+02 2.899E+02 1.589E+02 1.399E+02 1.244E+02 1.009E+02
+ 8.350E+01 5.634E+01 4.129E+01 3.221E+01 2.595E+01 2.158E+01
+ 1.612E+01 1.263E+01 9.631E+00 6.780E+00 4.307E+00 2.543E+00
+ 1.310E+00 9.146E-01 7.175E-01 5.132E-01 4.120E-01 3.500E-01
+ 2.222E-01 1.571E-01
+C
+FC2056 Deuteron (2H+) intra-track RMF interaction term (anoxic cells)
+F2056:D 3
+FM2056 0.1602
+DE2056 1.000E-03 2.000E-03 3.000E-03 4.000E-03 5.000E-03 6.470E-03
+ 7.500E-03 1.000E-02 2.000E-02 3.000E-02 4.000E-02 5.000E-02
+ 6.000E-02 7.000E-02 8.000E-02 9.000E-02 1.000E-01 2.000E-01
+ 3.000E-01 5.000E-01 9.000E-01 1.000E+00 1.100E+00 1.300E+00
+ 1.500E+00 2.000E+00 2.500E+00 3.000E+00 3.500E+00 4.000E+00
+ 5.000E+00 6.000E+00 7.500E+00 1.000E+01 1.500E+01 2.500E+01
+ 5.000E+01 7.500E+01 1.000E+02 1.500E+02 2.000E+02 2.500E+02
+ 5.000E+02 1.000E+03
+DF2056 1.902E+00 3.801E+00 5.674E+00 7.545E+00 9.447E+00 1.213E+01
+ 1.408E+01 1.871E+01 3.674E+01 5.430E+01 7.138E+01 8.760E+01
+ 1.037E+02 1.186E+02 1.335E+02 1.476E+02 1.610E+02 2.556E+02
+ 2.768E+02 1.732E+02 5.542E+01 4.367E+01 3.522E+01 2.424E+01
+ 1.770E+01 9.737E+00 6.328E+00 4.629E+00 3.584E+00 2.888E+00
+ 2.073E+00 1.590E+00 1.185E+00 8.195E-01 5.156E-01 3.028E-01
+ 1.555E-01 1.080E-01 8.413E-02 6.054E-02 4.847E-02 4.121E-02
+ 2.617E-02 1.844E-02
+C
+FC2066 Dose-weighted frequency-mean specific energy (ndia=5 um)
+F2066:D 3
+FM2066 0.1602
+DE2066 1.000E-03 2.000E-03 3.000E-03 4.000E-03 5.000E-03 6.470E-03
+ 7.500E-03 1.000E-02 2.000E-02 3.000E-02 4.000E-02 5.000E-02
+ 6.000E-02 7.000E-02 8.000E-02 9.000E-02 1.000E-01 2.000E-01
+ 3.000E-01 5.000E-01 9.000E-01 1.000E+00 1.100E+00 1.300E+00
+ 1.500E+00 2.000E+00 2.500E+00 3.000E+00 3.500E+00 4.000E+00
+ 5.000E+00 6.000E+00 7.500E+00 1.000E+01 1.500E+01 2.500E+01
+ 5.000E+01 7.500E+01 1.000E+02 1.500E+02 2.000E+02 2.500E+02
+ 5.000E+02 1.000E+03
+DF2066 2.447E-03 4.894E-03 7.340E-03 9.784E-03 1.223E-02 1.582E-02
+ 1.833E-02 2.442E-02 4.870E-02 7.285E-02 9.685E-02 1.207E-01
+ 1.443E-01 1.678E-01 1.910E-01 2.140E-01 2.366E-01 4.407E-01
+ 5.732E-01 5.460E-01 3.895E-01 3.636E-01 3.412E-01 3.044E-01
+ 2.753E-01 2.238E-01 1.897E-01 1.653E-01 1.470E-01 1.326E-01
+ 1.115E-01 9.663E-02 8.096E-02 6.431E-02 4.633E-02 3.055E-02
+ 1.736E-02 1.252E-02 9.967E-03 7.291E-03 5.891E-03 5.025E-03
+ 3.221E-03 2.286E-03
+C
+FC2076 Dose-weighted Deuteron (2H+) stopping power (keV/um)
+F2076:D 3
+FM2076 0.1602
+DE2076 1.000E-03 2.000E-03 3.000E-03 4.000E-03 5.000E-03 6.470E-03
+ 7.500E-03 1.000E-02 2.000E-02 3.000E-02 4.000E-02 5.000E-02
+ 6.000E-02 7.000E-02 8.000E-02 9.000E-02 1.000E-01 2.000E-01
+ 3.000E-01 5.000E-01 9.000E-01 1.000E+00 1.100E+00 1.300E+00
+ 1.500E+00 2.000E+00 2.500E+00 3.000E+00 3.500E+00 4.000E+00
+ 5.000E+00 6.000E+00 7.500E+00 1.000E+01 1.500E+01 2.500E+01
+ 5.000E+01 7.500E+01 1.000E+02 1.500E+02 2.000E+02 2.500E+02
+ 5.000E+02 1.000E+03
+DF2076 1.557E+01 1.737E+01 1.924E+01 2.112E+01 2.296E+01 2.557E+01
+ 2.733E+01 3.134E+01 4.425E+01 5.344E+01 6.014E+01 6.511E+01
+ 6.884E+01 7.165E+01 7.376E+01 7.533E+01 7.647E+01 7.694E+01
+ 7.147E+01 6.024E+01 4.501E+01 4.234E+01 3.998E+01 3.601E+01
+ 3.279E+01 2.693E+01 2.295E+01 2.007E+01 1.789E+01 1.616E+01
+ 1.361E+01 1.181E+01 9.904E+00 7.873E+00 5.676E+00 3.743E+00
+ 2.127E+00 1.534E+00 1.222E+00 8.937E-01 7.220E-01 6.159E-01
+ 3.948E-01 2.802E-01
+C *** ------------------------------------------------------------
+
+
diff --git a/MCNP/RBEfactors/additionalMat/MCDS_data/electrons.txt b/MCNP/RBEfactors/additionalMat/MCDS_data/electrons.txt
new file mode 100644
index 000000000..10767159a
--- /dev/null
+++ b/MCNP/RBEfactors/additionalMat/MCDS_data/electrons.txt
@@ -0,0 +1,132 @@
+ELECTRON (e-) DOSE-RESPONSE FUNCTIONS FOR USE IN MCNPX (August 15, 2013)
+Data generated by RDS using MCDS Version 3.10A 05-DEC-2011
+
+C *** ============================================================
+C *** Electron (e-) DOSE, RBE AND RELATED TALLIES
+C *** ------------------------------------------------------------
+FC916 Electron (e-) Absorbed Dose
+F916:E 3
+FM916 0.1602
+C
+FC916 RBE-weighted Electron (e-) dose; DSB induction (aerobic)
+F916:E 3
+FM916 0.1602
+DE916 1.000E-05 2.000E-05 3.000E-05 4.000E-05 5.000E-05 6.000E-05
+ 7.000E-05 8.000E-05 9.000E-05 1.000E-04 2.000E-04 3.000E-04
+ 4.000E-04 5.000E-04 6.000E-04 7.000E-04 8.000E-04 9.000E-04
+ 1.000E-03 2.000E-03 3.000E-03 4.000E-03 5.000E-03 6.000E-03
+ 7.000E-03 8.000E-03 9.000E-03 1.000E-02 2.000E-02 3.000E-02
+ 4.000E-02 5.000E-02 6.000E-02 7.000E-02 8.000E-02 9.000E-02
+ 1.000E-01 2.000E-01 3.000E-01 4.000E-01 5.000E-01 1.000E+00
+ 1.000E+01 1.000E+02 1.000E+03
+DF916 3.385E+00 3.354E+00 3.322E+00 3.279E+00 3.235E+00 3.191E+00
+ 3.140E+00 3.092E+00 3.047E+00 3.002E+00 2.601E+00 2.320E+00
+ 2.118E+00 1.966E+00 1.852E+00 1.760E+00 1.688E+00 1.627E+00
+ 1.573E+00 1.314E+00 1.215E+00 1.163E+00 1.129E+00 1.111E+00
+ 1.094E+00 1.083E+00 1.071E+00 1.062E+00 1.029E+00 1.016E+00
+ 1.011E+00 1.007E+00 1.006E+00 1.002E+00 1.002E+00 1.003E+00
+ 9.992E-01 9.963E-01 9.955E-01 9.948E-01 9.944E-01 9.925E-01
+ 9.910E-01 9.947E-01 9.947E-01
+C
+FC926 RBE-weighted Electron (e-) dose; DSB induction (anoxic)
+F926:E 3
+FM926 0.1602
+DE926 1.000E-05 2.000E-05 3.000E-05 4.000E-05 5.000E-05 6.000E-05
+ 7.000E-05 8.000E-05 9.000E-05 1.000E-04 2.000E-04 3.000E-04
+ 4.000E-04 5.000E-04 6.000E-04 7.000E-04 8.000E-04 9.000E-04
+ 1.000E-03 2.000E-03 3.000E-03 4.000E-03 5.000E-03 6.000E-03
+ 7.000E-03 8.000E-03 9.000E-03 1.000E-02 2.000E-02 3.000E-02
+ 4.000E-02 5.000E-02 6.000E-02 7.000E-02 8.000E-02 9.000E-02
+ 1.000E-01 2.000E-01 3.000E-01 4.000E-01 5.000E-01 1.000E+00
+ 1.000E+01 1.000E+02 1.000E+03
+DF926 9.839E+00 9.724E+00 9.590E+00 9.393E+00 9.174E+00 8.929E+00
+ 8.641E+00 8.359E+00 8.062E+00 7.761E+00 5.123E+00 3.657E+00
+ 2.887E+00 2.454E+00 2.187E+00 1.996E+00 1.876E+00 1.771E+00
+ 1.688E+00 1.343E+00 1.232E+00 1.171E+00 1.138E+00 1.118E+00
+ 1.096E+00 1.086E+00 1.070E+00 1.062E+00 1.030E+00 1.016E+00
+ 1.009E+00 1.005E+00 1.001E+00 1.001E+00 1.001E+00 1.002E+00
+ 9.975E-01 9.947E-01 9.951E-01 9.916E-01 9.940E-01 9.919E-01
+ 9.894E-01 9.946E-01 9.946E-01
+C
+FC936 Electron (e-) intra-track RMF interaction term (aerobic cells)
+F936:E 3
+FM936 0.1602
+DE936 1.000E-05 2.000E-05 3.000E-05 4.000E-05 5.000E-05 6.000E-05
+ 7.000E-05 8.000E-05 9.000E-05 1.000E-04 2.000E-04 3.000E-04
+ 4.000E-04 5.000E-04 6.000E-04 7.000E-04 8.000E-04 9.000E-04
+ 1.000E-03 2.000E-03 3.000E-03 4.000E-03 5.000E-03 6.000E-03
+ 7.000E-03 8.000E-03 9.000E-03 1.000E-02 2.000E-02 3.000E-02
+ 4.000E-02 5.000E-02 6.000E-02 7.000E-02 8.000E-02 9.000E-02
+ 1.000E-01 2.000E-01 3.000E-01 4.000E-01 5.000E-01 1.000E+00
+ 1.000E+01 1.000E+02 1.000E+03
+DF936 1.940E-02 3.810E-02 5.605E-02 7.282E-02 8.862E-02 1.035E-01
+ 1.168E-01 1.295E-01 1.415E-01 1.526E-01 2.291E-01 2.734E-01
+ 3.039E-01 3.274E-01 3.486E-01 3.671E-01 3.861E-01 4.035E-01
+ 4.189E-01 5.847E-01 7.486E-01 9.101E-01 1.067E+00 1.226E+00
+ 1.365E+00 1.495E+00 1.592E+00 1.667E+00 9.033E-01 6.016E-01
+ 4.692E-01 3.906E-01 3.397E-01 3.014E-01 2.746E-01 2.538E-01
+ 2.352E-01 1.574E-01 1.320E-01 1.197E-01 1.129E-01 1.017E-01
+ 1.088E-01 1.235E-01 1.346E-01
+C
+FC946 Electron (e-) intra-track RMF interaction term (anoxic cells)
+F946:E 3
+FM946 0.1602
+DE946 1.000E-05 2.000E-05 3.000E-05 4.000E-05 5.000E-05 6.000E-05
+ 7.000E-05 8.000E-05 9.000E-05 1.000E-04 2.000E-04 3.000E-04
+ 4.000E-04 5.000E-04 6.000E-04 7.000E-04 8.000E-04 9.000E-04
+ 1.000E-03 2.000E-03 3.000E-03 4.000E-03 5.000E-03 6.000E-03
+ 7.000E-03 8.000E-03 9.000E-03 1.000E-02 2.000E-02 3.000E-02
+ 4.000E-02 5.000E-02 6.000E-02 7.000E-02 8.000E-02 9.000E-02
+ 1.000E-01 2.000E-01 3.000E-01 4.000E-01 5.000E-01 1.000E+00
+ 1.000E+01 1.000E+02 1.000E+03
+DF946 1.936E-02 3.781E-02 5.517E-02 7.057E-02 8.416E-02 9.567E-02
+ 1.045E-01 1.118E-01 1.170E-01 1.205E-01 1.050E-01 8.022E-02
+ 6.669E-02 6.023E-02 5.737E-02 5.572E-02 5.632E-02 5.647E-02
+ 5.696E-02 7.208E-02 9.081E-02 1.090E-01 1.280E-01 1.465E-01
+ 1.618E-01 1.775E-01 1.876E-01 1.968E-01 1.069E-01 7.113E-02
+ 5.519E-02 4.597E-02 3.975E-02 3.554E-02 3.236E-02 2.995E-02
+ 2.768E-02 1.853E-02 1.557E-02 1.405E-02 1.332E-02 1.199E-02
+ 1.280E-02 1.458E-02 1.590E-02
+C
+FC956 Dose-weighted frequency-mean specific energy (ndia=5 um)
+F956:E 3
+FM956 0.1602
+DE956 1.000E-05 2.000E-05 3.000E-05 4.000E-05 5.000E-05 6.000E-05
+ 7.000E-05 8.000E-05 9.000E-05 1.000E-04 2.000E-04 3.000E-04
+ 4.000E-04 5.000E-04 6.000E-04 7.000E-04 8.000E-04 9.000E-04
+ 1.000E-03 2.000E-03 3.000E-03 4.000E-03 5.000E-03 6.000E-03
+ 7.000E-03 8.000E-03 9.000E-03 1.000E-02 2.000E-02 3.000E-02
+ 4.000E-02 5.000E-02 6.000E-02 7.000E-02 8.000E-02 9.000E-02
+ 1.000E-01 2.000E-01 3.000E-01 4.000E-01 5.000E-01 1.000E+00
+ 1.000E+01 1.000E+02 1.000E+03
+DF956 2.448E-05 4.895E-05 7.343E-05 9.791E-05 1.224E-04 1.469E-04
+ 1.713E-04 1.958E-04 2.203E-04 2.448E-04 4.895E-04 7.343E-04
+ 9.791E-04 1.224E-03 1.469E-03 1.713E-03 1.958E-03 2.203E-03
+ 2.447E-03 4.892E-03 7.326E-03 9.734E-03 1.209E-02 1.436E-02
+ 1.649E-02 1.843E-02 2.008E-02 2.137E-02 1.234E-02 8.429E-03
+ 6.632E-03 5.566E-03 4.853E-03 4.340E-03 3.953E-03 3.649E-03
+ 3.405E-03 2.293E-03 1.925E-03 1.749E-03 1.650E-03 1.492E-03
+ 1.601E-03 1.804E-03 1.967E-03
+C
+FC966 Dose-weighted Electron (e-) stopping power (keV/um)
+F966:E 3
+FM966 0.1602
+DE966 1.000E-05 2.000E-05 3.000E-05 4.000E-05 5.000E-05 6.000E-05
+ 7.000E-05 8.000E-05 9.000E-05 1.000E-04 2.000E-04 3.000E-04
+ 4.000E-04 5.000E-04 6.000E-04 7.000E-04 8.000E-04 9.000E-04
+ 1.000E-03 2.000E-03 3.000E-03 4.000E-03 5.000E-03 6.000E-03
+ 7.000E-03 8.000E-03 9.000E-03 1.000E-02 2.000E-02 3.000E-02
+ 4.000E-02 5.000E-02 6.000E-02 7.000E-02 8.000E-02 9.000E-02
+ 1.000E-01 2.000E-01 3.000E-01 4.000E-01 5.000E-01 1.000E+00
+ 1.000E+01 1.000E+02 1.000E+03
+DF966 1.632E+01 2.020E+01 2.159E+01 2.213E+01 2.229E+01 2.227E+01
+ 2.214E+01 2.195E+01 2.172E+01 2.148E+01 1.896E+01 1.695E+01
+ 1.537E+01 1.412E+01 1.309E+01 1.222E+01 1.148E+01 1.084E+01
+ 1.028E+01 6.955E+00 5.375E+00 4.428E+00 3.788E+00 3.324E+00
+ 2.971E+00 2.692E+00 2.465E+00 2.278E+00 1.340E+00 9.811E-01
+ 7.894E-01 6.693E-01 5.869E-01 5.267E-01 4.807E-01 4.445E-01
+ 4.153E-01 2.806E-01 2.358E-01 2.144E-01 2.022E-01 1.829E-01
+ 1.962E-01 2.212E-01 2.420E-01
+C *** ------------------------------------------------------------
+
+
diff --git a/MCNP/RBEfactors/additionalMat/MCDS_data/helium3.txt b/MCNP/RBEfactors/additionalMat/MCDS_data/helium3.txt
new file mode 100644
index 000000000..76b508a7c
--- /dev/null
+++ b/MCNP/RBEfactors/additionalMat/MCDS_data/helium3.txt
@@ -0,0 +1,289 @@
+3He DOSE-RESPONSE FUNCTIONS FOR USE IN MCNPX (August 23, 2013)
+Data generated by RDS using MCDS Version 3.10A 05-DEC-2011
+
+C *** ============================================================
+C *** 3He-Alpha (3He2+) DOSE, RBE AND RELATED TALLIES
+C *** ------------------------------------------------------------
+FC4016 3He-Alpha (3He2+) Absorbed Dose
+F4016:S 3
+FM4016 0.1602
+C
+FC4026 RBE-weighted 3He-Alpha (3He2+) dose; DSB induction (aerobic)
+F4026:S 3
+FM4026 0.1602
+DE4026 1.000E-03 1.500E-03 2.000E-03 2.500E-03 3.000E-03 4.000E-03
+ 5.000E-03 6.000E-03 7.000E-03 8.000E-03 9.000E-03 1.000E-02
+ 1.250E-02 1.500E-02 1.750E-02 2.000E-02 2.250E-02 2.500E-02
+ 2.750E-02 3.000E-02 3.500E-02 4.000E-02 4.500E-02 5.000E-02
+ 5.500E-02 6.000E-02 6.500E-02 7.000E-02 7.500E-02 8.000E-02
+ 8.500E-02 9.000E-02 9.500E-02 1.000E-01 1.250E-01 1.500E-01
+ 1.750E-01 2.000E-01 2.250E-01 2.500E-01 2.750E-01 3.000E-01
+ 3.500E-01 4.000E-01 4.500E-01 5.000E-01 5.500E-01 6.000E-01
+ 6.500E-01 7.000E-01 7.500E-01 8.000E-01 8.500E-01 9.000E-01
+ 9.500E-01 1.000E+00 1.250E+00 1.500E+00 1.750E+00 2.000E+00
+ 2.250E+00 2.500E+00 2.750E+00 3.000E+00 3.500E+00 4.000E+00
+ 4.500E+00 5.000E+00 5.500E+00 6.000E+00 6.500E+00 7.000E+00
+ 7.500E+00 8.000E+00 8.500E+00 9.000E+00 9.500E+00 1.000E+01
+ 1.250E+01 1.500E+01 1.750E+01 2.000E+01 2.500E+01 2.750E+01
+ 3.000E+01 3.500E+01 4.000E+01 4.500E+01 5.000E+01 5.500E+01
+ 6.000E+01 6.500E+01 7.000E+01 7.500E+01 8.000E+01 8.500E+01
+ 9.000E+01 9.500E+01 1.000E+02 1.250E+02 1.500E+02 1.750E+02
+ 2.000E+02 2.250E+02 2.500E+02 2.750E+02 3.000E+02 3.500E+02
+ 4.000E+02 4.500E+02 5.000E+02 5.500E+02 6.000E+02 6.500E+02
+ 7.000E+02 7.500E+02 8.000E+02 8.500E+02 9.000E+02 9.500E+02
+ 1.000E+03 2.000E+03 5.000E+03 7.500E+03 1.000E+04
+C
+DF4026 3.382E+00 3.382E+00 3.382E+00 3.381E+00 3.380E+00 3.381E+00
+ 3.378E+00 3.381E+00 3.378E+00 3.378E+00 3.377E+00 3.376E+00
+ 3.377E+00 3.377E+00 3.375E+00 3.375E+00 3.374E+00 3.374E+00
+ 3.372E+00 3.373E+00 3.372E+00 3.370E+00 3.368E+00 3.369E+00
+ 3.367E+00 3.366E+00 3.365E+00 3.364E+00 3.365E+00 3.363E+00
+ 3.363E+00 3.363E+00 3.359E+00 3.358E+00 3.356E+00 3.348E+00
+ 3.349E+00 3.340E+00 3.337E+00 3.333E+00 3.327E+00 3.324E+00
+ 3.315E+00 3.306E+00 3.297E+00 3.289E+00 3.281E+00 3.270E+00
+ 3.260E+00 3.253E+00 3.242E+00 3.231E+00 3.221E+00 3.211E+00
+ 3.202E+00 3.193E+00 3.144E+00 3.095E+00 3.047E+00 2.996E+00
+ 2.947E+00 2.901E+00 2.852E+00 2.809E+00 2.723E+00 2.646E+00
+ 2.571E+00 2.502E+00 2.438E+00 2.377E+00 2.323E+00 2.272E+00
+ 2.224E+00 2.178E+00 2.140E+00 2.101E+00 2.065E+00 2.031E+00
+ 1.886E+00 1.778E+00 1.692E+00 1.625E+00 1.522E+00 1.483E+00
+ 1.448E+00 1.392E+00 1.347E+00 1.314E+00 1.286E+00 1.262E+00
+ 1.241E+00 1.223E+00 1.209E+00 1.195E+00 1.185E+00 1.175E+00
+ 1.166E+00 1.156E+00 1.149E+00 1.121E+00 1.100E+00 1.087E+00
+ 1.076E+00 1.067E+00 1.062E+00 1.062E+00 1.050E+00 1.044E+00
+ 1.038E+00 1.035E+00 1.030E+00 1.027E+00 1.027E+00 1.024E+00
+ 1.022E+00 1.020E+00 1.020E+00 1.018E+00 1.018E+00 1.016E+00
+ 1.016E+00 1.008E+00 1.004E+00 1.004E+00 1.001E+00
+C
+FC4036 RBE-weighted 3He-Alpha (3He2+) dose; DSB induction (anoxic)
+F4036:S 3
+FM4036 0.1602
+DE4036 1.000E-03 1.500E-03 2.000E-03 2.500E-03 3.000E-03 4.000E-03
+ 5.000E-03 6.000E-03 7.000E-03 8.000E-03 9.000E-03 1.000E-02
+ 1.250E-02 1.500E-02 1.750E-02 2.000E-02 2.250E-02 2.500E-02
+ 2.750E-02 3.000E-02 3.500E-02 4.000E-02 4.500E-02 5.000E-02
+ 5.500E-02 6.000E-02 6.500E-02 7.000E-02 7.500E-02 8.000E-02
+ 8.500E-02 9.000E-02 9.500E-02 1.000E-01 1.250E-01 1.500E-01
+ 1.750E-01 2.000E-01 2.250E-01 2.500E-01 2.750E-01 3.000E-01
+ 3.500E-01 4.000E-01 4.500E-01 5.000E-01 5.500E-01 6.000E-01
+ 6.500E-01 7.000E-01 7.500E-01 8.000E-01 8.500E-01 9.000E-01
+ 9.500E-01 1.000E+00 1.250E+00 1.500E+00 1.750E+00 2.000E+00
+ 2.250E+00 2.500E+00 2.750E+00 3.000E+00 3.500E+00 4.000E+00
+ 4.500E+00 5.000E+00 5.500E+00 6.000E+00 6.500E+00 7.000E+00
+ 7.500E+00 8.000E+00 8.500E+00 9.000E+00 9.500E+00 1.000E+01
+ 1.250E+01 1.500E+01 1.750E+01 2.000E+01 2.500E+01 2.750E+01
+ 3.000E+01 3.500E+01 4.000E+01 4.500E+01 5.000E+01 5.500E+01
+ 6.000E+01 6.500E+01 7.000E+01 7.500E+01 8.000E+01 8.500E+01
+ 9.000E+01 9.500E+01 1.000E+02 1.250E+02 1.500E+02 1.750E+02
+ 2.000E+02 2.250E+02 2.500E+02 2.750E+02 3.000E+02 3.500E+02
+ 4.000E+02 4.500E+02 5.000E+02 5.500E+02 6.000E+02 6.500E+02
+ 7.000E+02 7.500E+02 8.000E+02 8.500E+02 9.000E+02 9.500E+02
+ 1.000E+03 2.000E+03 5.000E+03 7.500E+03 1.000E+04
+DF4036 9.833E+00 9.832E+00 9.832E+00 9.830E+00 9.827E+00 9.829E+00
+ 9.821E+00 9.829E+00 9.823E+00 9.822E+00 9.817E+00 9.816E+00
+ 9.820E+00 9.819E+00 9.804E+00 9.803E+00 9.802E+00 9.800E+00
+ 9.798E+00 9.794E+00 9.794E+00 9.790E+00 9.784E+00 9.786E+00
+ 9.779E+00 9.778E+00 9.766E+00 9.760E+00 9.764E+00 9.759E+00
+ 9.760E+00 9.760E+00 9.749E+00 9.745E+00 9.727E+00 9.706E+00
+ 9.698E+00 9.672E+00 9.653E+00 9.631E+00 9.616E+00 9.597E+00
+ 9.561E+00 9.514E+00 9.478E+00 9.432E+00 9.389E+00 9.346E+00
+ 9.297E+00 9.255E+00 9.202E+00 9.149E+00 9.101E+00 9.039E+00
+ 8.992E+00 8.944E+00 8.665E+00 8.363E+00 8.051E+00 7.728E+00
+ 7.407E+00 7.087E+00 6.779E+00 6.484E+00 5.899E+00 5.398E+00
+ 4.946E+00 4.546E+00 4.214E+00 3.924E+00 3.669E+00 3.453E+00
+ 3.262E+00 3.096E+00 2.955E+00 2.837E+00 2.718E+00 2.622E+00
+ 2.260E+00 2.037E+00 1.879E+00 1.768E+00 1.613E+00 1.559E+00
+ 1.512E+00 1.439E+00 1.386E+00 1.343E+00 1.310E+00 1.284E+00
+ 1.258E+00 1.238E+00 1.224E+00 1.209E+00 1.197E+00 1.185E+00
+ 1.175E+00 1.166E+00 1.157E+00 1.128E+00 1.101E+00 1.089E+00
+ 1.079E+00 1.068E+00 1.062E+00 1.062E+00 1.050E+00 1.045E+00
+ 1.037E+00 1.036E+00 1.028E+00 1.026E+00 1.024E+00 1.021E+00
+ 1.021E+00 1.019E+00 1.020E+00 1.017E+00 1.016E+00 1.015E+00
+ 1.017E+00 1.004E+00 1.004E+00 1.003E+00 1.000E+00
+C
+FC4046 3He-Alpha (3He2+) intra-track RMF interaction term (aerobic cells)
+F4046:S 3
+FM4046 0.1602
+DE4046 1.000E-03 1.500E-03 2.000E-03 2.500E-03 3.000E-03 4.000E-03
+ 5.000E-03 6.000E-03 7.000E-03 8.000E-03 9.000E-03 1.000E-02
+ 1.250E-02 1.500E-02 1.750E-02 2.000E-02 2.250E-02 2.500E-02
+ 2.750E-02 3.000E-02 3.500E-02 4.000E-02 4.500E-02 5.000E-02
+ 5.500E-02 6.000E-02 6.500E-02 7.000E-02 7.500E-02 8.000E-02
+ 8.500E-02 9.000E-02 9.500E-02 1.000E-01 1.250E-01 1.500E-01
+ 1.750E-01 2.000E-01 2.250E-01 2.500E-01 2.750E-01 3.000E-01
+ 3.500E-01 4.000E-01 4.500E-01 5.000E-01 5.500E-01 6.000E-01
+ 6.500E-01 7.000E-01 7.500E-01 8.000E-01 8.500E-01 9.000E-01
+ 9.500E-01 1.000E+00 1.250E+00 1.500E+00 1.750E+00 2.000E+00
+ 2.250E+00 2.500E+00 2.750E+00 3.000E+00 3.500E+00 4.000E+00
+ 4.500E+00 5.000E+00 5.500E+00 6.000E+00 6.500E+00 7.000E+00
+ 7.500E+00 8.000E+00 8.500E+00 9.000E+00 9.500E+00 1.000E+01
+ 1.250E+01 1.500E+01 1.750E+01 2.000E+01 2.500E+01 2.750E+01
+ 3.000E+01 3.500E+01 4.000E+01 4.500E+01 5.000E+01 5.500E+01
+ 6.000E+01 6.500E+01 7.000E+01 7.500E+01 8.000E+01 8.500E+01
+ 9.000E+01 9.500E+01 1.000E+02 1.250E+02 1.500E+02 1.750E+02
+ 2.000E+02 2.250E+02 2.500E+02 2.750E+02 3.000E+02 3.500E+02
+ 4.000E+02 4.500E+02 5.000E+02 5.500E+02 6.000E+02 6.500E+02
+ 7.000E+02 7.500E+02 8.000E+02 8.500E+02 9.000E+02 9.500E+02
+ 1.000E+03 2.000E+03 5.000E+03 7.500E+03 1.000E+04
+DF4046 1.937E+00 2.904E+00 3.873E+00 4.838E+00 5.803E+00 7.740E+00
+ 9.660E+00 1.160E+01 1.353E+01 1.545E+01 1.736E+01 1.928E+01
+ 2.411E+01 2.893E+01 3.370E+01 3.849E+01 4.326E+01 4.805E+01
+ 5.277E+01 5.758E+01 6.707E+01 7.654E+01 8.594E+01 9.547E+01
+ 1.048E+02 1.142E+02 1.236E+02 1.328E+02 1.422E+02 1.515E+02
+ 1.608E+02 1.701E+02 1.790E+02 1.882E+02 2.339E+02 2.782E+02
+ 3.234E+02 3.660E+02 4.093E+02 4.516E+02 4.928E+02 5.341E+02
+ 6.136E+02 6.898E+02 7.626E+02 8.320E+02 8.964E+02 9.555E+02
+ 1.010E+03 1.059E+03 1.100E+03 1.133E+03 1.160E+03 1.178E+03
+ 1.190E+03 1.194E+03 1.127E+03 9.885E+02 8.613E+02 7.561E+02
+ 6.712E+02 6.013E+02 5.418E+02 4.926E+02 4.121E+02 3.518E+02
+ 3.036E+02 2.652E+02 2.338E+02 2.079E+02 1.866E+02 1.684E+02
+ 1.529E+02 1.394E+02 1.283E+02 1.182E+02 1.094E+02 1.017E+02
+ 7.339E+01 5.642E+01 4.516E+01 3.741E+01 2.743E+01 2.410E+01
+ 2.141E+01 1.749E+01 1.469E+01 1.270E+01 1.117E+01 9.957E+00
+ 8.973E+00 8.170E+00 7.516E+00 6.949E+00 6.486E+00 6.071E+00
+ 5.706E+00 5.374E+00 5.092E+00 4.052E+00 3.375E+00 2.924E+00
+ 2.581E+00 2.319E+00 2.117E+00 1.971E+00 1.807E+00 1.595E+00
+ 1.433E+00 1.313E+00 1.209E+00 1.129E+00 1.065E+00 1.007E+00
+ 9.579E-01 9.147E-01 8.807E-01 8.471E-01 8.194E-01 7.928E-01
+ 7.700E-01 5.548E-01 4.411E-01 4.233E-01 4.139E-01
+C
+FC4056 3He-Alpha (3He2+) intra-track RMF interaction term (anoxic cells)
+F4056:S 3
+FM4056 0.1602
+DE4056 1.000E-03 1.500E-03 2.000E-03 2.500E-03 3.000E-03 4.000E-03
+ 5.000E-03 6.000E-03 7.000E-03 8.000E-03 9.000E-03 1.000E-02
+ 1.250E-02 1.500E-02 1.750E-02 2.000E-02 2.250E-02 2.500E-02
+ 2.750E-02 3.000E-02 3.500E-02 4.000E-02 4.500E-02 5.000E-02
+ 5.500E-02 6.000E-02 6.500E-02 7.000E-02 7.500E-02 8.000E-02
+ 8.500E-02 9.000E-02 9.500E-02 1.000E-01 1.250E-01 1.500E-01
+ 1.750E-01 2.000E-01 2.250E-01 2.500E-01 2.750E-01 3.000E-01
+ 3.500E-01 4.000E-01 4.500E-01 5.000E-01 5.500E-01 6.000E-01
+ 6.500E-01 7.000E-01 7.500E-01 8.000E-01 8.500E-01 9.000E-01
+ 9.500E-01 1.000E+00 1.250E+00 1.500E+00 1.750E+00 2.000E+00
+ 2.250E+00 2.500E+00 2.750E+00 3.000E+00 3.500E+00 4.000E+00
+ 4.500E+00 5.000E+00 5.500E+00 6.000E+00 6.500E+00 7.000E+00
+ 7.500E+00 8.000E+00 8.500E+00 9.000E+00 9.500E+00 1.000E+01
+ 1.250E+01 1.500E+01 1.750E+01 2.000E+01 2.500E+01 2.750E+01
+ 3.000E+01 3.500E+01 4.000E+01 4.500E+01 5.000E+01 5.500E+01
+ 6.000E+01 6.500E+01 7.000E+01 7.500E+01 8.000E+01 8.500E+01
+ 9.000E+01 9.500E+01 1.000E+02 1.250E+02 1.500E+02 1.750E+02
+ 2.000E+02 2.250E+02 2.500E+02 2.750E+02 3.000E+02 3.500E+02
+ 4.000E+02 4.500E+02 5.000E+02 5.500E+02 6.000E+02 6.500E+02
+ 7.000E+02 7.500E+02 8.000E+02 8.500E+02 9.000E+02 9.500E+02
+ 1.000E+03 2.000E+03 5.000E+03 7.500E+03 1.000E+04
+DF4056 1.934E+00 2.899E+00 3.866E+00 4.830E+00 5.792E+00 7.726E+00
+ 9.644E+00 1.158E+01 1.350E+01 1.542E+01 1.733E+01 1.925E+01
+ 2.407E+01 2.888E+01 3.358E+01 3.835E+01 4.311E+01 4.787E+01
+ 5.253E+01 5.733E+01 6.683E+01 7.626E+01 8.562E+01 9.513E+01
+ 1.044E+02 1.138E+02 1.229E+02 1.321E+02 1.414E+02 1.506E+02
+ 1.599E+02 1.692E+02 1.780E+02 1.871E+02 2.321E+02 2.762E+02
+ 3.203E+02 3.625E+02 4.045E+02 4.454E+02 4.862E+02 5.258E+02
+ 6.027E+02 6.746E+02 7.442E+02 8.082E+02 8.671E+02 9.219E+02
+ 9.695E+02 1.013E+03 1.047E+03 1.073E+03 1.093E+03 1.103E+03
+ 1.108E+03 1.107E+03 1.010E+03 8.525E+02 7.101E+02 5.942E+02
+ 5.006E+02 4.239E+02 3.614E+02 3.099E+02 2.284E+02 1.729E+02
+ 1.326E+02 1.034E+02 8.253E+01 6.689E+01 5.495E+01 4.592E+01
+ 3.885E+01 3.326E+01 2.889E+01 2.545E+01 2.239E+01 2.000E+01
+ 1.244E+01 8.744E+00 6.578E+00 5.228E+00 3.640E+00 3.148E+00
+ 2.757E+00 2.206E+00 1.836E+00 1.567E+00 1.369E+00 1.217E+00
+ 1.089E+00 9.893E-01 9.108E-01 8.390E-01 7.809E-01 7.291E-01
+ 6.844E-01 6.453E-01 6.094E-01 4.843E-01 3.996E-01 3.463E-01
+ 3.064E-01 2.743E-01 2.502E-01 2.329E-01 2.133E-01 1.887E-01
+ 1.690E-01 1.552E-01 1.423E-01 1.330E-01 1.252E-01 1.183E-01
+ 1.130E-01 1.079E-01 1.040E-01 9.969E-02 9.638E-02 9.341E-02
+ 9.108E-02 6.507E-02 5.207E-02 4.991E-02 4.884E-02
+C
+FC4066 Dose-weighted frequency-mean specific energy (ndia=5 um)
+F4066:S 3
+FM4066 0.1602
+DE4066 1.000E-03 1.500E-03 2.000E-03 2.500E-03 3.000E-03 4.000E-03
+ 5.000E-03 6.000E-03 7.000E-03 8.000E-03 9.000E-03 1.000E-02
+ 1.250E-02 1.500E-02 1.750E-02 2.000E-02 2.250E-02 2.500E-02
+ 2.750E-02 3.000E-02 3.500E-02 4.000E-02 4.500E-02 5.000E-02
+ 5.500E-02 6.000E-02 6.500E-02 7.000E-02 7.500E-02 8.000E-02
+ 8.500E-02 9.000E-02 9.500E-02 1.000E-01 1.250E-01 1.500E-01
+ 1.750E-01 2.000E-01 2.250E-01 2.500E-01 2.750E-01 3.000E-01
+ 3.500E-01 4.000E-01 4.500E-01 5.000E-01 5.500E-01 6.000E-01
+ 6.500E-01 7.000E-01 7.500E-01 8.000E-01 8.500E-01 9.000E-01
+ 9.500E-01 1.000E+00 1.250E+00 1.500E+00 1.750E+00 2.000E+00
+ 2.250E+00 2.500E+00 2.750E+00 3.000E+00 3.500E+00 4.000E+00
+ 4.500E+00 5.000E+00 5.500E+00 6.000E+00 6.500E+00 7.000E+00
+ 7.500E+00 8.000E+00 8.500E+00 9.000E+00 9.500E+00 1.000E+01
+ 1.250E+01 1.500E+01 1.750E+01 2.000E+01 2.500E+01 2.750E+01
+ 3.000E+01 3.500E+01 4.000E+01 4.500E+01 5.000E+01 5.500E+01
+ 6.000E+01 6.500E+01 7.000E+01 7.500E+01 8.000E+01 8.500E+01
+ 9.000E+01 9.500E+01 1.000E+02 1.250E+02 1.500E+02 1.750E+02
+ 2.000E+02 2.250E+02 2.500E+02 2.750E+02 3.000E+02 3.500E+02
+ 4.000E+02 4.500E+02 5.000E+02 5.500E+02 6.000E+02 6.500E+02
+ 7.000E+02 7.500E+02 8.000E+02 8.500E+02 9.000E+02 9.500E+02
+ 1.000E+03 2.000E+03 5.000E+03 7.500E+03 1.000E+04
+DF4066 2.448E-03 3.671E-03 4.895E-03 6.119E-03 7.342E-03 9.789E-03
+ 1.224E-02 1.468E-02 1.713E-02 1.957E-02 2.201E-02 2.446E-02
+ 3.056E-02 3.666E-02 4.276E-02 4.885E-02 5.493E-02 6.102E-02
+ 6.709E-02 7.316E-02 8.529E-02 9.741E-02 1.095E-01 1.216E-01
+ 1.336E-01 1.457E-01 1.577E-01 1.697E-01 1.816E-01 1.936E-01
+ 2.055E-01 2.174E-01 2.293E-01 2.412E-01 3.003E-01 3.588E-01
+ 4.169E-01 4.744E-01 5.314E-01 5.878E-01 6.436E-01 6.988E-01
+ 8.072E-01 9.123E-01 1.014E+00 1.112E+00 1.204E+00 1.292E+00
+ 1.373E+00 1.447E+00 1.513E+00 1.569E+00 1.616E+00 1.652E+00
+ 1.678E+00 1.694E+00 1.647E+00 1.492E+00 1.341E+00 1.218E+00
+ 1.117E+00 1.033E+00 9.627E-01 9.022E-01 8.035E-01 7.262E-01
+ 6.638E-01 6.122E-01 5.688E-01 5.317E-01 4.996E-01 4.715E-01
+ 4.468E-01 4.247E-01 4.049E-01 3.871E-01 3.709E-01 3.562E-01
+ 2.983E-01 2.580E-01 2.280E-01 2.048E-01 1.712E-01 1.585E-01
+ 1.477E-01 1.304E-01 1.170E-01 1.064E-01 9.768E-02 9.041E-02
+ 8.425E-02 7.896E-02 7.436E-02 7.032E-02 6.675E-02 6.356E-02
+ 6.069E-02 5.811E-02 5.576E-02 4.663E-02 4.035E-02 3.574E-02
+ 3.221E-02 2.942E-02 2.715E-02 2.527E-02 2.368E-02 2.116E-02
+ 1.923E-02 1.771E-02 1.648E-02 1.546E-02 1.461E-02 1.389E-02
+ 1.326E-02 1.271E-02 1.224E-02 1.181E-02 1.143E-02 1.110E-02
+ 1.079E-02 7.898E-03 6.327E-03 6.069E-03 5.975E-03
+C
+FC4076 Dose-weighted 3He-Alpha (3He2+) stopping power (keV/um)
+F4076:S 3
+FM4076 0.1602
+DE4076 1.000E-03 1.500E-03 2.000E-03 2.500E-03 3.000E-03 4.000E-03
+ 5.000E-03 6.000E-03 7.000E-03 8.000E-03 9.000E-03 1.000E-02
+ 1.250E-02 1.500E-02 1.750E-02 2.000E-02 2.250E-02 2.500E-02
+ 2.750E-02 3.000E-02 3.500E-02 4.000E-02 4.500E-02 5.000E-02
+ 5.500E-02 6.000E-02 6.500E-02 7.000E-02 7.500E-02 8.000E-02
+ 8.500E-02 9.000E-02 9.500E-02 1.000E-01 1.250E-01 1.500E-01
+ 1.750E-01 2.000E-01 2.250E-01 2.500E-01 2.750E-01 3.000E-01
+ 3.500E-01 4.000E-01 4.500E-01 5.000E-01 5.500E-01 6.000E-01
+ 6.500E-01 7.000E-01 7.500E-01 8.000E-01 8.500E-01 9.000E-01
+ 9.500E-01 1.000E+00 1.250E+00 1.500E+00 1.750E+00 2.000E+00
+ 2.250E+00 2.500E+00 2.750E+00 3.000E+00 3.500E+00 4.000E+00
+ 4.500E+00 5.000E+00 5.500E+00 6.000E+00 6.500E+00 7.000E+00
+ 7.500E+00 8.000E+00 8.500E+00 9.000E+00 9.500E+00 1.000E+01
+ 1.250E+01 1.500E+01 1.750E+01 2.000E+01 2.500E+01 2.750E+01
+ 3.000E+01 3.500E+01 4.000E+01 4.500E+01 5.000E+01 5.500E+01
+ 6.000E+01 6.500E+01 7.000E+01 7.500E+01 8.000E+01 8.500E+01
+ 9.000E+01 9.500E+01 1.000E+02 1.250E+02 1.500E+02 1.750E+02
+ 2.000E+02 2.250E+02 2.500E+02 2.750E+02 3.000E+02 3.500E+02
+ 4.000E+02 4.500E+02 5.000E+02 5.500E+02 6.000E+02 6.500E+02
+ 7.000E+02 7.500E+02 8.000E+02 8.500E+02 9.000E+02 9.500E+02
+ 1.000E+03 2.000E+03 5.000E+03 7.500E+03 1.000E+04
+DF4076 3.305E+01 3.329E+01 3.370E+01 3.425E+01 3.492E+01 3.647E+01
+ 3.817E+01 3.995E+01 4.174E+01 4.353E+01 4.529E+01 4.703E+01
+ 5.121E+01 5.516E+01 5.888E+01 6.241E+01 6.575E+01 6.892E+01
+ 7.195E+01 7.485E+01 8.030E+01 8.535E+01 9.008E+01 9.453E+01
+ 9.875E+01 1.028E+02 1.066E+02 1.103E+02 1.138E+02 1.173E+02
+ 1.206E+02 1.238E+02 1.270E+02 1.301E+02 1.444E+02 1.573E+02
+ 1.690E+02 1.795E+02 1.889E+02 1.971E+02 2.041E+02 2.101E+02
+ 2.190E+02 2.245E+02 2.272E+02 2.277E+02 2.267E+02 2.246E+02
+ 2.217E+02 2.183E+02 2.146E+02 2.107E+02 2.067E+02 2.027E+02
+ 1.987E+02 1.947E+02 1.764E+02 1.608E+02 1.476E+02 1.365E+02
+ 1.270E+02 1.188E+02 1.117E+02 1.054E+02 9.483E+01 8.634E+01
+ 7.934E+01 7.348E+01 6.848E+01 6.417E+01 6.042E+01 5.711E+01
+ 5.418E+01 5.156E+01 4.921E+01 4.708E+01 4.514E+01 4.337E+01
+ 3.641E+01 3.152E+01 2.788E+01 2.506E+01 2.095E+01 1.941E+01
+ 1.809E+01 1.597E+01 1.434E+01 1.303E+01 1.197E+01 1.108E+01
+ 1.032E+01 9.676E+00 9.112E+00 8.618E+00 8.180E+00 7.789E+00
+ 7.438E+00 7.121E+00 6.833E+00 5.715E+00 4.945E+00 4.381E+00
+ 3.948E+00 3.606E+00 3.328E+00 3.097E+00 2.903E+00 2.593E+00
+ 2.357E+00 2.170E+00 2.020E+00 1.895E+00 1.791E+00 1.702E+00
+ 1.625E+00 1.558E+00 1.500E+00 1.448E+00 1.402E+00 1.360E+00
+ 1.323E+00 9.681E-01 7.754E-01 7.438E-01 7.324E-01
+C *** ------------------------------------------------------------
+
+
diff --git a/MCNP/RBEfactors/additionalMat/MCDS_data/protons.txt b/MCNP/RBEfactors/additionalMat/MCDS_data/protons.txt
new file mode 100644
index 000000000..539a17a35
--- /dev/null
+++ b/MCNP/RBEfactors/additionalMat/MCDS_data/protons.txt
@@ -0,0 +1,214 @@
+PROTON DOSE-RESPONSE FUNCTIONS FOR USE IN MCNPX (October 9, 2013)
+Data generated by RDS using MCDS Version 3.10A 05-DEC-2011
+
+
+C *** ============================================================
+C *** PROTON (1H+) DOSE, RBE AND RELATED TALLIES
+C *** ------------------------------------------------------------
+FC1016 Proton (1H+) Absorbed Dose
+F1016:H 3
+FM1016 0.1602
+C
+FC1026 RBE-weighted proton (1H+) dose; DSB induction (aerobic)
+F1026:H 3
+FM1026 0.1602
+DE1026 1.000E-03 2.000E-03 3.000E-03 4.000E-03 5.000E-03 6.470E-03
+ 7.500E-03 1.000E-02 2.000E-02 3.000E-02 4.000E-02 5.000E-02
+ 6.000E-02 7.000E-02 8.000E-02 9.000E-02 1.000E-01 2.000E-01
+ 3.000E-01 5.000E-01 9.000E-01 1.000E+00 1.100E+00 1.300E+00
+ 1.500E+00 2.000E+00 2.500E+00 3.000E+00 3.500E+00 4.000E+00
+ 5.000E+00 6.000E+00 7.500E+00 1.000E+01 1.500E+01 2.500E+01
+ 5.000E+01 7.500E+01 1.000E+02 1.500E+02 2.000E+02 2.500E+02
+ 5.000E+02 1.000E+03
+DF1026 3.375E+00 3.367E+00 3.368E+00 3.363E+00 3.359E+00 3.352E+00
+ 3.348E+00 3.340E+00 3.317E+00 3.290E+00 3.264E+00 3.242E+00
+ 3.216E+00 3.193E+00 3.168E+00 3.143E+00 3.122E+00 2.889E+00
+ 2.687E+00 2.370E+00 1.986E+00 1.916E+00 1.860E+00 1.760E+00
+ 1.685E+00 1.542E+00 1.451E+00 1.386E+00 1.336E+00 1.297E+00
+ 1.244E+00 1.204E+00 1.164E+00 1.123E+00 1.083E+00 1.051E+00
+ 1.026E+00 1.016E+00 1.012E+00 1.004E+00 1.004E+00 1.003E+00
+ 1.001E+00 9.995E-01
+C
+FC1036 RBE-weighted proton (1H+) dose; DSB induction (anoxic)
+F1036:H 3
+FM1036 0.1602
+DE1036 1.000E-03 2.000E-03 3.000E-03 4.000E-03 5.000E-03 6.470E-03
+ 7.500E-03 1.000E-02 2.000E-02 3.000E-02 4.000E-02 5.000E-02
+ 6.000E-02 7.000E-02 8.000E-02 9.000E-02 1.000E-01 2.000E-01
+ 3.000E-01 5.000E-01 9.000E-01 1.000E+00 1.100E+00 1.300E+00
+ 1.500E+00 2.000E+00 2.500E+00 3.000E+00 3.500E+00 4.000E+00
+ 5.000E+00 6.000E+00 7.500E+00 1.000E+01 1.500E+01 2.500E+01
+ 5.000E+01 7.500E+01 1.000E+02 1.500E+02 2.000E+02 2.500E+02
+ 5.000E+02 1.000E+03
+DF1036 9.805E+00 9.770E+00 9.775E+00 9.748E+00 9.739E+00 9.707E+00
+ 9.697E+00 9.663E+00 9.543E+00 9.425E+00 9.298E+00 9.179E+00
+ 9.041E+00 8.910E+00 8.764E+00 8.628E+00 8.481E+00 6.980E+00
+ 5.626E+00 3.864E+00 2.490E+00 2.326E+00 2.198E+00 1.997E+00
+ 1.860E+00 1.638E+00 1.518E+00 1.432E+00 1.370E+00 1.330E+00
+ 1.261E+00 1.218E+00 1.175E+00 1.130E+00 1.086E+00 1.047E+00
+ 1.026E+00 1.013E+00 1.011E+00 1.002E+00 1.002E+00 1.002E+00
+ 9.993E-01 9.977E-01
+C
+FC1046 Proton (1H+) zf x RBE x RBE (intra-track) term (aerobic cells)
+F1046:H 3
+FM1046 0.1602
+DE1046 1.000E-03 2.000E-03 3.000E-03 4.000E-03 5.000E-03 6.470E-03
+ 7.500E-03 1.000E-02 2.000E-02 3.000E-02 4.000E-02 5.000E-02
+ 6.000E-02 7.000E-02 8.000E-02 9.000E-02 1.000E-01 2.000E-01
+ 3.000E-01 5.000E-01 9.000E-01 1.000E+00 1.100E+00 1.300E+00
+ 1.500E+00 2.000E+00 2.500E+00 3.000E+00 3.500E+00 4.000E+00
+ 5.000E+00 6.000E+00 7.500E+00 1.000E+01 1.500E+01 2.500E+01
+ 5.000E+01 7.500E+01 1.000E+02 1.500E+02 2.000E+02 2.500E+02
+ 5.000E+02 1.000E+03
+DF1046 2.763E-02 5.499E-02 8.253E-02 1.097E-01 1.368E-01 1.762E-01
+ 2.037E-01 2.703E-01 5.322E-01 7.841E-01 1.028E+00 1.264E+00
+ 1.489E+00 1.708E+00 1.914E+00 2.112E+00 2.305E+00 3.632E+00
+ 3.789E+00 2.156E+00 9.674E-01 8.307E-01 7.276E-01 5.731E-01
+ 4.697E-01 3.144E-01 2.336E-01 1.845E-01 1.517E-01 1.285E-01
+ 9.884E-02 7.986E-02 6.226E-02 4.581E-02 3.059E-02 1.899E-02
+ 1.041E-02 7.456E-03 5.977E-03 4.434E-03 3.683E-03 3.211E-03
+ 2.275E-03 1.823E-03
+C
+C
+FC1056 Proton (1H+) zf x RBE x RBE (intra-track) term (aerobic cells)
+F1056:H 3
+FM1056 0.1602
+DE1056 1.000E-03 2.000E-03 3.000E-03 4.000E-03 5.000E-03 6.470E-03
+ 7.500E-03 1.000E-02 2.000E-02 3.000E-02 4.000E-02 5.000E-02
+ 6.000E-02 7.000E-02 8.000E-02 9.000E-02 1.000E-01 2.000E-01
+ 3.000E-01 5.000E-01 9.000E-01 1.000E+00 1.100E+00 1.300E+00
+ 1.500E+00 2.000E+00 2.500E+00 3.000E+00 3.500E+00 4.000E+00
+ 5.000E+00 6.000E+00 7.500E+00 1.000E+01 1.500E+01 2.500E+01
+ 5.000E+01 7.500E+01 1.000E+02 1.500E+02 2.000E+02 2.500E+02
+ 5.000E+02 1.000E+03
+DF1056 2.327E-01 4.620E-01 6.936E-01 9.196E-01 1.147E+00 1.475E+00
+ 1.705E+00 2.258E+00 4.397E+00 6.423E+00 8.319E+00 1.011E+01
+ 1.174E+01 1.327E+01 1.462E+01 1.588E+01 1.698E+01 2.115E+01
+ 1.657E+01 5.719E+00 1.518E+00 1.221E+00 1.014E+00 7.361E-01
+ 5.716E-01 3.541E-01 2.554E-01 1.967E-01 1.592E-01 1.348E-01
+ 1.014E-01 8.161E-02 6.333E-02 4.635E-02 3.069E-02 1.884E-02
+ 1.039E-02 7.400E-03 5.952E-03 4.402E-03 3.665E-03 3.198E-03
+ 2.261E-03 1.813E-03
+C
+FC1066 Dose-weighted frequency-mean specific energy (ndia=5 um)
+F1066:H 3
+FM1066 0.1602
+DE1066 1.000E-03 2.000E-03 3.000E-03 4.000E-03 5.000E-03 6.470E-03
+ 7.500E-03 1.000E-02 2.000E-02 3.000E-02 4.000E-02 5.000E-02
+ 6.000E-02 7.000E-02 8.000E-02 9.000E-02 1.000E-01 2.000E-01
+ 3.000E-01 5.000E-01 9.000E-01 1.000E+00 1.100E+00 1.300E+00
+ 1.500E+00 2.000E+00 2.500E+00 3.000E+00 3.500E+00 4.000E+00
+ 5.000E+00 6.000E+00 7.500E+00 1.000E+01 1.500E+01 2.500E+01
+ 5.000E+01 7.500E+01 1.000E+02 1.500E+02 2.000E+02 2.500E+02
+ 5.000E+02 1.000E+03
+DF1066 2.448E-03 4.895E-03 7.341E-03 9.787E-03 1.223E-02 1.582E-02
+ 1.834E-02 2.445E-02 4.882E-02 7.312E-02 9.731E-02 1.214E-01
+ 1.453E-01 1.690E-01 1.925E-01 2.157E-01 2.387E-01 4.390E-01
+ 5.295E-01 3.873E-01 2.475E-01 2.283E-01 2.122E-01 1.866E-01
+ 1.670E-01 1.335E-01 1.120E-01 9.695E-02 8.576E-02 7.707E-02
+ 6.442E-02 5.559E-02 4.638E-02 3.668E-02 2.633E-02 1.736E-02
+ 9.971E-03 7.294E-03 5.893E-03 4.437E-03 3.690E-03 3.220E-03
+ 2.290E-03 1.842E-03
+C
+FC1076 Dose-weighted proton (1H+) stopping power (keV/um)
+F1076:H 3
+FM1076 0.1602
+DE1076 1.000E-03 2.000E-03 3.000E-03 4.000E-03 5.000E-03 6.470E-03
+ 7.500E-03 1.000E-02 2.000E-02 3.000E-02 4.000E-02 5.000E-02
+ 6.000E-02 7.000E-02 8.000E-02 9.000E-02 1.000E-01 2.000E-01
+ 3.000E-01 5.000E-01 9.000E-01 1.000E+00 1.100E+00 1.300E+00
+ 1.500E+00 2.000E+00 2.500E+00 3.000E+00 3.500E+00 4.000E+00
+ 5.000E+00 6.000E+00 7.500E+00 1.000E+01 1.500E+01 2.500E+01
+ 5.000E+01 7.500E+01 1.000E+02 1.500E+02 2.000E+02 2.500E+02
+ 5.000E+02 1.000E+03
+DF1076 1.737E+01 2.111E+01 2.474E+01 2.815E+01 3.134E+01 3.562E+01
+ 3.836E+01 4.424E+01 6.013E+01 6.883E+01 7.375E+01 7.647E+01
+ 7.782E+01 7.829E+01 7.819E+01 7.769E+01 7.694E+01 6.559E+01
+ 5.559E+01 4.236E+01 2.899E+01 2.694E+01 2.518E+01 2.232E+01
+ 2.008E+01 1.617E+01 1.362E+01 1.181E+01 1.046E+01 9.413E+00
+ 7.876E+00 6.802E+00 5.678E+00 4.493E+00 3.227E+00 2.128E+00
+ 1.222E+00 8.940E-01 7.223E-01 5.438E-01 4.514E-01 3.949E-01
+ 2.803E-01 2.257E-01
+C
+FC1086 Dose-weighted proton (1H+) low dose RBE (abr = 1 Gy, 100% O2)
+F1086:H 3
+FM1086 0.1602
+DE1086 1.000E-03 2.000E-03 3.000E-03 4.000E-03 5.000E-03 6.470E-03
+ 7.500E-03 1.000E-02 2.000E-02 3.000E-02 4.000E-02 5.000E-02
+ 6.000E-02 7.000E-02 8.000E-02 9.000E-02 1.000E-01 2.000E-01
+ 3.000E-01 5.000E-01 9.000E-01 1.000E+00 1.100E+00 1.300E+00
+ 1.500E+00 2.000E+00 2.500E+00 3.000E+00 3.500E+00 4.000E+00
+ 5.000E+00 6.000E+00 7.500E+00 1.000E+01 1.500E+01 2.500E+01
+ 5.000E+01 7.500E+01 1.000E+02 1.500E+02 2.000E+02 2.500E+02
+ 5.000E+02 1.000E+03
+DF1086 3.415E+00 3.462E+00 3.519E+00 3.568E+00 3.619E+00 3.691E+00
+ 3.742E+00 3.868E+00 4.370E+00 4.849E+00 5.313E+00 5.766E+00
+ 6.190E+00 6.608E+00 6.997E+00 7.368E+00 7.737E+00 1.017E+01
+ 1.028E+01 6.689E+00 3.919E+00 3.576E+00 3.312E+00 2.903E+00
+ 2.620E+00 2.166E+00 1.913E+00 1.750E+00 1.634E+00 1.549E+00
+ 1.437E+00 1.359E+00 1.284E+00 1.209E+00 1.139E+00 1.084E+00
+ 1.043E+00 1.026E+00 1.019E+00 1.009E+00 1.006E+00 1.005E+00
+ 1.001E+00 9.986E-01
+C
+FC1096 Dose-weighted proton (1H+) low dose RBE (abr = 3 Gy, 100% O2)
+F1096:H 3
+FM1096 0.1602
+DE1096 1.000E-03 2.000E-03 3.000E-03 4.000E-03 5.000E-03 6.470E-03
+ 7.500E-03 1.000E-02 2.000E-02 3.000E-02 4.000E-02 5.000E-02
+ 6.000E-02 7.000E-02 8.000E-02 9.000E-02 1.000E-01 2.000E-01
+ 3.000E-01 5.000E-01 9.000E-01 1.000E+00 1.100E+00 1.300E+00
+ 1.500E+00 2.000E+00 2.500E+00 3.000E+00 3.500E+00 4.000E+00
+ 5.000E+00 6.000E+00 7.500E+00 1.000E+01 1.500E+01 2.500E+01
+ 5.000E+01 7.500E+01 1.000E+02 1.500E+02 2.000E+02 2.500E+02
+ 5.000E+02 1.000E+03
+DF1096 3.378E+00 3.389E+00 3.408E+00 3.421E+00 3.435E+00 3.455E+00
+ 3.469E+00 3.506E+00 3.657E+00 3.798E+00 3.936E+00 4.071E+00
+ 4.195E+00 4.319E+00 4.432E+00 4.538E+00 4.647E+00 5.301E+00
+ 5.204E+00 3.799E+00 2.623E+00 2.462E+00 2.337E+00 2.135E+00
+ 1.991E+00 1.745E+00 1.600E+00 1.503E+00 1.431E+00 1.377E+00
+ 1.305E+00 1.252E+00 1.200E+00 1.148E+00 1.098E+00 1.058E+00
+ 1.029E+00 1.016E+00 1.011E+00 1.003E+00 1.002E+00 1.001E+00
+ 9.982E-01 9.962E-01
+C
+C
+FC1106 Dose-weighted proton (1H+) low dose RBE (abr = 5 Gy, 100% O2)
+F1106:H 3
+FM1106 0.1602
+DE1106 1.000E-03 2.000E-03 3.000E-03 4.000E-03 5.000E-03 6.470E-03
+ 7.500E-03 1.000E-02 2.000E-02 3.000E-02 4.000E-02 5.000E-02
+ 6.000E-02 7.000E-02 8.000E-02 9.000E-02 1.000E-01 2.000E-01
+ 3.000E-01 5.000E-01 9.000E-01 1.000E+00 1.100E+00 1.300E+00
+ 1.500E+00 2.000E+00 2.500E+00 3.000E+00 3.500E+00 4.000E+00
+ 5.000E+00 6.000E+00 7.500E+00 1.000E+01 1.500E+01 2.500E+01
+ 5.000E+01 7.500E+01 1.000E+02 1.500E+02 2.000E+02 2.500E+02
+ 5.000E+02 1.000E+03
+DF1106 3.371E+00 3.374E+00 3.386E+00 3.391E+00 3.399E+00 3.408E+00
+ 3.414E+00 3.433E+00 3.515E+00 3.589E+00 3.661E+00 3.733E+00
+ 3.797E+00 3.862E+00 3.920E+00 3.974E+00 4.031E+00 4.330E+00
+ 4.192E+00 3.223E+00 2.364E+00 2.240E+00 2.143E+00 1.982E+00
+ 1.865E+00 1.661E+00 1.538E+00 1.454E+00 1.391E+00 1.343E+00
+ 1.278E+00 1.231E+00 1.184E+00 1.136E+00 1.090E+00 1.053E+00
+ 1.026E+00 1.014E+00 1.009E+00 1.002E+00 1.001E+00 9.999E-01
+ 9.976E-01 9.957E-01
+C
+FC1116 Dose-weighted proton (1H+) low dose RBE (abr = 10 Gy, 100% O2)
+F1116:H 3
+FM1116 0.1602
+DE1116 1.000E-03 2.000E-03 3.000E-03 4.000E-03 5.000E-03 6.470E-03
+ 7.500E-03 1.000E-02 2.000E-02 3.000E-02 4.000E-02 5.000E-02
+ 6.000E-02 7.000E-02 8.000E-02 9.000E-02 1.000E-01 2.000E-01
+ 3.000E-01 5.000E-01 9.000E-01 1.000E+00 1.100E+00 1.300E+00
+ 1.500E+00 2.000E+00 2.500E+00 3.000E+00 3.500E+00 4.000E+00
+ 5.000E+00 6.000E+00 7.500E+00 1.000E+01 1.500E+01 2.500E+01
+ 5.000E+01 7.500E+01 1.000E+02 1.500E+02 2.000E+02 2.500E+02
+ 5.000E+02 1.000E+03
+DF1116 3.365E+00 3.363E+00 3.369E+00 3.369E+00 3.371E+00 3.372E+00
+ 3.373E+00 3.379E+00 3.408E+00 3.432E+00 3.455E+00 3.480E+00
+ 3.499E+00 3.520E+00 3.537E+00 3.551E+00 3.569E+00 3.603E+00
+ 3.433E+00 2.791E+00 2.171E+00 2.074E+00 1.997E+00 1.867E+00
+ 1.771E+00 1.598E+00 1.491E+00 1.417E+00 1.360E+00 1.317E+00
+ 1.259E+00 1.215E+00 1.171E+00 1.127E+00 1.084E+00 1.050E+00
+ 1.024E+00 1.012E+00 1.008E+00 1.001E+00 9.998E-01 9.992E-01
+ 9.971E-01 9.953E-01
+C
+C *** ------------------------------------------------------------
diff --git a/MCNP/RBEfactors/additionalMat/MCDS_data/reference.txt b/MCNP/RBEfactors/additionalMat/MCDS_data/reference.txt
new file mode 100644
index 000000000..2801ead6f
--- /dev/null
+++ b/MCNP/RBEfactors/additionalMat/MCDS_data/reference.txt
@@ -0,0 +1,3 @@
+http://faculty.washington.edu/trawets/mcds/
+
+Date: 03/10/2020
diff --git a/MCNP/RBEfactors/additionalMat/MCDS_data/triton.txt b/MCNP/RBEfactors/additionalMat/MCDS_data/triton.txt
new file mode 100644
index 000000000..11a24ad38
--- /dev/null
+++ b/MCNP/RBEfactors/additionalMat/MCDS_data/triton.txt
@@ -0,0 +1,133 @@
+2H DOSE-RESPONSE FUNCTIONS FOR USE IN MCNPX (August 23, 2013)
+Data generated by RDS using MCDS Version 3.10A 05-DEC-2011
+
+C *** ============================================================
+C *** Triton (3H+) DOSE, RBE AND RELATED TALLIES
+C *** ------------------------------------------------------------
+FC3016 Triton (3H+) Absorbed Dose
+F3016:T 3
+FM3016 0.1602
+C
+FC3026 RBE-weighted Triton (3H+) dose; DSB induction (aerobic)
+F3026:T 3
+FM3026 0.1602
+DE3026 1.000E-03 2.000E-03 3.000E-03 4.000E-03 5.000E-03 6.470E-03
+ 7.500E-03 1.000E-02 2.000E-02 3.000E-02 4.000E-02 5.000E-02
+ 6.000E-02 7.000E-02 8.000E-02 9.000E-02 1.000E-01 2.000E-01
+ 3.000E-01 5.000E-01 9.000E-01 1.000E+00 1.100E+00 1.300E+00
+ 1.500E+00 2.000E+00 2.500E+00 3.000E+00 3.500E+00 4.000E+00
+ 5.000E+00 6.000E+00 7.500E+00 1.000E+01 1.500E+01 2.500E+01
+ 5.000E+01 7.500E+01 1.000E+02 1.500E+02 2.000E+02 2.500E+02
+ 5.000E+02 1.000E+03
+DF3026 3.362E+00 3.359E+00 3.360E+00 3.355E+00 3.357E+00 3.353E+00
+ 3.354E+00 3.348E+00 3.336E+00 3.329E+00 3.318E+00 3.307E+00
+ 3.302E+00 3.293E+00 3.282E+00 3.274E+00 3.267E+00 3.185E+00
+ 3.107E+00 2.950E+00 2.673E+00 2.617E+00 2.556E+00 2.456E+00
+ 2.363E+00 2.169E+00 2.022E+00 1.907E+00 1.812E+00 1.737E+00
+ 1.619E+00 1.535E+00 1.443E+00 1.343E+00 1.237E+00 1.146E+00
+ 1.072E+00 1.041E+00 1.030E+00 1.019E+00 1.012E+00 1.007E+00
+ 1.001E+00 9.965E-01
+
+C
+FC3036 RBE-weighted Triton (3H+) dose; DSB induction (anoxic)
+F3036:T 3
+FM3036 0.1602
+DE3036 1.000E-03 2.000E-03 3.000E-03 4.000E-03 5.000E-03 6.470E-03
+ 7.500E-03 1.000E-02 2.000E-02 3.000E-02 4.000E-02 5.000E-02
+ 6.000E-02 7.000E-02 8.000E-02 9.000E-02 1.000E-01 2.000E-01
+ 3.000E-01 5.000E-01 9.000E-01 1.000E+00 1.100E+00 1.300E+00
+ 1.500E+00 2.000E+00 2.500E+00 3.000E+00 3.500E+00 4.000E+00
+ 5.000E+00 6.000E+00 7.500E+00 1.000E+01 1.500E+01 2.500E+01
+ 5.000E+01 7.500E+01 1.000E+02 1.500E+02 2.000E+02 2.500E+02
+ 5.000E+02 1.000E+03
+DF3036 9.755E+00 9.748E+00 9.750E+00 9.727E+00 9.732E+00 9.719E+00
+ 9.724E+00 9.696E+00 9.651E+00 9.621E+00 9.570E+00 9.528E+00
+ 9.490E+00 9.456E+00 9.401E+00 9.370E+00 9.325E+00 8.900E+00
+ 8.430E+00 7.427E+00 5.593E+00 5.218E+00 4.865E+00 4.303E+00
+ 3.843E+00 3.057E+00 2.600E+00 2.312E+00 2.098E+00 1.951E+00
+ 1.763E+00 1.635E+00 1.505E+00 1.372E+00 1.255E+00 1.154E+00
+ 1.073E+00 1.041E+00 1.030E+00 1.014E+00 1.011E+00 1.004E+00
+ 9.995E-01 9.979E-01
+C
+FC3046 Triton (3H+) intra-track RMF interaction term (aerobic cells)
+F3046:T 3
+FM3046 0.1602
+DE3046 1.000E-03 2.000E-03 3.000E-03 4.000E-03 5.000E-03 6.470E-03
+ 7.500E-03 1.000E-02 2.000E-02 3.000E-02 4.000E-02 5.000E-02
+ 6.000E-02 7.000E-02 8.000E-02 9.000E-02 1.000E-01 2.000E-01
+ 3.000E-01 5.000E-01 9.000E-01 1.000E+00 1.100E+00 1.300E+00
+ 1.500E+00 2.000E+00 2.500E+00 3.000E+00 3.500E+00 4.000E+00
+ 5.000E+00 6.000E+00 7.500E+00 1.000E+01 1.500E+01 2.500E+01
+ 5.000E+01 7.500E+01 1.000E+02 1.500E+02 2.000E+02 2.500E+02
+ 5.000E+02 1.000E+03
+DF3046 1.913E+00 3.821E+00 5.732E+00 7.619E+00 9.528E+00 1.229E+01
+ 1.426E+01 1.892E+01 3.742E+01 5.565E+01 7.340E+01 9.080E+01
+ 1.081E+02 1.248E+02 1.409E+02 1.571E+02 1.727E+02 3.043E+02
+ 3.803E+02 3.650E+02 2.375E+02 2.152E+02 1.946E+02 1.628E+02
+ 1.379E+02 9.612E+01 7.155E+01 5.589E+01 4.509E+01 3.752E+01
+ 2.757E+01 2.153E+01 1.601E+01 1.107E+01 6.795E+00 3.857E+00
+ 1.917E+00 1.300E+00 1.008E+00 7.148E-01 5.645E-01 4.719E-01
+ 2.862E-01 1.890E-01
+C
+FC3056 Triton (3H+) intra-track RMF interaction term (anoxic cells)
+F3056:T 3
+FM3056 0.1602
+DE3056 1.000E-03 2.000E-03 3.000E-03 4.000E-03 5.000E-03 6.470E-03
+ 7.500E-03 1.000E-02 2.000E-02 3.000E-02 4.000E-02 5.000E-02
+ 6.000E-02 7.000E-02 8.000E-02 9.000E-02 1.000E-01 2.000E-01
+ 3.000E-01 5.000E-01 9.000E-01 1.000E+00 1.100E+00 1.300E+00
+ 1.500E+00 2.000E+00 2.500E+00 3.000E+00 3.500E+00 4.000E+00
+ 5.000E+00 6.000E+00 7.500E+00 1.000E+01 1.500E+01 2.500E+01
+ 5.000E+01 7.500E+01 1.000E+02 1.500E+02 2.000E+02 2.500E+02
+ 5.000E+02 1.000E+03
+DF3056 1.902E+00 3.799E+00 5.700E+00 7.562E+00 9.454E+00 1.220E+01
+ 1.415E+01 1.874E+01 3.698E+01 5.489E+01 7.211E+01 8.900E+01
+ 1.054E+02 1.215E+02 1.366E+02 1.519E+02 1.662E+02 2.807E+02
+ 3.307E+02 2.732E+02 1.229E+02 1.011E+02 8.324E+01 5.901E+01
+ 4.304E+01 2.255E+01 1.397E+01 9.697E+00 7.136E+00 5.591E+00
+ 3.858E+00 2.885E+00 2.059E+00 1.364E+00 8.257E-01 4.618E-01
+ 2.269E-01 1.533E-01 1.190E-01 8.357E-02 6.650E-02 5.538E-02
+ 3.372E-02 2.239E-02
+C
+FC3066 Dose-weighted frequency-mean specific energy (ndia=5 um)
+F3066:T 3
+FM3066 0.1602
+DE3066 1.000E-03 2.000E-03 3.000E-03 4.000E-03 5.000E-03 6.470E-03
+ 7.500E-03 1.000E-02 2.000E-02 3.000E-02 4.000E-02 5.000E-02
+ 6.000E-02 7.000E-02 8.000E-02 9.000E-02 1.000E-01 2.000E-01
+ 3.000E-01 5.000E-01 9.000E-01 1.000E+00 1.100E+00 1.300E+00
+ 1.500E+00 2.000E+00 2.500E+00 3.000E+00 3.500E+00 4.000E+00
+ 5.000E+00 6.000E+00 7.500E+00 1.000E+01 1.500E+01 2.500E+01
+ 5.000E+01 7.500E+01 1.000E+02 1.500E+02 2.000E+02 2.500E+02
+ 5.000E+02 1.000E+03
+DF3066 2.447E-03 4.894E-03 7.340E-03 9.783E-03 1.222E-02 1.581E-02
+ 1.832E-02 2.440E-02 4.860E-02 7.259E-02 9.638E-02 1.200E-01
+ 1.433E-01 1.664E-01 1.892E-01 2.118E-01 2.340E-01 4.338E-01
+ 5.696E-01 6.062E-01 4.807E-01 4.543E-01 4.306E-01 3.900E-01
+ 3.568E-01 2.953E-01 2.530E-01 2.221E-01 1.985E-01 1.798E-01
+ 1.520E-01 1.322E-01 1.112E-01 8.872E-02 6.420E-02 4.247E-02
+ 2.412E-02 1.733E-02 1.374E-02 9.955E-03 7.965E-03 6.729E-03
+ 4.132E-03 2.752E-03
+C
+FC3076 Dose-weighted Triton (3H+) stopping power (keV/um)
+F3076:T 3
+FM3076 0.1602
+DE3076 1.000E-03 2.000E-03 3.000E-03 4.000E-03 5.000E-03 6.470E-03
+ 7.500E-03 1.000E-02 2.000E-02 3.000E-02 4.000E-02 5.000E-02
+ 6.000E-02 7.000E-02 8.000E-02 9.000E-02 1.000E-01 2.000E-01
+ 3.000E-01 5.000E-01 9.000E-01 1.000E+00 1.100E+00 1.300E+00
+ 1.500E+00 2.000E+00 2.500E+00 3.000E+00 3.500E+00 4.000E+00
+ 5.000E+00 6.000E+00 7.500E+00 1.000E+01 1.500E+01 2.500E+01
+ 5.000E+01 7.500E+01 1.000E+02 1.500E+02 2.000E+02 2.500E+02
+ 5.000E+02 1.000E+03
+DF3076 1.502E+01 1.616E+01 1.738E+01 1.863E+01 1.988E+01 2.171E+01
+ 2.297E+01 2.593E+01 3.619E+01 4.429E+01 5.074E+01 5.594E+01
+ 6.017E+01 6.365E+01 6.651E+01 6.887E+01 7.083E+01 7.822E+01
+ 7.692E+01 6.944E+01 5.554E+01 5.279E+01 5.029E+01 4.594E+01
+ 4.230E+01 3.539E+01 3.052E+01 2.690E+01 2.410E+01 2.187E+01
+ 1.853E+01 1.614E+01 1.360E+01 1.086E+01 7.863E+00 5.203E+00
+ 2.955E+00 2.124E+00 1.684E+00 1.220E+00 9.762E-01 8.248E-01
+ 5.064E-01 3.373E-01
+C *** ------------------------------------------------------------
+
+
diff --git a/MCNP/RBEfactors/additionalMat/MCDS_multiplierUnmodified/MCDS_3HeIntraTrack_intraT_aerobic.txt b/MCNP/RBEfactors/additionalMat/MCDS_multiplierUnmodified/MCDS_3HeIntraTrack_intraT_aerobic.txt
new file mode 100644
index 000000000..089b73907
--- /dev/null
+++ b/MCNP/RBEfactors/additionalMat/MCDS_multiplierUnmodified/MCDS_3HeIntraTrack_intraT_aerobic.txt
@@ -0,0 +1,125 @@
+0.001 0.028
+0.0015 0.042
+0.002 0.056
+0.0025 0.0699
+0.003 0.0839
+0.004 0.1119
+0.005 0.1397
+0.006 0.1678
+0.007 0.1955
+0.008 0.2233
+0.009 0.251
+0.01 0.2788
+0.0125 0.3485
+0.015 0.4181
+0.0175 0.4871
+0.02 0.5564
+0.0225 0.6253
+0.025 0.6946
+0.0275 0.7628
+0.03 0.8324
+0.035 0.9698
+0.04 1.1063
+0.045 1.2421
+0.05 1.3802
+0.055 1.5146
+0.06 1.6508
+0.065 1.7857
+0.07 1.9204
+0.075 2.0563
+0.08 2.1896
+0.085 2.3242
+0.09 2.4587
+0.095 2.5872
+0.1 2.7198
+0.125 3.3822
+0.15 4.0218
+0.175 4.6759
+0.2 5.2922
+0.225 5.9174
+0.25 6.5298
+0.275 7.124
+0.3 7.721
+0.35 8.8705
+0.4 9.9711
+0.45 11.0224
+0.5 12.0291
+0.55 12.961
+0.6 13.8152
+0.65 14.5917
+0.7 15.3122
+0.75 15.9025
+0.8 16.3794
+0.85 16.7657
+0.9 17.033
+0.95 17.2042
+1 17.2708
+1.25 16.2802
+1.5 14.2919
+1.75 12.4501
+2 10.9328
+2.25 9.7009
+2.5 8.6935
+2.75 7.8305
+3 7.1188
+3.5 5.9577
+4 5.0844
+4.5 4.3877
+5 3.8324
+5.5 3.3809
+6 3.0042
+6.5 2.696
+7 2.4339
+7.5 2.21
+8 2.0146
+8.5 1.8543
+9 1.7087
+9.5 1.5816
+10 1.4693
+12.5 1.0611
+15 0.8156
+17.5 0.6527
+20 0.5408
+25 0.3966
+27.5 0.3486
+30 0.3097
+35 0.2527
+40 0.2123
+45 0.1837
+50 0.1615
+55 0.144
+60 0.1298
+65 0.1181
+70 0.1087
+75 0.1004
+80 0.0937
+85 0.0878
+90 0.0825
+95 0.0777
+100 0.0736
+125 0.0586
+150 0.0488
+175 0.0422
+200 0.0373
+225 0.0335
+250 0.0306
+275 0.0285
+300 0.0261
+350 0.0231
+400 0.0207
+450 0.019
+500 0.0175
+550 0.0163
+600 0.0154
+650 0.0146
+700 0.0138
+750 0.0132
+800 0.0127
+850 0.0122
+900 0.0118
+950 0.0115
+1000 0.0111
+2000 0.008
+5000 0.0064
+7500 0.0061
+10000 0.006
diff --git a/MCNP/RBEfactors/additionalMat/MCDS_multiplierUnmodified/MCDS_3HeIntraTrack_intraT_anoxic.txt b/MCNP/RBEfactors/additionalMat/MCDS_multiplierUnmodified/MCDS_3HeIntraTrack_intraT_anoxic.txt
new file mode 100644
index 000000000..9b9f051db
--- /dev/null
+++ b/MCNP/RBEfactors/additionalMat/MCDS_multiplierUnmodified/MCDS_3HeIntraTrack_intraT_anoxic.txt
@@ -0,0 +1,125 @@
+0.001 0.2367
+0.0015 0.3549
+0.002 0.4732
+0.0025 0.5913
+0.003 0.709
+0.004 0.9457
+0.005 1.1806
+0.006 1.4182
+0.007 1.6529
+0.008 1.888
+0.009 2.1212
+0.01 2.3568
+0.0125 2.947
+0.015 3.5345
+0.0175 4.11
+0.02 4.6944
+0.0225 5.2776
+0.025 5.8604
+0.0275 6.4407
+0.03 7.0177
+0.035 8.1812
+0.04 9.3362
+0.045 10.4821
+0.05 11.6451
+0.055 12.776
+0.06 13.9303
+0.065 15.0406
+0.07 16.1652
+0.075 17.313
+0.08 18.4381
+0.085 19.5754
+0.09 20.709
+0.095 21.7934
+0.1 22.9056
+0.125 28.4127
+0.15 33.8013
+0.175 39.2099
+0.2 44.379
+0.225 49.5161
+0.25 54.5221
+0.275 59.5121
+0.3 64.3612
+0.35 73.7883
+0.4 82.5779
+0.45 91.0901
+0.5 98.9264
+0.55 106.1366
+0.6 112.8532
+0.65 118.6742
+0.7 123.9428
+0.75 128.116
+0.8 131.3319
+0.85 133.8504
+0.9 134.9742
+0.95 135.6765
+1 135.5118
+1.25 123.6604
+1.5 104.3501
+1.75 86.9217
+2 72.7414
+2.25 61.2827
+2.5 51.883
+2.75 44.2407
+3 37.9305
+3.5 27.9604
+4 21.1603
+4.5 16.2385
+5 12.6518
+5.5 10.1006
+6 8.187
+6.5 6.7254
+7 5.6218
+7.5 4.7542
+8 4.0708
+8.5 3.5356
+9 3.1156
+9.5 2.74
+10 2.4488
+12.5 1.5236
+15 1.0705
+17.5 0.805
+20 0.6402
+25 0.4454
+27.5 0.3852
+30 0.3377
+35 0.27
+40 0.2248
+45 0.1919
+50 0.1676
+55 0.1491
+60 0.1333
+65 0.121
+70 0.1114
+75 0.1028
+80 0.0956
+85 0.0893
+90 0.0838
+95 0.079
+100 0.0746
+125 0.0593
+150 0.0489
+175 0.0424
+200 0.0375
+225 0.0336
+250 0.0306
+275 0.0285
+300 0.0261
+350 0.0231
+400 0.0207
+450 0.019
+500 0.0174
+550 0.0163
+600 0.0153
+650 0.0145
+700 0.0138
+750 0.0132
+800 0.0127
+850 0.0122
+900 0.0118
+950 0.0114
+1000 0.0112
+2000 0.008
+5000 0.0064
+7500 0.0061
+10000 0.006
diff --git a/MCNP/RBEfactors/additionalMat/MCDS_multiplierUnmodified/MCDS_3HeRBE_DSB_aerobic.txt b/MCNP/RBEfactors/additionalMat/MCDS_multiplierUnmodified/MCDS_3HeRBE_DSB_aerobic.txt
new file mode 100644
index 000000000..ca93d2c47
--- /dev/null
+++ b/MCNP/RBEfactors/additionalMat/MCDS_multiplierUnmodified/MCDS_3HeRBE_DSB_aerobic.txt
@@ -0,0 +1,126 @@
+0.001 3.381
+0.0015 3.38
+0.002 3.381
+0.0025 3.38
+0.003 3.379
+0.004 3.38
+0.005 3.377
+0.006 3.379
+0.007 3.377
+0.008 3.377
+0.009 3.375
+0.01 3.375
+0.0125 3.376
+0.015 3.376
+0.0175 3.374
+0.02 3.374
+0.0225 3.373
+0.025 3.373
+0.0275 3.371
+0.03 3.372
+0.035 3.37
+0.04 3.369
+0.045 3.367
+0.05 3.368
+0.055 3.366
+0.06 3.365
+0.065 3.364
+0.07 3.362
+0.075 3.364
+0.08 3.362
+0.085 3.362
+0.09 3.362
+0.095 3.358
+0.1 3.357
+0.125 3.354
+0.15 3.347
+0.175 3.347
+0.2 3.339
+0.225 3.336
+0.25 3.332
+0.275 3.326
+0.3 3.323
+0.35 3.314
+0.4 3.305
+0.45 3.296
+0.5 3.288
+0.55 3.28
+0.6 3.269
+0.65 3.259
+0.7 3.251
+0.75 3.241
+0.8 3.23
+0.85 3.22
+0.9 3.21
+0.95 3.201
+1 3.192
+1.25 3.143
+1.5 3.094
+1.75 3.046
+2 2.995
+2.25 2.946
+2.5 2.9
+2.75 2.851
+3 2.808
+3.5 2.722
+4 2.645
+4.5 2.57
+5 2.502
+5.5 2.437
+6 2.376
+6.5 2.323
+7 2.271
+7.5 2.223
+8 2.178
+8.5 2.139
+9 2.1
+9.5 2.064
+10 2.031
+12.5 1.885
+15 1.777
+17.5 1.691
+20 1.624
+25 1.521
+27.5 1.482
+30 1.447
+35 1.392
+40 1.347
+45 1.313
+50 1.285
+55 1.261
+60 1.24
+65 1.223
+70 1.208
+75 1.195
+80 1.185
+85 1.175
+90 1.165
+95 1.156
+100 1.149
+125 1.12
+150 1.099
+175 1.087
+200 1.076
+225 1.067
+250 1.061
+275 1.054
+300 1.05
+350 1.044
+375 1.041
+400 1.038
+450 1.035
+500 1.029
+550 1.027
+600 1.026
+650 1.023
+700 1.022
+750 1.02
+800 1.02
+850 1.018
+900 1.018
+950 1.016
+1000 1.015
+2000 1.007
+5000 1.004
+7500 1.004
+10000 1
diff --git a/MCNP/RBEfactors/additionalMat/MCDS_multiplierUnmodified/MCDS_3HeRBE_DSB_anoxic.txt b/MCNP/RBEfactors/additionalMat/MCDS_multiplierUnmodified/MCDS_3HeRBE_DSB_anoxic.txt
new file mode 100644
index 000000000..9d9e8cbe4
--- /dev/null
+++ b/MCNP/RBEfactors/additionalMat/MCDS_multiplierUnmodified/MCDS_3HeRBE_DSB_anoxic.txt
@@ -0,0 +1,125 @@
+0.001 9.827
+0.0015 9.825
+0.002 9.826
+0.0025 9.824
+0.003 9.821
+0.004 9.823
+0.005 9.814
+0.006 9.822
+0.007 9.817
+0.008 9.816
+0.009 9.811
+0.01 9.809
+0.0125 9.813
+0.015 9.813
+0.0175 9.798
+0.02 9.797
+0.0225 9.795
+0.025 9.794
+0.0275 9.788
+0.03 9.791
+0.035 9.788
+0.04 9.783
+0.045 9.777
+0.05 9.78
+0.055 9.773
+0.06 9.772
+0.065 9.76
+0.07 9.754
+0.075 9.758
+0.08 9.753
+0.085 9.753
+0.09 9.754
+0.095 9.743
+0.1 9.739
+0.125 9.721
+0.15 9.7
+0.175 9.692
+0.2 9.666
+0.225 9.647
+0.25 9.625
+0.275 9.61
+0.3 9.591
+0.35 9.555
+0.4 9.508
+0.45 9.472
+0.5 9.426
+0.55 9.383
+0.6 9.34
+0.65 9.291
+0.7 9.25
+0.75 9.196
+0.8 9.143
+0.85 9.095
+0.9 9.033
+0.95 8.986
+1 8.939
+1.25 8.659
+1.5 8.358
+1.75 8.046
+2 7.723
+2.25 7.402
+2.5 7.083
+2.75 6.775
+3 6.48
+3.5 5.895
+4 5.395
+4.5 4.943
+5 4.544
+5.5 4.212
+6 3.922
+6.5 3.667
+7 3.451
+7.5 3.26
+8 3.094
+8.5 2.953
+9 2.835
+9.5 2.717
+10 2.62
+12.5 2.258
+15 2.036
+17.5 1.878
+20 1.767
+25 1.612
+27.5 1.558
+30 1.511
+35 1.438
+40 1.385
+45 1.342
+50 1.309
+55 1.283
+60 1.257
+65 1.238
+70 1.224
+75 1.208
+80 1.196
+85 1.184
+90 1.174
+95 1.165
+100 1.156
+125 1.127
+150 1.1
+175 1.088
+200 1.078
+225 1.068
+250 1.061
+275 1.055
+300 1.049
+350 1.044
+400 1.037
+450 1.035
+500 1.028
+550 1.025
+600 1.024
+650 1.02
+700 1.021
+750 1.019
+800 1.019
+850 1.016
+900 1.015
+950 1.014
+1000 1.016
+2000 1.004
+5000 1.003
+7500 1.003
+10000 0.9996
diff --git a/MCNP/RBEfactors/additionalMat/MCDS_multiplierUnmodified/MCDS_alphaIntraTrack_intraT_aerobic.txt b/MCNP/RBEfactors/additionalMat/MCDS_multiplierUnmodified/MCDS_alphaIntraTrack_intraT_aerobic.txt
new file mode 100644
index 000000000..1159a86f2
--- /dev/null
+++ b/MCNP/RBEfactors/additionalMat/MCDS_multiplierUnmodified/MCDS_alphaIntraTrack_intraT_aerobic.txt
@@ -0,0 +1,125 @@
+0.001 0.028
+0.0015 0.042
+0.002 0.056
+0.0025 0.0699
+0.003 0.0839
+0.004 0.1119
+0.005 0.1397
+0.006 0.1678
+0.007 0.1955
+0.008 0.2233
+0.009 0.251
+0.01 0.2787
+0.0125 0.3485
+0.015 0.418
+0.0175 0.4868
+0.02 0.5561
+0.0225 0.625
+0.025 0.6941
+0.0275 0.7623
+0.03 0.8317
+0.035 0.9688
+0.04 1.1048
+0.045 1.2398
+0.05 1.3779
+0.055 1.5123
+0.06 1.6462
+0.065 1.7811
+0.07 1.9148
+0.075 2.0506
+0.08 2.1828
+0.085 2.3162
+0.09 2.4497
+0.095 2.577
+0.1 2.7085
+0.125 3.3631
+0.15 3.9949
+0.175 4.6377
+0.2 5.242
+0.225 5.8529
+0.25 6.4509
+0.275 7.0288
+0.3 7.6083
+0.35 8.72
+0.4 9.7842
+0.45 10.7996
+0.5 11.7695
+0.55 12.6704
+0.6 13.4944
+0.65 14.2516
+0.7 14.9735
+0.75 15.5661
+0.8 16.0766
+0.85 16.5064
+0.9 16.8577
+0.95 17.1529
+1 17.3625
+1.25 17.3378
+1.5 16.0832
+1.75 14.4462
+2 12.8806
+2.25 11.5421
+2.5 10.4188
+2.75 9.4272
+3 8.6085
+3.5 7.2494
+4 6.2158
+4.5 5.3839
+5 4.7163
+5.5 4.1708
+6 3.7138
+6.5 3.3382
+7 3.0182
+7.5 2.7431
+8 2.5037
+8.5 2.3067
+9 2.1272
+9.5 1.9705
+10 1.8315
+12.5 1.326
+15 1.0205
+17.5 0.8176
+20 0.6781
+25 0.4976
+27.5 0.4377
+30 0.3891
+35 0.3176
+40 0.2671
+45 0.231
+50 0.2033
+55 0.1811
+60 0.1632
+65 0.1486
+70 0.1367
+75 0.1263
+80 0.1179
+85 0.1103
+90 0.1037
+95 0.0976
+100 0.0925
+125 0.0735
+150 0.0612
+175 0.0528
+200 0.0465
+225 0.0417
+250 0.0381
+275 0.0353
+300 0.0323
+350 0.0284
+400 0.0254
+450 0.0232
+500 0.0213
+550 0.0198
+600 0.0186
+650 0.0175
+700 0.0166
+750 0.0158
+800 0.0152
+850 0.0145
+900 0.014
+950 0.0135
+1000 0.0131
+2000 0.009
+5000 0.0067
+7500 0.0063
+10000 0.0061
diff --git a/MCNP/RBEfactors/additionalMat/MCDS_multiplierUnmodified/MCDS_alphaIntraTrack_intraT_anoxic.txt b/MCNP/RBEfactors/additionalMat/MCDS_multiplierUnmodified/MCDS_alphaIntraTrack_intraT_anoxic.txt
new file mode 100644
index 000000000..b50f7d8e3
--- /dev/null
+++ b/MCNP/RBEfactors/additionalMat/MCDS_multiplierUnmodified/MCDS_alphaIntraTrack_intraT_anoxic.txt
@@ -0,0 +1,125 @@
+0.001 0.2367
+0.0015 0.3549
+0.002 0.4732
+0.0025 0.5913
+0.003 0.709
+0.004 0.9457
+0.005 1.1806
+0.006 1.4182
+0.007 1.6529
+0.008 1.888
+0.009 2.1212
+0.01 2.3559
+0.0125 2.947
+0.015 3.5335
+0.0175 4.1081
+0.02 4.6915
+0.0225 5.2747
+0.025 5.8556
+0.0275 6.4359
+0.03 7.0119
+0.035 8.1726
+0.04 9.3237
+0.045 10.4629
+0.05 11.626
+0.055 12.7569
+0.06 13.892
+0.065 15.0024
+0.07 16.1176
+0.075 17.2653
+0.08 18.3809
+0.085 19.5088
+0.09 20.6328
+0.095 21.7078
+0.1 22.8106
+0.125 28.2519
+0.15 33.5752
+0.175 38.8902
+0.2 43.958
+0.225 48.9756
+0.25 53.8635
+0.275 58.7168
+0.3 63.4217
+0.35 72.536
+0.4 81.0301
+0.45 89.2486
+0.5 96.7913
+0.55 103.7565
+0.6 110.2328
+0.65 115.9083
+0.7 121.2019
+0.75 125.4063
+0.8 128.9045
+0.85 131.7797
+0.9 133.5853
+0.95 135.2722
+1 136.2317
+1.25 131.6942
+1.5 117.4289
+1.75 100.8577
+2 85.701
+2.25 72.9138
+2.5 62.1793
+2.75 53.2617
+3 45.8681
+3.5 34.0222
+4 25.8691
+4.5 19.925
+5 15.5699
+5.5 12.4606
+6 10.121
+6.5 8.3273
+7 6.9715
+7.5 5.9013
+8 5.0591
+8.5 4.3983
+9 3.8786
+9.5 3.4138
+10 3.0524
+12.5 1.9041
+15 1.3394
+17.5 1.0084
+20 0.8027
+25 0.5589
+27.5 0.4837
+30 0.4243
+35 0.3394
+40 0.2828
+45 0.2413
+50 0.2109
+55 0.1875
+60 0.1678
+65 0.1522
+70 0.1401
+75 0.1293
+80 0.1203
+85 0.1122
+90 0.1053
+95 0.0993
+100 0.0938
+125 0.0744
+150 0.0613
+175 0.053
+200 0.0468
+225 0.0418
+250 0.0381
+275 0.0353
+300 0.0323
+350 0.0285
+400 0.0254
+450 0.0232
+500 0.0212
+550 0.0197
+600 0.0185
+650 0.0174
+700 0.0166
+750 0.0158
+800 0.0152
+850 0.0145
+900 0.014
+950 0.0135
+1000 0.0131
+2000 0.0089
+5000 0.0067
+7500 0.0063
+10000 0.0061
diff --git a/MCNP/RBEfactors/additionalMat/MCDS_multiplierUnmodified/MCDS_alphaRBE_DSB_aerobic.txt b/MCNP/RBEfactors/additionalMat/MCDS_multiplierUnmodified/MCDS_alphaRBE_DSB_aerobic.txt
new file mode 100644
index 000000000..9afbeffd8
--- /dev/null
+++ b/MCNP/RBEfactors/additionalMat/MCDS_multiplierUnmodified/MCDS_alphaRBE_DSB_aerobic.txt
@@ -0,0 +1,126 @@
+0.001 3.381
+0.0015 3.379
+0.002 3.381
+0.0025 3.38
+0.003 3.378
+0.004 3.379
+0.005 3.378
+0.006 3.377
+0.007 3.378
+0.008 3.378
+0.009 3.377
+0.01 3.377
+0.0125 3.377
+0.015 3.376
+0.0175 3.374
+0.02 3.375
+0.0225 3.375
+0.025 3.373
+0.0275 3.371
+0.03 3.372
+0.035 3.372
+0.04 3.37
+0.045 3.371
+0.05 3.37
+0.055 3.367
+0.06 3.368
+0.065 3.369
+0.07 3.365
+0.075 3.365
+0.08 3.366
+0.085 3.365
+0.09 3.364
+0.095 3.362
+0.1 3.362
+0.125 3.358
+0.15 3.355
+0.175 3.352
+0.2 3.349
+0.225 3.345
+0.25 3.342
+0.275 3.338
+0.3 3.334
+0.35 3.329
+0.4 3.323
+0.45 3.317
+0.5 3.309
+0.55 3.303
+0.6 3.294
+0.65 3.289
+0.7 3.283
+0.75 3.276
+0.8 3.27
+0.85 3.263
+0.9 3.253
+0.95 3.247
+1 3.239
+1.25 3.204
+1.5 3.165
+1.75 3.129
+2 3.092
+2.25 3.055
+2.5 3.018
+2.75 2.979
+3 2.945
+3.5 2.869
+4 2.804
+4.5 2.739
+5 2.679
+5.5 2.622
+6 2.567
+6.5 2.513
+7 2.466
+7.5 2.417
+8 2.373
+8.5 2.332
+9 2.291
+9.5 2.255
+10 2.222
+12.5 2.07
+15 1.948
+17.5 1.852
+20 1.774
+25 1.654
+27.5 1.607
+30 1.566
+35 1.5
+40 1.444
+45 1.402
+50 1.367
+55 1.338
+60 1.311
+65 1.288
+70 1.271
+75 1.254
+80 1.24
+85 1.224
+90 1.216
+95 1.204
+100 1.195
+125 1.158
+150 1.131
+175 1.115
+200 1.1
+225 1.088
+250 1.079
+275 1.072
+300 1.067
+350 1.057
+375 1.053
+400 1.051
+450 1.044
+500 1.041
+550 1.037
+600 1.031
+650 1.032
+700 1.029
+750 1.027
+800 1.027
+850 1.024
+900 1.022
+950 1.02
+1000 1.02
+2000 1.01
+5000 1.004
+7500 1.004
+10000 1.002
diff --git a/MCNP/RBEfactors/additionalMat/MCDS_multiplierUnmodified/MCDS_alphaRBE_DSB_anoxic.txt b/MCNP/RBEfactors/additionalMat/MCDS_multiplierUnmodified/MCDS_alphaRBE_DSB_anoxic.txt
new file mode 100644
index 000000000..171182f4e
--- /dev/null
+++ b/MCNP/RBEfactors/additionalMat/MCDS_multiplierUnmodified/MCDS_alphaRBE_DSB_anoxic.txt
@@ -0,0 +1,126 @@
+0.001 9.826
+0.0015 9.82
+0.002 9.828
+0.0025 9.823
+0.003 9.818
+0.004 9.821
+0.005 9.819
+0.006 9.815
+0.007 9.818
+0.008 9.82
+0.009 9.815
+0.01 9.816
+0.0125 9.817
+0.015 9.814
+0.0175 9.808
+0.02 9.81
+0.0225 9.799
+0.025 9.794
+0.0275 9.789
+0.03 9.792
+0.035 9.792
+0.04 9.785
+0.045 9.788
+0.05 9.786
+0.055 9.778
+0.06 9.781
+0.065 9.782
+0.07 9.772
+0.075 9.772
+0.08 9.773
+0.085 9.761
+0.09 9.758
+0.095 9.752
+0.1 9.753
+0.125 9.742
+0.15 9.723
+0.175 9.713
+0.2 9.705
+0.225 9.685
+0.25 9.677
+0.275 9.653
+0.3 9.642
+0.35 9.619
+0.4 9.592
+0.45 9.563
+0.5 9.53
+0.55 9.501
+0.6 9.467
+0.65 9.442
+0.7 9.402
+0.75 9.372
+0.8 9.344
+0.85 9.303
+0.9 9.264
+0.95 9.226
+1 9.191
+1.25 8.996
+1.5 8.787
+1.75 8.574
+2 8.344
+2.25 8.114
+2.5 7.871
+2.75 7.627
+3 7.388
+3.5 6.912
+4 6.457
+4.5 6.015
+5 5.619
+5.5 5.255
+6 4.925
+6.5 4.619
+7 4.357
+7.5 4.119
+8 3.898
+8.5 3.713
+9 3.543
+9.5 3.389
+10 3.25
+12.5 2.74
+15 2.405
+17.5 2.19
+20 2.03
+25 1.816
+27.5 1.736
+30 1.676
+35 1.582
+40 1.507
+45 1.455
+50 1.405
+55 1.372
+60 1.339
+65 1.313
+70 1.293
+75 1.274
+80 1.258
+85 1.24
+90 1.23
+95 1.221
+100 1.21
+125 1.167
+150 1.137
+175 1.121
+200 1.101
+225 1.088
+250 1.079
+275 1.074
+300 1.067
+350 1.059
+375 1.054
+400 1.049
+450 1.042
+500 1.039
+550 1.035
+600 1.031
+650 1.033
+700 1.027
+750 1.026
+800 1.027
+850 1.023
+900 1.022
+950 1.02
+1000 1.019
+2000 1.006
+5000 1.002
+7500 1.002
+10000 1
diff --git a/MCNP/RBEfactors/additionalMat/MCDS_multiplierUnmodified/MCDS_deuteronIntraTrack_intraT_aerobic.txt b/MCNP/RBEfactors/additionalMat/MCDS_multiplierUnmodified/MCDS_deuteronIntraTrack_intraT_aerobic.txt
new file mode 100644
index 000000000..a8740491f
--- /dev/null
+++ b/MCNP/RBEfactors/additionalMat/MCDS_multiplierUnmodified/MCDS_deuteronIntraTrack_intraT_aerobic.txt
@@ -0,0 +1,44 @@
+0.001 0.0276
+0.002 0.0553
+0.003 0.0826
+0.004 0.1099
+0.005 0.1376
+0.00647 0.1771
+0.0075 0.2055
+0.01 0.2731
+0.02 0.5384
+0.03 0.801
+0.04 1.0573
+0.05 1.3033
+0.06 1.5496
+0.07 1.7855
+0.08 2.0199
+0.09 2.2479
+0.1 2.4608
+0.2 4.2515
+0.3 5.1176
+0.5 4.1924
+0.9 2.2962
+1 2.0234
+1.1 1.7987
+1.3 1.4586
+1.5 1.2071
+2 0.8147
+2.5 0.597
+3 0.4654
+3.5 0.3749
+4 0.312
+5 0.2331
+6 0.1827
+7.5 0.1391
+10 0.0981
+15 0.0622
+25 0.0368
+50 0.0189
+75 0.0132
+100 0.0104
+150 0.0074
+200 0.006
+250 0.0051
+500 0.0032
+1000 0.0023
diff --git a/MCNP/RBEfactors/additionalMat/MCDS_multiplierUnmodified/MCDS_deuteronIntraTrack_intraT_anoxic.txt b/MCNP/RBEfactors/additionalMat/MCDS_multiplierUnmodified/MCDS_deuteronIntraTrack_intraT_anoxic.txt
new file mode 100644
index 000000000..bebe210fb
--- /dev/null
+++ b/MCNP/RBEfactors/additionalMat/MCDS_multiplierUnmodified/MCDS_deuteronIntraTrack_intraT_anoxic.txt
@@ -0,0 +1,44 @@
+0.001 0.2328
+0.002 0.4652
+0.003 0.6945
+0.004 0.9236
+0.005 1.1564
+0.00647 1.4851
+0.0075 1.7236
+0.01 2.2906
+0.02 4.4975
+0.03 6.6469
+0.04 8.737
+0.05 10.7219
+0.06 12.6907
+0.07 14.5224
+0.08 16.346
+0.09 18.0697
+0.1 19.705
+0.2 31.2886
+0.3 33.888
+0.5 21.1986
+0.9 6.7827
+1 5.3448
+1.1 4.3121
+1.3 2.967
+1.5 2.1661
+2 1.1922
+2.5 0.7748
+3 0.567
+3.5 0.4389
+4 0.3536
+5 0.2536
+6 0.1946
+7.5 0.1449
+10 0.1003
+15 0.0631
+25 0.0371
+50 0.019
+75 0.0132
+100 0.0103
+150 0.0074
+200 0.0059
+250 0.005
+500 0.0032
+1000 0.0023
diff --git a/MCNP/RBEfactors/additionalMat/MCDS_multiplierUnmodified/MCDS_deuteronRBE_DSB_aerobic.txt b/MCNP/RBEfactors/additionalMat/MCDS_multiplierUnmodified/MCDS_deuteronRBE_DSB_aerobic.txt
new file mode 100644
index 000000000..22341f4b1
--- /dev/null
+++ b/MCNP/RBEfactors/additionalMat/MCDS_multiplierUnmodified/MCDS_deuteronRBE_DSB_aerobic.txt
@@ -0,0 +1,44 @@
+0.001 3.361
+0.002 3.36
+0.003 3.355
+0.004 3.352
+0.005 3.354
+0.00647 3.346
+0.0075 3.348
+0.01 3.344
+0.02 3.325
+0.03 3.316
+0.04 3.304
+0.05 3.286
+0.06 3.277
+0.07 3.262
+0.08 3.252
+0.09 3.241
+0.1 3.225
+0.2 3.106
+0.3 2.988
+0.5 2.771
+0.9 2.428
+1 2.359
+1.1 2.296
+1.3 2.189
+1.5 2.094
+2 1.908
+2.5 1.774
+3 1.678
+3.5 1.597
+4 1.534
+5 1.446
+6 1.375
+7.5 1.311
+10 1.235
+15 1.159
+25 1.097
+50 1.044
+75 1.028
+100 1.02
+150 1.009
+200 1.006
+250 1.003
+500 0.9985
+1000 0.9967
diff --git a/MCNP/RBEfactors/additionalMat/MCDS_multiplierUnmodified/MCDS_deuteronRBE_DSB_anoxic.txt b/MCNP/RBEfactors/additionalMat/MCDS_multiplierUnmodified/MCDS_deuteronRBE_DSB_anoxic.txt
new file mode 100644
index 000000000..aae03ef10
--- /dev/null
+++ b/MCNP/RBEfactors/additionalMat/MCDS_multiplierUnmodified/MCDS_deuteronRBE_DSB_anoxic.txt
@@ -0,0 +1,44 @@
+0.001 9.754
+0.002 9.75
+0.003 9.727
+0.004 9.716
+0.005 9.724
+0.00647 9.689
+0.0075 9.697
+0.01 9.685
+0.02 9.61
+0.03 9.552
+0.04 9.498
+0.05 9.425
+0.06 9.378
+0.07 9.303
+0.08 9.251
+0.09 9.189
+0.1 9.126
+0.2 8.426
+0.3 7.689
+0.5 6.231
+0.9 4.173
+1 3.834
+1.1 3.555
+1.3 3.122
+1.5 2.805
+2 2.308
+2.5 2.021
+3 1.852
+3.5 1.728
+4 1.633
+5 1.508
+6 1.419
+7.5 1.338
+10 1.249
+15 1.167
+25 1.102
+50 1.047
+75 1.028
+100 1.016
+150 1.008
+200 1.004
+250 1.002
+500 0.9973
+1000 0.9937
diff --git a/MCNP/RBEfactors/additionalMat/MCDS_multiplierUnmodified/MCDS_electronIntraTrack_intraT_aerobic.txt b/MCNP/RBEfactors/additionalMat/MCDS_multiplierUnmodified/MCDS_electronIntraTrack_intraT_aerobic.txt
new file mode 100644
index 000000000..f78cb58f9
--- /dev/null
+++ b/MCNP/RBEfactors/additionalMat/MCDS_multiplierUnmodified/MCDS_electronIntraTrack_intraT_aerobic.txt
@@ -0,0 +1,45 @@
+1e-05 0.0003
+2e-05 0.0006
+3e-05 0.0008
+4e-05 0.0011
+5e-05 0.0013
+6e-05 0.0015
+7e-05 0.0017
+8e-05 0.0019
+9e-05 0.002
+0.0001 0.0022
+0.0002 0.0033
+0.0003 0.004
+0.0004 0.0044
+0.0005 0.0047
+0.0006 0.005
+0.0007 0.0053
+0.0008 0.0056
+0.0009 0.0058
+0.001 0.0061
+0.002 0.0084
+0.003 0.0108
+0.004 0.0132
+0.005 0.0154
+0.006 0.0177
+0.007 0.0197
+0.008 0.0216
+0.009 0.023
+0.01 0.0241
+0.02 0.0131
+0.03 0.0087
+0.04 0.0068
+0.05 0.0056
+0.06 0.0049
+0.07 0.0044
+0.08 0.004
+0.09 0.0037
+0.1 0.0034
+0.2 0.0023
+0.3 0.0019
+0.4 0.0017
+0.5 0.0016
+1 0.0015
+10 0.0016
+100 0.0018
+1000 0.0019
diff --git a/MCNP/RBEfactors/additionalMat/MCDS_multiplierUnmodified/MCDS_electronIntraTrack_intraT_anoxic.txt b/MCNP/RBEfactors/additionalMat/MCDS_multiplierUnmodified/MCDS_electronIntraTrack_intraT_anoxic.txt
new file mode 100644
index 000000000..483c8b902
--- /dev/null
+++ b/MCNP/RBEfactors/additionalMat/MCDS_multiplierUnmodified/MCDS_electronIntraTrack_intraT_anoxic.txt
@@ -0,0 +1,45 @@
+1e-05 0.0024
+2e-05 0.0046
+3e-05 0.0068
+4e-05 0.0086
+5e-05 0.0103
+6e-05 0.0117
+7e-05 0.0128
+8e-05 0.0137
+9e-05 0.0143
+0.0001 0.0147
+0.0002 0.0128
+0.0003 0.0098
+0.0004 0.0082
+0.0005 0.0074
+0.0006 0.007
+0.0007 0.0068
+0.0008 0.0069
+0.0009 0.0069
+0.001 0.007
+0.002 0.0088
+0.003 0.0111
+0.004 0.0133
+0.005 0.0157
+0.006 0.0179
+0.007 0.0198
+0.008 0.0217
+0.009 0.023
+0.01 0.0241
+0.02 0.0131
+0.03 0.0087
+0.04 0.0068
+0.05 0.0056
+0.06 0.0049
+0.07 0.0043
+0.08 0.004
+0.09 0.0037
+0.1 0.0034
+0.2 0.0023
+0.3 0.0019
+0.4 0.0017
+0.5 0.0016
+1 0.0015
+10 0.0016
+100 0.0018
+1000 0.0019
diff --git a/MCNP/RBEfactors/additionalMat/MCDS_multiplierUnmodified/MCDS_electronRBE_DSB_aerobic.txt b/MCNP/RBEfactors/additionalMat/MCDS_multiplierUnmodified/MCDS_electronRBE_DSB_aerobic.txt
new file mode 100644
index 000000000..2d2a39582
--- /dev/null
+++ b/MCNP/RBEfactors/additionalMat/MCDS_multiplierUnmodified/MCDS_electronRBE_DSB_aerobic.txt
@@ -0,0 +1,53 @@
+1e-05 3.383
+2e-05 3.353
+3e-05 3.321
+4e-05 3.278
+5e-05 3.234
+6e-05 3.19
+7e-05 3.139
+8e-05 3.091
+9e-05 3.046
+0.0001 3.001
+0.0002 2.6
+0.0003 2.319
+0.0004 2.118
+0.0005 1.966
+0.0006 1.851
+0.0007 1.759
+0.0008 1.688
+0.0009 1.627
+0.001 1.573
+0.002 1.314
+0.003 1.215
+0.004 1.162
+0.005 1.129
+0.006 1.111
+0.007 1.093
+0.008 1.082
+0.009 1.07
+0.01 1.062
+0.02 1.028
+0.03 1.015
+0.04 1.011
+0.05 1.007
+0.06 1.006
+0.07 1.002
+0.08 1.002
+0.09 1.002
+0.1 0.9989
+0.2 0.9959
+0.3 0.9952
+0.4 0.9945
+0.5 0.9941
+1 0.9921
+10 0.9907
+100 0.9943
+150 0.9943
+200 0.9943
+300 0.9943
+400 0.9943
+500 0.9943
+600 0.9943
+800 0.9943
+900 0.9943
+1000 0.9943
diff --git a/MCNP/RBEfactors/additionalMat/MCDS_multiplierUnmodified/MCDS_electronRBE_DSB_anoxic.txt b/MCNP/RBEfactors/additionalMat/MCDS_multiplierUnmodified/MCDS_electronRBE_DSB_anoxic.txt
new file mode 100644
index 000000000..830b1370f
--- /dev/null
+++ b/MCNP/RBEfactors/additionalMat/MCDS_multiplierUnmodified/MCDS_electronRBE_DSB_anoxic.txt
@@ -0,0 +1,53 @@
+1e-05 9.833
+2e-05 9.718
+3e-05 9.584
+4e-05 9.387
+5e-05 9.168
+6e-05 8.923
+7e-05 8.635
+8e-05 8.353
+9e-05 8.057
+0.0001 7.756
+0.0002 5.12
+0.0003 3.654
+0.0004 2.886
+0.0005 2.453
+0.0006 2.185
+0.0007 1.994
+0.0008 1.875
+0.0009 1.77
+0.001 1.687
+0.002 1.342
+0.003 1.231
+0.004 1.17
+0.005 1.137
+0.006 1.117
+0.007 1.095
+0.008 1.085
+0.009 1.069
+0.01 1.061
+0.02 1.029
+0.03 1.016
+0.04 1.009
+0.05 1.005
+0.06 1.001
+0.07 1.001
+0.08 1
+0.09 1.002
+0.1 0.9969
+0.2 0.9941
+0.3 0.9945
+0.4 0.991
+0.5 0.9933
+1 0.9913
+10 0.9887
+100 0.994
+150 0.994
+200 0.994
+300 0.994
+400 0.994
+500 0.994
+600 0.994
+800 0.994
+900 0.994
+1000 0.994
diff --git a/MCNP/RBEfactors/additionalMat/MCDS_multiplierUnmodified/MCDS_heavyIonsIntraTrack_intraT_aerobic.txt b/MCNP/RBEfactors/additionalMat/MCDS_multiplierUnmodified/MCDS_heavyIonsIntraTrack_intraT_aerobic.txt
new file mode 100644
index 000000000..54ecfc817
--- /dev/null
+++ b/MCNP/RBEfactors/additionalMat/MCDS_multiplierUnmodified/MCDS_heavyIonsIntraTrack_intraT_aerobic.txt
@@ -0,0 +1,43 @@
+0.001 0.02846210037
+0.01 0.28455704915
+0.1 2.825177711125
+0.2 5.600020284375
+0.3 8.32836499275
+0.5 13.6604011775
+0.9 23.87728589125
+1 26.34098957875
+1.1 28.76661123875
+1.3 33.50520734
+1.5 38.08435312
+2 48.82392092875
+2.5 58.51841325
+3 67.27916914125
+3.5 75.2410745625
+4 82.470555035
+5 94.5693023825
+6 103.84242143
+7.5 113.96976977375
+10 125.76996565375
+15 139.4119072225
+25 141.36975948975
+35 134.329075755875
+50 124.02139011625
+100 99.984988211625
+200 74.19003967375
+300 59.8193069375
+400 50.4299955542625
+500 43.753787347325
+750 33.170315152975
+1000 26.9326025970375
+2000 15.9597518460875
+3000 11.75043342605
+4000 9.515300393225
+5000 8.1262322769375
+7500 6.21215544565
+10000 5.2275533457125
+20000 3.7305488446875
+30000 3.2442282719
+40000 3.0145732969
+50000 2.8862063404625
+75000 2.736030882475
+100000 2.6767537357
diff --git a/MCNP/RBEfactors/additionalMat/MCDS_multiplierUnmodified/MCDS_heavyIonsIntraTrack_intraT_anoxic.txt b/MCNP/RBEfactors/additionalMat/MCDS_multiplierUnmodified/MCDS_heavyIonsIntraTrack_intraT_anoxic.txt
new file mode 100644
index 000000000..26c185239
--- /dev/null
+++ b/MCNP/RBEfactors/additionalMat/MCDS_multiplierUnmodified/MCDS_heavyIonsIntraTrack_intraT_anoxic.txt
@@ -0,0 +1,43 @@
+0.001 0.24135521373
+0.01 2.41300981035
+0.1 23.957169760125
+0.2 47.487503559375
+0.3 70.62354101475
+0.5 115.8385713975
+0.9 202.47653422125
+1 223.36844740875
+1.1 243.93742954875
+1.3 284.12015886
+1.5 322.95076848
+2 414.02102155875
+2.5 496.22915925
+3 570.51932347125
+3.5 638.0353310625
+4 699.340462515
+5 801.9363958425
+6 880.57133847
+7.5 966.45004356375
+10 1066.51429608375
+15 1182.1963322025
+25 1198.79868572775
+35 1139.09452808288
+50 1051.68658424625
+100 847.860765224625
+200 629.12268066375
+300 507.2605824375
+400 427.640342672363
+500 371.026893989925
+750 281.280313088775
+1000 228.385255185338
+2000 135.336790602787
+3000 99.64227285045
+4000 80.688611531025
+5000 68.9094797124375
+7500 52.67833665885
+10000 44.3290283794125
+20000 31.6346089021875
+30000 27.5106684951
+40000 25.5632217201
+50000 24.4746852521625
+75000 23.201215294275
+100000 22.6985521653
diff --git a/MCNP/RBEfactors/additionalMat/MCDS_multiplierUnmodified/MCDS_lithiumIntraTrack_intraT_aerobic.txt b/MCNP/RBEfactors/additionalMat/MCDS_multiplierUnmodified/MCDS_lithiumIntraTrack_intraT_aerobic.txt
new file mode 100644
index 000000000..91349d7f8
--- /dev/null
+++ b/MCNP/RBEfactors/additionalMat/MCDS_multiplierUnmodified/MCDS_lithiumIntraTrack_intraT_aerobic.txt
@@ -0,0 +1,43 @@
+0.001 0.02808
+0.01 0.2803
+0.1 2.753
+0.2 5.407
+0.3 7.964
+0.5 12.79
+0.9 21.32
+1 23.15
+1.1 24.86
+1.3 27.84
+1.5 30.23
+2 33.74
+2.5 33.79
+3 31.96
+3.5 29.63
+4 27.4
+5 23.61
+6 20.72
+7.5 17.38
+10 13.48
+15 8.918
+25 4.84
+35 3.078
+50 1.855
+100 0.6803
+200 0.2663
+300 0.1632
+400 0.1175
+500 0.09313
+750 0.06287
+1000 0.04888
+2000 0.02914
+3000 0.023
+4000 0.02003
+5000 0.01823
+7500 0.01612
+10000 0.01514
+20000 0.01398
+30000 0.01377
+40000 0.01373
+50000 0.01372
+75000 0.01381
+100000 0.01388
diff --git a/MCNP/RBEfactors/additionalMat/MCDS_multiplierUnmodified/MCDS_lithiumIntraTrack_intraT_anoxic.txt b/MCNP/RBEfactors/additionalMat/MCDS_multiplierUnmodified/MCDS_lithiumIntraTrack_intraT_anoxic.txt
new file mode 100644
index 000000000..fda1ec0e5
--- /dev/null
+++ b/MCNP/RBEfactors/additionalMat/MCDS_multiplierUnmodified/MCDS_lithiumIntraTrack_intraT_anoxic.txt
@@ -0,0 +1,43 @@
+0.001 0.2372
+0.01 2.368
+0.1 23.26
+0.2 45.68
+0.3 67.16
+0.5 107.9
+0.9 179.4
+1 194.4
+1.1 208.8
+1.3 233.4
+1.5 252.8
+2 281
+2.5 280.3
+3 263.4
+3.5 242.5
+4 222.2
+5 187.9
+6 161.3
+7.5 130.2
+10 92.96
+15 49.96
+25 17.02
+35 7.491
+50 3.229
+100 0.8154
+200 0.2812
+300 0.1685
+400 0.1199
+500 0.09438
+750 0.06353
+1000 0.04883
+2000 0.02917
+3000 0.023
+4000 0.02004
+5000 0.01825
+7500 0.01603
+10000 0.01511
+20000 0.01396
+30000 0.01373
+40000 0.01368
+50000 0.0137
+75000 0.01377
+100000 0.01384
diff --git a/MCNP/RBEfactors/additionalMat/MCDS_multiplierUnmodified/MCDS_lithiumRBE_DSB_aerobic.txt b/MCNP/RBEfactors/additionalMat/MCDS_multiplierUnmodified/MCDS_lithiumRBE_DSB_aerobic.txt
new file mode 100644
index 000000000..3a819d214
--- /dev/null
+++ b/MCNP/RBEfactors/additionalMat/MCDS_multiplierUnmodified/MCDS_lithiumRBE_DSB_aerobic.txt
@@ -0,0 +1,43 @@
+0.001 3.387
+0.01 3.385
+0.1 3.38
+0.2 3.378
+0.3 3.375
+0.5 3.369
+0.9 3.358
+1 3.354
+1.1 3.351
+1.3 3.345
+1.5 3.338
+2 3.325
+2.5 3.306
+3 3.291
+3.5 3.275
+4 3.256
+5 3.217
+6 3.183
+7.5 3.127
+10 3.03
+15 2.845
+25 2.54
+35 2.31
+50 2.066
+100 1.655
+200 1.371
+300 1.263
+400 1.201
+500 1.165
+750 1.115
+1000 1.09
+2000 1.05
+3000 1.038
+4000 1.032
+5000 1.026
+7500 1.022
+10000 1.02
+20000 1.016
+30000 1.015
+40000 1.015
+50000 1.015
+75000 1.016
+100000 1.016
diff --git a/MCNP/RBEfactors/additionalMat/MCDS_multiplierUnmodified/MCDS_lithiumRBE_DSB_anoxic.txt b/MCNP/RBEfactors/additionalMat/MCDS_multiplierUnmodified/MCDS_lithiumRBE_DSB_anoxic.txt
new file mode 100644
index 000000000..205146d1d
--- /dev/null
+++ b/MCNP/RBEfactors/additionalMat/MCDS_multiplierUnmodified/MCDS_lithiumRBE_DSB_anoxic.txt
@@ -0,0 +1,43 @@
+0.001 9.844
+0.01 9.838
+0.1 9.824
+0.2 9.817
+0.3 9.801
+0.5 9.783
+0.9 9.743
+1 9.72
+1.1 9.713
+1.3 9.685
+1.5 9.653
+2 9.596
+2.5 9.522
+3 9.447
+3.5 9.368
+4 9.274
+5 9.076
+6 8.88
+7.5 8.558
+10 7.958
+15 6.734
+25 4.763
+35 3.603
+50 2.726
+100 1.812
+200 1.409
+300 1.283
+400 1.213
+500 1.173
+750 1.121
+1000 1.09
+2000 1.051
+3000 1.038
+4000 1.032
+5000 1.026
+7500 1.019
+10000 1.018
+20000 1.016
+30000 1.014
+40000 1.013
+50000 1.014
+75000 1.014
+100000 1.015
diff --git a/MCNP/RBEfactors/additionalMat/MCDS_multiplierUnmodified/MCDS_protonIntraTrack_intraT_aerobic.txt b/MCNP/RBEfactors/additionalMat/MCDS_multiplierUnmodified/MCDS_protonIntraTrack_intraT_aerobic.txt
new file mode 100644
index 000000000..7faeab41b
--- /dev/null
+++ b/MCNP/RBEfactors/additionalMat/MCDS_multiplierUnmodified/MCDS_protonIntraTrack_intraT_aerobic.txt
@@ -0,0 +1,44 @@
+0.001 0.02763
+0.002 0.05499
+0.003 0.08253
+0.004 0.1097
+0.005 0.1368
+0.00647 0.1762
+0.0075 0.2037
+0.01 0.2703
+0.02 0.5322
+0.03 0.7841
+0.04 1.028
+0.05 1.264
+0.06 1.489
+0.07 1.708
+0.08 1.914
+0.09 2.112
+0.1 2.305
+0.2 3.632
+0.3 3.789
+0.5 2.156
+0.9 0.9674
+1 0.8307
+1.1 0.7276
+1.3 0.5731
+1.5 0.4697
+2 0.3144
+2.5 0.2336
+3 0.1845
+3.5 0.1517
+4 0.1285
+5 0.09884
+6 0.07986
+7.5 0.06226
+10 0.04581
+15 0.03059
+25 0.01899
+50 0.01041
+75 0.007456
+100 0.005977
+150 0.004434
+200 0.003683
+250 0.003211
+500 0.002275
+1000 0.001823
diff --git a/MCNP/RBEfactors/additionalMat/MCDS_multiplierUnmodified/MCDS_protonIntraTrack_intraT_anoxic.txt b/MCNP/RBEfactors/additionalMat/MCDS_multiplierUnmodified/MCDS_protonIntraTrack_intraT_anoxic.txt
new file mode 100644
index 000000000..7fedd968a
--- /dev/null
+++ b/MCNP/RBEfactors/additionalMat/MCDS_multiplierUnmodified/MCDS_protonIntraTrack_intraT_anoxic.txt
@@ -0,0 +1,44 @@
+0.001 0.2327
+0.002 0.462
+0.003 0.6936
+0.004 0.9196
+0.005 1.147
+0.00647 1.475
+0.0075 1.705
+0.01 2.258
+0.02 4.397
+0.03 6.423
+0.04 8.319
+0.05 10.11
+0.06 11.74
+0.07 13.27
+0.08 14.62
+0.09 15.88
+0.1 16.98
+0.2 21.15
+0.3 16.57
+0.5 5.719
+0.9 1.518
+1 1.221
+1.1 1.014
+1.3 0.7361
+1.5 0.5716
+2 0.3541
+2.5 0.2554
+3 0.1967
+3.5 0.1592
+4 0.1348
+5 0.1014
+6 0.08161
+7.5 0.06333
+10 0.04635
+15 0.03069
+25 0.01884
+50 0.01039
+75 0.0074
+100 0.005952
+150 0.004402
+200 0.003665
+250 0.003198
+500 0.002261
+1000 0.001813
diff --git a/MCNP/RBEfactors/additionalMat/MCDS_multiplierUnmodified/MCDS_protonRBE_DSB_aerobic.txt b/MCNP/RBEfactors/additionalMat/MCDS_multiplierUnmodified/MCDS_protonRBE_DSB_aerobic.txt
new file mode 100644
index 000000000..fa0a7b84f
--- /dev/null
+++ b/MCNP/RBEfactors/additionalMat/MCDS_multiplierUnmodified/MCDS_protonRBE_DSB_aerobic.txt
@@ -0,0 +1,44 @@
+0.001 3.375
+0.002 3.367
+0.003 3.368
+0.004 3.363
+0.005 3.359
+0.00647 3.352
+0.0075 3.348
+0.01 3.34
+0.02 3.317
+0.03 3.29
+0.04 3.264
+0.05 3.242
+0.06 3.216
+0.07 3.193
+0.08 3.168
+0.09 3.143
+0.1 3.122
+0.2 2.889
+0.3 2.687
+0.5 2.37
+0.9 1.986
+1 1.916
+1.1 1.86
+1.3 1.76
+1.5 1.685
+2 1.542
+2.5 1.451
+3 1.386
+3.5 1.336
+4 1.297
+5 1.244
+6 1.204
+7.5 1.164
+10 1.123
+15 1.083
+25 1.051
+50 1.026
+75 1.016
+100 1.012
+150 1.004
+200 1.004
+250 1.003
+500 1.001
+1000 0.9995
diff --git a/MCNP/RBEfactors/additionalMat/MCDS_multiplierUnmodified/MCDS_protonRBE_DSB_anoxic.txt b/MCNP/RBEfactors/additionalMat/MCDS_multiplierUnmodified/MCDS_protonRBE_DSB_anoxic.txt
new file mode 100644
index 000000000..cf31ad3f5
--- /dev/null
+++ b/MCNP/RBEfactors/additionalMat/MCDS_multiplierUnmodified/MCDS_protonRBE_DSB_anoxic.txt
@@ -0,0 +1,44 @@
+0.001 9.805
+0.002 9.77
+0.003 9.775
+0.004 9.748
+0.005 9.739
+0.00647 9.707
+0.0075 9.697
+0.01 9.663
+0.02 9.543
+0.03 9.425
+0.04 9.298
+0.05 9.179
+0.06 9.041
+0.07 8.91
+0.08 8.764
+0.09 8.628
+0.1 8.481
+0.2 6.98
+0.3 5.626
+0.5 3.864
+0.9 2.49
+1 2.326
+1.1 2.198
+1.3 1.997
+1.5 1.86
+2 1.638
+2.5 1.518
+3 1.432
+3.5 1.37
+4 1.33
+5 1.261
+6 1.218
+7.5 1.175
+10 1.13
+15 1.086
+25 1.047
+50 1.026
+75 1.013
+100 1.011
+150 1.002
+200 1.002
+250 1.002
+500 0.9993
+1000 0.9977
diff --git a/MCNP/RBEfactors/additionalMat/MCDS_multiplierUnmodified/MCDS_tritonIntraTrack_intraT_aerobic.txt b/MCNP/RBEfactors/additionalMat/MCDS_multiplierUnmodified/MCDS_tritonIntraTrack_intraT_aerobic.txt
new file mode 100644
index 000000000..2d12e78d4
--- /dev/null
+++ b/MCNP/RBEfactors/additionalMat/MCDS_multiplierUnmodified/MCDS_tritonIntraTrack_intraT_aerobic.txt
@@ -0,0 +1,44 @@
+0.001 0.0277
+0.002 0.0552
+0.003 0.0829
+0.004 0.1101
+0.005 0.1377
+0.00647 0.1777
+0.0075 0.2061
+0.01 0.2735
+0.02 0.5409
+0.03 0.8045
+0.04 1.0611
+0.05 1.3123
+0.06 1.5624
+0.07 1.8044
+0.08 2.038
+0.09 2.2703
+0.1 2.4975
+0.2 4.4006
+0.3 5.4986
+0.5 5.2755
+0.9 3.4346
+1 3.1114
+1.1 2.8132
+1.3 2.3525
+1.5 1.9923
+2 1.3893
+2.5 1.0344
+3 0.8077
+3.5 0.6517
+4 0.5425
+5 0.3984
+6 0.3115
+7.5 0.2315
+10 0.16
+15 0.0982
+25 0.0558
+50 0.0277
+75 0.0188
+100 0.0146
+150 0.0103
+200 0.0082
+250 0.0068
+500 0.0041
+1000 0.0027
diff --git a/MCNP/RBEfactors/additionalMat/MCDS_multiplierUnmodified/MCDS_tritonIntraTrack_intraT_anoxic.txt b/MCNP/RBEfactors/additionalMat/MCDS_multiplierUnmodified/MCDS_tritonIntraTrack_intraT_anoxic.txt
new file mode 100644
index 000000000..b91a773e3
--- /dev/null
+++ b/MCNP/RBEfactors/additionalMat/MCDS_multiplierUnmodified/MCDS_tritonIntraTrack_intraT_anoxic.txt
@@ -0,0 +1,44 @@
+0.001 0.2329
+0.002 0.465
+0.003 0.6978
+0.004 0.9256
+0.005 1.1574
+0.00647 1.4934
+0.0075 1.7323
+0.01 2.2939
+0.02 4.5267
+0.03 6.7192
+0.04 8.827
+0.05 10.8939
+0.06 12.9056
+0.07 14.8788
+0.08 16.7213
+0.09 18.5954
+0.1 20.3476
+0.2 34.3613
+0.3 40.4786
+0.5 33.4382
+0.9 15.0371
+1 12.3695
+1.1 10.1915
+1.3 7.2212
+1.5 5.2695
+2 2.7597
+2.5 1.7103
+3 1.1872
+3.5 0.8737
+4 0.6844
+5 0.4724
+6 0.3534
+7.5 0.2519
+10 0.167
+15 0.1011
+25 0.0566
+50 0.0278
+75 0.0188
+100 0.0146
+150 0.0102
+200 0.0081
+250 0.0068
+500 0.0041
+1000 0.0027
diff --git a/MCNP/RBEfactors/additionalMat/MCDS_multiplierUnmodified/MCDS_tritonRBE_DSB_aerobic.txt b/MCNP/RBEfactors/additionalMat/MCDS_multiplierUnmodified/MCDS_tritonRBE_DSB_aerobic.txt
new file mode 100644
index 000000000..d2884103f
--- /dev/null
+++ b/MCNP/RBEfactors/additionalMat/MCDS_multiplierUnmodified/MCDS_tritonRBE_DSB_aerobic.txt
@@ -0,0 +1,44 @@
+0.001 3.362
+0.002 3.359
+0.003 3.36
+0.004 3.355
+0.005 3.357
+0.00647 3.353
+0.0075 3.354
+0.01 3.348
+0.02 3.336
+0.03 3.329
+0.04 3.318
+0.05 3.307
+0.06 3.302
+0.07 3.293
+0.08 3.282
+0.09 3.274
+0.1 3.267
+0.2 3.185
+0.3 3.107
+0.5 2.95
+0.9 2.673
+1 2.617
+1.1 2.556
+1.3 2.456
+1.5 2.363
+2 2.169
+2.5 2.022
+3 1.907
+3.5 1.812
+4 1.737
+5 1.619
+6 1.535
+7.5 1.443
+10 1.343
+15 1.237
+25 1.146
+50 1.072
+75 1.041
+100 1.03
+150 1.019
+200 1.012
+250 1.007
+500 1.001
+1000 0.9965
diff --git a/MCNP/RBEfactors/additionalMat/MCDS_multiplierUnmodified/MCDS_tritonRBE_DSB_anoxic.txt b/MCNP/RBEfactors/additionalMat/MCDS_multiplierUnmodified/MCDS_tritonRBE_DSB_anoxic.txt
new file mode 100644
index 000000000..eb2f5c577
--- /dev/null
+++ b/MCNP/RBEfactors/additionalMat/MCDS_multiplierUnmodified/MCDS_tritonRBE_DSB_anoxic.txt
@@ -0,0 +1,44 @@
+0.001 9.755
+0.002 9.748
+0.003 9.75
+0.004 9.727
+0.005 9.732
+0.00647 9.719
+0.0075 9.724
+0.01 9.696
+0.02 9.651
+0.03 9.621
+0.04 9.57
+0.05 9.528
+0.06 9.49
+0.07 9.456
+0.08 9.401
+0.09 9.37
+0.1 9.325
+0.2 8.9
+0.3 8.43
+0.5 7.427
+0.9 5.593
+1 5.218
+1.1 4.865
+1.3 4.303
+1.5 3.843
+2 3.057
+2.5 2.6
+3 2.312
+3.5 2.098
+4 1.951
+5 1.763
+6 1.635
+7.5 1.505
+10 1.372
+15 1.255
+25 1.154
+50 1.073
+75 1.041
+100 1.03
+150 1.014
+200 1.011
+250 1.004
+500 0.9995
+1000 0.9979
diff --git a/MCNP/RBEfactors/additionalMat/MCDS_writeIntraTrackfactors.m b/MCNP/RBEfactors/additionalMat/MCDS_writeIntraTrackfactors.m
new file mode 100644
index 000000000..d841b64dc
--- /dev/null
+++ b/MCNP/RBEfactors/additionalMat/MCDS_writeIntraTrackfactors.m
@@ -0,0 +1,478 @@
+%% Proton IntraTrack
+% Aerobic data taken from MCDS
+
+DE_protons_intraT_aerobic = [1.000E-03 2.000E-03 3.000E-03 4.000E-03 5.000E-03 6.470E-03...
+ 7.500E-03 1.000E-02 2.000E-02 3.000E-02 4.000E-02 5.000E-02...
+ 6.000E-02 7.000E-02 8.000E-02 9.000E-02 1.000E-01 2.000E-01...
+ 3.000E-01 5.000E-01 9.000E-01 1.000E+00 1.100E+00 1.300E+00...
+ 1.500E+00 2.000E+00 2.500E+00 3.000E+00 3.500E+00 4.000E+00...
+ 5.000E+00 6.000E+00 7.500E+00 1.000E+01 1.500E+01 2.500E+01...
+ 5.000E+01 7.500E+01 1.000E+02 1.500E+02 2.000E+02 2.500E+02...
+ 5.000E+02 1.000E+03];
+
+DF_protons_intraT_aerobic = [2.763E-02 5.499E-02 8.253E-02 1.097E-01 1.368E-01 1.762E-01...
+ 2.037E-01 2.703E-01 5.322E-01 7.841E-01 1.028E+00 1.264E+00...
+ 1.489E+00 1.708E+00 1.914E+00 2.112E+00 2.305E+00 3.632E+00...
+ 3.789E+00 2.156E+00 9.674E-01 8.307E-01 7.276E-01 5.731E-01...
+ 4.697E-01 3.144E-01 2.336E-01 1.845E-01 1.517E-01 1.285E-01...
+ 9.884E-02 7.986E-02 6.226E-02 4.581E-02 3.059E-02 1.899E-02...
+ 1.041E-02 7.456E-03 5.977E-03 4.434E-03 3.683E-03 3.211E-03...
+ 2.275E-03 1.823E-03];
+
+writematrix([DE_protons_intraT_aerobic', DF_protons_intraT_aerobic'], 'MCDS_protonIntraTrack_intraT_aerobic.txt','Delimiter','tab');
+
+% Anoxic data taken from MCDS
+
+DE_protons_intraT_anoxic = [1.000E-03 2.000E-03 3.000E-03 4.000E-03 5.000E-03 6.470E-03...
+ 7.500E-03 1.000E-02 2.000E-02 3.000E-02 4.000E-02 5.000E-02...
+ 6.000E-02 7.000E-02 8.000E-02 9.000E-02 1.000E-01 2.000E-01...
+ 3.000E-01 5.000E-01 9.000E-01 1.000E+00 1.100E+00 1.300E+00...
+ 1.500E+00 2.000E+00 2.500E+00 3.000E+00 3.500E+00 4.000E+00...
+ 5.000E+00 6.000E+00 7.500E+00 1.000E+01 1.500E+01 2.500E+01...
+ 5.000E+01 7.500E+01 1.000E+02 1.500E+02 2.000E+02 2.500E+02...
+ 5.000E+02 1.000E+03];
+
+DF_protons_intraT_anoxic = [2.327E-01 4.620E-01 6.936E-01 9.196E-01 1.147E+00 1.475E+00...
+ 1.705E+00 2.258E+00 4.397E+00 6.423E+00 8.319E+00 1.011E+01...
+ 1.174E+01 1.327E+01 1.462E+01 1.588E+01 1.698E+01 2.115E+01...
+ 1.657E+01 5.719E+00 1.518E+00 1.221E+00 1.014E+00 7.361E-01...
+ 5.716E-01 3.541E-01 2.554E-01 1.967E-01 1.592E-01 1.348E-01...
+ 1.014E-01 8.161E-02 6.333E-02 4.635E-02 3.069E-02 1.884E-02...
+ 1.039E-02 7.400E-03 5.952E-03 4.402E-03 3.665E-03 3.198E-03...
+ 2.261E-03 1.813E-03];
+
+writematrix([DE_protons_intraT_anoxic', DF_protons_intraT_anoxic'], 'MCDS_protonIntraTrack_intraT_anoxic.txt','Delimiter','tab');
+
+%% Electron IntraTrack
+% Aerobic data taken from MCDS
+
+DE_electrons_intraT_aerobic = [1.000E-05 2.000E-05 3.000E-05 4.000E-05 5.000E-05 6.000E-05...
+ 7.000E-05 8.000E-05 9.000E-05 1.000E-04 2.000E-04 3.000E-04...
+ 4.000E-04 5.000E-04 6.000E-04 7.000E-04 8.000E-04 9.000E-04...
+ 1.000E-03 2.000E-03 3.000E-03 4.000E-03 5.000E-03 6.000E-03...
+ 7.000E-03 8.000E-03 9.000E-03 1.000E-02 2.000E-02 3.000E-02...
+ 4.000E-02 5.000E-02 6.000E-02 7.000E-02 8.000E-02 9.000E-02...
+ 1.000E-01 2.000E-01 3.000E-01 4.000E-01 5.000E-01 1.000E+00...
+ 1.000E+01 1.000E+02 1.000E+03];
+
+DF_electrons_intraT_aerobic = [0.0003 0.0006 0.0008 0.0011 0.0013 0.0015...
+ 0.0017 0.0019 0.0020 0.0022 0.0033 0.0040...
+ 0.0044 0.0047 0.0050 0.0053 0.0056 0.0058...
+ 0.0061 0.0084 0.0108 0.0132 0.0154 0.0177...
+ 0.0197 0.0216 0.0230 0.0241 0.0131 0.0087...
+ 0.0068 0.0056 0.0049 0.0044 0.0040 0.0037...
+ 0.0034 0.0023 0.0019 0.0017 0.0016 0.0015...
+ 0.0016 0.0018 0.0019];
+
+writematrix([DE_electrons_intraT_aerobic', DF_electrons_intraT_aerobic'], 'MCDS_electronIntraTrack_intraT_aerobic.txt','Delimiter','tab');
+
+% Anoxic data taken from MCDS
+
+DE_electrons_intraT_anoxic = [1.000E-05 2.000E-05 3.000E-05 4.000E-05 5.000E-05 6.000E-05...
+ 7.000E-05 8.000E-05 9.000E-05 1.000E-04 2.000E-04 3.000E-04...
+ 4.000E-04 5.000E-04 6.000E-04 7.000E-04 8.000E-04 9.000E-04...
+ 1.000E-03 2.000E-03 3.000E-03 4.000E-03 5.000E-03 6.000E-03...
+ 7.000E-03 8.000E-03 9.000E-03 1.000E-02 2.000E-02 3.000E-02...
+ 4.000E-02 5.000E-02 6.000E-02 7.000E-02 8.000E-02 9.000E-02...
+ 1.000E-01 2.000E-01 3.000E-01 4.000E-01 5.000E-01 1.000E+00...
+ 1.000E+01 1.000E+02 1.000E+03];
+
+DF_electrons_intraT_anoxic = [0.0024 0.0046 0.0068 0.0086 0.0103 0.0117...
+ 0.0128 0.0137 0.0143 0.0147 0.0128 0.0098...
+ 0.0082 0.0074 0.0070 0.0068 0.0069 0.0069...
+ 0.0070 0.0088 0.0111 0.0133 0.0157 0.0179...
+ 0.0198 0.0217 0.0230 0.0241 0.0131 0.0087...
+ 0.0068 0.0056 0.0049 0.0043 0.0040 0.0037...
+ 0.0034 0.0023 0.0019 0.0017 0.0016 0.0015...
+ 0.0016 0.0018 0.0019];
+
+writematrix([DE_electrons_intraT_anoxic', DF_electrons_intraT_anoxic'], 'MCDS_electronIntraTrack_intraT_anoxic.txt','Delimiter','tab');
+
+%% Deuteron IntraTrack
+% Aerobic data taken from MCDS
+
+DE_deuterons_intraT_aerobic = [1.000E-03 2.000E-03 3.000E-03 4.000E-03 5.000E-03 6.470E-03...
+ 7.500E-03 1.000E-02 2.000E-02 3.000E-02 4.000E-02 5.000E-02...
+ 6.000E-02 7.000E-02 8.000E-02 9.000E-02 1.000E-01 2.000E-01...
+ 3.000E-01 5.000E-01 9.000E-01 1.000E+00 1.100E+00 1.300E+00...
+ 1.500E+00 2.000E+00 2.500E+00 3.000E+00 3.500E+00 4.000E+00...
+ 5.000E+00 6.000E+00 7.500E+00 1.000E+01 1.500E+01 2.500E+01...
+ 5.000E+01 7.500E+01 1.000E+02 1.500E+02 2.000E+02 2.500E+02...
+ 5.000E+02 1.000E+03];
+
+DF_deuterons_intraT_aerobic = [0.0276 0.0553 0.0826 0.1099 0.1376 0.1771...
+ 0.2055 0.2731 0.5384 0.8010 1.0573 1.3033...
+ 1.5496 1.7855 2.0199 2.2479 2.4608 4.2515...
+ 5.1176 4.1924 2.2962 2.0234 1.7987 1.4586...
+ 1.2071 0.8147 0.5970 0.4654 0.3749 0.3120...
+ 0.2331 0.1827 0.1391 0.0981 0.0622 0.0368...
+ 0.0189 0.0132 0.0104 0.0074 0.0060 0.0051...
+ 0.0032 0.0023];
+
+writematrix([DE_deuterons_intraT_aerobic', DF_deuterons_intraT_aerobic'], 'MCDS_deuteronIntraTrack_intraT_aerobic.txt','Delimiter','tab');
+
+% Anoxic data taken from MCDS
+
+DE_deuterons_intraT_anoxic = [1.000E-03 2.000E-03 3.000E-03 4.000E-03 5.000E-03 6.470E-03...
+ 7.500E-03 1.000E-02 2.000E-02 3.000E-02 4.000E-02 5.000E-02...
+ 6.000E-02 7.000E-02 8.000E-02 9.000E-02 1.000E-01 2.000E-01...
+ 3.000E-01 5.000E-01 9.000E-01 1.000E+00 1.100E+00 1.300E+00...
+ 1.500E+00 2.000E+00 2.500E+00 3.000E+00 3.500E+00 4.000E+00...
+ 5.000E+00 6.000E+00 7.500E+00 1.000E+01 1.500E+01 2.500E+01...
+ 5.000E+01 7.500E+01 1.000E+02 1.500E+02 2.000E+02 2.500E+02...
+ 5.000E+02 1.000E+03];
+
+DF_deuterons_intraT_anoxic = [0.2328 0.4652 0.6945 0.9236 1.1564 1.4851...
+ 1.7236 2.2906 4.4975 6.6469 8.7370 10.7219...
+ 12.6907 14.5224 16.3460 18.0697 19.7050 31.2886...
+ 33.8880 21.1986 6.7827 5.3448 4.3121 2.9670...
+ 2.1661 1.1922 0.7748 0.5670 0.4389 0.3536...
+ 0.2536 0.1946 0.1449 0.1003 0.0631 0.0371...
+ 0.0190 0.0132 0.0103 0.0074 0.0059 0.0050...
+ 0.0032 0.0023];
+
+writematrix([DE_deuterons_intraT_anoxic', DF_deuterons_intraT_anoxic'], 'MCDS_deuteronIntraTrack_intraT_anoxic.txt','Delimiter','tab');
+
+
+%% Triton IntraTrack
+% Aerobic data taken from MCDS
+
+DE_tritons_intraT_aerobic = [1.000E-03 2.000E-03 3.000E-03 4.000E-03 5.000E-03 6.470E-03...
+ 7.500E-03 1.000E-02 2.000E-02 3.000E-02 4.000E-02 5.000E-02...
+ 6.000E-02 7.000E-02 8.000E-02 9.000E-02 1.000E-01 2.000E-01...
+ 3.000E-01 5.000E-01 9.000E-01 1.000E+00 1.100E+00 1.300E+00...
+ 1.500E+00 2.000E+00 2.500E+00 3.000E+00 3.500E+00 4.000E+00...
+ 5.000E+00 6.000E+00 7.500E+00 1.000E+01 1.500E+01 2.500E+01...
+ 5.000E+01 7.500E+01 1.000E+02 1.500E+02 2.000E+02 2.500E+02...
+ 5.000E+02 1.000E+03];
+
+DF_tritons_intraT_aerobic = [0.0277 0.0552 0.0829 0.1101 0.1377 0.1777...
+ 0.2061 0.2735 0.5409 0.8045 1.0611 1.3123...
+ 1.5624 1.8044 2.0380 2.2703 2.4975 4.4006...
+ 5.4986 5.2755 3.4346 3.1114 2.8132 2.3525...
+ 1.9923 1.3893 1.0344 0.8077 0.6517 0.5425...
+ 0.3984 0.3115 0.2315 0.1600 0.0982 0.0558...
+ 0.0277 0.0188 0.0146 0.0103 0.0082 0.0068...
+ 0.0041 0.0027];
+
+writematrix([DE_tritons_intraT_aerobic', DF_tritons_intraT_aerobic'], 'MCDS_tritonIntraTrack_intraT_aerobic.txt','Delimiter','tab');
+
+% Anoxic data taken from MCDS
+
+DE_tritons_intraT_anoxic = [1.000E-03 2.000E-03 3.000E-03 4.000E-03 5.000E-03 6.470E-03...
+ 7.500E-03 1.000E-02 2.000E-02 3.000E-02 4.000E-02 5.000E-02...
+ 6.000E-02 7.000E-02 8.000E-02 9.000E-02 1.000E-01 2.000E-01...
+ 3.000E-01 5.000E-01 9.000E-01 1.000E+00 1.100E+00 1.300E+00...
+ 1.500E+00 2.000E+00 2.500E+00 3.000E+00 3.500E+00 4.000E+00...
+ 5.000E+00 6.000E+00 7.500E+00 1.000E+01 1.500E+01 2.500E+01...
+ 5.000E+01 7.500E+01 1.000E+02 1.500E+02 2.000E+02 2.500E+02...
+ 5.000E+02 1.000E+03];
+
+DF_tritons_intraT_anoxic = [0.2329 0.4650 0.6978 0.9256 1.1574 1.4934...
+ 1.7323 2.2939 4.5267 6.7192 8.8270 10.8939...
+ 12.9056 14.8788 16.7213 18.5954 20.3476 34.3613...
+ 40.4786 33.4382 15.0371 12.3695 10.1915 7.2212...
+ 5.2695 2.7597 1.7103 1.1872 0.8737 0.6844...
+ 0.4724 0.3534 0.2519 0.1670 0.1011 0.0566...
+ 0.0278 0.0188 0.0146 0.0102 0.0081 0.0068...
+ 0.0041 0.0027];
+
+writematrix([DE_tritons_intraT_anoxic', DF_tritons_intraT_anoxic'], 'MCDS_tritonIntraTrack_intraT_anoxic.txt','Delimiter','tab');
+
+%% 3He IntraTrack
+% Aerobic data taken from MCDS
+
+DE_3He_intraT_aerobic = [1.000E-03 1.500E-03 2.000E-03 2.500E-03 3.000E-03 4.000E-03...
+ 5.000E-03 6.000E-03 7.000E-03 8.000E-03 9.000E-03 1.000E-02...
+ 1.250E-02 1.500E-02 1.750E-02 2.000E-02 2.250E-02 2.500E-02...
+ 2.750E-02 3.000E-02 3.500E-02 4.000E-02 4.500E-02 5.000E-02...
+ 5.500E-02 6.000E-02 6.500E-02 7.000E-02 7.500E-02 8.000E-02...
+ 8.500E-02 9.000E-02 9.500E-02 1.000E-01 1.250E-01 1.500E-01...
+ 1.750E-01 2.000E-01 2.250E-01 2.500E-01 2.750E-01 3.000E-01...
+ 3.500E-01 4.000E-01 4.500E-01 5.000E-01 5.500E-01 6.000E-01...
+ 6.500E-01 7.000E-01 7.500E-01 8.000E-01 8.500E-01 9.000E-01...
+ 9.500E-01 1.000E+00 1.250E+00 1.500E+00 1.750E+00 2.000E+00...
+ 2.250E+00 2.500E+00 2.750E+00 3.000E+00 3.500E+00 4.000E+00...
+ 4.500E+00 5.000E+00 5.500E+00 6.000E+00 6.500E+00 7.000E+00...
+ 7.500E+00 8.000E+00 8.500E+00 9.000E+00 9.500E+00 1.000E+01...
+ 1.250E+01 1.500E+01 1.750E+01 2.000E+01 2.500E+01 2.750E+01...
+ 3.000E+01 3.500E+01 4.000E+01 4.500E+01 5.000E+01 5.500E+01...
+ 6.000E+01 6.500E+01 7.000E+01 7.500E+01 8.000E+01 8.500E+01...
+ 9.000E+01 9.500E+01 1.000E+02 1.250E+02 1.500E+02 1.750E+02...
+ 2.000E+02 2.250E+02 2.500E+02 2.750E+02 3.000E+02 3.500E+02...
+ 4.000E+02 4.500E+02 5.000E+02 5.500E+02 6.000E+02 6.500E+02...
+ 7.000E+02 7.500E+02 8.000E+02 8.500E+02 9.000E+02 9.500E+02...
+ 1.000E+03 2.000E+03 5.000E+03 7.500E+03 1.000E+04];
+
+DF_3He_intraT_aerobic = [0.0280 0.0420 0.0560 0.0699 0.0839 0.1119...
+ 0.1397 0.1678 0.1955 0.2233 0.2510 0.2788...
+ 0.3485 0.4181 0.4871 0.5564 0.6253 0.6946...
+ 0.7628 0.8324 0.9698 1.1063 1.2421 1.3802...
+ 1.5146 1.6508 1.7857 1.9204 2.0563 2.1896...
+ 2.3242 2.4587 2.5872 2.7198 3.3822 4.0218...
+ 4.6759 5.2922 5.9174 6.5298 7.1240 7.7210...
+ 8.8705 9.9711 11.0224 12.0291 12.9610 13.8152...
+ 14.5917 15.3122 15.9025 16.3794 16.7657 17.0330...
+ 17.2042 17.2708 16.2802 14.2919 12.4501 10.9328...
+ 9.7009 8.6935 7.8305 7.1188 5.9577 5.0844...
+ 4.3877 3.8324 3.3809 3.0042 2.6960 2.4339...
+ 2.2100 2.0146 1.8543 1.7087 1.5816 1.4693...
+ 1.0611 0.8156 0.6527 0.5408 0.3966 0.3486...
+ 0.3097 0.2527 0.2123 0.1837 0.1615 0.1440...
+ 0.1298 0.1181 0.1087 0.1004 0.0937 0.0878...
+ 0.0825 0.0777 0.0736 0.0586 0.0488 0.0422...
+ 0.0373 0.0335 0.0306 0.0285 0.0261 0.0231...
+ 0.0207 0.0190 0.0175 0.0163 0.0154 0.0146 ...
+ 0.0138 0.0132 0.0127 0.0122 0.0118 0.0115...
+ 0.0111 0.0080 0.0064 0.0061 0.0060];
+
+writematrix([DE_3He_intraT_aerobic', DF_3He_intraT_aerobic'], 'MCDS_3HeIntraTrack_intraT_aerobic.txt','Delimiter','tab');
+
+% Anoxic data taken from MCDS
+
+DE_3He_intraT_anoxic = [1.000E-03 1.500E-03 2.000E-03 2.500E-03 3.000E-03 4.000E-03...
+ 5.000E-03 6.000E-03 7.000E-03 8.000E-03 9.000E-03 1.000E-02...
+ 1.250E-02 1.500E-02 1.750E-02 2.000E-02 2.250E-02 2.500E-02...
+ 2.750E-02 3.000E-02 3.500E-02 4.000E-02 4.500E-02 5.000E-02...
+ 5.500E-02 6.000E-02 6.500E-02 7.000E-02 7.500E-02 8.000E-02...
+ 8.500E-02 9.000E-02 9.500E-02 1.000E-01 1.250E-01 1.500E-01...
+ 1.750E-01 2.000E-01 2.250E-01 2.500E-01 2.750E-01 3.000E-01...
+ 3.500E-01 4.000E-01 4.500E-01 5.000E-01 5.500E-01 6.000E-01...
+ 6.500E-01 7.000E-01 7.500E-01 8.000E-01 8.500E-01 9.000E-01...
+ 9.500E-01 1.000E+00 1.250E+00 1.500E+00 1.750E+00 2.000E+00...
+ 2.250E+00 2.500E+00 2.750E+00 3.000E+00 3.500E+00 4.000E+00...
+ 4.500E+00 5.000E+00 5.500E+00 6.000E+00 6.500E+00 7.000E+00...
+ 7.500E+00 8.000E+00 8.500E+00 9.000E+00 9.500E+00 1.000E+01...
+ 1.250E+01 1.500E+01 1.750E+01 2.000E+01 2.500E+01 2.750E+01...
+ 3.000E+01 3.500E+01 4.000E+01 4.500E+01 5.000E+01 5.500E+01...
+ 6.000E+01 6.500E+01 7.000E+01 7.500E+01 8.000E+01 8.500E+01...
+ 9.000E+01 9.500E+01 1.000E+02 1.250E+02 1.500E+02 1.750E+02...
+ 2.000E+02 2.250E+02 2.500E+02 2.750E+02 3.000E+02 3.500E+02...
+ 4.000E+02 4.500E+02 5.000E+02 5.500E+02 6.000E+02 6.500E+02...
+ 7.000E+02 7.500E+02 8.000E+02 8.500E+02 9.000E+02 9.500E+02...
+ 1.000E+03 2.000E+03 5.000E+03 7.500E+03 1.000E+04];
+
+DF_3He_intraT_anoxic = [0.2367 0.3549 0.4732 0.5913 0.7090 0.9457...
+ 1.1806 1.4182 1.6529 1.8880 2.1212 2.3568...
+ 2.9470 3.5345 4.1100 4.6944 5.2776 5.8604...
+ 6.4407 7.0177 8.1812 9.3362 10.4821 11.6451...
+ 12.7760 13.9303 15.0406 16.1652 17.3130 18.4381...
+ 19.5754 20.7090 21.7934 22.9056 28.4127 33.8013...
+ 39.2099 44.3790 49.5161 54.5221 59.5121 64.3612...
+ 73.7883 82.5779 91.0901 98.9264 106.1366 112.8532...
+ 118.6742 123.9428 128.1160 131.3319 133.8504 134.9742...
+ 135.6765 135.5118 123.6604 104.3501 86.9217 72.7414...
+ 61.2827 51.8830 44.2407 37.9305 27.9604 21.1603...
+ 16.2385 12.6518 10.1006 8.1870 6.7254 5.6218...
+ 4.7542 4.0708 3.5356 3.1156 2.7400 2.4488...
+ 1.5236 1.0705 0.8050 0.6402 0.4454 0.3852...
+ 0.3377 0.2700 0.2248 0.1919 0.1676 0.1491...
+ 0.1333 0.1210 0.1114 0.1028 0.0956 0.0893...
+ 0.0838 0.0790 0.0746 0.0593 0.0489 0.0424...
+ 0.0375 0.0336 0.0306 0.0285 0.0261 0.0231...
+ 0.0207 0.0190 0.0174 0.0163 0.0153 0.0145...
+ 0.0138 0.0132 0.0127 0.0122 0.0118 0.0114...
+ 0.0112 0.0080 0.0064 0.0061 0.0060];
+
+writematrix([DE_3He_intraT_anoxic', DF_3He_intraT_anoxic'], 'MCDS_3HeIntraTrack_intraT_anoxic.txt','Delimiter','tab');
+
+%% Alpha IntraTrack
+% Aerobic data taken from MCDS
+
+DE_alphas_intraT_aerobic = [1.000E-03 1.500E-03 2.000E-03 2.500E-03 3.000E-03 4.000E-03...
+ 5.000E-03 6.000E-03 7.000E-03 8.000E-03 9.000E-03 1.000E-02...
+ 1.250E-02 1.500E-02 1.750E-02 2.000E-02 2.250E-02 2.500E-02...
+ 2.750E-02 3.000E-02 3.500E-02 4.000E-02 4.500E-02 5.000E-02...
+ 5.500E-02 6.000E-02 6.500E-02 7.000E-02 7.500E-02 8.000E-02...
+ 8.500E-02 9.000E-02 9.500E-02 1.000E-01 1.250E-01 1.500E-01...
+ 1.750E-01 2.000E-01 2.250E-01 2.500E-01 2.750E-01 3.000E-01...
+ 3.500E-01 4.000E-01 4.500E-01 5.000E-01 5.500E-01 6.000E-01...
+ 6.500E-01 7.000E-01 7.500E-01 8.000E-01 8.500E-01 9.000E-01...
+ 9.500E-01 1.000E+00 1.250E+00 1.500E+00 1.750E+00 2.000E+00...
+ 2.250E+00 2.500E+00 2.750E+00 3.000E+00 3.500E+00 4.000E+00...
+ 4.500E+00 5.000E+00 5.500E+00 6.000E+00 6.500E+00 7.000E+00...
+ 7.500E+00 8.000E+00 8.500E+00 9.000E+00 9.500E+00 1.000E+01...
+ 1.250E+01 1.500E+01 1.750E+01 2.000E+01 2.500E+01 2.750E+01...
+ 3.000E+01 3.500E+01 4.000E+01 4.500E+01 5.000E+01 5.500E+01...
+ 6.000E+01 6.500E+01 7.000E+01 7.500E+01 8.000E+01 8.500E+01...
+ 9.000E+01 9.500E+01 1.000E+02 1.250E+02 1.500E+02 1.750E+02...
+ 2.000E+02 2.250E+02 2.500E+02 2.750E+02 3.000E+02 3.500E+02...
+ 4.000E+02 4.500E+02 5.000E+02 5.500E+02 6.000E+02 6.500E+02...
+ 7.000E+02 7.500E+02 8.000E+02 8.500E+02 9.000E+02 9.500E+02...
+ 1.000E+03 2.000E+03 5.000E+03 7.500E+03 1.000E+04];
+
+DF_alphas_intraT_aerobic = [0.0280 0.0420 0.0560 0.0699 0.0839 0.1119...
+ 0.1397 0.1678 0.1955 0.2233 0.2510 0.2787...
+ 0.3485 0.4180 0.4868 0.5561 0.6250 0.6941...
+ 0.7623 0.8317 0.9688 1.1048 1.2398 1.3779...
+ 1.5123 1.6462 1.7811 1.9148 2.0506 2.1828...
+ 2.3162 2.4497 2.5770 2.7085 3.3631 3.9949...
+ 4.6377 5.2420 5.8529 6.4509 7.0288 7.6083...
+ 8.7200 9.7842 10.7996 11.7695 12.6704 13.4944...
+ 14.2516 14.9735 15.5661 16.0766 16.5064 16.8577...
+ 17.1529 17.3625 17.3378 16.0832 14.4462 12.8806...
+ 11.5421 10.4188 9.4272 8.6085 7.2494 6.2158...
+ 5.3839 4.7163 4.1708 3.7138 3.3382 3.0182...
+ 2.7431 2.5037 2.3067 2.1272 1.9705 1.8315...
+ 1.3260 1.0205 0.8176 0.6781 0.4976 0.4377...
+ 0.3891 0.3176 0.2671 0.2310 0.2033 0.1811...
+ 0.1632 0.1486 0.1367 0.1263 0.1179 0.1103...
+ 0.1037 0.0976 0.0925 0.0735 0.0612 0.0528...
+ 0.0465 0.0417 0.0381 0.0353 0.0323 0.0284...
+ 0.0254 0.0232 0.0213 0.0198 0.0186 0.0175...
+ 0.0166 0.0158 0.0152 0.0145 0.0140 0.0135...
+ 0.0131 0.0090 0.0067 0.0063 0.0061];
+
+writematrix([DE_alphas_intraT_aerobic', DF_alphas_intraT_aerobic'], 'MCDS_alphaIntraTrack_intraT_aerobic.txt','Delimiter','tab');
+
+% Anoxic data taken from MCDS
+
+DE_alphas_intraT_anoxic = [1.000E-03 1.500E-03 2.000E-03 2.500E-03 3.000E-03 4.000E-03...
+ 5.000E-03 6.000E-03 7.000E-03 8.000E-03 9.000E-03 1.000E-02...
+ 1.250E-02 1.500E-02 1.750E-02 2.000E-02 2.250E-02 2.500E-02...
+ 2.750E-02 3.000E-02 3.500E-02 4.000E-02 4.500E-02 5.000E-02...
+ 5.500E-02 6.000E-02 6.500E-02 7.000E-02 7.500E-02 8.000E-02...
+ 8.500E-02 9.000E-02 9.500E-02 1.000E-01 1.250E-01 1.500E-01...
+ 1.750E-01 2.000E-01 2.250E-01 2.500E-01 2.750E-01 3.000E-01...
+ 3.500E-01 4.000E-01 4.500E-01 5.000E-01 5.500E-01 6.000E-01...
+ 6.500E-01 7.000E-01 7.500E-01 8.000E-01 8.500E-01 9.000E-01...
+ 9.500E-01 1.000E+00 1.250E+00 1.500E+00 1.750E+00 2.000E+00...
+ 2.250E+00 2.500E+00 2.750E+00 3.000E+00 3.500E+00 4.000E+00...
+ 4.500E+00 5.000E+00 5.500E+00 6.000E+00 6.500E+00 7.000E+00...
+ 7.500E+00 8.000E+00 8.500E+00 9.000E+00 9.500E+00 1.000E+01...
+ 1.250E+01 1.500E+01 1.750E+01 2.000E+01 2.500E+01 2.750E+01...
+ 3.000E+01 3.500E+01 4.000E+01 4.500E+01 5.000E+01 5.500E+01...
+ 6.000E+01 6.500E+01 7.000E+01 7.500E+01 8.000E+01 8.500E+01...
+ 9.000E+01 9.500E+01 1.000E+02 1.250E+02 1.500E+02 1.750E+02...
+ 2.000E+02 2.250E+02 2.500E+02 2.750E+02 3.000E+02 3.500E+02...
+ 4.000E+02 4.500E+02 5.000E+02 5.500E+02 6.000E+02 6.500E+02...
+ 7.000E+02 7.500E+02 8.000E+02 8.500E+02 9.000E+02 9.500E+02...
+ 1.000E+03 2.000E+03 5.000E+03 7.500E+03 1.000E+04];
+
+DF_alphas_intraT_anoxic = [0.2367 0.3549 0.4732 0.5913 0.7090 0.9457...
+ 1.1806 1.4182 1.6529 1.8880 2.1212 2.3559...
+ 2.9470 3.5335 4.1081 4.6915 5.2747 5.8556...
+ 6.4359 7.0119 8.1726 9.3237 10.4629 11.6260...
+ 12.7569 13.8920 15.0024 16.1176 17.2653 18.3809...
+ 19.5088 20.6328 21.7078 22.8106 28.2519 33.5752...
+ 38.8902 43.9580 48.9756 53.8635 58.7168 63.4217...
+ 72.5360 81.0301 89.2486 96.7913 103.7565 110.2328...
+ 115.9083 121.2019 125.4063 128.9045 131.7797 133.5853...
+ 135.2722 136.2317 131.6942 117.4289 100.8577 85.7010...
+ 72.9138 62.1793 53.2617 45.8681 34.0222 25.8691...
+ 19.9250 15.5699 12.4606 10.1210 8.3273 6.9715...
+ 5.9013 5.0591 4.3983 3.8786 3.4138 3.0524...
+ 1.9041 1.3394 1.0084 0.8027 0.5589 0.4837...
+ 0.4243 0.3394 0.2828 0.2413 0.2109 0.1875...
+ 0.1678 0.1522 0.1401 0.1293 0.1203 0.1122...
+ 0.1053 0.0993 0.0938 0.0744 0.0613 0.0530...
+ 0.0468 0.0418 0.0381 0.0353 0.0323 0.0285...
+ 0.0254 0.0232 0.0212 0.0197 0.0185 0.0174...
+ 0.0166 0.0158 0.0152 0.0145 0.0140 0.0135...
+ 0.0131 0.0089 0.0067 0.0063 0.0061];
+
+writematrix([DE_alphas_intraT_anoxic', DF_alphas_intraT_anoxic'], 'MCDS_alphaIntraTrack_intraT_anoxic.txt','Delimiter','tab');
+
+%% Lithium-7 IntraTrack
+% Aerobic data taken from MCDS
+
+DE_lithium_intraT_aerobic = [1.000E-03 1.000E-02 1.000E-01 2.000E-01 3.000E-01 5.000E-01...
+ 9.000E-01 1.000E+00 1.100E+00 1.300E+00 1.500E+00 2.000E+00...
+ 2.500E+00 3.000E+00 3.500E+00 4.000E+00 5.000E+00 6.000E+00...
+ 7.500E+00 1.000E+01 1.500E+01 2.500E+01 3.500E+01 5.000E+01...
+ 1.000E+02 2.000E+02 3.000E+02 4.000E+02 5.000E+02 7.500E+02...
+ 1.000E+03 2.000E+03 3.000E+03 4.000E+03 5.000E+03 7.500E+03...
+ 1.000E+04 2.000E+04 3.000E+04 4.000E+04 5.000E+04 7.500E+04...
+ 1.000E+05];
+
+DF_lithium_intraT_aerobic = [2.808E-02 2.803E-01 2.753E+00 5.407E+00 7.964E+00 1.279E+01...
+ 2.132E+01 2.315E+01 2.486E+01 2.784E+01 3.023E+01 3.374E+01...
+ 3.379E+01 3.196E+01 2.963E+01 2.740E+01 2.361E+01 2.072E+01...
+ 1.738E+01 1.348E+01 8.918E+00 4.840E+00 3.078E+00 1.855E+00...
+ 6.803E-01 2.663E-01 1.632E-01 1.175E-01 9.313E-02 6.287E-02...
+ 4.888E-02 2.914E-02 2.300E-02 2.003E-02 1.823E-02 1.612E-02...
+ 1.514E-02 1.398E-02 1.377E-02 1.373E-02 1.372E-02 1.381E-02...
+ 1.388E-02];
+
+writematrix([DE_lithium_intraT_aerobic', DF_lithium_intraT_aerobic'], 'MCDS_lithiumIntraTrack_intraT_aerobic.txt','Delimiter','tab');
+
+% Anoxic data taken from MCDS
+
+DE_lithium_intraT_anoxic = [1.000E-03 1.000E-02 1.000E-01 2.000E-01 3.000E-01 5.000E-01...
+ 9.000E-01 1.000E+00 1.100E+00 1.300E+00 1.500E+00 2.000E+00...
+ 2.500E+00 3.000E+00 3.500E+00 4.000E+00 5.000E+00 6.000E+00...
+ 7.500E+00 1.000E+01 1.500E+01 2.500E+01 3.500E+01 5.000E+01...
+ 1.000E+02 2.000E+02 3.000E+02 4.000E+02 5.000E+02 7.500E+02...
+ 1.000E+03 2.000E+03 3.000E+03 4.000E+03 5.000E+03 7.500E+03...
+ 1.000E+04 2.000E+04 3.000E+04 4.000E+04 5.000E+04 7.500E+04...
+ 1.000E+05];
+
+DF_lithium_intraT_anoxic = [2.372E-01 2.368E+00 2.326E+01 4.568E+01 6.716E+01 1.079E+02...
+ 1.794E+02 1.944E+02 2.088E+02 2.334E+02 2.528E+02 2.810E+02...
+ 2.803E+02 2.634E+02 2.425E+02 2.222E+02 1.879E+02 1.613E+02...
+ 1.302E+02 9.296E+01 4.996E+01 1.702E+01 7.491E+00 3.229E+00...
+ 8.154E-01 2.812E-01 1.685E-01 1.199E-01 9.438E-02 6.353E-02...
+ 4.883E-02 2.917E-02 2.300E-02 2.004E-02 1.825E-02 1.603E-02...
+ 1.511E-02 1.396E-02 1.373E-02 1.368E-02 1.370E-02 1.377E-02...
+ 1.384E-02];
+
+writematrix([DE_lithium_intraT_anoxic', DF_lithium_intraT_anoxic'], 'MCDS_lithiumIntraTrack_intraT_anoxic.txt','Delimiter','tab');
+
+%% Heavy Ion IntraTrack
+% Aerobic data taken from MCDS
+
+DE_heavyIons_intraT_aerobic = [1.000E-03 1.000E-02 1.000E-01 2.000E-01 3.000E-01 5.000E-01...
+ 9.000E-01 1.000E+00 1.100E+00 1.300E+00 1.500E+00 2.000E+00...
+ 2.500E+00 3.000E+00 3.500E+00 4.000E+00 5.000E+00 6.000E+00...
+ 7.500E+00 1.000E+01 1.500E+01 2.500E+01 3.500E+01 5.000E+01...
+ 1.000E+02 2.000E+02 3.000E+02 4.000E+02 5.000E+02 7.500E+02...
+ 1.000E+03 2.000E+03 3.000E+03 4.000E+03 5.000E+03 7.500E+03...
+ 1.000E+04 2.000E+04 3.000E+04 4.000E+04 5.000E+04 7.500E+04...
+ 1.000E+05];
+
+DF_heavyIons_intraT_aerobic = [0.00244770000000000 0.0244715000000000 0.242961250000000 ...
+ 0.481593750000000 0.716227500000000 1.17477500000000 ...
+ 2.05341250000000 2.26528750000000 2.47388750000000 ...
+ 2.88140000000000 3.27520000000000 4.19878750000000 ...
+ 5.03250000000000 5.78591250000000 6.47062500000000 ...
+ 7.09235000000000 8.13282500000000 8.93030000000000 ...
+ 9.80123750000000 10.8160375000000 11.9892250000000 ...
+ 12.1575975000000 11.5521087500000 10.6656625000000 ...
+ 8.59856625000000 6.38023750000000 5.14437500000000 4.33690762500000 ...
+ 3.76276325000000 2.85259975000000 2.31616537500000 1.37251587500000 ...
+ 1.01052050000000 0.818302250000000 0.698844375000000 0.534236500000000 ...
+ 0.449562125000000 0.320821875000000 0.278999000000000 0.259249000000000 ...
+ 0.248209625000000 0.235294750000000 0.230197000000000];
+
+DF_heavyIons_intraT_aerobic = DF_heavyIons_intraT_aerobic*3.41^2; % Use constant RBE factor for heavy ions
+
+writematrix([DE_heavyIons_intraT_aerobic', DF_heavyIons_intraT_aerobic'], 'MCDS_heavyIonsIntraTrack_intraT_aerobic.txt','Delimiter','tab');
+
+% Anoxic data taken from MCDS
+
+DE_heavyIons_intraT_anoxic = [1.000E-03 1.000E-02 1.000E-01 2.000E-01 3.000E-01 5.000E-01...
+ 9.000E-01 1.000E+00 1.100E+00 1.300E+00 1.500E+00 2.000E+00...
+ 2.500E+00 3.000E+00 3.500E+00 4.000E+00 5.000E+00 6.000E+00...
+ 7.500E+00 1.000E+01 1.500E+01 2.500E+01 3.500E+01 5.000E+01...
+ 1.000E+02 2.000E+02 3.000E+02 4.000E+02 5.000E+02 7.500E+02...
+ 1.000E+03 2.000E+03 3.000E+03 4.000E+03 5.000E+03 7.500E+03...
+ 1.000E+04 2.000E+04 3.000E+04 4.000E+04 5.000E+04 7.500E+04...
+ 1.000E+05];
+
+DF_heavyIons_intraT_anoxic = [0.00244770000000000 0.0244715000000000 0.242961250000000 ...
+ 0.481593750000000 0.716227500000000 1.17477500000000 ...
+ 2.05341250000000 2.26528750000000 2.47388750000000 ...
+ 2.88140000000000 3.27520000000000 4.19878750000000 ...
+ 5.03250000000000 5.78591250000000 6.47062500000000 ...
+ 7.09235000000000 8.13282500000000 8.93030000000000 ...
+ 9.80123750000000 10.8160375000000 11.9892250000000 ...
+ 12.1575975000000 11.5521087500000 10.6656625000000 ...
+ 8.59856625000000 6.38023750000000 5.14437500000000 4.33690762500000 ...
+ 3.76276325000000 2.85259975000000 2.31616537500000 1.37251587500000 ...
+ 1.01052050000000 0.818302250000000 0.698844375000000 0.534236500000000 ...
+ 0.449562125000000 0.320821875000000 0.278999000000000 0.259249000000000 ...
+ 0.248209625000000 0.235294750000000 0.230197000000000];
+
+DF_heavyIons_intraT_anoxic = DF_heavyIons_intraT_anoxic*9.93^2; % Use constant RBE factor for heavy ions
+
+writematrix([DE_heavyIons_intraT_anoxic', DF_heavyIons_intraT_anoxic'], 'MCDS_heavyIonsIntraTrack_intraT_anoxic.txt','Delimiter','tab');
diff --git a/MCNP/RBEfactors/additionalMat/MCDS_writeRBEfactors.m b/MCNP/RBEfactors/additionalMat/MCDS_writeRBEfactors.m
new file mode 100644
index 000000000..422bc813a
--- /dev/null
+++ b/MCNP/RBEfactors/additionalMat/MCDS_writeRBEfactors.m
@@ -0,0 +1,423 @@
+%% Proton RBE
+% Aerobic data taken from MCDS
+
+DE_protons_DSB_aerobic = [1.000E-03 2.000E-03 3.000E-03 4.000E-03 5.000E-03 6.470E-03...
+ 7.500E-03 1.000E-02 2.000E-02 3.000E-02 4.000E-02 5.000E-02...
+ 6.000E-02 7.000E-02 8.000E-02 9.000E-02 1.000E-01 2.000E-01...
+ 3.000E-01 5.000E-01 9.000E-01 1.000E+00 1.100E+00 1.300E+00...
+ 1.500E+00 2.000E+00 2.500E+00 3.000E+00 3.500E+00 4.000E+00...
+ 5.000E+00 6.000E+00 7.500E+00 1.000E+01 1.500E+01 2.500E+01...
+ 5.000E+01 7.500E+01 1.000E+02 1.500E+02 2.000E+02 2.500E+02...
+ 5.000E+02 1.000E+03];
+
+DF_protons_DSB_aerobic = [3.375E+00 3.367E+00 3.368E+00 3.363E+00 3.359E+00 3.352E+00...
+ 3.348E+00 3.340E+00 3.317E+00 3.290E+00 3.264E+00 3.242E+00...
+ 3.216E+00 3.193E+00 3.168E+00 3.143E+00 3.122E+00 2.889E+00...
+ 2.687E+00 2.370E+00 1.986E+00 1.916E+00 1.860E+00 1.760E+00...
+ 1.685E+00 1.542E+00 1.451E+00 1.386E+00 1.336E+00 1.297E+00...
+ 1.244E+00 1.204E+00 1.164E+00 1.123E+00 1.083E+00 1.051E+00...
+ 1.026E+00 1.016E+00 1.012E+00 1.004E+00 1.004E+00 1.003E+00...
+ 1.001E+00 9.995E-01];
+
+writematrix([DE_protons_DSB_aerobic', DF_protons_DSB_aerobic'], 'MCDS_protonRBE_DSB_aerobic.txt','Delimiter','tab');
+
+% Anoxic data taken from MCDS
+
+DE_protons_DSB_anoxic = [1.000E-03 2.000E-03 3.000E-03 4.000E-03 5.000E-03 6.470E-03...
+ 7.500E-03 1.000E-02 2.000E-02 3.000E-02 4.000E-02 5.000E-02...
+ 6.000E-02 7.000E-02 8.000E-02 9.000E-02 1.000E-01 2.000E-01...
+ 3.000E-01 5.000E-01 9.000E-01 1.000E+00 1.100E+00 1.300E+00...
+ 1.500E+00 2.000E+00 2.500E+00 3.000E+00 3.500E+00 4.000E+00...
+ 5.000E+00 6.000E+00 7.500E+00 1.000E+01 1.500E+01 2.500E+01...
+ 5.000E+01 7.500E+01 1.000E+02 1.500E+02 2.000E+02 2.500E+02...
+ 5.000E+02 1.000E+03];
+
+DF_protons_DSB_anoxic = [9.805E+00 9.770E+00 9.775E+00 9.748E+00 9.739E+00 9.707E+00...
+ 9.697E+00 9.663E+00 9.543E+00 9.425E+00 9.298E+00 9.179E+00...
+ 9.041E+00 8.910E+00 8.764E+00 8.628E+00 8.481E+00 6.980E+00...
+ 5.626E+00 3.864E+00 2.490E+00 2.326E+00 2.198E+00 1.997E+00...
+ 1.860E+00 1.638E+00 1.518E+00 1.432E+00 1.370E+00 1.330E+00...
+ 1.261E+00 1.218E+00 1.175E+00 1.130E+00 1.086E+00 1.047E+00...
+ 1.026E+00 1.013E+00 1.011E+00 1.002E+00 1.002E+00 1.002E+00...
+ 9.993E-01 9.977E-01];
+
+writematrix([DE_protons_DSB_anoxic', DF_protons_DSB_anoxic'], 'MCDS_protonRBE_DSB_anoxic.txt','Delimiter','tab');
+
+%% Electron RBE
+% Aerobic data taken from MCDS
+
+DE_electrons_DSB_aerobic = [1.000E-05 2.000E-05 3.000E-05 4.000E-05 5.000E-05 6.000E-05...
+ 7.000E-05 8.000E-05 9.000E-05 1.000E-04 2.000E-04 3.000E-04...
+ 4.000E-04 5.000E-04 6.000E-04 7.000E-04 8.000E-04 9.000E-04...
+ 1.000E-03 2.000E-03 3.000E-03 4.000E-03 5.000E-03 6.000E-03...
+ 7.000E-03 8.000E-03 9.000E-03 1.000E-02 2.000E-02 3.000E-02...
+ 4.000E-02 5.000E-02 6.000E-02 7.000E-02 8.000E-02 9.000E-02...
+ 1.000E-01 2.000E-01 3.000E-01 4.000E-01 5.000E-01 1.000E+00...
+ 1.000E+01 1.000E+02 1.500E+02 2.000E+02 3.000E+02 4.000E+02...
+ 5.000E+02 6.000E+02 8.000E+02 9.000E+02 1.000E+03];
+
+DF_electrons_DSB_aerobic = [3.383E+00 3.353E+00 3.321E+00 3.278E+00 3.234E+00 3.190E+00...
+ 3.139E+00 3.091E+00 3.046E+00 3.001E+00 2.600E+00 2.319E+00...
+ 2.118E+00 1.966E+00 1.851E+00 1.759E+00 1.688E+00 1.627E+00...
+ 1.573E+00 1.314E+00 1.215E+00 1.162E+00 1.129E+00 1.111E+00...
+ 1.093E+00 1.082E+00 1.070E+00 1.062E+00 1.028E+00 1.015E+00...
+ 1.011E+00 1.007E+00 1.006E+00 1.002E+00 1.002E+00 1.002E+00...
+ 9.989E-01 9.959E-01 9.952E-01 9.945E-01 9.941E-01 9.921E-01...
+ 9.907E-01 9.943E-01 9.943E-01 9.943E-01 9.943E-01 9.943E-01...
+ 9.943E-01 9.943E-01 9.943E-01 9.943E-01 9.943E-01];
+
+writematrix([DE_electrons_DSB_aerobic', DF_electrons_DSB_aerobic'], 'MCDS_electronRBE_DSB_aerobic.txt','Delimiter','tab');
+
+% Anoxic data taken from MCDS
+
+DE_electrons_DSB_anoxic = [1.000E-05 2.000E-05 3.000E-05 4.000E-05 5.000E-05 6.000E-05...
+ 7.000E-05 8.000E-05 9.000E-05 1.000E-04 2.000E-04 3.000E-04...
+ 4.000E-04 5.000E-04 6.000E-04 7.000E-04 8.000E-04 9.000E-04...
+ 1.000E-03 2.000E-03 3.000E-03 4.000E-03 5.000E-03 6.000E-03...
+ 7.000E-03 8.000E-03 9.000E-03 1.000E-02 2.000E-02 3.000E-02...
+ 4.000E-02 5.000E-02 6.000E-02 7.000E-02 8.000E-02 9.000E-02...
+ 1.000E-01 2.000E-01 3.000E-01 4.000E-01 5.000E-01 1.000E+00...
+ 1.000E+01 1.000E+02 1.500E+02 2.000E+02 3.000E+02 4.000E+02...
+ 5.000E+02 6.000E+02 8.000E+02 9.000E+02 1.000E+03];
+
+DF_electrons_DSB_anoxic = [9.833E+00 9.718E+00 9.584E+00 9.387E+00 9.168E+00 8.923E+00...
+ 8.635E+00 8.353E+00 8.057E+00 7.756E+00 5.120E+00 3.654E+00...
+ 2.886E+00 2.453E+00 2.185E+00 1.994E+00 1.875E+00 1.770E+00...
+ 1.687E+00 1.342E+00 1.231E+00 1.170E+00 1.137E+00 1.117E+00...
+ 1.095E+00 1.085E+00 1.069E+00 1.061E+00 1.029E+00 1.016E+00...
+ 1.009E+00 1.005E+00 1.001E+00 1.001E+00 1.000E+00 1.002E+00...
+ 9.969E-01 9.941E-01 9.945E-01 9.910E-01 9.933E-01 9.913E-01...
+ 9.887E-01 9.940E-01 9.940E-01 9.940E-01 9.940E-01 9.940E-01...
+ 9.940E-01 9.940E-01 9.940E-01 9.940E-01 9.940E-01];
+
+writematrix([DE_electrons_DSB_anoxic', DF_electrons_DSB_anoxic'], 'MCDS_electronRBE_DSB_anoxic.txt','Delimiter','tab');
+
+%% Deuteron RBE
+% Aerobic data taken from MCDS
+
+DE_deuterons_DSB_aerobic = [1.000E-03 2.000E-03 3.000E-03 4.000E-03 5.000E-03 6.470E-03...
+ 7.500E-03 1.000E-02 2.000E-02 3.000E-02 4.000E-02 5.000E-02...
+ 6.000E-02 7.000E-02 8.000E-02 9.000E-02 1.000E-01 2.000E-01...
+ 3.000E-01 5.000E-01 9.000E-01 1.000E+00 1.100E+00 1.300E+00...
+ 1.500E+00 2.000E+00 2.500E+00 3.000E+00 3.500E+00 4.000E+00...
+ 5.000E+00 6.000E+00 7.500E+00 1.000E+01 1.500E+01 2.500E+01...
+ 5.000E+01 7.500E+01 1.000E+02 1.500E+02 2.000E+02 2.500E+02...
+ 5.000E+02 1.000E+03];
+
+DF_deuterons_DSB_aerobic = [3.361E+00 3.360E+00 3.355E+00 3.352E+00 3.354E+00 3.346E+00...
+ 3.348E+00 3.344E+00 3.325E+00 3.316E+00 3.304E+00 3.286E+00...
+ 3.277E+00 3.262E+00 3.252E+00 3.241E+00 3.225E+00 3.106E+00...
+ 2.988E+00 2.771E+00 2.428E+00 2.359E+00 2.296E+00 2.189E+00...
+ 2.094E+00 1.908E+00 1.774E+00 1.678E+00 1.597E+00 1.534E+00...
+ 1.446E+00 1.375E+00 1.311E+00 1.235E+00 1.159E+00 1.097E+00...
+ 1.044E+00 1.028E+00 1.020E+00 1.009E+00 1.006E+00 1.003E+00...
+ 9.985E-01 9.967E-01];
+
+writematrix([DE_deuterons_DSB_aerobic', DF_deuterons_DSB_aerobic'], 'MCDS_deuteronRBE_DSB_aerobic.txt','Delimiter','tab');
+
+% Anoxic data taken from MCDS
+
+DE_deuterons_DSB_anoxic = [1.000E-03 2.000E-03 3.000E-03 4.000E-03 5.000E-03 6.470E-03...
+ 7.500E-03 1.000E-02 2.000E-02 3.000E-02 4.000E-02 5.000E-02...
+ 6.000E-02 7.000E-02 8.000E-02 9.000E-02 1.000E-01 2.000E-01...
+ 3.000E-01 5.000E-01 9.000E-01 1.000E+00 1.100E+00 1.300E+00...
+ 1.500E+00 2.000E+00 2.500E+00 3.000E+00 3.500E+00 4.000E+00...
+ 5.000E+00 6.000E+00 7.500E+00 1.000E+01 1.500E+01 2.500E+01...
+ 5.000E+01 7.500E+01 1.000E+02 1.500E+02 2.000E+02 2.500E+02...
+ 5.000E+02 1.000E+03];
+
+DF_deuterons_DSB_anoxic = [9.754E+00 9.750E+00 9.727E+00 9.716E+00 9.724E+00 9.689E+00...
+ 9.697E+00 9.685E+00 9.610E+00 9.552E+00 9.498E+00 9.425E+00...
+ 9.378E+00 9.303E+00 9.251E+00 9.189E+00 9.126E+00 8.426E+00...
+ 7.689E+00 6.231E+00 4.173E+00 3.834E+00 3.555E+00 3.122E+00...
+ 2.805E+00 2.308E+00 2.021E+00 1.852E+00 1.728E+00 1.633E+00...
+ 1.508E+00 1.419E+00 1.338E+00 1.249E+00 1.167E+00 1.102E+00...
+ 1.047E+00 1.028E+00 1.016E+00 1.008E+00 1.004E+00 1.002E+00...
+ 9.973E-01 9.937E-01];
+
+writematrix([DE_deuterons_DSB_anoxic', DF_deuterons_DSB_anoxic'], 'MCDS_deuteronRBE_DSB_anoxic.txt','Delimiter','tab');
+
+
+%% Triton RBE
+% Aerobic data taken from MCDS
+
+DE_tritons_DSB_aerobic = [1.000E-03 2.000E-03 3.000E-03 4.000E-03 5.000E-03 6.470E-03...
+ 7.500E-03 1.000E-02 2.000E-02 3.000E-02 4.000E-02 5.000E-02...
+ 6.000E-02 7.000E-02 8.000E-02 9.000E-02 1.000E-01 2.000E-01...
+ 3.000E-01 5.000E-01 9.000E-01 1.000E+00 1.100E+00 1.300E+00...
+ 1.500E+00 2.000E+00 2.500E+00 3.000E+00 3.500E+00 4.000E+00...
+ 5.000E+00 6.000E+00 7.500E+00 1.000E+01 1.500E+01 2.500E+01...
+ 5.000E+01 7.500E+01 1.000E+02 1.500E+02 2.000E+02 2.500E+02...
+ 5.000E+02 1.000E+03];
+
+DF_tritons_DSB_aerobic = [3.362E+00 3.359E+00 3.360E+00 3.355E+00 3.357E+00 3.353E+00...
+ 3.354E+00 3.348E+00 3.336E+00 3.329E+00 3.318E+00 3.307E+00...
+ 3.302E+00 3.293E+00 3.282E+00 3.274E+00 3.267E+00 3.185E+00...
+ 3.107E+00 2.950E+00 2.673E+00 2.617E+00 2.556E+00 2.456E+00...
+ 2.363E+00 2.169E+00 2.022E+00 1.907E+00 1.812E+00 1.737E+00...
+ 1.619E+00 1.535E+00 1.443E+00 1.343E+00 1.237E+00 1.146E+00...
+ 1.072E+00 1.041E+00 1.030E+00 1.019E+00 1.012E+00 1.007E+00...
+ 1.001E+00 9.965E-01];
+
+writematrix([DE_tritons_DSB_aerobic', DF_tritons_DSB_aerobic'], 'MCDS_tritonRBE_DSB_aerobic.txt','Delimiter','tab');
+
+% Anoxic data taken from MCDS
+
+DE_tritons_DSB_anoxic = [1.000E-03 2.000E-03 3.000E-03 4.000E-03 5.000E-03 6.470E-03...
+ 7.500E-03 1.000E-02 2.000E-02 3.000E-02 4.000E-02 5.000E-02...
+ 6.000E-02 7.000E-02 8.000E-02 9.000E-02 1.000E-01 2.000E-01...
+ 3.000E-01 5.000E-01 9.000E-01 1.000E+00 1.100E+00 1.300E+00...
+ 1.500E+00 2.000E+00 2.500E+00 3.000E+00 3.500E+00 4.000E+00...
+ 5.000E+00 6.000E+00 7.500E+00 1.000E+01 1.500E+01 2.500E+01...
+ 5.000E+01 7.500E+01 1.000E+02 1.500E+02 2.000E+02 2.500E+02...
+ 5.000E+02 1.000E+03];
+
+DF_tritons_DSB_anoxic = [9.755E+00 9.748E+00 9.750E+00 9.727E+00 9.732E+00 9.719E+00...
+ 9.724E+00 9.696E+00 9.651E+00 9.621E+00 9.570E+00 9.528E+00...
+ 9.490E+00 9.456E+00 9.401E+00 9.370E+00 9.325E+00 8.900E+00...
+ 8.430E+00 7.427E+00 5.593E+00 5.218E+00 4.865E+00 4.303E+00...
+ 3.843E+00 3.057E+00 2.600E+00 2.312E+00 2.098E+00 1.951E+00...
+ 1.763E+00 1.635E+00 1.505E+00 1.372E+00 1.255E+00 1.154E+00...
+ 1.073E+00 1.041E+00 1.030E+00 1.014E+00 1.011E+00 1.004E+00...
+ 9.995E-01 9.979E-01];
+
+writematrix([DE_tritons_DSB_anoxic', DF_tritons_DSB_anoxic'], 'MCDS_tritonRBE_DSB_anoxic.txt','Delimiter','tab');
+
+%% 3He RBE
+% Aerobic data taken from MCDS
+
+DE_3He_DSB_aerobic = [1.000E-03 1.500E-03 2.000E-03 2.500E-03 3.000E-03 4.000E-03...
+ 5.000E-03 6.000E-03 7.000E-03 8.000E-03 9.000E-03 1.000E-02...
+ 1.250E-02 1.500E-02 1.750E-02 2.000E-02 2.250E-02 2.500E-02...
+ 2.750E-02 3.000E-02 3.500E-02 4.000E-02 4.500E-02 5.000E-02...
+ 5.500E-02 6.000E-02 6.500E-02 7.000E-02 7.500E-02 8.000E-02...
+ 8.500E-02 9.000E-02 9.500E-02 1.000E-01 1.250E-01 1.500E-01...
+ 1.750E-01 2.000E-01 2.250E-01 2.500E-01 2.750E-01 3.000E-01...
+ 3.500E-01 4.000E-01 4.500E-01 5.000E-01 5.500E-01 6.000E-01...
+ 6.500E-01 7.000E-01 7.500E-01 8.000E-01 8.500E-01 9.000E-01...
+ 9.500E-01 1.000E+00 1.250E+00 1.500E+00 1.750E+00 2.000E+00...
+ 2.250E+00 2.500E+00 2.750E+00 3.000E+00 3.500E+00 4.000E+00...
+ 4.500E+00 5.000E+00 5.500E+00 6.000E+00 6.500E+00 7.000E+00...
+ 7.500E+00 8.000E+00 8.500E+00 9.000E+00 9.500E+00 1.000E+01...
+ 1.250E+01 1.500E+01 1.750E+01 2.000E+01 2.500E+01 2.750E+01...
+ 3.000E+01 3.500E+01 4.000E+01 4.500E+01 5.000E+01 5.500E+01...
+ 6.000E+01 6.500E+01 7.000E+01 7.500E+01 8.000E+01 8.500E+01...
+ 9.000E+01 9.500E+01 1.000E+02 1.250E+02 1.500E+02 1.750E+02...
+ 2.000E+02 2.250E+02 2.500E+02 2.750E+02 3.000E+02 3.500E+02...
+ 3.750E+02 4.000E+02 4.500E+02 5.000E+02 5.500E+02 6.000E+02...
+ 6.500E+02 7.000E+02 7.500E+02 8.000E+02 8.500E+02 9.000E+02...
+ 9.500E+02 1.000E+03 2.000E+03 5.000E+03 7.500E+03 1.000E+04];
+
+DF_3He_DSB_aerobic = [3.381E+00 3.380E+00 3.381E+00 3.380E+00 3.379E+00 3.380E+00...
+ 3.377E+00 3.379E+00 3.377E+00 3.377E+00 3.375E+00 3.375E+00...
+ 3.376E+00 3.376E+00 3.374E+00 3.374E+00 3.373E+00 3.373E+00...
+ 3.371E+00 3.372E+00 3.370E+00 3.369E+00 3.367E+00 3.368E+00...
+ 3.366E+00 3.365E+00 3.364E+00 3.362E+00 3.364E+00 3.362E+00...
+ 3.362E+00 3.362E+00 3.358E+00 3.357E+00 3.354E+00 3.347E+00...
+ 3.347E+00 3.339E+00 3.336E+00 3.332E+00 3.326E+00 3.323E+00...
+ 3.314E+00 3.305E+00 3.296E+00 3.288E+00 3.280E+00 3.269E+00...
+ 3.259E+00 3.251E+00 3.241E+00 3.230E+00 3.220E+00 3.210E+00...
+ 3.201E+00 3.192E+00 3.143E+00 3.094E+00 3.046E+00 2.995E+00...
+ 2.946E+00 2.900E+00 2.851E+00 2.808E+00 2.722E+00 2.645E+00...
+ 2.570E+00 2.502E+00 2.437E+00 2.376E+00 2.323E+00 2.271E+00...
+ 2.223E+00 2.178E+00 2.139E+00 2.100E+00 2.064E+00 2.031E+00...
+ 1.885E+00 1.777E+00 1.691E+00 1.624E+00 1.521E+00 1.482E+00...
+ 1.447E+00 1.392E+00 1.347E+00 1.313E+00 1.285E+00 1.261E+00...
+ 1.240E+00 1.223E+00 1.208E+00 1.195E+00 1.185E+00 1.175E+00...
+ 1.165E+00 1.156E+00 1.149E+00 1.120E+00 1.099E+00 1.087E+00...
+ 1.076E+00 1.067E+00 1.061E+00 1.054E+00 1.050E+00 1.044E+00...
+ 1.041E+00 1.038E+00 1.035E+00 1.029E+00 1.027E+00 1.026E+00...
+ 1.023E+00 1.022E+00 1.020E+00 1.020E+00 1.018E+00 1.018E+00...
+ 1.016E+00 1.015E+00 1.007E+00 1.004E+00 1.004E+00 1.000E+00];
+
+writematrix([DE_3He_DSB_aerobic', DF_3He_DSB_aerobic'], 'MCDS_3HeRBE_DSB_aerobic.txt','Delimiter','tab');
+
+% Anoxic data taken from MCDS
+
+DE_3He_DSB_anoxic = [1.000E-03 1.500E-03 2.000E-03 2.500E-03 3.000E-03 4.000E-03...
+ 5.000E-03 6.000E-03 7.000E-03 8.000E-03 9.000E-03 1.000E-02...
+ 1.250E-02 1.500E-02 1.750E-02 2.000E-02 2.250E-02 2.500E-02...
+ 2.750E-02 3.000E-02 3.500E-02 4.000E-02 4.500E-02 5.000E-02...
+ 5.500E-02 6.000E-02 6.500E-02 7.000E-02 7.500E-02 8.000E-02...
+ 8.500E-02 9.000E-02 9.500E-02 1.000E-01 1.250E-01 1.500E-01...
+ 1.750E-01 2.000E-01 2.250E-01 2.500E-01 2.750E-01 3.000E-01...
+ 3.500E-01 4.000E-01 4.500E-01 5.000E-01 5.500E-01 6.000E-01...
+ 6.500E-01 7.000E-01 7.500E-01 8.000E-01 8.500E-01 9.000E-01...
+ 9.500E-01 1.000E+00 1.250E+00 1.500E+00 1.750E+00 2.000E+00...
+ 2.250E+00 2.500E+00 2.750E+00 3.000E+00 3.500E+00 4.000E+00...
+ 4.500E+00 5.000E+00 5.500E+00 6.000E+00 6.500E+00 7.000E+00...
+ 7.500E+00 8.000E+00 8.500E+00 9.000E+00 9.500E+00 1.000E+01...
+ 1.250E+01 1.500E+01 1.750E+01 2.000E+01 2.500E+01 2.750E+01...
+ 3.000E+01 3.500E+01 4.000E+01 4.500E+01 5.000E+01 5.500E+01...
+ 6.000E+01 6.500E+01 7.000E+01 7.500E+01 8.000E+01 8.500E+01...
+ 9.000E+01 9.500E+01 1.000E+02 1.250E+02 1.500E+02 1.750E+02...
+ 2.000E+02 2.250E+02 2.500E+02 2.750E+02 3.000E+02 3.500E+02...
+ 4.000E+02 4.500E+02 5.000E+02 5.500E+02 6.000E+02 6.500E+02...
+ 7.000E+02 7.500E+02 8.000E+02 8.500E+02 9.000E+02 9.500E+02...
+ 1.000E+03 2.000E+03 5.000E+03 7.500E+03 1.000E+04];
+
+DF_3He_DSB_anoxic = [9.827E+00 9.825E+00 9.826E+00 9.824E+00 9.821E+00 9.823E+00...
+ 9.814E+00 9.822E+00 9.817E+00 9.816E+00 9.811E+00 9.809E+00...
+ 9.813E+00 9.813E+00 9.798E+00 9.797E+00 9.795E+00 9.794E+00...
+ 9.788E+00 9.791E+00 9.788E+00 9.783E+00 9.777E+00 9.780E+00...
+ 9.773E+00 9.772E+00 9.760E+00 9.754E+00 9.758E+00 9.753E+00...
+ 9.753E+00 9.754E+00 9.743E+00 9.739E+00 9.721E+00 9.700E+00...
+ 9.692E+00 9.666E+00 9.647E+00 9.625E+00 9.610E+00 9.591E+00...
+ 9.555E+00 9.508E+00 9.472E+00 9.426E+00 9.383E+00 9.340E+00...
+ 9.291E+00 9.250E+00 9.196E+00 9.143E+00 9.095E+00 9.033E+00...
+ 8.986E+00 8.939E+00 8.659E+00 8.358E+00 8.046E+00 7.723E+00...
+ 7.402E+00 7.083E+00 6.775E+00 6.480E+00 5.895E+00 5.395E+00...
+ 4.943E+00 4.544E+00 4.212E+00 3.922E+00 3.667E+00 3.451E+00...
+ 3.260E+00 3.094E+00 2.953E+00 2.835E+00 2.717E+00 2.620E+00...
+ 2.258E+00 2.036E+00 1.878E+00 1.767E+00 1.612E+00 1.558E+00...
+ 1.511E+00 1.438E+00 1.385E+00 1.342E+00 1.309E+00 1.283E+00...
+ 1.257E+00 1.238E+00 1.224E+00 1.208E+00 1.196E+00 1.184E+00...
+ 1.174E+00 1.165E+00 1.156E+00 1.127E+00 1.100E+00 1.088E+00...
+ 1.078E+00 1.068E+00 1.061E+00 1.055E+00 1.049E+00 1.044E+00...
+ 1.037E+00 1.035E+00 1.028E+00 1.025E+00 1.024E+00 1.020E+00...
+ 1.021E+00 1.019E+00 1.019E+00 1.016E+00 1.015E+00 1.014E+00...
+ 1.016E+00 1.004E+00 1.003E+00 1.003E+00 9.996E-01];
+
+writematrix([DE_3He_DSB_anoxic', DF_3He_DSB_anoxic'], 'MCDS_3HeRBE_DSB_anoxic.txt','Delimiter','tab');
+
+%% Alpha RBE
+% Aerobic data taken from MCDS
+
+DE_alphas_DSB_aerobic = [1.000E-03 1.500E-03 2.000E-03 2.500E-03 3.000E-03 4.000E-03...
+ 5.000E-03 6.000E-03 7.000E-03 8.000E-03 9.000E-03 1.000E-02...
+ 1.250E-02 1.500E-02 1.750E-02 2.000E-02 2.250E-02 2.500E-02...
+ 2.750E-02 3.000E-02 3.500E-02 4.000E-02 4.500E-02 5.000E-02...
+ 5.500E-02 6.000E-02 6.500E-02 7.000E-02 7.500E-02 8.000E-02...
+ 8.500E-02 9.000E-02 9.500E-02 1.000E-01 1.250E-01 1.500E-01...
+ 1.750E-01 2.000E-01 2.250E-01 2.500E-01 2.750E-01 3.000E-01...
+ 3.500E-01 4.000E-01 4.500E-01 5.000E-01 5.500E-01 6.000E-01...
+ 6.500E-01 7.000E-01 7.500E-01 8.000E-01 8.500E-01 9.000E-01...
+ 9.500E-01 1.000E+00 1.250E+00 1.500E+00 1.750E+00 2.000E+00...
+ 2.250E+00 2.500E+00 2.750E+00 3.000E+00 3.500E+00 4.000E+00...
+ 4.500E+00 5.000E+00 5.500E+00 6.000E+00 6.500E+00 7.000E+00...
+ 7.500E+00 8.000E+00 8.500E+00 9.000E+00 9.500E+00 1.000E+01...
+ 1.250E+01 1.500E+01 1.750E+01 2.000E+01 2.500E+01 2.750E+01...
+ 3.000E+01 3.500E+01 4.000E+01 4.500E+01 5.000E+01 5.500E+01...
+ 6.000E+01 6.500E+01 7.000E+01 7.500E+01 8.000E+01 8.500E+01...
+ 9.000E+01 9.500E+01 1.000E+02 1.250E+02 1.500E+02 1.750E+02...
+ 2.000E+02 2.250E+02 2.500E+02 2.750E+02 3.000E+02 3.500E+02...
+ 3.750E+02 4.000E+02 4.500E+02 5.000E+02 5.500E+02 6.000E+02...
+ 6.500E+02 7.000E+02 7.500E+02 8.000E+02 8.500E+02 9.000E+02...
+ 9.500E+02 1.000E+03 2.000E+03 5.000E+03 7.500E+03 1.000E+04];
+
+DF_alphas_DSB_aerobic = [3.381E+00 3.379E+00 3.381E+00 3.380E+00 3.378E+00 3.379E+00...
+ 3.378E+00 3.377E+00 3.378E+00 3.378E+00 3.377E+00 3.377E+00...
+ 3.377E+00 3.376E+00 3.374E+00 3.375E+00 3.375E+00 3.373E+00...
+ 3.371E+00 3.372E+00 3.372E+00 3.370E+00 3.371E+00 3.370E+00...
+ 3.367E+00 3.368E+00 3.369E+00 3.365E+00 3.365E+00 3.366E+00...
+ 3.365E+00 3.364E+00 3.362E+00 3.362E+00 3.358E+00 3.355E+00...
+ 3.352E+00 3.349E+00 3.345E+00 3.342E+00 3.338E+00 3.334E+00...
+ 3.329E+00 3.323E+00 3.317E+00 3.309E+00 3.303E+00 3.294E+00...
+ 3.289E+00 3.283E+00 3.276E+00 3.270E+00 3.263E+00 3.253E+00...
+ 3.247E+00 3.239E+00 3.204E+00 3.165E+00 3.129E+00 3.092E+00...
+ 3.055E+00 3.018E+00 2.979E+00 2.945E+00 2.869E+00 2.804E+00...
+ 2.739E+00 2.679E+00 2.622E+00 2.567E+00 2.513E+00 2.466E+00...
+ 2.417E+00 2.373E+00 2.332E+00 2.291E+00 2.255E+00 2.222E+00...
+ 2.070E+00 1.948E+00 1.852E+00 1.774E+00 1.654E+00 1.607E+00...
+ 1.566E+00 1.500E+00 1.444E+00 1.402E+00 1.367E+00 1.338E+00...
+ 1.311E+00 1.288E+00 1.271E+00 1.254E+00 1.240E+00 1.224E+00...
+ 1.216E+00 1.204E+00 1.195E+00 1.158E+00 1.131E+00 1.115E+00...
+ 1.100E+00 1.088E+00 1.079E+00 1.072E+00 1.067E+00 1.057E+00...
+ 1.053E+00 1.051E+00 1.044E+00 1.041E+00 1.037E+00 1.031E+00...
+ 1.032E+00 1.029E+00 1.027E+00 1.027E+00 1.024E+00 1.022E+00...
+ 1.020E+00 1.020E+00 1.010E+00 1.004E+00 1.004E+00 1.002E+00];
+
+writematrix([DE_alphas_DSB_aerobic', DF_alphas_DSB_aerobic'], 'MCDS_alphaRBE_DSB_aerobic.txt','Delimiter','tab');
+
+% Anoxic data taken from MCDS
+
+DE_alphas_DSB_anoxic = [1.000E-03 1.500E-03 2.000E-03 2.500E-03 3.000E-03 4.000E-03...
+ 5.000E-03 6.000E-03 7.000E-03 8.000E-03 9.000E-03 1.000E-02...
+ 1.250E-02 1.500E-02 1.750E-02 2.000E-02 2.250E-02 2.500E-02...
+ 2.750E-02 3.000E-02 3.500E-02 4.000E-02 4.500E-02 5.000E-02...
+ 5.500E-02 6.000E-02 6.500E-02 7.000E-02 7.500E-02 8.000E-02...
+ 8.500E-02 9.000E-02 9.500E-02 1.000E-01 1.250E-01 1.500E-01...
+ 1.750E-01 2.000E-01 2.250E-01 2.500E-01 2.750E-01 3.000E-01...
+ 3.500E-01 4.000E-01 4.500E-01 5.000E-01 5.500E-01 6.000E-01...
+ 6.500E-01 7.000E-01 7.500E-01 8.000E-01 8.500E-01 9.000E-01...
+ 9.500E-01 1.000E+00 1.250E+00 1.500E+00 1.750E+00 2.000E+00...
+ 2.250E+00 2.500E+00 2.750E+00 3.000E+00 3.500E+00 4.000E+00...
+ 4.500E+00 5.000E+00 5.500E+00 6.000E+00 6.500E+00 7.000E+00...
+ 7.500E+00 8.000E+00 8.500E+00 9.000E+00 9.500E+00 1.000E+01...
+ 1.250E+01 1.500E+01 1.750E+01 2.000E+01 2.500E+01 2.750E+01...
+ 3.000E+01 3.500E+01 4.000E+01 4.500E+01 5.000E+01 5.500E+01...
+ 6.000E+01 6.500E+01 7.000E+01 7.500E+01 8.000E+01 8.500E+01...
+ 9.000E+01 9.500E+01 1.000E+02 1.250E+02 1.500E+02 1.750E+02...
+ 2.000E+02 2.250E+02 2.500E+02 2.750E+02 3.000E+02 3.500E+02...
+ 3.750E+02 4.000E+02 4.500E+02 5.000E+02 5.500E+02 6.000E+02...
+ 6.500E+02 7.000E+02 7.500E+02 8.000E+02 8.500E+02 9.000E+02...
+ 9.500E+02 1.000E+03 2.000E+03 5.000E+03 7.500E+03 1.000E+04];
+
+DF_alphas_DSB_anoxic = [9.826E+00 9.820E+00 9.828E+00 9.823E+00 9.818E+00 9.821E+00...
+ 9.819E+00 9.815E+00 9.818E+00 9.820E+00 9.815E+00 9.816E+00...
+ 9.817E+00 9.814E+00 9.808E+00 9.810E+00 9.799E+00 9.794E+00...
+ 9.789E+00 9.792E+00 9.792E+00 9.785E+00 9.788E+00 9.786E+00...
+ 9.778E+00 9.781E+00 9.782E+00 9.772E+00 9.772E+00 9.773E+00...
+ 9.761E+00 9.758E+00 9.752E+00 9.753E+00 9.742E+00 9.723E+00...
+ 9.713E+00 9.705E+00 9.685E+00 9.677E+00 9.653E+00 9.642E+00...
+ 9.619E+00 9.592E+00 9.563E+00 9.530E+00 9.501E+00 9.467E+00...
+ 9.442E+00 9.402E+00 9.372E+00 9.344E+00 9.303E+00 9.264E+00...
+ 9.226E+00 9.191E+00 8.996E+00 8.787E+00 8.574E+00 8.344E+00...
+ 8.114E+00 7.871E+00 7.627E+00 7.388E+00 6.912E+00 6.457E+00...
+ 6.015E+00 5.619E+00 5.255E+00 4.925E+00 4.619E+00 4.357E+00...
+ 4.119E+00 3.898E+00 3.713E+00 3.543E+00 3.389E+00 3.250E+00...
+ 2.740E+00 2.405E+00 2.190E+00 2.030E+00 1.816E+00 1.736E+00...
+ 1.676E+00 1.582E+00 1.507E+00 1.455E+00 1.405E+00 1.372E+00...
+ 1.339E+00 1.313E+00 1.293E+00 1.274E+00 1.258E+00 1.240E+00...
+ 1.230E+00 1.221E+00 1.210E+00 1.167E+00 1.137E+00 1.121E+00...
+ 1.101E+00 1.088E+00 1.079E+00 1.074E+00 1.067E+00 1.059E+00...
+ 1.054E+00 1.049E+00 1.042E+00 1.039E+00 1.035E+00 1.031E+00...
+ 1.033E+00 1.027E+00 1.026E+00 1.027E+00 1.023E+00 1.022E+00...
+ 1.020E+00 1.019E+00 1.006E+00 1.002E+00 1.002E+00 1.000E+00];
+
+writematrix([DE_alphas_DSB_anoxic', DF_alphas_DSB_anoxic'], 'MCDS_alphaRBE_DSB_anoxic.txt','Delimiter','tab');
+
+%% Lithium-7 RBE
+% Aerobic data taken from MCDS
+
+DE_lithium_DSB_aerobic = [1.000E-03 1.000E-02 1.000E-01 2.000E-01 3.000E-01 5.000E-01...
+ 9.000E-01 1.000E+00 1.100E+00 1.300E+00 1.500E+00 2.000E+00...
+ 2.500E+00 3.000E+00 3.500E+00 4.000E+00 5.000E+00 6.000E+00...
+ 7.500E+00 1.000E+01 1.500E+01 2.500E+01 3.500E+01 5.000E+01...
+ 1.000E+02 2.000E+02 3.000E+02 4.000E+02 5.000E+02 7.500E+02...
+ 1.000E+03 2.000E+03 3.000E+03 4.000E+03 5.000E+03 7.500E+03...
+ 1.000E+04 2.000E+04 3.000E+04 4.000E+04 5.000E+04 7.500E+04...
+ 1.000E+05];
+
+DF_lithium_DSB_aerobic = [3.387E+00 3.385E+00 3.380E+00 3.378E+00 3.375E+00 3.369E+00...
+ 3.358E+00 3.354E+00 3.351E+00 3.345E+00 3.338E+00 3.325E+00...
+ 3.306E+00 3.291E+00 3.275E+00 3.256E+00 3.217E+00 3.183E+00...
+ 3.127E+00 3.030E+00 2.845E+00 2.540E+00 2.310E+00 2.066E+00...
+ 1.655E+00 1.371E+00 1.263E+00 1.201E+00 1.165E+00 1.115E+00...
+ 1.090E+00 1.050E+00 1.038E+00 1.032E+00 1.026E+00 1.022E+00...
+ 1.020E+00 1.016E+00 1.015E+00 1.015E+00 1.015E+00 1.016E+00...
+ 1.016E+00];
+
+writematrix([DE_lithium_DSB_aerobic', DF_lithium_DSB_aerobic'], 'MCDS_lithiumRBE_DSB_aerobic.txt','Delimiter','tab');
+
+% Anoxic data taken from MCDS
+
+DE_lithium_DSB_anoxic = [1.000E-03 1.000E-02 1.000E-01 2.000E-01 3.000E-01 5.000E-01...
+ 9.000E-01 1.000E+00 1.100E+00 1.300E+00 1.500E+00 2.000E+00...
+ 2.500E+00 3.000E+00 3.500E+00 4.000E+00 5.000E+00 6.000E+00...
+ 7.500E+00 1.000E+01 1.500E+01 2.500E+01 3.500E+01 5.000E+01...
+ 1.000E+02 2.000E+02 3.000E+02 4.000E+02 5.000E+02 7.500E+02...
+ 1.000E+03 2.000E+03 3.000E+03 4.000E+03 5.000E+03 7.500E+03...
+ 1.000E+04 2.000E+04 3.000E+04 4.000E+04 5.000E+04 7.500E+04...
+ 1.000E+05];
+
+DF_lithium_DSB_anoxic = [9.844E+00 9.838E+00 9.824E+00 9.817E+00 9.801E+00 9.783E+00...
+ 9.743E+00 9.720E+00 9.713E+00 9.685E+00 9.653E+00 9.596E+00...
+ 9.522E+00 9.447E+00 9.368E+00 9.274E+00 9.076E+00 8.880E+00...
+ 8.558E+00 7.958E+00 6.734E+00 4.763E+00 3.603E+00 2.726E+00...
+ 1.812E+00 1.409E+00 1.283E+00 1.213E+00 1.173E+00 1.121E+00...
+ 1.090E+00 1.051E+00 1.038E+00 1.032E+00 1.026E+00 1.019E+00...
+ 1.018E+00 1.016E+00 1.014E+00 1.013E+00 1.014E+00 1.014E+00...
+ 1.015E+00];
+
+writematrix([DE_lithium_DSB_anoxic', DF_lithium_DSB_anoxic'], 'MCDS_lithiumRBE_DSB_anoxic.txt','Delimiter','tab');
diff --git a/MCNP/RBEfactors/additionalMat/RBEcalcStewardEtAl.m b/MCNP/RBEfactors/additionalMat/RBEcalcStewardEtAl.m
new file mode 100644
index 000000000..9c5c1d8fe
--- /dev/null
+++ b/MCNP/RBEfactors/additionalMat/RBEcalcStewardEtAl.m
@@ -0,0 +1,25 @@
+% Modify energy and RBE values here
+energyIntRBE_Steward = ...
+ [1e-9 1e-3 2e-3 5e-3 7.5e-3 1e-2 2e-2 3e-2 5e-2 1e-1 2e-1 3e-1 4e-1 5e-1 6e-1 7e-1 8e-1 9e-1 9.5e-1 1 2 2.5 3 3.5 4 5 10 20 30];
+
+IntRBE_Steward = ...
+ [3.375 3.375 3.375 3.37 3.37 3.365 3.35 3.34 3.32 3.28 3.21 3.1 3.08 2.98 2.92 2.86 2.81 2.79 2.82 2.88 2.58 2.53 2.59 2.86 2.85 2.85 2.85 2.85 2.85];
+
+% Load energy intervals defined by tabulated KERMA values
+load('energyIntTally.mat')
+
+% Inerpolate RBE values for given energy intervals
+IntRBE_Steward_interpolatedData = interp1(energyIntRBE_Steward,IntRBE_Steward,energyIntTally);
+
+figure
+plot(energyIntRBE_Steward, IntRBE_Steward)
+hold on
+plot(energyIntTally,IntRBE_Steward_interpolatedData)
+
+data = [energyIntTally; IntRBE_Steward_interpolatedData];
+
+fileID = fopen('neutronRBE_StewardEtAl.txt', 'w');
+fprintf(fileID,'%0.5e %0.5e\n', data)
+fclose(fileID)
+
+
diff --git a/MCNP/RBEfactors/additionalMat/X_neutronRBE_ICRP103_ex.xlsx b/MCNP/RBEfactors/additionalMat/X_neutronRBE_ICRP103_ex.xlsx
new file mode 100644
index 000000000..3f13ccd80
Binary files /dev/null and b/MCNP/RBEfactors/additionalMat/X_neutronRBE_ICRP103_ex.xlsx differ
diff --git a/MCNP/RBEfactors/additionalMat/energyIntTally.mat b/MCNP/RBEfactors/additionalMat/energyIntTally.mat
new file mode 100644
index 000000000..3d1f5d177
Binary files /dev/null and b/MCNP/RBEfactors/additionalMat/energyIntTally.mat differ
diff --git a/MCNP/RBEfactors/additionalMat/neutronRBE_StewardEtAl.txt b/MCNP/RBEfactors/additionalMat/neutronRBE_StewardEtAl.txt
new file mode 100644
index 000000000..b5c25495c
--- /dev/null
+++ b/MCNP/RBEfactors/additionalMat/neutronRBE_StewardEtAl.txt
@@ -0,0 +1,117 @@
+2.53000e-08 3.37500e+00
+3.60000e-08 3.37500e+00
+6.30000e-08 3.37500e+00
+1.10000e-07 3.37500e+00
+2.00000e-07 3.37500e+00
+3.60000e-07 3.37500e+00
+6.30000e-07 3.37500e+00
+1.10000e-06 3.37500e+00
+2.00000e-06 3.37500e+00
+3.60000e-06 3.37500e+00
+6.30000e-06 3.37500e+00
+1.10000e-05 3.37500e+00
+2.00000e-05 3.37500e+00
+3.60000e-05 3.37500e+00
+6.30000e-05 3.37500e+00
+1.10000e-04 3.37500e+00
+2.00000e-04 3.37500e+00
+3.60000e-04 3.37500e+00
+6.30000e-04 3.37500e+00
+1.10000e-03 3.37500e+00
+2.00000e-03 3.37500e+00
+3.60000e-03 3.37233e+00
+6.30000e-03 3.37000e+00
+1.10000e-02 3.36350e+00
+2.00000e-02 3.35000e+00
+3.60000e-02 3.33400e+00
+6.30000e-02 3.30960e+00
+8.20000e-02 3.29440e+00
+8.60000e-02 3.29120e+00
+9.00000e-02 3.28800e+00
+9.40000e-02 3.28480e+00
+9.80000e-02 3.28160e+00
+1.05000e-01 3.27650e+00
+1.15000e-01 3.26950e+00
+1.25000e-01 3.26250e+00
+1.35000e-01 3.25550e+00
+1.45000e-01 3.24850e+00
+1.55000e-01 3.24150e+00
+1.65000e-01 3.23450e+00
+1.75000e-01 3.22750e+00
+1.85000e-01 3.22050e+00
+1.95000e-01 3.21350e+00
+2.10000e-01 3.19900e+00
+2.30000e-01 3.17700e+00
+2.50000e-01 3.15500e+00
+2.70000e-01 3.13300e+00
+2.90000e-01 3.11100e+00
+3.10000e-01 3.09800e+00
+3.30000e-01 3.09400e+00
+3.50000e-01 3.09000e+00
+3.70000e-01 3.08600e+00
+3.90000e-01 3.08200e+00
+4.20000e-01 3.06000e+00
+4.60000e-01 3.02000e+00
+5.00000e-01 2.98000e+00
+5.40000e-01 2.95600e+00
+5.80000e-01 2.93200e+00
+6.20000e-01 2.90800e+00
+6.60000e-01 2.88400e+00
+7.00000e-01 2.86000e+00
+7.40000e-01 2.84000e+00
+7.80000e-01 2.82000e+00
+8.20000e-01 2.80600e+00
+8.60000e-01 2.79800e+00
+9.00000e-01 2.79000e+00
+9.40000e-01 2.81400e+00
+9.80000e-01 2.85600e+00
+1.05000e+00 2.86500e+00
+1.15000e+00 2.83500e+00
+1.25000e+00 2.80500e+00
+1.35000e+00 2.77500e+00
+1.45000e+00 2.74500e+00
+1.55000e+00 2.71500e+00
+1.65000e+00 2.68500e+00
+1.75000e+00 2.65500e+00
+1.85000e+00 2.62500e+00
+1.95000e+00 2.59500e+00
+2.10000e+00 2.57000e+00
+2.30000e+00 2.55000e+00
+2.50000e+00 2.53000e+00
+2.70000e+00 2.55400e+00
+2.90000e+00 2.57800e+00
+3.10000e+00 2.64400e+00
+3.30000e+00 2.75200e+00
+3.50000e+00 2.86000e+00
+3.70000e+00 2.85600e+00
+3.90000e+00 2.85200e+00
+4.20000e+00 2.85000e+00
+4.60000e+00 2.85000e+00
+5.00000e+00 2.85000e+00
+5.40000e+00 2.85000e+00
+5.80000e+00 2.85000e+00
+6.20000e+00 2.85000e+00
+6.60000e+00 2.85000e+00
+7.00000e+00 2.85000e+00
+7.40000e+00 2.85000e+00
+7.80000e+00 2.85000e+00
+8.20000e+00 2.85000e+00
+8.60000e+00 2.85000e+00
+9.00000e+00 2.85000e+00
+9.40000e+00 2.85000e+00
+9.80000e+00 2.85000e+00
+1.05000e+01 2.85000e+00
+1.15000e+01 2.85000e+00
+1.25000e+01 2.85000e+00
+1.35000e+01 2.85000e+00
+1.45000e+01 2.85000e+00
+1.55000e+01 2.85000e+00
+1.65000e+01 2.85000e+00
+1.75000e+01 2.85000e+00
+1.85000e+01 2.85000e+00
+1.95000e+01 2.85000e+00
+2.10000e+01 2.85000e+00
+2.30000e+01 2.85000e+00
+2.50000e+01 2.85000e+00
+2.70000e+01 2.85000e+00
+2.90000e+01 2.85000e+00
diff --git a/MCNP/RBEfactors/neutronRBE_ICRP103.txt b/MCNP/RBEfactors/neutronRBE_ICRP103.txt
new file mode 100644
index 000000000..457b40afb
--- /dev/null
+++ b/MCNP/RBEfactors/neutronRBE_ICRP103.txt
@@ -0,0 +1,117 @@
+2.53E-08 2.50E+00
+3.60E-08 2.50E+00
+6.30E-08 2.50E+00
+1.10E-07 2.50E+00
+2.00E-07 2.50E+00
+3.60E-07 2.50E+00
+6.30E-07 2.50E+00
+1.10E-06 2.50E+00
+2.00E-06 2.50E+00
+3.60E-06 2.50E+00
+6.30E-06 2.50E+00
+1.10E-05 2.50E+00
+2.00E-05 2.50E+00
+3.60E-05 2.50E+00
+6.30E-05 2.50E+00
+1.10E-04 2.50E+00
+2.00E-04 2.50E+00
+3.60E-04 2.50E+00
+6.30E-04 2.50E+00
+1.10E-03 2.51E+00
+2.00E-03 2.53E+00
+3.60E-03 2.59E+00
+6.30E-03 2.75E+00
+1.10E-02 3.11E+00
+2.00E-02 3.92E+00
+3.60E-02 5.39E+00
+6.30E-02 7.59E+00
+8.20E-02 8.92E+00
+8.60E-02 9.17E+00
+9.00E-02 9.42E+00
+9.40E-02 9.67E+00
+9.80E-02 9.91E+00
+1.05E-01 1.03E+01
+1.15E-01 1.08E+01
+1.25E-01 1.14E+01
+1.35E-01 1.18E+01
+1.45E-01 1.23E+01
+1.55E-01 1.27E+01
+1.65E-01 1.31E+01
+1.75E-01 1.35E+01
+1.85E-01 1.38E+01
+1.95E-01 1.42E+01
+2.10E-01 1.46E+01
+2.30E-01 1.52E+01
+2.50E-01 1.57E+01
+2.70E-01 1.62E+01
+2.90E-01 1.66E+01
+3.10E-01 1.70E+01
+3.30E-01 1.73E+01
+3.50E-01 1.76E+01
+3.70E-01 1.79E+01
+3.90E-01 1.82E+01
+4.20E-01 1.86E+01
+4.60E-01 1.90E+01
+5.00E-01 1.93E+01
+5.40E-01 1.96E+01
+5.80E-01 1.98E+01
+6.20E-01 2.00E+01
+6.60E-01 2.02E+01
+7.00E-01 2.03E+01
+7.40E-01 2.04E+01
+7.80E-01 2.05E+01
+8.20E-01 2.06E+01
+8.60E-01 2.06E+01
+9.00E-01 2.07E+01
+9.40E-01 2.07E+01
+9.80E-01 2.07E+01
+1.05E+00 2.07E+01
+1.15E+00 2.06E+01
+1.25E+00 2.05E+01
+1.35E+00 2.04E+01
+1.45E+00 2.03E+01
+1.55E+00 2.01E+01
+1.65E+00 2.00E+01
+1.75E+00 1.98E+01
+1.85E+00 1.96E+01
+1.95E+00 1.94E+01
+2.10E+00 1.91E+01
+2.30E+00 1.87E+01
+2.50E+00 1.83E+01
+2.70E+00 1.79E+01
+2.90E+00 1.76E+01
+3.10E+00 1.72E+01
+3.30E+00 1.69E+01
+3.50E+00 1.65E+01
+3.70E+00 1.62E+01
+3.90E+00 1.59E+01
+4.20E+00 1.54E+01
+4.60E+00 1.48E+01
+5.00E+00 1.43E+01
+5.40E+00 1.38E+01
+5.80E+00 1.34E+01
+6.20E+00 1.29E+01
+6.60E+00 1.26E+01
+7.00E+00 1.22E+01
+7.40E+00 1.18E+01
+7.80E+00 1.15E+01
+8.20E+00 1.12E+01
+8.60E+00 1.09E+01
+9.00E+00 1.06E+01
+9.40E+00 1.04E+01
+9.80E+00 1.01E+01
+1.05E+01 8.63E+00
+1.15E+01 8.30E+00
+1.25E+01 8.02E+00
+1.35E+01 7.78E+00
+1.45E+01 7.57E+00
+1.55E+01 7.38E+00
+1.65E+01 7.22E+00
+1.75E+01 7.07E+00
+1.85E+01 6.93E+00
+1.95E+01 6.82E+00
+2.10E+01 6.66E+00
+2.30E+01 6.48E+00
+2.50E+01 6.33E+00
+2.70E+01 6.20E+00
+2.90E+01 6.09E+00
diff --git a/MCNP/RBEfactors/neutronRBE_StewardEtAl.txt b/MCNP/RBEfactors/neutronRBE_StewardEtAl.txt
new file mode 100644
index 000000000..b5c25495c
--- /dev/null
+++ b/MCNP/RBEfactors/neutronRBE_StewardEtAl.txt
@@ -0,0 +1,117 @@
+2.53000e-08 3.37500e+00
+3.60000e-08 3.37500e+00
+6.30000e-08 3.37500e+00
+1.10000e-07 3.37500e+00
+2.00000e-07 3.37500e+00
+3.60000e-07 3.37500e+00
+6.30000e-07 3.37500e+00
+1.10000e-06 3.37500e+00
+2.00000e-06 3.37500e+00
+3.60000e-06 3.37500e+00
+6.30000e-06 3.37500e+00
+1.10000e-05 3.37500e+00
+2.00000e-05 3.37500e+00
+3.60000e-05 3.37500e+00
+6.30000e-05 3.37500e+00
+1.10000e-04 3.37500e+00
+2.00000e-04 3.37500e+00
+3.60000e-04 3.37500e+00
+6.30000e-04 3.37500e+00
+1.10000e-03 3.37500e+00
+2.00000e-03 3.37500e+00
+3.60000e-03 3.37233e+00
+6.30000e-03 3.37000e+00
+1.10000e-02 3.36350e+00
+2.00000e-02 3.35000e+00
+3.60000e-02 3.33400e+00
+6.30000e-02 3.30960e+00
+8.20000e-02 3.29440e+00
+8.60000e-02 3.29120e+00
+9.00000e-02 3.28800e+00
+9.40000e-02 3.28480e+00
+9.80000e-02 3.28160e+00
+1.05000e-01 3.27650e+00
+1.15000e-01 3.26950e+00
+1.25000e-01 3.26250e+00
+1.35000e-01 3.25550e+00
+1.45000e-01 3.24850e+00
+1.55000e-01 3.24150e+00
+1.65000e-01 3.23450e+00
+1.75000e-01 3.22750e+00
+1.85000e-01 3.22050e+00
+1.95000e-01 3.21350e+00
+2.10000e-01 3.19900e+00
+2.30000e-01 3.17700e+00
+2.50000e-01 3.15500e+00
+2.70000e-01 3.13300e+00
+2.90000e-01 3.11100e+00
+3.10000e-01 3.09800e+00
+3.30000e-01 3.09400e+00
+3.50000e-01 3.09000e+00
+3.70000e-01 3.08600e+00
+3.90000e-01 3.08200e+00
+4.20000e-01 3.06000e+00
+4.60000e-01 3.02000e+00
+5.00000e-01 2.98000e+00
+5.40000e-01 2.95600e+00
+5.80000e-01 2.93200e+00
+6.20000e-01 2.90800e+00
+6.60000e-01 2.88400e+00
+7.00000e-01 2.86000e+00
+7.40000e-01 2.84000e+00
+7.80000e-01 2.82000e+00
+8.20000e-01 2.80600e+00
+8.60000e-01 2.79800e+00
+9.00000e-01 2.79000e+00
+9.40000e-01 2.81400e+00
+9.80000e-01 2.85600e+00
+1.05000e+00 2.86500e+00
+1.15000e+00 2.83500e+00
+1.25000e+00 2.80500e+00
+1.35000e+00 2.77500e+00
+1.45000e+00 2.74500e+00
+1.55000e+00 2.71500e+00
+1.65000e+00 2.68500e+00
+1.75000e+00 2.65500e+00
+1.85000e+00 2.62500e+00
+1.95000e+00 2.59500e+00
+2.10000e+00 2.57000e+00
+2.30000e+00 2.55000e+00
+2.50000e+00 2.53000e+00
+2.70000e+00 2.55400e+00
+2.90000e+00 2.57800e+00
+3.10000e+00 2.64400e+00
+3.30000e+00 2.75200e+00
+3.50000e+00 2.86000e+00
+3.70000e+00 2.85600e+00
+3.90000e+00 2.85200e+00
+4.20000e+00 2.85000e+00
+4.60000e+00 2.85000e+00
+5.00000e+00 2.85000e+00
+5.40000e+00 2.85000e+00
+5.80000e+00 2.85000e+00
+6.20000e+00 2.85000e+00
+6.60000e+00 2.85000e+00
+7.00000e+00 2.85000e+00
+7.40000e+00 2.85000e+00
+7.80000e+00 2.85000e+00
+8.20000e+00 2.85000e+00
+8.60000e+00 2.85000e+00
+9.00000e+00 2.85000e+00
+9.40000e+00 2.85000e+00
+9.80000e+00 2.85000e+00
+1.05000e+01 2.85000e+00
+1.15000e+01 2.85000e+00
+1.25000e+01 2.85000e+00
+1.35000e+01 2.85000e+00
+1.45000e+01 2.85000e+00
+1.55000e+01 2.85000e+00
+1.65000e+01 2.85000e+00
+1.75000e+01 2.85000e+00
+1.85000e+01 2.85000e+00
+1.95000e+01 2.85000e+00
+2.10000e+01 2.85000e+00
+2.30000e+01 2.85000e+00
+2.50000e+01 2.85000e+00
+2.70000e+01 2.85000e+00
+2.90000e+01 2.85000e+00
diff --git a/MCNP/RBEfactors/neutronRBE_constFactor.txt b/MCNP/RBEfactors/neutronRBE_constFactor.txt
new file mode 100644
index 000000000..e440e5c84
--- /dev/null
+++ b/MCNP/RBEfactors/neutronRBE_constFactor.txt
@@ -0,0 +1 @@
+3
\ No newline at end of file
diff --git a/MCNP/SpectralInformation/spectrum_neutrons_BNCT_VerbekeEtAl_2000.txt b/MCNP/SpectralInformation/spectrum_neutrons_BNCT_VerbekeEtAl_2000.txt
new file mode 100644
index 000000000..0727e7140
--- /dev/null
+++ b/MCNP/SpectralInformation/spectrum_neutrons_BNCT_VerbekeEtAl_2000.txt
@@ -0,0 +1,30 @@
+2.17248367543193e-07 0
+3.24024437085395e-07 0.00799706589049011
+4.94862987074838e-07 0.00822342408527524
+7.95102484626137e-07 0.00837787796020519
+1.24466931533025e-06 0.00865518546648131
+2.15286707660405e-06 0.00898336535484149
+3.19914229132792e-06 0.00954340654329382
+5.12286242863352e-06 0.0101856353097894
+8.19509757702819e-06 0.0110238634903589
+1.24487840474720e-05 0.0122118428982812
+1.98676759292905e-05 0.0136542943734052
+3.17078796873714e-05 0.0152671268692661
+4.80689465625149e-05 0.0173910862814576
+7.65870317020372e-05 0.0199029036430157
+0.000115832742600646 0.0234222269295927
+0.000183996207177201 0.0279512307137798
+0.000278001584777066 0.0333559785225995
+0.000439819013986167 0.0420911181179390
+0.000679083165922629 0.0526219052872261
+0.00104780418421728 0.0664023341283472
+0.00166049035882188 0.0818650337141875
+0.00250716524498267 0.0986079355808162
+0.00607617113277039 0.122706519314511
+0.00970380211789908 0.135929906767644
+0.0159729408988303 0.0990677278010755
+0.0275167612344502 0.0271818443777738
+0.0490229866629595 0.00936746507844497
+0.0776622728347163 0.0116026587072257
+0.125011707098872 0.00814726826386254
+0.195958974954586 0.00826176852881349
\ No newline at end of file
diff --git a/MCNP/SpectralInformation/spectrum_neutrons_FNT_JonesEtAl_1996_p66Be.txt b/MCNP/SpectralInformation/spectrum_neutrons_FNT_JonesEtAl_1996_p66Be.txt
new file mode 100644
index 000000000..26049426b
--- /dev/null
+++ b/MCNP/SpectralInformation/spectrum_neutrons_FNT_JonesEtAl_1996_p66Be.txt
@@ -0,0 +1,35 @@
+0.001 0
+2 0.0709018718094158
+4 0.0541690300623937
+6 0.0416903006239365
+8 0.0317640385706183
+10 0.0291406693136699
+12 0.0268009075439592
+14 0.0259500850822462
+16 0.0254537719795803
+18 0.0258791832104368
+20 0.0276517300056722
+22 0.0309841179807147
+24 0.0345292115711855
+26 0.0370816789563245
+28 0.0365144639818491
+30 0.0359472490073738
+32 0.0346710153148043
+34 0.0341747022121384
+36 0.0337492909812819
+38 0.0317640385706183
+40 0.0300623936471923
+42 0.0296369824163358
+44 0.0293533749290981
+46 0.0280062393647192
+48 0.0272972206466251
+50 0.0266591038003403
+52 0.0263754963131027
+54 0.0255246738513897
+56 0.0249574588769144
+58 0.0243193420306296
+60 0.0222631877481566
+62 0.0182217810550199
+64 0.0120533182076007
+66 0.00482132728304027
+68 0.00163074305161656
\ No newline at end of file
diff --git a/MCNP/SpectralInformation/spectrum_neutrons_FNT_MEDAPP_BreitkreutzEtAl_2008.txt b/MCNP/SpectralInformation/spectrum_neutrons_FNT_MEDAPP_BreitkreutzEtAl_2008.txt
new file mode 100644
index 000000000..9f1df8952
--- /dev/null
+++ b/MCNP/SpectralInformation/spectrum_neutrons_FNT_MEDAPP_BreitkreutzEtAl_2008.txt
@@ -0,0 +1,43 @@
+1e-10 0
+1e-09 1.93523780330449e-08
+1e-08 1.26268107846584e-05
+2.53e-08 4.01527628524379e-05
+5e-08 5.53061949303639e-05
+1e-07 9.35333003646622e-05
+2e-07 2.58944124742016e-05
+5e-07 1.43568914827894e-05
+1e-06 1.90499115871254e-05
+2e-06 8.46098558968084e-05
+5e-06 0.000400720138917626
+1e-05 0.000682506639145605
+2e-05 0.00120920884298132
+5e-05 0.00262899455188656
+0.0001 0.00236334415752914
+0.0002 0.00399310453671937
+0.0005 0.00669367825205206
+0.001 0.00495073246527111
+0.002 0.00637725181632081
+0.005 0.0107137447298783
+0.01 0.00865752034820597
+0.02 0.0105782507111179
+0.03 0.0081842493210612
+0.05 0.00644212471015152
+0.07 0.00946665230670216
+0.1 0.00601073365244178
+0.15 0.0173213363780917
+0.2 0.0133461608478952
+0.3 0.0259026242329143
+0.5 0.050219010407816
+0.7 0.0685216519520812
+0.9 0.0558919670518734
+1 0.0230326145628086
+1.2 0.067028480492813
+2 0.235513239881639
+3 0.164454154487318
+4 0.0744874946568933
+5 0.0453371198530867
+6 0.0361112089393133
+7 0.0140161034962103
+8 0.0144526953344381
+9 0.000529097300126934
+10 0.00413667345154727
diff --git a/MCNP/SpectralInformation/spectrum_neutrons_FRMII_SommerEtAl_2025_woSKA_thermalNeutrons.txt b/MCNP/SpectralInformation/spectrum_neutrons_FRMII_SommerEtAl_2025_woSKA_thermalNeutrons.txt
new file mode 100644
index 000000000..d0515003c
--- /dev/null
+++ b/MCNP/SpectralInformation/spectrum_neutrons_FRMII_SommerEtAl_2025_woSKA_thermalNeutrons.txt
@@ -0,0 +1,58 @@
+1e-10 0
+1e-09 5.3668e-09
+1e-08 1.0419e-06
+2.53e-08 4.6728e-06
+5e-08 7.7419e-06
+1e-07 8.3778e-06
+1.06e-07 5.7164e-07
+1.22e-07 8.7005e-07
+1.41e-07 6.0206e-07
+1.65e-07 3.6216e-07
+1.94e-07 3.8434e-07
+2.32e-07 3.1212e-08
+2.79e-07 7.1232e-09
+3.39e-07 0
+4.15e-07 0
+5.11e-07 0
+6.25e-07 0
+1e-06 0
+2e-06 0
+3e-06 0
+4e-06 0
+5e-06 0
+1e-05 0
+2e-05 0
+5e-05 0
+0.0001 0
+0.0002 0
+0.0005 0
+0.001 0
+0.002 0
+0.005 0
+0.01 0
+0.015 0
+0.0248 0
+0.0409 0
+0.0674 0
+0.0865 0
+0.111 0
+0.143 0
+0.183 0
+0.235 0
+0.302 0
+0.388 0
+0.498 0
+0.639 0
+0.821 0
+1.05 0
+1.35 0
+1.74 0
+2.23 0
+3 0
+4 0
+5 0
+6 0
+7 0
+8 0
+9 0
+10 0
diff --git a/MCNP/SpectralInformation/spectrum_photons_FNT_MEDAPP_JungwirthEtAl_2012.txt b/MCNP/SpectralInformation/spectrum_photons_FNT_MEDAPP_JungwirthEtAl_2012.txt
new file mode 100644
index 000000000..ff45dd062
--- /dev/null
+++ b/MCNP/SpectralInformation/spectrum_photons_FNT_MEDAPP_JungwirthEtAl_2012.txt
@@ -0,0 +1,107 @@
+0.01 0
+0.0667 0.00116965076567438
+0.133 0.00206938212388545
+0.2 0.00122963285622179
+0.267 0.00212936421443285
+0.333 0.00361891946302673
+0.4 0.00728782400150963
+0.467 0.013196059920429
+0.533 0.0247925974262605
+0.6 0.0219934332007149
+0.667 0.0254923884826468
+0.733 0.0262921496899456
+0.8 0.0293912243682281
+0.867 0.0294911945191405
+0.933 0.02819158255728
+1 0.0298910751227898
+1.07 0.0301909855755269
+1.13 0.0239928362189617
+1.2 0.0252924481808222
+1.27 0.0250925078789975
+1.33 0.0237928959171371
+1.4 0.0216935227479779
+1.47 0.0207937913897668
+1.53 0.0195941495788188
+1.6 0.0182945376169583
+1.67 0.0190942988242571
+1.73 0.0168949555041856
+1.8 0.0152954330895881
+1.87 0.0155953435423251
+1.93 0.0141957614295524
+2 0.0138958509768153
+2.07 0.0129961196186043
+2.13 0.013795880825903
+2.2 0.0118964479585685
+2.27 0.0576827770764205
+2.33 0.0118964479585685
+2.4 0.00839749267663661
+2.47 0.00804759714844342
+2.53 0.00812757326917329
+2.6 0.0117964778076562
+2.67 0.00836750163136291
+2.73 0.00760772848442912
+2.8 0.00636809861311609
+2.87 0.00881736731046844
+2.93 0.00582825979818946
+3 0.014395701731377
+3.07 0.0109967166003575
+3.13 0.0064580717489372
+3.2 0.0041987463383183
+3.27 0.00644807473384597
+3.33 0.00494852247016086
+3.4 0.00556833740581737
+3.47 0.00947717030648989
+3.53 0.00487854336452222
+3.6 0.0083375105860892
+3.67 0.00303909258773515
+3.73 0.0050484926210732
+3.8 0.00310907169337379
+3.87 0.00664801503567065
+3.93 0.00542837919454009
+4 0.00326902393483354
+4.07 0.0023193075011663
+4.13 0.00189943286733447
+4.2 0.00931721806503014
+4.27 0.00922724492920904
+4.4 0.00516845680216801
+4.47 0.0032590269197423
+4.6 0.00506848665125567
+4.67 0.00396881499121992
+4.73 0.00513846575689431
+4.8 0.00809758222389959
+4.87 0.00147955823350264
+4.93 0.00556833740581737
+5.13 0.0055783344209086
+5.2 0.00489853739470469
+5.27 0.00119964181094809
+5.33 0.000864741805391746
+5.47 0.00711787474495865
+5.67 0.00483855530415728
+5.73 0.00145956420332017
+5.8 0.00120963882603932
+5.87 0.00128961494676919
+5.93 0.000646806876402844
+6 0.000464861201742384
+6.07 0.000399880603649362
+6.13 0.00532840904362775
+6.2 0.000948716732158112
+6.27 0.00602820010001414
+6.53 0.00578827173782452
+6.6 0.000246926272753481
+6.67 0.00027591761651806
+6.73 0.00105968359967081
+6.87 0.00119964181094809
+6.93 0.000264920899917703
+7 0.000263921198408579
+7.07 0.000200940003333805
+7.13 0.000264920899917703
+7.2 0.000335899707065464
+7.47 0.00306908363300886
+7.53 0.000282915527081924
+7.6 0.000160951942968868
+7.67 0.000283915228591047
+7.73 0.0495851948525209
+7.8 3.58892841775303e-05
+8 2.06938212388545e-05
+8.6 9.37720015557755e-06
+9.13 4.45866873069039e-05
diff --git a/MCNP/calcNeutronDirections4RSSA.m b/MCNP/calcNeutronDirections4RSSA.m
new file mode 100644
index 000000000..ee9d8c8b0
--- /dev/null
+++ b/MCNP/calcNeutronDirections4RSSA.m
@@ -0,0 +1,82 @@
+%% Calculate opening angles for maximum field size
+% MLC 1
+
+lengthBeamline1 = [62 274 288 428 478 493];
+hight1 = [16 18 30 20 20 22];
+width1 = [18 24 35 30 30 30];
+
+sourceWidht = 15; % square dimension of converter plate
+
+funA = @(ho) ho/2 - sourceWidht/2;
+funB = @(br) br/2 + sourceWidht/2;
+funC = @(ho) ho/2 + sourceWidht/2;
+funD = @(br) br/2 - sourceWidht/2;
+
+funU = @(a,b) sqrt(a^2 + b^2);
+funV = @(c,b) sqrt(c^2 + b^2);
+funW = @(c,d) sqrt(c^2 + d^2);
+funX = @(a,d) sqrt(a^2 + d^2);
+
+funTheta = @(ho, br,l) [atand(funX(funA(ho), funD(br))/l), ...
+ atand(funU(funA(ho), funB(br))/l), ...
+ atand(funV(funB(br), funC(ho))/l), ...
+ atand(funW(funA(ho), funD(br))/l)];
+
+
+maxOpeningAngle_MLC1 = 0;
+openingAngles_MLC1 = zeros(4,length(lengthBeamline1));
+for counter = 1:length(lengthBeamline1)
+ dummy = max(max(funTheta(hight1(counter), width1(counter), lengthBeamline1(counter))));
+ maxOpeningAngle_MLC1 = max(maxOpeningAngle_MLC1, dummy);
+ openingAngles_MLC1(:,counter) = funTheta(hight1(counter), width1(counter), lengthBeamline1(counter))';
+end
+
+MLC_1.maxOpeningAngle_MLC1 = maxOpeningAngle_MLC1;
+MLC_1.openingAngles_MLC1 = openingAngles_MLC1;
+
+MLC_1.lengthBeamline1 = lengthBeamline1;
+MLC_1.hight1 = hight1;
+MLC_1.width1 = width1;
+
+%% Calculate opening angles for maximum field size
+% MLC 3
+
+lengthBeamline3 = [62 274 288 463 493 523];
+hight3 = [16 18 30 24 18 6]; %18];
+width3 = [18 24 35 30 26.5 6]; %26.5];
+
+sourceWidht = 15; % square dimension of converter plate
+
+funA = @(ho) ho/2 - sourceWidht/2;
+funB = @(br) br/2 + sourceWidht/2;
+funC = @(ho) ho/2 + sourceWidht/2;
+funD = @(br) br/2 - sourceWidht/2;
+
+funU = @(a,b) sqrt(a^2 + b^2);
+funV = @(c,b) sqrt(c^2 + b^2);
+funW = @(c,d) sqrt(c^2 + d^2);
+funX = @(a,d) sqrt(a^2 + d^2);
+
+funTheta = @(ho, br,l) [atand(funX(funA(ho), funD(br))/l), ...
+ atand(funU(funA(ho), funB(br))/l), ...
+ atand(funV(funB(br), funC(ho))/l), ...
+ atand(funW(funA(ho), funD(br))/l)];
+
+
+maxOpeningAngle_MLC3 = 0;
+openingAngles_MLC3 = zeros(4,length(lengthBeamline3));
+for counter = 1:length(lengthBeamline3)
+ dummy = max(max(funTheta(hight3(counter), width3(counter), lengthBeamline3(counter))));
+ maxOpeningAngle_MLC3 = max(maxOpeningAngle_MLC3, dummy);
+ openingAngles_MLC3(:,counter) = funTheta(hight3(counter), width3(counter), lengthBeamline3(counter))';
+end
+
+MLC_3.maxOpeningAngle_MLC3 = maxOpeningAngle_MLC3;
+MLC_3.openingAngles_MLC3 = openingAngles_MLC3;
+
+MLC_3.lengthBeamline3 = lengthBeamline3;
+MLC_3.hight3 = hight3;
+MLC_3.width3 = width3;
+
+%% Clean up
+clearvars -except MLC_1 MLC_3
\ No newline at end of file
diff --git a/MCNP/conversionCT2tissue.mat b/MCNP/conversionCT2tissue.mat
new file mode 100644
index 000000000..49989b8b1
Binary files /dev/null and b/MCNP/conversionCT2tissue.mat differ
diff --git a/MCNP/matRad_MCNPBixelVisualization.m b/MCNP/matRad_MCNPBixelVisualization.m
new file mode 100644
index 000000000..3f821f9bc
--- /dev/null
+++ b/MCNP/matRad_MCNPBixelVisualization.m
@@ -0,0 +1,148 @@
+function matRad_MCNPBixelVisualization(ct, cst, stf, pln)
+% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% matRad visualization of bixel locations
+%
+% call
+% matRad_MCNPBixelVisualization(ct, cst, stf, pln)
+%
+% input
+% ct
+% cst
+% stf
+% pln
+%
+% output
+% ...
+%
+% Author: Lucas Sommer (Lucas.Sommer@tum.de), 02/2019
+%
+% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+%% Selection of Gantry and Couch Angles
+
+if pln.propStf.numOfBeams==1
+ beamSelect = 1; % index to spezify # of beam to plot
+elseif pln.propStf.numOfBeams > 1
+ for counterBeam = 1:pln.propStf.numOfBeams; beamList(counterBeam) = {['Gantry Angle: ', num2str(pln.propStf.gantryAngles(counterBeam)), ', Couch Angle: ', num2str(pln.propStf.couchAngles(counterBeam))]}; end
+ [beamSelect,tf] = listdlg('ListString',beamList, 'Name','Please select a beam.', 'OKString', 'Select');
+ if tf == 0 || length(beamSelect)~= 1
+ warning('Please select only on combination of gantry and couch angle!')
+ [beamSelect,tf] = listdlg('ListString',beamList, 'Name','Please select a beam.', 'OKString', 'Select');
+ end
+end
+
+%% Plot geometry
+
+% Prepare slice plot in isocenter plane
+[x,y,z] = meshgrid(1:ct.cubeDim(1), 1:ct.cubeDim(2), 1:ct.cubeDim(3));
+
+% Get point on isocenter plane for given couch angle and plot isocenter
+% plane through CT-data
+if stf(beamSelect).couchAngle ~= 0 && stf(beamSelect).couchAngle ~= 90 && stf(beamSelect).couchAngle ~= 180 && stf(beamSelect).couchAngle ~= 270
+ [xs, ys] = meshgrid(1:ct.cubeDim(1), 1:ct.cubeDim(2));
+ point = [round(stf(beamSelect).isoCenter(1)/ct.resolution.x) round(stf(beamSelect).isoCenter(2)/ct.resolution.y) round(stf(beamSelect).isoCenter(3)/ct.resolution.z)];
+ normVec = [sind(180 - (stf(beamSelect).couchAngle + 90)) 0 -cosd(180 - (stf(beamSelect).couchAngle + 90))];
+ zs = ((xs-point(1))*normVec(1) + (ys-point(2))*normVec(2))/normVec(3) + point(3);
+
+ slicePlot = slice(x, y, z, ct.cubeHU{1}, xs, ys, zs);
+ %
+ % [xs, ys] = meshgrid(1:ct.cubeDim(1), 1:ct.cubeDim(2));
+ % point = [round(stf(beamSelect).isoCenter(2)/ct.resolution.y) round(stf(beamSelect).isoCenter(1)/ct.resolution.x) round(stf(beamSelect).isoCenter(3)/ct.resolution.z)];
+ % normVec = [sind(180 - (stf(beamSelect).couchAngle + 90)) 0 -cosd(180 - (stf(beamSelect).couchAngle + 90))];
+ % zs = ((xs-point(1))*normVec(1) + (ys-point(2))*normVec(2))/normVec(3) + point(3);
+ %
+ % slicePlot = slice(x, y, z, ct.cubeHU{1}, xs, ys, zs);
+
+elseif stf(beamSelect).couchAngle == 0
+ slicePlot = slice(x, y, z, ct.cubeHU{1}, [stf(beamSelect).isoCenter(1)/ct.resolution.x], [], []);
+elseif stf(beamSelect).couchAngle == 90
+ slicePlot = slice(x, y, z, ct.cubeHU{1}, [], [], [stf(beamSelect).isoCenter(3)/ct.resolution.z]);
+elseif stf(beamSelect).couchAngle == 180
+ slicePlot = slice(x, y, z, ct.cubeHU{1}, [], [stf(beamSelect).isoCenter(1)/ct.resolution.x], []);
+elseif stf(beamSelect).couchAngle == 270
+ slicePlot = slice(x, y, z, ct.cubeHU{1}, [], [], [stf(beamSelect).isoCenter(3)/ct.resolution.z]);
+end
+
+
+shading flat, colormap gray;
+hold on
+
+% Get target structures and plot isosurface
+volumeDummy = zeros(ct.cubeDim);
+for counterCst = 1:size(cst,1)
+ if strcmp('TARGET', cst{counterCst,3})
+ volumeDummy(cst{counterCst,4}{1}) = 1;
+ end
+end
+
+isoPlot = patch(isosurface(x,y,z, volumeDummy, .9));
+
+alpha(isoPlot, .7)
+isoPlot.FaceColor = 'red';
+isoPlot.EdgeColor = 'none';
+%camlight('infinite')
+lighting gouraud
+
+% Plot source and bixel direction
+for bixelCounter = 1:stf(beamSelect).numOfRays
+ plot3( [stf(beamSelect).ray(bixelCounter).rayPosMLC(1)/ct.resolution.x (stf(beamSelect).isoCenter(1)+ stf(beamSelect).ray(bixelCounter).rayPos(1))/ct.resolution.x], ...
+ [stf(beamSelect).ray(bixelCounter).rayPosMLC(2)/ct.resolution.y (stf(beamSelect).isoCenter(2)+ stf(beamSelect).ray(bixelCounter).rayPos(2))/ct.resolution.y], ...
+ [stf(beamSelect).ray(bixelCounter).rayPosMLC(3)/ct.resolution.z (stf(beamSelect).isoCenter(3)+ stf(beamSelect).ray(bixelCounter).rayPos(3))/ct.resolution.z], ...
+ '-', ...
+ 'Color', [135/256 206/256 250/256], ...
+ 'LineWidth',2.4)
+end
+
+% Plot MLC opening
+for bixelCounter = 1:stf(beamSelect).numOfRays
+ if stf(beamSelect).couchAngle ~= 0 && stf(beamSelect).couchAngle ~= 90 && stf(beamSelect).couchAngle ~= 180 && stf(beamSelect).couchAngle ~= 270
+
+ xBixel_MLC = [stf(beamSelect).ray(bixelCounter).rayPosMLC(1)-sind(stf(beamSelect).couchAngle)*stf(beamSelect).bixelWidth/2 ...
+ stf(beamSelect).ray(bixelCounter).rayPosMLC(1)-sind(stf(beamSelect).couchAngle)*stf(beamSelect).bixelWidth/2 ...
+ stf(beamSelect).ray(bixelCounter).rayPosMLC(1)+sind(stf(beamSelect).couchAngle)*stf(beamSelect).bixelWidth/2 ...
+ stf(beamSelect).ray(bixelCounter).rayPosMLC(1)+sind(stf(beamSelect).couchAngle)*stf(beamSelect).bixelWidth/2];
+ xBixel_MLC = [xBixel_MLC(1)/ct.resolution.x xBixel_MLC(2)/ct.resolution.y xBixel_MLC(3)/ct.resolution.z];
+ yBixel_MLC = [stf(beamSelect).ray(bixelCounter).rayPosMLC(2)-stf(beamSelect).bixelWidth/2 ...
+ stf(beamSelect).ray(bixelCounter).rayPosMLC(2)+stf(beamSelect).bixelWidth/2 ...
+ stf(beamSelect).ray(bixelCounter).rayPosMLC(2)-stf(beamSelect).bixelWidth/2 ...
+ stf(beamSelect).ray(bixelCounter).rayPosMLC(2)+stf(beamSelect).bixelWidth/2];
+ yBixel_MLC = [yBixel_MLC(1)/ct.resolution.x yBixel_MLC(2)/ct.resolution.y yBixel_MLC(3)/ct.resolution.z];
+ zBixel_MLC = [stf(beamSelect).ray(bixelCounter).rayPosMLC(3)-cosd(stf(beamSelect).couchAngle)*stf(beamSelect).bixelWidth/2 ...
+ stf(beamSelect).ray(bixelCounter).rayPosMLC(1)-cosd(stf(beamSelect).couchAngle)*stf(beamSelect).bixelWidth/2 ...
+ stf(beamSelect).ray(bixelCounter).rayPosMLC(1)+cosd(stf(beamSelect).couchAngle)*stf(beamSelect).bixelWidth/2 ...
+ stf(beamSelect).ray(bixelCounter).rayPosMLC(1)+cosd(stf(beamSelect).couchAngle)*stf(beamSelect).bixelWidth/2];
+ zBixel_MLC = [zBixel_MLC(1)/ct.resolution.x zBixel_MLC(2)/ct.resolution.y zBixel_MLC(3)/ct.resolution.z];
+ elseif stf(beamSelect).couchAngle == 0 || ...
+ stf(beamSelect).couchAngle == 180 || ...
+ stf(beamSelect).couchAngle == 90 || ...
+ stf(beamSelect).couchAngle == 270
+
+ xBixel_MLC = [stf(beamSelect).ray(bixelCounter).rayPosMLC(1)...
+ stf(beamSelect).ray(bixelCounter).rayPosMLC(1)...
+ stf(beamSelect).ray(bixelCounter).rayPosMLC(1)...
+ stf(beamSelect).ray(bixelCounter).rayPosMLC(1)];
+ xBixel_MLC = xBixel_MLC/ct.resolution.x;
+
+ yBixel_MLC = [stf(beamSelect).ray(bixelCounter).rayPosMLC(2)-stf(beamSelect).bixelWidth/2 ...
+ stf(beamSelect).ray(bixelCounter).rayPosMLC(2)-stf(beamSelect).bixelWidth/2 ...
+ stf(beamSelect).ray(bixelCounter).rayPosMLC(2)+stf(beamSelect).bixelWidth/2 ...
+ stf(beamSelect).ray(bixelCounter).rayPosMLC(2)+stf(beamSelect).bixelWidth/2];
+ yBixel_MLC = yBixel_MLC/ct.resolution.y;
+
+ zBixel_MLC = [stf(beamSelect).ray(bixelCounter).rayPosMLC(3)-stf(beamSelect).bixelWidth/2 ...
+ stf(beamSelect).ray(bixelCounter).rayPosMLC(3)+stf(beamSelect).bixelWidth/2 ...
+ stf(beamSelect).ray(bixelCounter).rayPosMLC(3)+stf(beamSelect).bixelWidth/2 ...
+ stf(beamSelect).ray(bixelCounter).rayPosMLC(3)-stf(beamSelect).bixelWidth/2];
+ zBixel_MLC = zBixel_MLC/ct.resolution.z;
+ end
+ patch(xBixel_MLC, yBixel_MLC, zBixel_MLC, [135/256 206/256 250/256]); % 'b'); %[255/256 255/256 0/256])
+end
+
+axis tight
+axis off
+
+
+% Set rotation mode
+cameratoolbar('SetMode','orbit')
+cameratoolbar('SetCoordSys','y')
+end
\ No newline at end of file
diff --git a/MCNP/matRad_MCNPConfig.m b/MCNP/matRad_MCNPConfig.m
new file mode 100644
index 000000000..9c30a073c
--- /dev/null
+++ b/MCNP/matRad_MCNPConfig.m
@@ -0,0 +1,36 @@
+classdef matRad_MCNPConfig
+% matRad_MCNPConfig class definition
+%
+%
+% References
+%
+% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% Copyright 2024
+%
+% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+ properties
+
+ %%% Simulation parameters:
+ Num_Primaries = 1e6;
+ Num_Threads = feature('numcores'); % Number of parallel calculation threads
+ RNG_Seed = 43; % Seed for the random number generator
+
+
+
+
+ end
+
+ methods
+ function obj = matRad_MCNPConfig()
+ %matRad_MCNPConfig Configuration Class for MCNP
+ matRad_cfg = MatRad_Config.instance(); %Instance of matRad configuration class
+
+ % Set default histories from MatRad_Config
+ if isfield(matRad_cfg.propDoseCalc,'defaultNumHistories')
+ obj.Num_Primaries = matRad_cfg.propMC.defaultNumHistories;
+ end
+ end
+ end
+end
+
diff --git a/MCNP/matRad_RSSAgenerationMCNP_frm2.m b/MCNP/matRad_RSSAgenerationMCNP_frm2.m
new file mode 100644
index 000000000..a3517615c
--- /dev/null
+++ b/MCNP/matRad_RSSAgenerationMCNP_frm2.m
@@ -0,0 +1,1093 @@
+function [runfileName, WSSAfileName] = matRad_RSSAgenerationMCNP_frm2(MLCleafPositions, MLCidentifier, runfileName, SSD4kernelCalc, WSSAoption, npsKernelGen, particleType, transportMedium)
+% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% Calculate dose for predefined MLC shape either from dose calculation in
+% matRad or predefined.
+%
+% call
+% [control_MLCfieldWSSA, control_MLCfieldPhantom] =
+% kernelGenerationMCNP(resultGUI, beamOfInterest, MLCshapeOfInterest, WSSAoption)
+%
+% input
+% MLCleafPositions: leaf positions have to be defined from left to
+% right in a 2-by-#leafs sized matrix where upper row
+% defines leaf bank A and lower row defines leaf bank B
+% MLCidentifier: string identifier to select beam shaping device
+% runfileName: name of runfile to be generated
+% WSSAoption: boolean to control generation of WSSA file
+%
+% output
+% control_MLCfieldWSSA: control variable to check if WSSA was created
+% sucessfully
+%
+% References
+%
+% Author: Lucas Sommer (Lucas.Sommer@tum.de), 04/2020
+%
+% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+%% Check function input
+if nargin < 2
+ error('Input not defined properly. Please make sure to characterize leaf positions and the name of the predefined beam shaping device you would like to simualte.')
+end
+
+
+%% Get paths
+pathRunfiles = pwd;
+% pathWSSAfiles = strcat(matRad_getMATRADdirectory_hardCoded, filesep, 'MCNP', filesep, 'WSSA_depot', filesep);
+
+%% Generate runfiles for given leaf positions
+listMLCid = ["frm2MLC1"; "frm2MLC3"]; % Please list all names for known beam shaping devices here
+
+if isempty(listMLCid==MLCidentifier); error('Beam shaping device unknown! Cannot calculate radiation field...'), end
+switch MLCidentifier
+ case 'frm2MLC1'
+ disp('*****')
+ disp('Calculation of radiation field performed for MLC1...')
+ disp('*****')
+
+ % Check if MLC positions extend maximum field width
+ maxFieldSize_MLC1 = 20; % vertical field size in cm
+ if max(max(abs(MLCleafPositions)))>maxFieldSize_MLC1/2
+ error('Leaf positions out of range, maximum vertical field size of MLC1 exceeded!')
+ end
+
+ % Write runfiles for FRM2 MLC1 for given leafpositions
+ runfileName = makeRunfileFRM2MLC1(MLCleafPositions, pathRunfiles, runfileName);
+
+ % Write runfiles for water phantom PTW
+ sourceOpeningAngle = 3.39;
+ [waterPhantomRunfileName, WSSAfileName] = makeWaterPhantomFRM2PTW(runfileName, SSD4kernelCalc, npsKernelGen, particleType, transportMedium, sourceOpeningAngle, WSSAoption);
+
+
+ case'frm2MLC3'
+ disp('*****')
+ disp('Calculation of radiation field performed for MLC3...')
+ disp('*****')
+
+ % Check if MLC positions extend maximum field width
+ maxFieldSize_MLC3 = 18; % vertical field size in cm
+ if max(max(abs(MLCleafPositions)))>maxFieldSize_MLC3/2
+ error('Leaf positions out of range, maximum vertical field size of MLC3 exceeded!')
+ end
+
+ % Write runfiles for FRM2 MLC1 for given leafpositions
+ runfileName = makeRunfileFRM2MLC3(MLCleafPositions, pathRunfiles, runfileName);
+
+ % Write runfiles for water phantom PTW
+ sourceOpeningAngle = 1.63;
+ [waterPhantomRunfileName, WSSAfileName] = makeWaterPhantomFRM2PTW(runfileName, SSD4kernelCalc, npsKernelGen, particleType, transportMedium, sourceOpeningAngle, WSSAoption);
+end
+
+% Concatenate runfiles
+runfileName = concatenateRunfile(runfileName, waterPhantomRunfileName);
+
+
+
+% Clean up
+fragmentList = dir('*block*');
+for counter = 1:length(fragmentList)
+ delete(fragmentList(counter).name)
+end
+
+
+%% Function definition for FRM 2 MLC 1 MCNP runfile goes here...
+ function runfileName = makeRunfileFRM2MLC1(MLCleafPositions, pathRunfiles, runfileName)
+ fileID_runfile_blockA = fopen(strcat(pathRunfiles,filesep,runfileName, '_blockA.txt'), 'w');
+ fileID_runfile_blockB = fopen(strcat(pathRunfiles,filesep,runfileName, '_blockB.txt'), 'w');
+ fileID_runfile_blockC = fopen(strcat(pathRunfiles,filesep,runfileName, '_blockC.txt'), 'w');
+
+ % Write block A: Cells
+ fprintf(fileID_runfile_blockA, 'MCNP Runfile for WSSA/matRad Kernel Generation for MLC1 at FRM2\n');
+ fprintf(fileID_runfile_blockA, 'C ***************************************************************\n');
+ fprintf(fileID_runfile_blockA, 'C ***************************************************************\n');
+ fprintf(fileID_runfile_blockA, 'C Block A: Cells\n');
+ fprintf(fileID_runfile_blockA, 'C ***************************************************************\n');
+
+ fprintf(fileID_runfile_blockA, '1000 0 7000 9 (-1:-2:-3:-4:-5:-7:-8) $ Propagation tunnel\n');
+ fprintf(fileID_runfile_blockA, '9 0 -9\n'); % RSSA helper cell
+ fprintf(fileID_runfile_blockA, '1001 0 (-6 $ Start MLC $ Inside of MLC for fluence tally\n');
+ fprintf(fileID_runfile_blockA, ' 501 $ Bank A leaf 1\n'); % leaf bank A
+ fprintf(fileID_runfile_blockA, ' 502 $ Bank A leaf 2\n');
+ fprintf(fileID_runfile_blockA, ' 503 $ Bank A leaf 3\n');
+ fprintf(fileID_runfile_blockA, ' 504 $ Bank A leaf 4\n');
+ fprintf(fileID_runfile_blockA, ' 505 $ Bank A leaf 5\n');
+ fprintf(fileID_runfile_blockA, ' 506 $ Bank A leaf 6\n');
+ fprintf(fileID_runfile_blockA, ' 507 $ Bank A leaf 7\n');
+ fprintf(fileID_runfile_blockA, ' 508 $ Bank A leaf 8\n');
+ fprintf(fileID_runfile_blockA, ' 509 $ Bank A leaf 9\n');
+ fprintf(fileID_runfile_blockA, ' 510 $ Bank A leaf 10\n');
+ fprintf(fileID_runfile_blockA, ' 511 $ Bank A leaf 11\n');
+ fprintf(fileID_runfile_blockA, ' 512 $ Bank A leaf 12\n');
+ fprintf(fileID_runfile_blockA, ' 513 $ Bank A leaf 13\n');
+ fprintf(fileID_runfile_blockA, ' 514 $ Bank A leaf 14\n');
+ fprintf(fileID_runfile_blockA, ' 515 $ Bank A leaf 15\n');
+ fprintf(fileID_runfile_blockA, ' 516 $ Bank A leaf 16\n');
+ fprintf(fileID_runfile_blockA, ' 517 $ Bank A leaf 17\n');
+ fprintf(fileID_runfile_blockA, ' 518 $ Bank A leaf 18\n');
+ fprintf(fileID_runfile_blockA, ' 519 $ Bank A leaf 19\n');
+ fprintf(fileID_runfile_blockA, ' 520 $ Bank A leaf 20\n');
+
+ fprintf(fileID_runfile_blockA, ' 601 $ Bank B leaf 1\n'); % leaf bank B
+ fprintf(fileID_runfile_blockA, ' 602 $ Bank B leaf 2\n');
+ fprintf(fileID_runfile_blockA, ' 603 $ Bank B leaf 3\n');
+ fprintf(fileID_runfile_blockA, ' 604 $ Bank B leaf 4\n');
+ fprintf(fileID_runfile_blockA, ' 605 $ Bank B leaf 5\n');
+ fprintf(fileID_runfile_blockA, ' 606 $ Bank B leaf 6\n');
+ fprintf(fileID_runfile_blockA, ' 607 $ Bank B leaf 7\n');
+ fprintf(fileID_runfile_blockA, ' 608 $ Bank B leaf 8\n');
+ fprintf(fileID_runfile_blockA, ' 609 $ Bank B leaf 9\n');
+ fprintf(fileID_runfile_blockA, ' 610 $ Bank B leaf 10\n');
+ fprintf(fileID_runfile_blockA, ' 611 $ Bank B leaf 11\n');
+ fprintf(fileID_runfile_blockA, ' 612 $ Bank B leaf 12\n');
+ fprintf(fileID_runfile_blockA, ' 613 $ Bank B leaf 13\n');
+ fprintf(fileID_runfile_blockA, ' 614 $ Bank B leaf 14\n');
+ fprintf(fileID_runfile_blockA, ' 615 $ Bank B leaf 15\n');
+ fprintf(fileID_runfile_blockA, ' 616 $ Bank B leaf 16\n');
+ fprintf(fileID_runfile_blockA, ' 617 $ Bank B leaf 17\n');
+ fprintf(fileID_runfile_blockA, ' 618 $ Bank B leaf 18\n');
+ fprintf(fileID_runfile_blockA, ' 619 $ Bank B leaf 19\n');
+ fprintf(fileID_runfile_blockA, ' 620) $ Bank B leaf 20\n');
+
+ fprintf(fileID_runfile_blockA, '9999 0 1 2 3 4 5 6 7 8 $ Graveyard\n');
+
+ fprintf(fileID_runfile_blockA, '1002 0 -6 $ Exclude MLC\n');
+ fprintf(fileID_runfile_blockA, ' (-501: $ Bank A leaf 1\n'); % leaf bank A
+ fprintf(fileID_runfile_blockA, ' -502: $ Bank A leaf 2\n');
+ fprintf(fileID_runfile_blockA, ' -503: $ Bank A leaf 3\n');
+ fprintf(fileID_runfile_blockA, ' -504: $ Bank A leaf 4\n');
+ fprintf(fileID_runfile_blockA, ' -505: $ Bank A leaf 5\n');
+ fprintf(fileID_runfile_blockA, ' -506: $ Bank A leaf 6\n');
+ fprintf(fileID_runfile_blockA, ' -507: $ Bank A leaf 7\n');
+ fprintf(fileID_runfile_blockA, ' -508: $ Bank A leaf 8\n');
+ fprintf(fileID_runfile_blockA, ' -509: $ Bank A leaf 9\n');
+ fprintf(fileID_runfile_blockA, ' -510: $ Bank A leaf 10\n');
+ fprintf(fileID_runfile_blockA, ' -511: $ Bank A leaf 11\n');
+ fprintf(fileID_runfile_blockA, ' -512: $ Bank A leaf 12\n');
+ fprintf(fileID_runfile_blockA, ' -513: $ Bank A leaf 13\n');
+ fprintf(fileID_runfile_blockA, ' -514: $ Bank A leaf 14\n');
+ fprintf(fileID_runfile_blockA, ' -515: $ Bank A leaf 15\n');
+ fprintf(fileID_runfile_blockA, ' -516: $ Bank A leaf 16\n');
+ fprintf(fileID_runfile_blockA, ' -517: $ Bank A leaf 17\n');
+ fprintf(fileID_runfile_blockA, ' -518: $ Bank A leaf 18\n');
+ fprintf(fileID_runfile_blockA, ' -519: $ Bank A leaf 19\n');
+ fprintf(fileID_runfile_blockA, ' -520: $ Bank A leaf 20\n');
+
+ fprintf(fileID_runfile_blockA, ' -601: $ Bank B leaf 1\n'); % leaf bank B
+ fprintf(fileID_runfile_blockA, ' -602: $ Bank B leaf 2\n');
+ fprintf(fileID_runfile_blockA, ' -603: $ Bank B leaf 3\n');
+ fprintf(fileID_runfile_blockA, ' -604: $ Bank B leaf 4\n');
+ fprintf(fileID_runfile_blockA, ' -605: $ Bank B leaf 5\n');
+ fprintf(fileID_runfile_blockA, ' -606: $ Bank B leaf 6\n');
+ fprintf(fileID_runfile_blockA, ' -607: $ Bank B leaf 7\n');
+ fprintf(fileID_runfile_blockA, ' -608: $ Bank B leaf 8\n');
+ fprintf(fileID_runfile_blockA, ' -609: $ Bank B leaf 9\n');
+ fprintf(fileID_runfile_blockA, ' -610: $ Bank B leaf 10\n');
+ fprintf(fileID_runfile_blockA, ' -611: $ Bank B leaf 11\n');
+ fprintf(fileID_runfile_blockA, ' -612: $ Bank B leaf 12\n');
+ fprintf(fileID_runfile_blockA, ' -613: $ Bank B leaf 13\n');
+ fprintf(fileID_runfile_blockA, ' -614: $ Bank B leaf 14\n');
+ fprintf(fileID_runfile_blockA, ' -615: $ Bank B leaf 15\n');
+ fprintf(fileID_runfile_blockA, ' -616: $ Bank B leaf 16\n');
+ fprintf(fileID_runfile_blockA, ' -617: $ Bank B leaf 17\n');
+ fprintf(fileID_runfile_blockA, ' -618: $ Bank B leaf 18\n');
+ fprintf(fileID_runfile_blockA, ' -619: $ Bank B leaf 19\n');
+ fprintf(fileID_runfile_blockA, ' -620) $ Bank B leaf 20\n');
+
+ fprintf(fileID_runfile_blockB, '\n');
+ fprintf(fileID_runfile_blockB, 'C ***************************************************************\n');
+ fprintf(fileID_runfile_blockB, 'C ***************************************************************\n');
+ fprintf(fileID_runfile_blockB, 'C Block B: Surfaces\n');
+ fprintf(fileID_runfile_blockB, 'C ***************************************************************\n');
+
+ fprintf(fileID_runfile_blockB, '1 RPP 0 62 -50 50 -50 50 $ Outer boundaries of simulation volume\n');
+ fprintf(fileID_runfile_blockB, '4 RPP 288 418 -50 50 -50 50\n');
+ fprintf(fileID_runfile_blockB, '8 RPP 493 700 -50 50 -50 50\n');
+ fprintf(fileID_runfile_blockB, '9 RPP 492.5 492.9 -10.9 10.9 -14.9 14.9\n'); % RSSA generation helper surface
+
+ fprintf(fileID_runfile_blockB, '2 ARB 62 -8 -9 $ Inner boundaries of transport tunnnel\n');
+ fprintf(fileID_runfile_blockB, ' 62 -8 9\n');
+ fprintf(fileID_runfile_blockB, ' 62 8 9\n');
+ fprintf(fileID_runfile_blockB, ' 62 8 -9\n');
+ fprintf(fileID_runfile_blockB, ' 274 -9 -12\n');
+ fprintf(fileID_runfile_blockB, ' 274 -9 12\n');
+ fprintf(fileID_runfile_blockB, ' 274 9 12\n');
+ fprintf(fileID_runfile_blockB, ' 274 9 -12\n');
+ fprintf(fileID_runfile_blockB, ' 1234 2367 1458 3478 1256 5678\n');
+ fprintf(fileID_runfile_blockB, '3 RPP 274 288 -15 15 -17.5 17.5\n');
+ fprintf(fileID_runfile_blockB, '5 RPP 418 428 -10 10 -15 15\n');
+ fprintf(fileID_runfile_blockB, '6 RPP 428 478 -10 10 -15 15\n');
+ fprintf(fileID_runfile_blockB, '7 RPP 478 493 -11 11 -15 15\n');
+
+ fprintf(fileID_runfile_blockB, 'C ***************************************************************\n');
+ fprintf(fileID_runfile_blockB, 'C MLC Leafs\n');
+ fprintf(fileID_runfile_blockB, 'C ***************************************************************\n');
+ fprintf(fileID_runfile_blockB, '501 501 RPP 0 50 -6 6 -.75 .75\n');
+ fprintf(fileID_runfile_blockB, '502 502 RPP 0 50 -6 6 -.75 .75\n');
+ fprintf(fileID_runfile_blockB, '503 503 RPP 0 50 -6 6 -.75 .75\n');
+ fprintf(fileID_runfile_blockB, '504 504 RPP 0 50 -6 6 -.75 .75\n');
+ fprintf(fileID_runfile_blockB, '505 505 RPP 0 50 -6 6 -.75 .75\n');
+ fprintf(fileID_runfile_blockB, '506 506 RPP 0 50 -6 6 -.75 .75\n');
+ fprintf(fileID_runfile_blockB, '507 507 RPP 0 50 -6 6 -.75 .75\n');
+ fprintf(fileID_runfile_blockB, '508 508 RPP 0 50 -6 6 -.75 .75\n');
+ fprintf(fileID_runfile_blockB, '509 509 RPP 0 50 -6 6 -.75 .75\n');
+ fprintf(fileID_runfile_blockB, '510 510 RPP 0 50 -6 6 -.75 .75\n');
+ fprintf(fileID_runfile_blockB, '511 511 RPP 0 50 -6 6 -.75 .75\n');
+ fprintf(fileID_runfile_blockB, '512 512 RPP 0 50 -6 6 -.75 .75\n');
+ fprintf(fileID_runfile_blockB, '513 513 RPP 0 50 -6 6 -.75 .75\n');
+ fprintf(fileID_runfile_blockB, '514 514 RPP 0 50 -6 6 -.75 .75\n');
+ fprintf(fileID_runfile_blockB, '515 515 RPP 0 50 -6 6 -.75 .75\n');
+ fprintf(fileID_runfile_blockB, '516 516 RPP 0 50 -6 6 -.75 .75\n');
+ fprintf(fileID_runfile_blockB, '517 517 RPP 0 50 -6 6 -.75 .75\n');
+ fprintf(fileID_runfile_blockB, '518 518 RPP 0 50 -6 6 -.75 .75\n');
+ fprintf(fileID_runfile_blockB, '519 519 RPP 0 50 -6 6 -.75 .75\n');
+ fprintf(fileID_runfile_blockB, '520 520 RPP 0 50 -6 6 -.75 .75\n');
+
+ fprintf(fileID_runfile_blockB, '601 601 RPP 0 50 -6 6 -.75 .75\n');
+ fprintf(fileID_runfile_blockB, '602 602 RPP 0 50 -6 6 -.75 .75\n');
+ fprintf(fileID_runfile_blockB, '603 603 RPP 0 50 -6 6 -.75 .75\n');
+ fprintf(fileID_runfile_blockB, '604 604 RPP 0 50 -6 6 -.75 .75\n');
+ fprintf(fileID_runfile_blockB, '605 605 RPP 0 50 -6 6 -.75 .75\n');
+ fprintf(fileID_runfile_blockB, '606 606 RPP 0 50 -6 6 -.75 .75\n');
+ fprintf(fileID_runfile_blockB, '607 607 RPP 0 50 -6 6 -.75 .75\n');
+ fprintf(fileID_runfile_blockB, '608 608 RPP 0 50 -6 6 -.75 .75\n');
+ fprintf(fileID_runfile_blockB, '609 609 RPP 0 50 -6 6 -.75 .75\n');
+ fprintf(fileID_runfile_blockB, '610 610 RPP 0 50 -6 6 -.75 .75\n');
+ fprintf(fileID_runfile_blockB, '611 611 RPP 0 50 -6 6 -.75 .75\n');
+ fprintf(fileID_runfile_blockB, '612 612 RPP 0 50 -6 6 -.75 .75\n');
+ fprintf(fileID_runfile_blockB, '613 613 RPP 0 50 -6 6 -.75 .75\n');
+ fprintf(fileID_runfile_blockB, '614 614 RPP 0 50 -6 6 -.75 .75\n');
+ fprintf(fileID_runfile_blockB, '615 615 RPP 0 50 -6 6 -.75 .75\n');
+ fprintf(fileID_runfile_blockB, '616 616 RPP 0 50 -6 6 -.75 .75\n');
+ fprintf(fileID_runfile_blockB, '617 617 RPP 0 50 -6 6 -.75 .75\n');
+ fprintf(fileID_runfile_blockB, '618 618 RPP 0 50 -6 6 -.75 .75\n');
+ fprintf(fileID_runfile_blockB, '619 619 RPP 0 50 -6 6 -.75 .75\n');
+ fprintf(fileID_runfile_blockB, '620 620 RPP 0 50 -6 6 -.75 .75\n');
+
+ fprintf(fileID_runfile_blockB, '420 px 533 $ Detector plane\n');
+
+ fprintf(fileID_runfile_blockC, '\n');
+ fprintf(fileID_runfile_blockC, 'C ***************************************************************\n');
+ fprintf(fileID_runfile_blockC, 'C ***************************************************************\n');
+ fprintf(fileID_runfile_blockC, 'C Block C\n');
+ fprintf(fileID_runfile_blockC, 'C ***************************************************************\n');
+ fprintf(fileID_runfile_blockC, 'C Block C: Tranformations\n');
+ fprintf(fileID_runfile_blockC, 'C ***************************************************************\n');
+ fprintf(fileID_runfile_blockC, ['TR501 428 ', num2str(6 + MLCleafPositions(1,1)), ' 14.25 1 0 0 0 1 0 0 0 1 $ Block A\n']);
+ fprintf(fileID_runfile_blockC, ['TR502 428 ', num2str(6 + MLCleafPositions(1,2)), ' 12.75 1 0 0 0 1 0 0 0 1\n']);
+ fprintf(fileID_runfile_blockC, ['TR503 428 ', num2str(6 + MLCleafPositions(1,3)), ' 11.25 1 0 0 0 1 0 0 0 1\n']);
+ fprintf(fileID_runfile_blockC, ['TR504 428 ', num2str(6 + MLCleafPositions(1,4)), ' 9.75 1 0 0 0 1 0 0 0 1\n']);
+ fprintf(fileID_runfile_blockC, ['TR505 428 ', num2str(6 + MLCleafPositions(1,5)), ' 8.25 1 0 0 0 1 0 0 0 1\n']);
+ fprintf(fileID_runfile_blockC, ['TR506 428 ', num2str(6 + MLCleafPositions(1,6)), ' 6.75 1 0 0 0 1 0 0 0 1\n']);
+ fprintf(fileID_runfile_blockC, ['TR507 428 ', num2str(6 + MLCleafPositions(1,7)), ' 5.25 1 0 0 0 1 0 0 0 1\n']);
+ fprintf(fileID_runfile_blockC, ['TR508 428 ', num2str(6 + MLCleafPositions(1,8)), ' 3.75 1 0 0 0 1 0 0 0 1\n']);
+ fprintf(fileID_runfile_blockC, ['TR509 428 ', num2str(6 + MLCleafPositions(1,9)), ' 2.25 1 0 0 0 1 0 0 0 1\n']);
+ fprintf(fileID_runfile_blockC, ['TR510 428 ', num2str(6 + MLCleafPositions(1,10)), ' .75 1 0 0 0 1 0 0 0 1\n']);
+ fprintf(fileID_runfile_blockC, ['TR511 428 ', num2str(6 + MLCleafPositions(1,11)), ' -.75 1 0 0 0 1 0 0 0 1\n']);
+ fprintf(fileID_runfile_blockC, ['TR512 428 ', num2str(6 + MLCleafPositions(1,12)), ' -2.25 1 0 0 0 1 0 0 0 1\n']);
+ fprintf(fileID_runfile_blockC, ['TR513 428 ', num2str(6 + MLCleafPositions(1,13)), ' -3.75 1 0 0 0 1 0 0 0 1\n']);
+ fprintf(fileID_runfile_blockC, ['TR514 428 ', num2str(6 + MLCleafPositions(1,14)), ' -5.25 1 0 0 0 1 0 0 0 1\n']);
+ fprintf(fileID_runfile_blockC, ['TR515 428 ', num2str(6 + MLCleafPositions(1,15)), ' -6.75 1 0 0 0 1 0 0 0 1\n']);
+ fprintf(fileID_runfile_blockC, ['TR516 428 ', num2str(6 + MLCleafPositions(1,16)), ' -8.25 1 0 0 0 1 0 0 0 1\n']);
+ fprintf(fileID_runfile_blockC, ['TR517 428 ', num2str(6 + MLCleafPositions(1,17)), ' -9.75 1 0 0 0 1 0 0 0 1\n']);
+ fprintf(fileID_runfile_blockC, ['TR518 428 ', num2str(6 + MLCleafPositions(1,18)), ' -11.25 1 0 0 0 1 0 0 0 1\n']);
+ fprintf(fileID_runfile_blockC, ['TR519 428 ', num2str(6 + MLCleafPositions(1,19)), ' -12.75 1 0 0 0 1 0 0 0 1\n']);
+ fprintf(fileID_runfile_blockC, ['TR520 428 ', num2str(6 + MLCleafPositions(1,20)), ' -14.25 1 0 0 0 1 0 0 0 1\n']);
+
+ fprintf(fileID_runfile_blockC, ['TR601 428 ', num2str(MLCleafPositions(2,1) - 6), ' 14.25 1 0 0 0 1 0 0 0 1 $ Block B\n']);
+ fprintf(fileID_runfile_blockC, ['TR602 428 ', num2str(MLCleafPositions(2,2) - 6), ' 12.75 1 0 0 0 1 0 0 0 1\n']);
+ fprintf(fileID_runfile_blockC, ['TR603 428 ', num2str(MLCleafPositions(2,3) - 6), ' 11.25 1 0 0 0 1 0 0 0 1\n']);
+ fprintf(fileID_runfile_blockC, ['TR604 428 ', num2str(MLCleafPositions(2,4) - 6), ' 9.75 1 0 0 0 1 0 0 0 1\n']);
+ fprintf(fileID_runfile_blockC, ['TR605 428 ', num2str(MLCleafPositions(2,5) - 6), ' 8.25 1 0 0 0 1 0 0 0 1\n']);
+ fprintf(fileID_runfile_blockC, ['TR606 428 ', num2str(MLCleafPositions(2,6) - 6), ' 6.75 1 0 0 0 1 0 0 0 1\n']);
+ fprintf(fileID_runfile_blockC, ['TR607 428 ', num2str(MLCleafPositions(2,7) - 6), ' 5.25 1 0 0 0 1 0 0 0 1\n']);
+ fprintf(fileID_runfile_blockC, ['TR608 428 ', num2str(MLCleafPositions(2,8) - 6), ' 3.75 1 0 0 0 1 0 0 0 1\n']);
+ fprintf(fileID_runfile_blockC, ['TR609 428 ', num2str(MLCleafPositions(2,9) - 6), ' 2.25 1 0 0 0 1 0 0 0 1\n']);
+ fprintf(fileID_runfile_blockC, ['TR610 428 ', num2str(MLCleafPositions(2,10) - 6), ' .75 1 0 0 0 1 0 0 0 1\n']);
+ fprintf(fileID_runfile_blockC, ['TR611 428 ', num2str(MLCleafPositions(2,11) - 6), ' -.75 1 0 0 0 1 0 0 0 1\n']);
+ fprintf(fileID_runfile_blockC, ['TR612 428 ', num2str(MLCleafPositions(2,12) - 6), ' -2.25 1 0 0 0 1 0 0 0 1\n']);
+ fprintf(fileID_runfile_blockC, ['TR613 428 ', num2str(MLCleafPositions(2,13) - 6), ' -3.75 1 0 0 0 1 0 0 0 1\n']);
+ fprintf(fileID_runfile_blockC, ['TR614 428 ', num2str(MLCleafPositions(2,14) - 6), ' -5.25 1 0 0 0 1 0 0 0 1\n']);
+ fprintf(fileID_runfile_blockC, ['TR615 428 ', num2str(MLCleafPositions(2,15) - 6), ' -6.75 1 0 0 0 1 0 0 0 1\n']);
+ fprintf(fileID_runfile_blockC, ['TR616 428 ', num2str(MLCleafPositions(2,16) - 6), ' -8.25 1 0 0 0 1 0 0 0 1\n']);
+ fprintf(fileID_runfile_blockC, ['TR617 428 ', num2str(MLCleafPositions(2,17) - 6), ' -9.75 1 0 0 0 1 0 0 0 1\n']);
+ fprintf(fileID_runfile_blockC, ['TR618 428 ', num2str(MLCleafPositions(2,18) - 6), ' -11.25 1 0 0 0 1 0 0 0 1\n']);
+ fprintf(fileID_runfile_blockC, ['TR619 428 ', num2str(MLCleafPositions(2,19) - 6), ' -12.75 1 0 0 0 1 0 0 0 1\n']);
+ fprintf(fileID_runfile_blockC, ['TR620 428 ', num2str(MLCleafPositions(2,20) - 6), ' -14.25 1 0 0 0 1 0 0 0 1\n']);
+
+ fclose(fileID_runfile_blockA);
+ fclose(fileID_runfile_blockB);
+ fclose(fileID_runfile_blockC);
+
+ end
+
+%% Function definition for FRM 2 MLC 3 MCNP runfile goes here...
+ function runfileName = makeRunfileFRM2MLC3(MLCleafPositions, pathRunfiles, runfileName)
+
+ % Prepare leaf dimenions s. th. leafs fit into available area
+ horizontalDimMLCExitWindow = 265;
+ leafDimensions_MLC3 = ...
+ [ 18.5 14.5 14.5 14.5 14.5 7.5 11.5 11.5 11.5 18.2 11.5 11.5 11.5 7.5 14.5 14.5 14.5 14.5 18.5;... % Back side
+ 14.9 14.5 14.5 14.5 14.5 17.5 11.5 11.5 11.5 8.2 11.5 11.5 11.5 17.5 14.5 14.5 14.5 14.5 14.8]; % Front side
+
+ % add additional margin around leafs s.th. entrance window has width = 26.5cm
+ leafDimensions_MLC3(1,:) = leafDimensions_MLC3(1,:) + .5;
+ additionalMarginOuterLeafs = (horizontalDimMLCExitWindow - sum(leafDimensions_MLC3(1,:)))/2;
+ leafDimensions_MLC3(1,1) = leafDimensions_MLC3(1,1) + additionalMarginOuterLeafs;
+ leafDimensions_MLC3(1,end) = leafDimensions_MLC3(1,end) + additionalMarginOuterLeafs;
+
+ % add additional margin around leafs s.th. entrance window has width = 26.5cm
+ leafDimensions_MLC3(2,:) = leafDimensions_MLC3(2,:) + .35;
+ additionalMarginOuterLeafs = (horizontalDimMLCExitWindow - sum(leafDimensions_MLC3(2,:)))/2;
+ leafDimensions_MLC3(2,1) = leafDimensions_MLC3(2,1) + additionalMarginOuterLeafs;
+ leafDimensions_MLC3(2,end) = leafDimensions_MLC3(2,end) + additionalMarginOuterLeafs;
+
+ leafDimensions_MLC3 = leafDimensions_MLC3/10; % rescale to cm for MCNP
+ horizontalDimMLCExitWindow = horizontalDimMLCExitWindow/10;
+
+ fileID_runfile_blockA = fopen(strcat(pathRunfiles,filesep,runfileName, '_blockA.txt'), 'w');
+ fileID_runfile_blockB = fopen(strcat(pathRunfiles,filesep,runfileName, '_blockB.txt'), 'w');
+ fileID_runfile_blockC = fopen(strcat(pathRunfiles,filesep,runfileName, '_blockC.txt'), 'w');
+
+ % Write block A: Cells
+ fprintf(fileID_runfile_blockA, 'MCNP Runfile for WSSA Generation for MLC3 at FRM2\n');
+ fprintf(fileID_runfile_blockA, 'C ***************************************************************\n');
+ fprintf(fileID_runfile_blockA, 'C ***************************************************************\n');
+ fprintf(fileID_runfile_blockA, 'C Block A: Cells\n');
+ fprintf(fileID_runfile_blockA, 'C ***************************************************************\n');
+
+ fprintf(fileID_runfile_blockA, '1000 0 7000 (-1:-2:-3:-4:-5:-8) $ Propagation tunnel\n');
+ fprintf(fileID_runfile_blockA, '1001 0 (-6 $ Start MLC $ Inside of MLC for fluence tally\n');
+ fprintf(fileID_runfile_blockA, ' 501 $ Bank A leaf 1\n'); % leaf bank A
+ fprintf(fileID_runfile_blockA, ' 502 $ Bank A leaf 2\n');
+ fprintf(fileID_runfile_blockA, ' 503 $ Bank A leaf 3\n');
+ fprintf(fileID_runfile_blockA, ' 504 $ Bank A leaf 4\n');
+ fprintf(fileID_runfile_blockA, ' 505 $ Bank A leaf 5\n');
+ fprintf(fileID_runfile_blockA, ' 506 $ Bank A leaf 6\n');
+ fprintf(fileID_runfile_blockA, ' 507 $ Bank A leaf 7\n');
+ fprintf(fileID_runfile_blockA, ' 508 $ Bank A leaf 8\n');
+ fprintf(fileID_runfile_blockA, ' 509 $ Bank A leaf 9\n');
+ fprintf(fileID_runfile_blockA, ' 510 $ Bank A leaf 10\n');
+ fprintf(fileID_runfile_blockA, ' 511 $ Bank A leaf 11\n');
+ fprintf(fileID_runfile_blockA, ' 512 $ Bank A leaf 12\n');
+ fprintf(fileID_runfile_blockA, ' 513 $ Bank A leaf 13\n');
+ fprintf(fileID_runfile_blockA, ' 514 $ Bank A leaf 14\n');
+ fprintf(fileID_runfile_blockA, ' 515 $ Bank A leaf 15\n');
+ fprintf(fileID_runfile_blockA, ' 516 $ Bank A leaf 16\n');
+ fprintf(fileID_runfile_blockA, ' 517 $ Bank A leaf 17\n');
+ fprintf(fileID_runfile_blockA, ' 518 $ Bank A leaf 18\n');
+ fprintf(fileID_runfile_blockA, ' 519 $ Bank A leaf 19\n');
+
+ fprintf(fileID_runfile_blockA, ' 601 $ Bank B leaf 1\n'); % leaf bank B
+ fprintf(fileID_runfile_blockA, ' 602 $ Bank B leaf 2\n');
+ fprintf(fileID_runfile_blockA, ' 603 $ Bank B leaf 3\n');
+ fprintf(fileID_runfile_blockA, ' 604 $ Bank B leaf 4\n');
+ fprintf(fileID_runfile_blockA, ' 605 $ Bank B leaf 5\n');
+ fprintf(fileID_runfile_blockA, ' 606 $ Bank B leaf 6\n');
+ fprintf(fileID_runfile_blockA, ' 607 $ Bank B leaf 7\n');
+ fprintf(fileID_runfile_blockA, ' 608 $ Bank B leaf 8\n');
+ fprintf(fileID_runfile_blockA, ' 609 $ Bank B leaf 9\n');
+ fprintf(fileID_runfile_blockA, ' 610 $ Bank B leaf 10\n');
+ fprintf(fileID_runfile_blockA, ' 611 $ Bank B leaf 11\n');
+ fprintf(fileID_runfile_blockA, ' 612 $ Bank B leaf 12\n');
+ fprintf(fileID_runfile_blockA, ' 613 $ Bank B leaf 13\n');
+ fprintf(fileID_runfile_blockA, ' 614 $ Bank B leaf 14\n');
+ fprintf(fileID_runfile_blockA, ' 615 $ Bank B leaf 15\n');
+ fprintf(fileID_runfile_blockA, ' 616 $ Bank B leaf 16\n');
+ fprintf(fileID_runfile_blockA, ' 617 $ Bank B leaf 17\n');
+ fprintf(fileID_runfile_blockA, ' 618 $ Bank B leaf 18\n');
+ fprintf(fileID_runfile_blockA, ' 619) $ Bank B leaf 19\n');
+
+
+ fprintf(fileID_runfile_blockA, '9999 0 1 2 3 4 5 6 8 $ Graveyard\n');
+
+ fprintf(fileID_runfile_blockA, '1002 0 -6 $ Exclude MLC\n');
+ fprintf(fileID_runfile_blockA, ' (-501: $ Bank A leaf 1\n'); % leaf bank A
+ fprintf(fileID_runfile_blockA, ' -502: $ Bank A leaf 2\n');
+ fprintf(fileID_runfile_blockA, ' -503: $ Bank A leaf 3\n');
+ fprintf(fileID_runfile_blockA, ' -504: $ Bank A leaf 4\n');
+ fprintf(fileID_runfile_blockA, ' -505: $ Bank A leaf 5\n');
+ fprintf(fileID_runfile_blockA, ' -506: $ Bank A leaf 6\n');
+ fprintf(fileID_runfile_blockA, ' -507: $ Bank A leaf 7\n');
+ fprintf(fileID_runfile_blockA, ' -508: $ Bank A leaf 8\n');
+ fprintf(fileID_runfile_blockA, ' -509: $ Bank A leaf 9\n');
+ fprintf(fileID_runfile_blockA, ' -510: $ Bank A leaf 10\n');
+ fprintf(fileID_runfile_blockA, ' -511: $ Bank A leaf 11\n');
+ fprintf(fileID_runfile_blockA, ' -512: $ Bank A leaf 12\n');
+ fprintf(fileID_runfile_blockA, ' -513: $ Bank A leaf 13\n');
+ fprintf(fileID_runfile_blockA, ' -514: $ Bank A leaf 14\n');
+ fprintf(fileID_runfile_blockA, ' -515: $ Bank A leaf 15\n');
+ fprintf(fileID_runfile_blockA, ' -516: $ Bank A leaf 16\n');
+ fprintf(fileID_runfile_blockA, ' -517: $ Bank A leaf 17\n');
+ fprintf(fileID_runfile_blockA, ' -518: $ Bank A leaf 18\n');
+ fprintf(fileID_runfile_blockA, ' -519: $ Bank A leaf 19\n');
+
+ fprintf(fileID_runfile_blockA, ' -601: $ Bank B leaf 1\n'); % leaf bank B
+ fprintf(fileID_runfile_blockA, ' -602: $ Bank B leaf 2\n');
+ fprintf(fileID_runfile_blockA, ' -603: $ Bank B leaf 3\n');
+ fprintf(fileID_runfile_blockA, ' -604: $ Bank B leaf 4\n');
+ fprintf(fileID_runfile_blockA, ' -605: $ Bank B leaf 5\n');
+ fprintf(fileID_runfile_blockA, ' -606: $ Bank B leaf 6\n');
+ fprintf(fileID_runfile_blockA, ' -607: $ Bank B leaf 7\n');
+ fprintf(fileID_runfile_blockA, ' -608: $ Bank B leaf 8\n');
+ fprintf(fileID_runfile_blockA, ' -609: $ Bank B leaf 9\n');
+ fprintf(fileID_runfile_blockA, ' -610: $ Bank B leaf 10\n');
+ fprintf(fileID_runfile_blockA, ' -611: $ Bank B leaf 11\n');
+ fprintf(fileID_runfile_blockA, ' -612: $ Bank B leaf 12\n');
+ fprintf(fileID_runfile_blockA, ' -613: $ Bank B leaf 13\n');
+ fprintf(fileID_runfile_blockA, ' -614: $ Bank B leaf 14\n');
+ fprintf(fileID_runfile_blockA, ' -615: $ Bank B leaf 15\n');
+ fprintf(fileID_runfile_blockA, ' -616: $ Bank B leaf 16\n');
+ fprintf(fileID_runfile_blockA, ' -617: $ Bank B leaf 17\n');
+ fprintf(fileID_runfile_blockA, ' -618: $ Bank B leaf 18\n');
+ fprintf(fileID_runfile_blockA, ' -619) $ Bank B leaf 19\n');
+
+ fprintf(fileID_runfile_blockB, '\n');
+ fprintf(fileID_runfile_blockB, 'C ***************************************************************\n');
+ fprintf(fileID_runfile_blockB, 'C ***************************************************************\n');
+ fprintf(fileID_runfile_blockB, 'C Block B: Surfaces\n');
+ fprintf(fileID_runfile_blockB, 'C ***************************************************************\n');
+
+ fprintf(fileID_runfile_blockB, '1 RPP 0 62 -50 50 -50 50 $ Outer boundaries of simulation volume\n');
+ fprintf(fileID_runfile_blockB, '4 RPP 288 423 -50 50 -50 50\n');
+ fprintf(fileID_runfile_blockB, '8 RPP 523 700 -50 50 -50 50\n');
+
+ fprintf(fileID_runfile_blockB, '2 ARB 62 -8 -9 $ Inner boundaries of transport tunnnel\n');
+ fprintf(fileID_runfile_blockB, ' 62 -8 9\n');
+ fprintf(fileID_runfile_blockB, ' 62 8 9\n');
+ fprintf(fileID_runfile_blockB, ' 62 8 -9\n');
+ fprintf(fileID_runfile_blockB, ' 274 -9 -12\n');
+ fprintf(fileID_runfile_blockB, ' 274 -9 12\n');
+ fprintf(fileID_runfile_blockB, ' 274 9 12\n');
+ fprintf(fileID_runfile_blockB, ' 274 9 -12\n');
+ fprintf(fileID_runfile_blockB, ' 1234 2367 1458 3478 1256 5678\n');
+ fprintf(fileID_runfile_blockB, '3 RPP 274 288 -15 15 -17.5 17.5\n');
+ fprintf(fileID_runfile_blockB, '5 RPP 423 463 -12 12 -15 15\n');
+ fprintf(fileID_runfile_blockB, '6 RPP 463 523 -10 10 -13.25 13.25\n');
+
+ fprintf(fileID_runfile_blockB, 'C ***************************************************************\n');
+ fprintf(fileID_runfile_blockB, 'C MLC Leafs\n');
+ fprintf(fileID_runfile_blockB, 'C ***************************************************************\n');
+ % leaf 1
+ leafCounter = 1;
+ fprintf(fileID_runfile_blockB, [num2str(500 + leafCounter), ' ', num2str(500 + leafCounter), ' ARB 0 -5 ', ...
+ num2str(-horizontalDimMLCExitWindow/2), '\n']);
+ fprintf(fileID_runfile_blockB, [' 0 -5 ', num2str(-horizontalDimMLCExitWindow/2 +leafDimensions_MLC3(1,leafCounter)), '\n']);
+ fprintf(fileID_runfile_blockB, [' 0 5 ', num2str(-horizontalDimMLCExitWindow/2 +leafDimensions_MLC3(1,leafCounter)), '\n']);
+ fprintf(fileID_runfile_blockB, [' 0 5 ', num2str(-horizontalDimMLCExitWindow/2), '\n']);
+ fprintf(fileID_runfile_blockB, [' 60 -5 ', num2str(-horizontalDimMLCExitWindow/2), '\n']);
+ fprintf(fileID_runfile_blockB, [' 60 -5 ', num2str(-horizontalDimMLCExitWindow/2 +leafDimensions_MLC3(2,leafCounter)), '\n']);
+ fprintf(fileID_runfile_blockB, [' 60 5 ', num2str(-horizontalDimMLCExitWindow/2 +leafDimensions_MLC3(2,leafCounter)), '\n']);
+ fprintf(fileID_runfile_blockB, [' 60 5 ', num2str(-horizontalDimMLCExitWindow/2), '\n']);
+ fprintf(fileID_runfile_blockB, ' 1234 2367 1458 3478 1256 5678\n');
+
+ % leafs 2:end
+ for leafCounter = 2:size(leafDimensions_MLC3,2)
+ fprintf(fileID_runfile_blockB, [num2str(500 + leafCounter), ' ', num2str(500 + leafCounter), ' ARB 0 -5 ', ...
+ num2str(-horizontalDimMLCExitWindow/2 + sum(leafDimensions_MLC3(1,1:leafCounter-1))), '\n']);
+ fprintf(fileID_runfile_blockB, [' 0 -5 ', num2str(-horizontalDimMLCExitWindow/2 + ...
+ sum(leafDimensions_MLC3(1,1:leafCounter))), '\n']);
+ fprintf(fileID_runfile_blockB, [' 0 5 ', num2str(-horizontalDimMLCExitWindow/2 + ...
+ sum(leafDimensions_MLC3(1,1:leafCounter))), '\n']);
+ fprintf(fileID_runfile_blockB, [' 0 5 ', num2str(-horizontalDimMLCExitWindow/2 + ...
+ sum(leafDimensions_MLC3(1,1:leafCounter-1))), '\n']);
+ fprintf(fileID_runfile_blockB, [' 60 -5 ', num2str(-horizontalDimMLCExitWindow/2 + ...
+ sum(leafDimensions_MLC3(2,1:leafCounter-1))), '\n']);
+ fprintf(fileID_runfile_blockB, [' 60 -5 ', num2str(-horizontalDimMLCExitWindow/2 + ...
+ sum(leafDimensions_MLC3(2,1:leafCounter))), '\n']);
+ fprintf(fileID_runfile_blockB, [' 60 5 ', num2str(-horizontalDimMLCExitWindow/2 + ...
+ sum(leafDimensions_MLC3(2,1:leafCounter))), '\n']);
+ fprintf(fileID_runfile_blockB, [' 60 5 ', num2str(-horizontalDimMLCExitWindow/2 + ...
+ sum(leafDimensions_MLC3(2,1:leafCounter-1))), '\n']);
+ fprintf(fileID_runfile_blockB, ' 1234 2367 1458 3478 1256 5678\n');
+ end
+
+ % leaf 1
+ leafCounter = 1;
+ fprintf(fileID_runfile_blockB, [num2str(600 + leafCounter), ' ', num2str(600 + leafCounter), ' ARB 0 -5 ', ...
+ num2str(-horizontalDimMLCExitWindow/2), '\n']);
+ fprintf(fileID_runfile_blockB, [' 0 -5 ', num2str(-horizontalDimMLCExitWindow/2 +leafDimensions_MLC3(1,leafCounter)), '\n']);
+ fprintf(fileID_runfile_blockB, [' 0 5 ', num2str(-horizontalDimMLCExitWindow/2 +leafDimensions_MLC3(1,leafCounter)), '\n']);
+ fprintf(fileID_runfile_blockB, [' 0 5 ', num2str(-horizontalDimMLCExitWindow/2), '\n']);
+ fprintf(fileID_runfile_blockB, [' 60 -5 ', num2str(-horizontalDimMLCExitWindow/2), '\n']);
+ fprintf(fileID_runfile_blockB, [' 60 -5 ', num2str(-horizontalDimMLCExitWindow/2 +leafDimensions_MLC3(2,leafCounter)), '\n']);
+ fprintf(fileID_runfile_blockB, [' 60 5 ', num2str(-horizontalDimMLCExitWindow/2 +leafDimensions_MLC3(2,leafCounter)), '\n']);
+ fprintf(fileID_runfile_blockB, [' 60 5 ', num2str(-horizontalDimMLCExitWindow/2), '\n']);
+ fprintf(fileID_runfile_blockB, ' 1234 2367 1458 3478 1256 5678\n');
+
+ % leafs 2:end
+ for leafCounter = 2:size(leafDimensions_MLC3,2)
+ fprintf(fileID_runfile_blockB, [num2str(600 + leafCounter), ' ', num2str(600 + leafCounter), ' ARB 0 -5 ', ...
+ num2str(-horizontalDimMLCExitWindow/2 + sum(leafDimensions_MLC3(1,1:leafCounter-1))), '\n']);
+ fprintf(fileID_runfile_blockB, [' 0 -5 ', num2str(-horizontalDimMLCExitWindow/2 + ...
+ sum(leafDimensions_MLC3(1,1:leafCounter))), '\n']);
+ fprintf(fileID_runfile_blockB, [' 0 5 ', num2str(-horizontalDimMLCExitWindow/2 + ...
+ sum(leafDimensions_MLC3(1,1:leafCounter))), '\n']);
+ fprintf(fileID_runfile_blockB, [' 0 5 ', num2str(-horizontalDimMLCExitWindow/2 + ...
+ sum(leafDimensions_MLC3(1,1:leafCounter-1))), '\n']);
+ fprintf(fileID_runfile_blockB, [' 60 -5 ', num2str(-horizontalDimMLCExitWindow/2 + ...
+ sum(leafDimensions_MLC3(2,1:leafCounter-1))), '\n']);
+ fprintf(fileID_runfile_blockB, [' 60 -5 ', num2str(-horizontalDimMLCExitWindow/2 + ...
+ sum(leafDimensions_MLC3(2,1:leafCounter))), '\n']);
+ fprintf(fileID_runfile_blockB, [' 60 5 ', num2str(-horizontalDimMLCExitWindow/2 + ...
+ sum(leafDimensions_MLC3(2,1:leafCounter))), '\n']);
+ fprintf(fileID_runfile_blockB, [' 60 5 ', num2str(-horizontalDimMLCExitWindow/2 + ...
+ sum(leafDimensions_MLC3(2,1:leafCounter-1))), '\n']);
+ fprintf(fileID_runfile_blockB, ' 1234 2367 1458 3478 1256 5678\n');
+ end
+
+
+ fprintf(fileID_runfile_blockB, '420 px 533 $ Detector plane\n');
+
+ fprintf(fileID_runfile_blockC, '\n');
+ fprintf(fileID_runfile_blockC, 'C ***************************************************************\n');
+ fprintf(fileID_runfile_blockC, 'C ***************************************************************\n');
+ fprintf(fileID_runfile_blockC, 'C Block C\n');
+ fprintf(fileID_runfile_blockC, 'C ***************************************************************\n');
+ fprintf(fileID_runfile_blockC, 'C Block C: Tranformations\n');
+ fprintf(fileID_runfile_blockC, 'C ***************************************************************\n');
+ for leafCounter = 1:size(leafDimensions_MLC3,2)
+ if leafCounter == 1
+ fprintf(fileID_runfile_blockC, ['TR', num2str(500 + leafCounter), ' 463 ', num2str(5 + MLCleafPositions(1,leafCounter)), ' ', ...
+ '0' ,...
+ ' 1 0 0 0 1 0 0 0 1 $ Block A\n']);
+ else
+ fprintf(fileID_runfile_blockC, ['TR', num2str(500 + leafCounter), ' 463 ', num2str(5 + MLCleafPositions(1,leafCounter)), ' ', ...
+ '0' ,...
+ ' 1 0 0 0 1 0 0 0 1 $ Block A\n']);
+ end
+ end
+
+ for leafCounter = 1:size(leafDimensions_MLC3,2)
+ if leafCounter == 1
+ fprintf(fileID_runfile_blockC, ['TR', num2str(600 + leafCounter), ' 463 ', num2str(MLCleafPositions(2,1) - 5), ' ', ...
+ '0' ,...
+ ' 1 0 0 0 1 0 0 0 1 $ Block B\n']);
+ else
+ fprintf(fileID_runfile_blockC, ['TR', num2str(600 + leafCounter), ' 463 ', num2str(MLCleafPositions(2,leafCounter) - 5), ' ', ...
+ '0' ,...
+ ' 1 0 0 0 1 0 0 0 1 $ Block B\n']);
+ end
+ end
+
+
+ fclose(fileID_runfile_blockA);
+ fclose(fileID_runfile_blockB);
+ fclose(fileID_runfile_blockC);
+
+ end
+
+%% Function definition for FRM 2 PTW water phantom (52x63.5x63.5cm^3)
+ function [waterPhantomRunfileName, WSSAfileName] = makeWaterPhantomFRM2PTW(runfileName, SSD4kernelCalc, npsKernelGen, particleType, transportMedium, sourceOpeningAngle, WSSAoption) % SSD defined from wall to water phantom surface
+ phantomDimensions = [63.5 52 63.5];
+ wallPosition = 493;
+ diameterCentralDetector = 1.5;
+ waterPhantomRunfileName = [runfileName, '_waterPhantom'];
+ fileID_waterPhantom_blockA = fopen(strcat(pwd,filesep, [waterPhantomRunfileName, '_blockA.txt']), 'w');
+ fileID_waterPhantom_blockB = fopen(strcat(pwd,filesep, [waterPhantomRunfileName, '_blockB.txt']), 'w');
+ fileID_waterPhantom_blockC = fopen(strcat(pwd,filesep, [waterPhantomRunfileName, '_blockC.txt']), 'w');
+
+ fprintf(fileID_waterPhantom_blockA, 'C ***************************************************************\n');
+ fprintf(fileID_waterPhantom_blockA, 'C Block A: Cells Waterphantom\n');
+ fprintf(fileID_waterPhantom_blockA, 'C ***************************************************************\n');
+
+ fprintf(fileID_waterPhantom_blockB, 'C ***************************************************************\n');
+ fprintf(fileID_waterPhantom_blockB, 'C Block B: Surfaces Waterphantom\n');
+ fprintf(fileID_waterPhantom_blockB, 'C ***************************************************************\n');
+
+ switch particleType
+ case 'neutronField'
+ % Get list of available tabulated neutron spectra
+ spectralInformation.pathLocation = fullfile(matRad_getMATRADdirectory_hardCoded,'MCNP', 'SpectralInformation', filesep);
+ spectralInformation.neutronSpectrum = dir([spectralInformation.pathLocation, 'spectrum_neutrons_*']);
+
+ % Check if there is more than one neutron spectrum available in
+ % ../MATRAD/MCNP/SpectralInformation
+ if size(spectralInformation.neutronSpectrum,1)~=1
+ [spectralInformation.neutronIndex,~] = listdlg('PromptString','Please select neutron spectrum:',...
+ 'SelectionMode','single',...
+ 'ListString',{spectralInformation.neutronSpectrum.name});
+ else
+ spectralInformation.neutronIndex = 1;
+ end
+
+ % Read spectral information from selected file with first column as
+ % energy and second column as spectral information
+ fid_neutronSpectrum = fopen([spectralInformation.neutronSpectrum(spectralInformation.neutronIndex).folder, filesep, spectralInformation.neutronSpectrum(spectralInformation.neutronIndex).name], 'r');
+ spectralInformation.spectrumValuesNeutrons = fscanf(fid_neutronSpectrum, '%f', [2,inf]);
+ spectralInformation.spectrumValuesNeutrons = spectralInformation.spectrumValuesNeutrons';
+ fclose(fid_neutronSpectrum);
+
+ % Define source card, note: VEC=reference vector for the direction
+ % sampling, DIR=cosine of angle between VEC and partice direction,
+ % in case DIR=-1 a monodirectional source in counter direction of
+ % VEC.
+ % ERG=d3 used to define spectrum according to information read from
+ % tabulated data in ..\MATRAD\MCNP\SpectralInformation
+
+ source.sourceCard_0 = 'SDEF\n POS=0 0 0\n X=0 Y=d1 Z=d2\n VEC=1 0 0\n DIR=d4 PAR=1 ERG=d3 $wgt=3.5088e+03 $ changed from HB (wgt=30.65e6) since primer states use 1/fsa2 (fsa2=0.000285)\n';
+ source.sourceCard_1_i = 'SI1 -7.5 7.5\n'; % Initial position and source extension
+ source.sourceCard_1_p = 'SP1 0 1\n';
+ source.sourceCard_2_i = 'SI2 -7.5 7.5\n'; % ...
+ source.sourceCard_2_p = 'SP2 0 1\n';
+ source.energyCard_3_i_0 = 'SI3 H\n'; % Energy bins
+ source.energyCard_3_i = ' %8d\n';
+ source.energyCard_3_p_0 = 'SP3 D\n'; % Spectral information
+ source.energyCard_3_p = ' %8d\n';
+ source.energyCard_4_i = ['SI4 -1 ', num2str(cosd(sourceOpeningAngle)), ' 1\n'];
+ source.energyCard_4_p = ['SP4 0 ', num2str(1-4*pi*(sin((sourceOpeningAngle/360)*2*pi/2)^2)/(4*pi)),' ', num2str(4*pi*(sin((sourceOpeningAngle/360)*2*pi/2)^2)/(4*pi)), '\n'];
+ source.energyCard_4_b = 'SB4 0 0 1\n';
+
+ % Write source block
+ fprintf(fileID_waterPhantom_blockC, 'C ***************************************************************\n');
+ fprintf(fileID_waterPhantom_blockC, 'C C: Source\n');
+ fprintf(fileID_waterPhantom_blockC, 'C ***************************************************************\n');
+
+ % Write initial source position and extension
+ fprintf(fileID_waterPhantom_blockC, source.sourceCard_0);
+ fprintf(fileID_waterPhantom_blockC, source.sourceCard_1_i);
+ fprintf(fileID_waterPhantom_blockC, source.sourceCard_1_p);
+ fprintf(fileID_waterPhantom_blockC, source.sourceCard_2_i);
+ fprintf(fileID_waterPhantom_blockC, source.sourceCard_2_p);
+
+ % Write spectral distribution
+ fprintf(fileID_waterPhantom_blockC, source.energyCard_3_i_0);
+ fprintf(fileID_waterPhantom_blockC, source.energyCard_3_i, ...
+ spectralInformation.spectrumValuesNeutrons(:,1));
+ fprintf(fileID_waterPhantom_blockC, source.energyCard_3_p_0);
+ fprintf(fileID_waterPhantom_blockC, source.energyCard_3_p, ...
+ spectralInformation.spectrumValuesNeutrons(:,2));
+ fprintf(fileID_waterPhantom_blockC, source.energyCard_4_i);
+ fprintf(fileID_waterPhantom_blockC, source.energyCard_4_p);
+ fprintf(fileID_waterPhantom_blockC, source.energyCard_4_b);
+
+ case 'photonField'
+ % Get list of available tabulated photon spectra
+ spectralInformation.pathLocation = fullfile(matRad_getMATRADdirectory_hardCoded,'MCNP', 'SpectralInformation', filesep);
+ spectralInformation.photonSpectrum = dir([spectralInformation.pathLocation, 'spectrum_photons_*']);
+
+ % Check if there is more than one photon spectra available in
+ % ../MATRAD/MCNP/SpectralInformation
+ if size(spectralInformation.photonSpectrum,1)~=1
+ [spectralInformation.photonIndex,~] = listdlg('PromptString','Please select photon spectrum:',...
+ 'SelectionMode','single',...
+ 'ListString',{spectralInformation.photonSpectrum.name});
+ else
+ spectralInformation.photonIndex = 1;
+ end
+
+ % Read spectral information from selected file with first column as
+ % energy and second column as spectral information
+ fid_photonSpectrum = fopen([spectralInformation.photonSpectrum(spectralInformation.photonIndex).folder, filesep, spectralInformation.photonSpectrum(spectralInformation.photonIndex).name], 'r');
+ spectralInformation.spectrumValuesPhotons = fscanf(fid_photonSpectrum, '%f', [2,inf]);
+ spectralInformation.spectrumValuesPhotons = spectralInformation.spectrumValuesPhotons';
+ fclose(fid_photonSpectrum);
+
+ % Define source card, note: VEC=reference vector for the direction
+ % sampling, DIR=cosine of angle between VEC and partice direction,
+ % in case DIR=-1 a monodirectional source in counter direction of
+ % VEC.
+ % ERG=d3 used to define spectrum according to information read from
+ % tabulated data in ..\MATRAD\MCNP\SpectralInformation
+
+ source.sourceCard_0 = 'SDEF\n POS=0 0 0\n X=0 Y=d1 Z=d2\n VEC=1 0 0\n DIR=d4 PAR=2 ERG=d3 $ wgt=3.5088e+03 $ changed from HB (wgt=30.65e6) since primer states use 1/fsa2 (fsa2=0.000285)\n';
+ source.sourceCard_1_i = 'SI1 -7.5 7.5\n'; % Initial position and source extension
+ source.sourceCard_1_p = 'SP1 0 1\n';
+ source.sourceCard_2_i = 'SI2 -7.5 7.5\n'; % ...
+ source.sourceCard_2_p = 'SP2 0 1\n';
+ source.energyCard_3_i_0 = 'SI3 H\n'; % Energy bins
+ source.energyCard_3_i = ' %8d\n';
+ source.energyCard_3_p_0 = 'SP3 D\n'; % Spectral information
+ source.energyCard_3_p = ' %8d\n';
+ source.energyCard_4_i = ['SI4 -1 ', num2str(cosd(sourceOpeningAngle)), ' 1\n'];
+ source.energyCard_4_p = ['SP4 0 ', num2str(1-4*pi*(sin((sourceOpeningAngle/360)*2*pi/2)^2)/(4*pi)),' ', num2str(4*pi*(sin((sourceOpeningAngle/360)*2*pi/2)^2)/(4*pi)), '\n'];
+ source.energyCard_4_b = 'SB4 0 0 1\n';
+
+ % Write source block
+ fprintf(fileID_waterPhantom_blockC, 'C ***************************************************************\n');
+ fprintf(fileID_waterPhantom_blockC, 'C C: Source\n');
+ fprintf(fileID_waterPhantom_blockC, 'C ***************************************************************\n');
+
+ % Write initial source position and extension
+ fprintf(fileID_waterPhantom_blockC, source.sourceCard_0);
+ fprintf(fileID_waterPhantom_blockC, source.sourceCard_1_i);
+ fprintf(fileID_waterPhantom_blockC, source.sourceCard_1_p);
+ fprintf(fileID_waterPhantom_blockC, source.sourceCard_2_i);
+ fprintf(fileID_waterPhantom_blockC, source.sourceCard_2_p);
+
+ % Write spectral distribution
+ fprintf(fileID_waterPhantom_blockC, source.energyCard_3_i_0);
+ fprintf(fileID_waterPhantom_blockC, source.energyCard_3_i, ...
+ spectralInformation.spectrumValuesPhotons(:,1));
+ fprintf(fileID_waterPhantom_blockC, source.energyCard_3_p_0);
+ fprintf(fileID_waterPhantom_blockC, source.energyCard_3_p, ...
+ spectralInformation.spectrumValuesPhotons(:,2));
+ fprintf(fileID_waterPhantom_blockC, source.energyCard_4_i);
+ fprintf(fileID_waterPhantom_blockC, source.energyCard_4_p);
+ fprintf(fileID_waterPhantom_blockC, source.energyCard_4_b);
+
+ case 'mixedField'
+ % Get list of available tabulated neutron spectra
+ spectralInformation.pathLocation = fullfile(matRad_getMATRADdirectory_hardCoded,'MCNP', 'SpectralInformation', filesep);
+ spectralInformation.neutronSpectrum = dir([spectralInformation.pathLocation, 'spectrum_neutrons_*']);
+ spectralInformation.photonSpectrum = dir([spectralInformation.pathLocation, 'spectrum_photons_*']);
+
+ % Check if there is more than one neutron spectrum available in
+ % ../MATRAD/MCNP/SpectralInformation
+ if size(spectralInformation.neutronSpectrum,1)~=1
+ [spectralInformation.neutronIndex,~] = listdlg('PromptString','Please select neutron spectrum:',...
+ 'SelectionMode','single',...
+ 'ListString',{spectralInformation.neutronSpectrum.name});
+ else
+ spectralInformation.neutronIndex = 1;
+ end
+ % Same for photons
+ if size(spectralInformation.photonSpectrum,1)~=1
+ [spectralInformation.photonIndex,~] = listdlg('PromptString','Please select photon spectrum:',...
+ 'SelectionMode','single',...
+ 'ListString',{spectralInformation.photonSpectrum.name});
+ else
+ spectralInformation.photonIndex = 1;
+ end
+
+ % Read spectral information from selected file with first column as
+ % energy and second column as spectral information
+ % Neutrons
+ fid_neutronSpectrum = fopen([spectralInformation.neutronSpectrum(spectralInformation.neutronIndex).folder, filesep, spectralInformation.neutronSpectrum(spectralInformation.neutronIndex).name], 'r');
+ spectralInformation.spectrumValuesNeutrons = fscanf(fid_neutronSpectrum, '%f', [2,inf]);
+ spectralInformation.spectrumValuesNeutrons = spectralInformation.spectrumValuesNeutrons';
+ fclose(fid_neutronSpectrum);
+ % Photons
+ fid_photonSpectrum = fopen([spectralInformation.photonSpectrum(spectralInformation.photonIndex).folder, filesep, spectralInformation.photonSpectrum(spectralInformation.photonIndex).name], 'r');
+ spectralInformation.spectrumValuesPhotons = fscanf(fid_photonSpectrum, '%f', [2,inf]);
+ spectralInformation.spectrumValuesPhotons = spectralInformation.spectrumValuesPhotons';
+ fclose(fid_photonSpectrum);
+
+ % Define source card, note: VEC=reference vector for the direction
+ % sampling, DIR=cosine of angle between VEC and partice direction,
+ % in case DIR=-1 a monodirectional source in counter direction of
+ % VEC.
+ % ERG=d3 used to define spectrum according to information read from
+ % tabulated data in ..\MATRAD\MCNP\SpectralInformation
+
+ source.sourceCard_0 = 'SDEF\n POS=0 0 0\n X=0 Y=d1 Z=d2\n VEC=1 0 0\n PAR=d3 ERG=fpar=d4 DIR=d7\n';
+ source.sourceCard_1_i = 'SI1 -7.5 7.5\n'; % Initial position and source extension
+ source.sourceCard_1_p = 'SP1 0 1\n';
+ source.sourceCard_2_i = 'SI2 -7.5 7.5\n'; % ...
+ source.sourceCard_2_p = 'SP2 0 1\n';
+ source.particleDistribution_i = 'SI3 L 1 2\n';
+ source.particleDistribution_p = 'SP3 3.2 2.9\n'; % 3.2e8 n/cm^2/s and 2.9 gammas/cm^2/s
+ source.particleEnergyDistributions = 'DS4 S 5 6\n';
+ source.neutronEnergyCard_5_i_0 = 'SI5 H\n'; % Energy bins neutrons
+ source.neutronEnergyCard_5_i = ' %8d\n';
+ source.neutronEnergyCard_5_p_0 = 'SP5 D\n'; % Spectral information neutrons
+ source.neutronEnergyCard_5_p = ' %8d\n';
+ source.photonEnergyCard_6_i_0 = 'SI6 H\n'; % Energy bins photons
+ source.photonEnergyCard_6_i = ' %8d\n';
+ source.photonEnergyCard_6_p_0 = 'SP6 D\n'; % Spectral information photons
+ source.photonEnergyCard_6_p = ' %8d\n';
+ source.energyCard_7_i = ['SI7 -1 ', num2str(cosd(sourceOpeningAngle)), ' 1\n'];
+ source.energyCard_7_p = ['SP7 0 ', num2str(1-4*pi*(sin((sourceOpeningAngle/360)*2*pi/2)^2)/(4*pi)),' ', num2str(4*pi*(sin((sourceOpeningAngle/360)*2*pi/2)^2)/(4*pi)), '\n'];
+ source.energyCard_7_b = 'SB7 0 0 1\n';
+
+ % Write source block
+ fprintf(fileID_waterPhantom_blockC, 'C ***************************************************************\n');
+ fprintf(fileID_waterPhantom_blockC, 'C C: Source\n');
+ fprintf(fileID_waterPhantom_blockC, 'C ***************************************************************\n');
+
+ % Write initial source position and extension
+ fprintf(fileID_waterPhantom_blockC, source.sourceCard_0);
+ fprintf(fileID_waterPhantom_blockC, source.sourceCard_1_i);
+ fprintf(fileID_waterPhantom_blockC, source.sourceCard_1_p);
+ fprintf(fileID_waterPhantom_blockC, source.sourceCard_2_i);
+ fprintf(fileID_waterPhantom_blockC, source.sourceCard_2_p);
+
+ % Write spectral distribution
+ fprintf(fileID_waterPhantom_blockC, source.particleDistribution_i);
+ fprintf(fileID_waterPhantom_blockC, source.particleDistribution_p);
+ fprintf(fileID_waterPhantom_blockC, source.particleEnergyDistributions);
+ % Neutrons
+ fprintf(fileID_waterPhantom_blockC, source.neutronEnergyCard_5_i_0);
+ fprintf(fileID_waterPhantom_blockC, source.neutronEnergyCard_5_i, ...
+ spectralInformation.spectrumValuesNeutrons(:,1));
+ fprintf(fileID_waterPhantom_blockC, source.neutronEnergyCard_5_p_0);
+ fprintf(fileID_waterPhantom_blockC, source.neutronEnergyCard_5_p, ...
+ spectralInformation.spectrumValuesNeutrons(:,2));
+ % Photons
+ fprintf(fileID_waterPhantom_blockC, source.photonEnergyCard_6_i_0);
+ fprintf(fileID_waterPhantom_blockC, source.photonEnergyCard_6_i, ...
+ spectralInformation.spectrumValuesPhotons(:,1));
+ fprintf(fileID_waterPhantom_blockC, source.photonEnergyCard_6_p_0);
+ fprintf(fileID_waterPhantom_blockC, source.photonEnergyCard_6_p, ...
+ spectralInformation.spectrumValuesPhotons(:,2));
+ fprintf(fileID_waterPhantom_blockC, source.energyCard_7_i);
+ fprintf(fileID_waterPhantom_blockC, source.energyCard_7_p);
+ fprintf(fileID_waterPhantom_blockC, source.energyCard_7_b);
+
+ end
+
+
+ fprintf(fileID_waterPhantom_blockC, 'C ************************************************************\n');
+ switch transportMedium
+ case 'water'
+ fprintf(fileID_waterPhantom_blockC, 'C ***************************************************************\n');
+ fprintf(fileID_waterPhantom_blockC, 'C Block C: Waterphantom\n');
+ fprintf(fileID_waterPhantom_blockC, 'C ***************************************************************\n');
+
+ fprintf(fileID_waterPhantom_blockA, '7000 1 -1 -7000 7999 $ Water phantom w/o central PDD detector\n');
+ fprintf(fileID_waterPhantom_blockB, ['7000 RPP ', num2str(wallPosition + SSD4kernelCalc), ' ', ...
+ num2str(wallPosition + SSD4kernelCalc + phantomDimensions(1)), ' ', ...
+ num2str(-phantomDimensions(2)/2), ' ', num2str(phantomDimensions(2)/2), ' ', ...
+ num2str(-phantomDimensions(3)/2), ' ', num2str(phantomDimensions(3)/2), ' $ Water phantom outer contour\n']);
+ fprintf(fileID_waterPhantom_blockB, ['7999 CX ', num2str(diameterCentralDetector/2), '\n']);
+
+ fprintf(fileID_waterPhantom_blockC, 'MODE N P E H D T S A #\n');
+ fprintf(fileID_waterPhantom_blockC, 'C ************************************************************\n');
+ fprintf(fileID_waterPhantom_blockC, 'PHYS:N 101 0 0 3J 1 -1 3J 0 0\n');
+ fprintf(fileID_waterPhantom_blockC, 'PHYS:H 101 101 -1 J 0 J 1 3J 0 0 0 0.917\n');
+ fprintf(fileID_waterPhantom_blockC, 'CUT:n J 0\n');
+ fprintf(fileID_waterPhantom_blockC, 'CUT:p J 1.0E-03\n');
+ fprintf(fileID_waterPhantom_blockC, 'CUT:e J 1.0E-03\n');
+ fprintf(fileID_waterPhantom_blockC, 'CUT:h J 1.0E-06\n');
+ fprintf(fileID_waterPhantom_blockC, 'CUT:d J 1.0E-06\n');
+ fprintf(fileID_waterPhantom_blockC, 'CUT:t J 1.0E-06\n');
+ fprintf(fileID_waterPhantom_blockC, 'CUT:s J 1.0E-06\n');
+ fprintf(fileID_waterPhantom_blockC, 'CUT:a J 1.0E-06\n');
+ fprintf(fileID_waterPhantom_blockC, 'CUT:# J 1.0E-06\n');
+ fprintf(fileID_waterPhantom_blockC, 'C ************************************************************\n');
+ fprintf(fileID_waterPhantom_blockC, 'C ************************************************************\n');
+ case 'none'
+ fprintf(fileID_waterPhantom_blockC, 'C ***************************************************************\n');
+ fprintf(fileID_waterPhantom_blockC, 'C Block C: Waterphantom\n');
+ fprintf(fileID_waterPhantom_blockC, 'C ***************************************************************\n');
+
+ fprintf(fileID_waterPhantom_blockA, '7000 1 -1 -7000 $ Water phantom\n');
+ fprintf(fileID_waterPhantom_blockB, ['7000 RPP ', num2str(wallPosition + SSD4kernelCalc), ' ', ...
+ num2str(wallPosition + SSD4kernelCalc + phantomDimensions(1)), ' ', ...
+ num2str(-phantomDimensions(2)/2), ' ', num2str(phantomDimensions(2)/2), ' ', ...
+ num2str(-phantomDimensions(3)/2), ' ', num2str(phantomDimensions(3)/2), ' $ Water phantom outer contour\n']);
+
+ fprintf(fileID_waterPhantom_blockC, 'MODE N P\n');
+ fprintf(fileID_waterPhantom_blockC, 'C ************************************************************\n');
+ fprintf(fileID_waterPhantom_blockC, 'PHYS:N 101 0 0 3J 1 -1 3J 0 0\n');
+ fprintf(fileID_waterPhantom_blockC, 'CUT:n J 0\n');
+ fprintf(fileID_waterPhantom_blockC, 'CUT:p J 1.0E-03\n');
+ fprintf(fileID_waterPhantom_blockC, 'C ************************************************************\n');
+ fprintf(fileID_waterPhantom_blockC, 'C ************************************************************\n');
+ end
+ fprintf(fileID_waterPhantom_blockC, ['NPS ', num2str(npsKernelGen), '\n']);
+ fprintf(fileID_waterPhantom_blockC, ['PRDMP J ', num2str(npsKernelGen/2),' 1 1\n']);
+
+ fprintf(fileID_waterPhantom_blockC, 'C ************************************************************\n');
+ fprintf(fileID_waterPhantom_blockC, 'C Transport medium\n');
+ fprintf(fileID_waterPhantom_blockC, 'C ************************************************************\n');
+ switch transportMedium
+ case 'water'
+ fprintf(fileID_waterPhantom_blockC, 'm1 1001.66c -0.112102272\n');
+ fprintf(fileID_waterPhantom_blockC, ' 1002.80c -2.57667e-05\n');
+ fprintf(fileID_waterPhantom_blockC, ' 8016.80c -0.887512659\n');
+ fprintf(fileID_waterPhantom_blockC, ' 8017.80c -0.000359302\n');
+ fprintf(fileID_waterPhantom_blockC, 'mt1 lwtr.20t\n');
+ fprintf(fileID_waterPhantom_blockC, 'C ************************************************************\n');
+ case 'none'
+ fprintf(fileID_waterPhantom_blockC, 'm1 7014.70c -0.755000000\n');
+ fprintf(fileID_waterPhantom_blockC, ' 8016.70c -0.232000000\n');
+ fprintf(fileID_waterPhantom_blockC, ' 18040.70c -0.013000000\n');
+ fprintf(fileID_waterPhantom_blockC, 'C ************************************************************\n');
+ fprintf(fileID_waterPhantom_blockC, 'void\n');
+ end
+
+ if WSSAoption
+ fprintf(fileID_waterPhantom_blockC, 'C ***************************************************************\n');
+ fprintf(fileID_waterPhantom_blockC, 'C Block C: Write WSSA\n');
+ fprintf(fileID_waterPhantom_blockC, 'C ***************************************************************\n');
+ switch transportMedium
+ case 'water'
+ fprintf(fileID_waterPhantom_blockC, 'SSW 9.1 (-9) PTY=N P\n');
+ case 'none'
+ fprintf(fileID_waterPhantom_blockC, 'SSW 9.1 (-9) PTY=N P\n');
+ end
+ WSSAfileName = 'WSSAGenerated';
+ else
+ WSSAfileName = 'WSSAnotGenerated';
+ end
+
+
+ fprintf(fileID_waterPhantom_blockC, 'C ***************************************************************\n');
+ fprintf(fileID_waterPhantom_blockC, 'C Block C: Tallies Waterphantom\n');
+ fprintf(fileID_waterPhantom_blockC, 'C ***************************************************************\n');
+ switch transportMedium
+ case 'water'
+ numberTalliesPDD = [35 150 60];
+ tallyResolution = [.1 .2 .5];
+ tallyCounter = 1;
+ fprintf(fileID_waterPhantom_blockB, [num2str(7000+tallyCounter),' PX ',num2str(wallPosition + SSD4kernelCalc), '\n']);
+
+ while tallyCounter <= numberTalliesPDD(1)
+ % Write cell cards
+ fprintf(fileID_waterPhantom_blockA, [num2str(7000+tallyCounter),' 1 -1 -7999 ',num2str(7000+tallyCounter), ' -',num2str(7000+tallyCounter+1), '\n']);
+ % Write surface cards
+ fprintf(fileID_waterPhantom_blockB, [num2str(7000+tallyCounter+1),' PX ',num2str(wallPosition + SSD4kernelCalc + (tallyCounter)*tallyResolution(1)), '\n']);
+ % Write tallies
+ fprintf(fileID_waterPhantom_blockC, ['+F',num2str(tallyCounter), '16 ', num2str(7000+tallyCounter), '\n']);
+ fprintf(fileID_waterPhantom_blockC, ['SF',num2str(tallyCounter), '16 7999\n']);
+ tallyCounter = tallyCounter +1;
+ end
+
+ while tallyCounter <= numberTalliesPDD(1)+numberTalliesPDD(2)
+ % Write cell cards
+ fprintf(fileID_waterPhantom_blockA, [num2str(7000+tallyCounter),' 1 -1 -7999 ',num2str(7000+tallyCounter), ' -',num2str(7000+tallyCounter+1), '\n']);
+ % Write surface cards
+ fprintf(fileID_waterPhantom_blockB, [num2str(7000+tallyCounter+1),' PX ',num2str(wallPosition + SSD4kernelCalc + numberTalliesPDD(1)*tallyResolution(1) + (tallyCounter-numberTalliesPDD(1))*tallyResolution(2)), '\n']);
+ % Write tallies
+ fprintf(fileID_waterPhantom_blockC, ['+F',num2str(tallyCounter), '16 ', num2str(7000+tallyCounter), '\n']);
+ fprintf(fileID_waterPhantom_blockC, ['SF',num2str(tallyCounter), '16 7999\n']);
+ tallyCounter = tallyCounter +1;
+ end
+
+ while tallyCounter <= sum(numberTalliesPDD)
+ % Write cell cards
+ fprintf(fileID_waterPhantom_blockA, [num2str(7000+tallyCounter),' 1 -1 -7999 ',num2str(7000+tallyCounter), ' -',num2str(7000+tallyCounter+1), '\n']);
+ % Write surface cards
+ fprintf(fileID_waterPhantom_blockB, [num2str(7000+tallyCounter+1),' PX ',num2str(wallPosition + SSD4kernelCalc + numberTalliesPDD(1)*tallyResolution(1) + numberTalliesPDD(2)*tallyResolution(2) + (tallyCounter-numberTalliesPDD(1)-numberTalliesPDD(2))*tallyResolution(3)), '\n']);
+ % Write tallies
+ fprintf(fileID_waterPhantom_blockC, ['+F',num2str(tallyCounter), '16 ', num2str(7000+tallyCounter), '\n']);
+ fprintf(fileID_waterPhantom_blockC, ['SF',num2str(tallyCounter), '16 7999\n']);
+ tallyCounter = tallyCounter +1;
+ end
+
+
+ % Fluence tallies inside MLC
+ fprintf(fileID_waterPhantom_blockC, 'C ***************************************************************\n');
+ fprintf(fileID_waterPhantom_blockC, 'C Fluence Tallies:\n');
+ fprintf(fileID_waterPhantom_blockC, 'C ***************************************************************\n');
+
+ fprintf(fileID_waterPhantom_blockC, 'F10014:N 1001\n'); %n neutrons
+ fprintf(fileID_waterPhantom_blockC, 'E10014\n');
+ energyResolution = [1e-6 1e-5 1e-4 1e-3 1e-2 1e-1:1e-1:.9 1:.25:11];
+ for counterEnergyRes = 1:length(energyResolution)
+ fprintf(fileID_waterPhantom_blockC, [' ', num2str(energyResolution(counterEnergyRes)), '\n']);
+ end
+ fprintf(fileID_waterPhantom_blockC, 'F10024:P 1001\n'); % photons
+ fprintf(fileID_waterPhantom_blockC, 'E10024\n');
+ energyResolution = [1e-6 1e-5 1e-4 1e-3 1e-2 1e-1:1e-1:.9 1:.25:11];
+ for counterEnergyRes = 1:length(energyResolution)
+ fprintf(fileID_waterPhantom_blockC, [' ', num2str(energyResolution(counterEnergyRes)), '\n']);
+ end
+
+ % TMESH tally inside water phantom
+ meshTally.typeCard = 'TMESH\n';
+ meshTally.geometry = 'RMESH3 %s\n';
+ meshTally.corA = 'CORA3 %.4f %dI %.4f\n';
+ meshTally.corB = 'CORB3 %.4f %dI %.4f\n';
+ meshTally.corC = 'CORC3 %.4f %dI %.4f\n';
+ tallyKeyword= 'TOTAL';
+ meshTally.resolution = .25;
+
+
+ %Write to text file
+ fprintf(fileID_waterPhantom_blockC, 'C ***************************************************************\n');
+ fprintf(fileID_waterPhantom_blockC, 'C TMESH Tally:\n');
+ fprintf(fileID_waterPhantom_blockC, 'C ***************************************************************\n');
+ fprintf(fileID_waterPhantom_blockC, meshTally.typeCard);
+ fprintf(fileID_waterPhantom_blockC, meshTally.geometry, tallyKeyword);
+ fprintf(fileID_waterPhantom_blockC, meshTally.corA, wallPosition + SSD4kernelCalc, (phantomDimensions(1)/meshTally.resolution-1), wallPosition + SSD4kernelCalc + phantomDimensions(1));
+ fprintf(fileID_waterPhantom_blockC, meshTally.corB, -phantomDimensions(2)/2, (phantomDimensions(2)/meshTally.resolution-1), phantomDimensions(2)/2);
+ fprintf(fileID_waterPhantom_blockC, meshTally.corC, -phantomDimensions(3)/2, (phantomDimensions(3)/meshTally.resolution-1), phantomDimensions(3)/2);
+ fprintf(fileID_waterPhantom_blockC, 'ENDMD\n');
+ case 'none'
+ disp('Water phantom not set up in simulation.')
+ numberTalliesPDD = [35 150 60];
+ % Fluence tallies inside MLC
+ fprintf(fileID_waterPhantom_blockC, 'C ***************************************************************\n');
+ fprintf(fileID_waterPhantom_blockC, 'C Fluence Tallies:\n');
+ fprintf(fileID_waterPhantom_blockC, 'C ***************************************************************\n');
+
+ fprintf(fileID_waterPhantom_blockC, 'F10014:N 1001\n'); %n neutrons
+ fprintf(fileID_waterPhantom_blockC, 'E10014\n');
+ energyResolution = [1e-6 1e-5 1e-4 1e-3 1e-2 1e-1:1e-1:.9 1:.25:11];
+ for counterEnergyRes = 1:length(energyResolution)
+ fprintf(fileID_waterPhantom_blockC, [' ', num2str(energyResolution(counterEnergyRes)), '\n']);
+ end
+ fprintf(fileID_waterPhantom_blockC, 'F10024:P 1001\n'); % photons
+ fprintf(fileID_waterPhantom_blockC, 'E10024\n');
+ energyResolution = [1e-6 1e-5 1e-4 1e-3 1e-2 1e-1:1e-1:.9 1:.25:11];
+ for counterEnergyRes = 1:length(energyResolution)
+ fprintf(fileID_waterPhantom_blockC, [' ', num2str(energyResolution(counterEnergyRes)), '\n']);
+ end
+
+ % TMESH tally inside water phantom
+ meshTally.typeCard = 'TMESH\n';
+ meshTally.geometry = 'RMESH3 %s\n';
+ meshTally.corA = 'CORA3 %.4f %dI %.4f\n';
+ meshTally.corB = 'CORB3 %.4f %dI %.4f\n';
+ meshTally.corC = 'CORC3 %.4f %dI %.4f\n';
+ tallyKeyword= 'TOTAL';
+ meshTally.resolution = .25;
+
+
+ %Write to text file
+ fprintf(fileID_waterPhantom_blockC, 'C ***************************************************************\n');
+ fprintf(fileID_waterPhantom_blockC, 'C TMESH Tally:\n');
+ fprintf(fileID_waterPhantom_blockC, 'C ***************************************************************\n');
+ fprintf(fileID_waterPhantom_blockC, meshTally.typeCard);
+ fprintf(fileID_waterPhantom_blockC, meshTally.geometry, tallyKeyword);
+ fprintf(fileID_waterPhantom_blockC, meshTally.corA, wallPosition + SSD4kernelCalc, (phantomDimensions(1)/meshTally.resolution-1), wallPosition + SSD4kernelCalc + phantomDimensions(1));
+ fprintf(fileID_waterPhantom_blockC, meshTally.corB, -phantomDimensions(2)/2, (phantomDimensions(2)/meshTally.resolution-1), phantomDimensions(2)/2);
+ fprintf(fileID_waterPhantom_blockC, meshTally.corC, -phantomDimensions(3)/2, (phantomDimensions(3)/meshTally.resolution-1), phantomDimensions(3)/2);
+ fprintf(fileID_waterPhantom_blockC, 'ENDMD\n');
+
+ end
+
+
+ fprintf(fileID_waterPhantom_blockC, 'C ***************************************************************\n');
+ fprintf(fileID_waterPhantom_blockC, 'C Block C: Physics\n');
+ fprintf(fileID_waterPhantom_blockC, 'C ***************************************************************\n');
+ switch transportMedium
+ case 'water'
+ fprintf(fileID_waterPhantom_blockC, 'IMP:N,P,E,H,D,T,S,A,# 1 1 1 0 0\n');
+ for importanceCounter = 1:sum(numberTalliesPDD)+1
+ fprintf(fileID_waterPhantom_blockC, ' 1\n');
+ end
+
+ case 'none'
+ fprintf(fileID_waterPhantom_blockC, 'IMP:N,P 1 1 1 0 0 1\n');
+ end
+
+ fprintf(fileID_waterPhantom_blockC, 'RAND GEN=2 SEED=43 STRIDE=10000000001\n');
+
+
+ fclose(fileID_waterPhantom_blockA);
+ fclose(fileID_waterPhantom_blockB);
+ fclose(fileID_waterPhantom_blockC);
+
+ end
+
+%% Function to concatenate runfiles
+ function runfileName = concatenateRunfile(runfileName, waterPhantomRunfileName)
+ blockA_0 = [runfileName, '_blockA.txt'];
+ blockB_0 = [runfileName, '_blockB.txt'];
+ blockC_0 = [runfileName, '_blockC.txt'];
+
+ blockA_waterPhantom = [waterPhantomRunfileName, '_blockA.txt'];
+ blockB_waterPhantom = [waterPhantomRunfileName, '_blockB.txt'];
+ blockC_waterPhantom = [waterPhantomRunfileName, '_blockC.txt'];
+
+ if ismac || isunix
+ system(['cat ', blockA_0,' >> ', runfileName]);
+ system(['cat ', blockA_waterPhantom,' >> ', runfileName]);
+ system(['cat ', blockB_0,' >> ', runfileName]);
+ system(['cat ', blockB_waterPhantom,' >> ', runfileName]);
+ system(['cat ', blockC_0,' >> ', runfileName]);
+ system(['cat ', blockC_waterPhantom,' >> ', runfileName]);
+ elseif ispc
+ system(['type ', blockA_0,' >> ', runfileName]);
+ system(['type ', blockA_waterPhantom,' >> ', runfileName]);
+ system(['type ', blockB_0,' >> ', runfileName]);
+ system(['type ', blockB_waterPhantom,' >> ', runfileName]);
+ system(['type ', blockC_0,' >> ', runfileName]);
+ system(['type ', blockC_waterPhantom,' >> ', runfileName]);
+ else
+ disp('Platform not supported but you can concatenate the blocks to one runfile by hand.')
+ end
+ end
+end
\ No newline at end of file
diff --git a/MCNP/matRad_bixelDoseCalculatorMCNP.m b/MCNP/matRad_bixelDoseCalculatorMCNP.m
new file mode 100644
index 000000000..b9c7cf8a8
--- /dev/null
+++ b/MCNP/matRad_bixelDoseCalculatorMCNP.m
@@ -0,0 +1,101 @@
+function matRad_bixelDoseCalculatorMCNP(this)
+% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% matRad neutron dose calculation for each bixel individually
+%
+% Neutron dose engine A: Monte Carlo - MCNP6
+%
+% call
+% dij = matRad_calcPhotonDose(pathToRunfiles, stf, ct, pln, cst, binIntervals)
+%
+% input
+% pathToRunfiles: indicate path to MCNP runfiles here
+% stf, ct, pln, binIntervals
+%
+% output
+% dij: matRad dij struct
+%
+% References
+% [1] PELOWITZ, D. B., et al. MCNP6 Users Manual. LACP-00634, May, 2013.
+%
+% Author: Lucas Sommer (Lucas.Sommer@tum.de), 11/2018
+%
+% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+matRad_cfg = MatRad_Config.instance();
+
+if this.MCNPinstallationCheck && ~this.externalCalculation
+ %% Go to runfiles and get list of runfiles within directory
+ cd(strcat(matRad_cfg.matRadRoot, filesep, 'MCNP', filesep, 'runfiles_tmp'));
+ runFileList = dir('MCNPrunfile_*bixel');
+
+ wb = waitbar(0, ['Calculating dose for bixel: ', num2str(1)], 'Name', 'Dose Calculation with MCNP');
+
+ %% Run calculation for every bixel
+ parfor bixelCounter=1:size(runFileList,1)
+
+ disp('*****')
+ disp(['MCNP calculation of dose distribution for bixel ', num2str(bixelCounter), '...'])
+ disp('*****')
+
+ tic;
+
+ % waitbar(bixelCounter/size(runFileList,1), wb, ['Calculating dose for bixel: ', num2str(bixelCounter)], 'Name', 'Dose Calculation with MCNP');
+ if ispc
+ % system(['mpiexec -np ',num2str(numberCores4U), ' mcnp6.mpi I=', runFileList(bixelCounter).name, ...
+ system(['mcnp6 I=', runFileList(bixelCounter).name, ...
+ ' OUTP=', runFileList(bixelCounter).name, 'o ', ...
+ ' RUNTPE=', runFileList(bixelCounter).name, 'r ', ...
+ ' MCTAL=', runFileList(bixelCounter).name, 'm ', ...
+ 'MDATA= ', runFileList(bixelCounter).name, 'd']);
+ % Clean up
+ delete(strcat(runFileList(bixelCounter).name, 'o'))
+ delete(strcat(runFileList(bixelCounter).name, 'r'))
+ delete(strcat(runFileList(bixelCounter).name, 'd'))
+
+ else
+ system(['mcnp6 I=', runFileList(bixelCounter).name, ...
+ ' OUTP=', runFileList(bixelCounter).name, 'o ', ...
+ ' RUNTPE=', runFileList(bixelCounter).name, 'r ', ...
+ ' MCTAL=', runFileList(bixelCounter).name, 'm ', ...
+ ' MESHTAL=', runFileList(bixelCounter).name, 'meshtal '])
+ % Clean up
+ delete(strcat(runFileList(bixelCounter).name, 'o'))
+ delete(strcat(runFileList(bixelCounter).name, 'r'));
+ delete(strcat(runFileList(bixelCounter).name, 'd'));
+ end
+
+ calculationTime = toc;
+ disp('*****')
+ disp(['Calculation for bixel ', num2str(bixelCounter), ' took ', num2str(calculationTime), ' seconds.'])
+ disp('*****')
+
+ end
+
+ close(wb)
+elseif this.externalCalculation
+ if ispc % Write script to run MCNP simulation
+ cores = feature('numcores'); % Attention: should be adopted to allow portability to other pc/cluster
+ cd(strcat(matRad_cfg.matRadRoot, filesep, 'MCNP', filesep, 'runfiles_tmp'));
+ runFileList = dir('MCNPrunfile_*bixel');
+ commandMCNP = 'mpiexec -np %d mcnp6.mpi n=MCNPrunfile_%dbixel\n';
+ fileID_runAll = fopen('runAll.cmd', 'w');
+ for i=1:size(runFileList,1); fprintf(fileID_runAll, commandMCNP,cores, i); end
+ fclose(fileID_runAll);
+ end
+
+ matRad_cfg.dispInfo('Please use question dialog to continue after finishing external calculations.\n')
+ matRad_cfg.dispInfo('*****\n')
+ % External calculation
+ answer = questdlg('Did external MCNP simulations finish?', ...
+ 'External Calculation', ...
+ 'Yes', 'No', 'No');
+
+ while ~strcmp(answer, 'Yes')
+ matRad_cfg.dispInfo('matRad will crash if you continue without finishing external calculation.\n')
+ answer = questdlg('Did external MCNP simulations finish?', ...
+ 'External Calculation', ...
+ 'Yes', 'No', 'No');
+ end
+elseif ~this.externalCalculation && this.MCNPinstallationCheck
+ matRad_cfg.dispWarning('MCNP simulation requested but no MCNP installation found on your computer!\n')
+end
+end
\ No newline at end of file
diff --git a/MCNP/matRad_calcMCNProtMatrix.m b/MCNP/matRad_calcMCNProtMatrix.m
new file mode 100644
index 000000000..b7e193350
--- /dev/null
+++ b/MCNP/matRad_calcMCNProtMatrix.m
@@ -0,0 +1,50 @@
+function rotMatrix = matRad_calcMCNProtMatrix(gantryAngle, couchAngle)
+% Calculate MCNP rotation matrix
+%
+% call
+% rotMatrix = matRad_calcMCNProtMatrix(gantryAngle, couchAngle)
+%
+% input
+% gantryAngle
+% couchAngle
+%
+% output
+% rotMatrix: Roation matrix as MCNP input.
+% Note: Rotation angle for couch rotation in opposite
+% direction for matRad than for usual rotation in eD.
+%
+% References
+% -
+%
+% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% Copyright
+%
+% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+Phi = gantryAngle;
+Theta = couchAngle;
+
+matrixGantryRot_z = @(Phi) [cosd(Phi) -sind(Phi) 0; ...
+ sind(Phi) cosd(Phi) 0; ...
+ 0 0 1];
+
+% matrixCouchRot_y = @(Theta) [cosd(360-Theta) 0 sind(360-Theta);...
+% 0 1 0; ...
+% -sind(360-Theta) 0 cosd(360-Theta)];
+
+matrixCouchRot_y = @(Theta) [cosd(Theta) 0 sind(Theta);...
+ 0 1 0; ...
+ -sind(Theta) 0 cosd(Theta)];
+
+getCosAngle = @(Phi, Theta, vec1, vec2) ...
+ vec1*(matrixCouchRot_y(Theta)*matrixGantryRot_z(Phi)*vec2')/...
+ (sqrt(sum([vec1].^2))*sqrt(sum([(matrixCouchRot_y(Theta)*matrixGantryRot_z(Phi)*vec2')].^2)));
+
+e_x = [1 0 0];
+e_y = [0 1 0];
+e_z = [0 0 1];
+
+rotMatrix = [getCosAngle(Phi, Theta, e_x, e_x) getCosAngle(Phi, Theta,e_y , e_x) getCosAngle(Phi, Theta, e_z, e_x);...
+ getCosAngle(Phi, Theta, e_x, e_y) getCosAngle(Phi, Theta, e_y, e_y) getCosAngle(Phi, Theta, e_z, e_y); ...
+ getCosAngle(Phi, Theta, e_x, e_z) getCosAngle(Phi, Theta, e_y, e_z) getCosAngle(Phi, Theta, e_z, e_z)];
\ No newline at end of file
diff --git a/MCNP/matRad_calcNeutronDoseMCNP.m b/MCNP/matRad_calcNeutronDoseMCNP.m
new file mode 100644
index 000000000..dc1247acc
--- /dev/null
+++ b/MCNP/matRad_calcNeutronDoseMCNP.m
@@ -0,0 +1,297 @@
+function [dij,ct,stf,pln,cst] = matRad_calcNeutronDoseMCNP(ct,stf,pln,cst,calcDoseDirect)
+% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% matRad neutron dose calculation wrapper
+%
+% Neutron dose engine: Monte Carlo - MCNP6
+%
+% call
+% dij = matRad_calcNeutronDoseMCNP(ct,stf,pln,cst)
+%
+% input
+% ct: ct cube
+% stf: matRad steering information struct
+% pln: matRad plan meta information struct
+% cst: matRad cst struct
+% calcDoseDirect: use predefined MLC field shape for calculation
+%
+% output
+% dij: matRad dij struct
+%
+% References
+% [1] PELOWITZ, D. B., et al. MCNP6 User�s Manual. LACP-00634, May, 2013.
+%
+% Author: Lucas Sommer (Lucas.Sommer@tum.de), 10/2018
+%
+% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+%% Prelude
+matRad_cfg = MatRad_Config.instance();
+
+% initialize
+matRad_calcDoseInit;
+
+% Generate log-file
+pathLog = strcat(matRad_cfg.matRadRoot,filesep, 'submodules', filesep, 'MCdoseEngineMCNP', filesep, 'logFile');
+
+try diary(fullfile(pathLog, strcat(matRad_getTime4log, '_neutronDoseCalcuation')))
+catch
+ mkdir('logFile')
+ diary(fullfile(pathLog, strcat(matRad_getTime4log, '_neutronDoseCalcuation')))
+end
+
+% Default: dose influence matrix computation
+if ~exist('calcDoseDirect','var')
+ calcDoseDirect = false;
+ varHelper.calcDoseDirect = calcDoseDirect;
+elseif exist('calcDoseDirect','var')
+ if calcDoseDirect
+ varHelper.calcDoseDirect = calcDoseDirect;
+ stf(1).ray(1).energy = 'rssa';
+ end
+end
+
+
+% Check if MCNP6 is installed
+answer = questdlg('Is MCNP6 installed on your computer?', ...
+ 'MCNP6', ...
+ 'Yes', 'No', 'No');
+
+switch answer
+ case 'Yes'
+ disp('*****')
+ disp('Monte Carlo dose calculation enabled.')
+ disp('*****')
+ varHelper.runMCdoseCalc = 1;
+ case 'No'
+ disp('*****')
+ disp(['MCNP runfiles will be created but no dose caculation will be performed.', newline, '(dij=zeros(size(ct.cubeHU)))'])
+ disp('*****')
+ varHelper.runMCdoseCalc = 0;
+end
+clear answer
+
+% Load predefined conversion properties for tissue characterization
+% according to CT values - elemental composition will be assigned according
+% to these predefined tissue intervals later
+disp('*****')
+disp('Load pre-defined HU conversion properties and MCNP cross sections from conversionCT2tissue.mat.')
+disp('Note: Modification of conversionCT2tissue.mat using generateVar_conversionCT2tissue.m.')
+load('conversionCT2tissue.mat')
+disp('*****')
+
+%% Process CT data
+% Check ct for MCNP Simulation
+if ct.resolution.x ~= ct.resolution.y
+ error('x- and y-resolution have to be equal for the simulation.')
+end
+
+% Set HU outside body to air, i.e. neglect everything outside body for the
+% simulation
+% Note: body structure is the only normal tissue structure that
+% has to be contured
+
+pln.propMCNP.bodyStructureName = 'Body'; % Default name for body structure is 'Body'
+try
+ cstBodyIndex = matRad_findBodyStructureCST(cst, pln.propMCNP.bodyStructureName);
+catch
+ prompt = {'Please enter body structure name:'};
+ dlgtitle = 'Find Body Structure';
+ pln.propMCNP.bodyStructureName = inputdlg(prompt,dlgtitle);
+ cstBodyIndex = matRad_findBodyStructureCST(cst, pln.propMCNP.bodyStructureName);
+end
+
+% Process HU values
+disp('*****')
+disp(['Properties from (scaled) HU loaded are: Minimum value: ',num2str(min(ct.cubeHU{1}, [], 'all')), ' and '])
+disp(['Maximum value: ',num2str(max(ct.cubeHU{1}(cst{cstBodyIndex,4}{1}), [], 'all')), '.'])
+if ~isfield(ct, 'dicomInfo') || ~isfield(ct.dicomInfo, 'RescaleSlope') || ~isfield(ct.dicomInfo, 'RescaleIntercept')
+ matRad_cfg.dispWarning('No information on rescale slope and/or intercept provided in DICOM data. Calculation might crash...')
+else
+ disp(['Rescale slope from CT data is read to be: ',num2str(ct.dicomInfo.RescaleSlope), ' and rescale intercept is read to be ',num2str(ct.dicomInfo.RescaleIntercept),'.'])
+end
+
+disp('Please use question dialog to decide how to convert to scaled HU.')
+disp('*****')
+
+% Set values outside body to air
+try
+ cstTargetIndex = matRad_findTargetStructureCST(cst);
+catch
+ error('Target structure has to be set in matRad.')
+end
+
+maskNonBody = ones(ct.cubeDim);
+bodyIdx = [cst{sort([cstTargetIndex, cstBodyIndex]),4}];
+bodyIdx = unique(vertcat(bodyIdx{:}));
+
+maskNonBody(bodyIdx) = 0;
+ct.cube{1}(maskNonBody>0) = 0;
+ct.cubeHU{1}(maskNonBody>0) = -1000;
+
+
+% DICOM rescaling
+answer = questdlg('Would you like to use DICOM rescale slope and intercept? If not, an offset of 1000 will be added to the HU values to get re-scale HUs.', ...
+ 'Use DICOM Info', ...
+ 'Yes', 'No', 'No');
+
+switch answer
+ case 'Yes'
+ disp('*****')
+ disp('You decided to use the following parameters to re-scale (scaled) HU data given in ct.cubeHU to HU in ct.cube.')
+ disp(['Rescale HU: slope=', num2str(ct.dicomInfo.RescaleSlope), ' intercept=', num2str(ct.dicomInfo.RescaleIntercept)])
+ disp('*****')
+ ct.cubeHU{1} = ct.cubeHU{1}.*ct.dicomInfo.RescaleSlope - ct.dicomInfo.RescaleIntercept;
+ %ct.cubeHU{1}(setxor(1:prod(ct.cubeDim), cst{cstBodyIndex,4}{1})) = 0; % Set values outside body to air
+ %ct.cubeHU{1}(ct.cubeHU{1}(:)<0) = 0; % Clean up
+ case 'No'
+ disp('*****')
+ disp('You decided not to use DICOM rescale slope and intercept.')
+ disp('*****')
+ ct.cubeHU{1} = ct.cubeHU{1} + 1000;
+ %ct.cubeHU{1}(setxor(1:prod(ct.cubeDim), cst{cstBodyIndex,4}{1})) = 0; % Set values outside body to air
+ %ct.cubeHU{1}(ct.cubeHU{1}(:)<0) = 0; % Clean up
+end
+clear answer
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% Additional Information on Conversion %
+% Re-scale HU from intensity values given in DICOM by using 'rescale intercept' and 'rescale slope' %
+% Def. HU: HU = 1000*((mu - mu_water)/mu_water) -> HU_water = 0 %
+% Note: For our purpose, HU values should start at zero. %
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+% Infere tissue characteristics from HU
+disp('*****')
+disp(['Properties from rescaled HU are: Minimum value: ',num2str(min(ct.cubeHU{1}, [], 'all')), ' and '])
+disp(['Maximum value: ',num2str(max(ct.cubeHU{1}, [], 'all')), '.'])
+disp('*****')
+disp('Material types are assigned using the following HU intervals...')
+maxHUbin_nonEmpty = 1; % Find last non-empty entry
+while ~isempty(binIntervals(maxHUbin_nonEmpty+1).HUbin) && (maxHUbin_nonEmpty <= size(binIntervals,2))
+ maxHUbin_nonEmpty = maxHUbin_nonEmpty +1;
+end
+for i=1:maxHUbin_nonEmpty
+ disp([binIntervals(i).name, ': ', num2str(binIntervals(i).HUbin(1)), ' to ', num2str(binIntervals(i).HUbin(2))]);
+end
+disp('*****')
+
+[cst, ct.tissueBin] = matRad_segmentationCTscan(ct.cubeHU{1}, ct.resolution, binIntervals, cst, cstBodyIndex, cstTargetIndex);
+
+% Calculate density for CT voxels and resize afterwards -> caution: step-
+% wise definition of conversion causes a difference concerning the ordering
+% of the conversion and resize operation
+disp('*****')
+disp('Calculate density from CT data with density given in [g/cm^3]')
+disp('*****')
+ct.density{1} = hounsfield2density(ct.cubeHU{1})*1e-3; % rescale from kg/m^3 to g/cm^3
+ct.density{1}(ct.density{1}<=(hounsfield2density(segVar.upperLimitAir)*1e-3)) = segVar.densityAir;
+
+%% Rescale ct information to cm for MCNP runfile
+varHelper.rescaleFactor = 1e-1; % conversion from mm to cm
+ct.resolution.x_resized = ct.resolution.x*varHelper.rescaleFactor;
+ct.resolution.y_resized = ct.resolution.y*varHelper.rescaleFactor;
+ct.resolution.z_resized = ct.resolution.z*varHelper.rescaleFactor;
+
+
+%% Create MCNP runfile blocks A and B
+varHelper.simPropMCNP.loopCounter = false; % try to generate MCNP runfile with maximum 99999 elements for reasons of performance
+varHelper.simPropMCNP.MCNP_limitNumberOfElements = 99999-1; % minus one since we need one integer for the source surface
+
+[varHelper.simPropMCNP.control_makeTargetMCNP, varHelper.simPropMCNP.fileID_A, varHelper.simPropMCNP.fileID_B, varHelper.simPropMCNP.geometryOption] = ...
+ matRad_makeTargetMCNP(ct, varHelper.simPropMCNP);
+
+if ~varHelper.simPropMCNP.control_makeTargetMCNP
+ varHelper.simPropMCNP.MCNP_limitNumberOfElements = 99999999-1; % minus one since we need one integer for the source surface
+ varHelper.simPropMCNP.loopCounter = true;
+ [varHelper.simPropMCNP.control_makeTargetMCNP,~ ,~ ,~ ] = ...
+ matRad_makeTargetMCNP(ct, varHelper.simPropMCNP);
+end
+
+if ~varHelper.simPropMCNP.control_makeTargetMCNP
+ error('Number of defined elements for simulation is too high! MCNP6 only allows 99,999,999 cells and surfaces in total.')
+end
+
+%% Create MCNP runfile block C (source etc.)
+% Set default number of particles
+defNPS = 1e6;
+if isfield(pln, 'propMCNP') && isfield(pln.propMCNP, 'numberParticles')
+ varHelper.simPropMCNP.numberParticles = pln.propMCNP.numberParticles;
+else
+ varHelper.simPropMCNP.numberParticles = defNPS;
+ pln.propMCNP.numberParticles = defNPS;
+
+end
+
+% Get total number of bixels and write source card
+% Total number of bixel is counter for j in dij matrix
+
+% C.1 Source
+varHelper.totalNumberBixels = 0;
+for counterField =1:size(stf,2)
+ varHelper.simPropMCNP.counterField = counterField;
+ for counterRay=1:stf(counterField).numOfRays
+ varHelper.simPropMCNP.counterRay = counterRay;
+ % Calculate position of MLC field in LPS system
+ stf(counterField).ray(counterRay).rayPosMLC = stf(counterField).isoCenter + stf(counterField).ray(counterRay).rayPos + stf(counterField).sourcePoint;
+ varHelper.totalNumberBixels = varHelper.totalNumberBixels + 1;
+
+ % Generate source card for each bixel - see also description of
+ % matRad^_makeSourceMCNP(...)
+ [control_makeSourceMCNP, varHelper] = matRad_makeSourceMCNP(stf, pln, varHelper, counterField, counterRay);
+ end
+end
+
+varHelper.simPropMCNP.sourceBlockNames = strings(1,varHelper.totalNumberBixels);
+for cntList=1:varHelper.totalNumberBixels; varHelper.simPropMCNP.sourceBlockNames(cntList)=['blockC_source', int2str(cntList)]; end
+
+% Open file to write rest of block C
+% Source and the rest of block C input are seperated so the source
+% positioning can be done easily w/o wasting time on redundant writing of
+% the rest (like MODE and PHYS card) into a text file.
+
+pathRunfiles = strcat(matRad_cfg.matRadRoot,filesep, 'submodules', filesep, 'MCdoseEngineMCNP', filesep, 'runfiles_tmp', filesep);
+fileID_C_rest = fopen(strcat(pathRunfiles,'blockC_rest'), 'w');
+
+% C.2 Physics and problem termination
+fprintf(fileID_C_rest, 'C ***************************************************************\n');
+fprintf(fileID_C_rest, 'C C.2: Physics\n');
+fprintf(fileID_C_rest, 'C ***************************************************************\n');
+
+matRad_definePhysicsMCNP(fileID_C_rest, pln, binIntervals, varHelper.simPropMCNP); % Define PHYS-card
+
+% C.3 Materials
+fprintf(fileID_C_rest, 'C ***************************************************************\n');
+fprintf(fileID_C_rest, 'C C.3: Materials\n');
+fprintf(fileID_C_rest, 'C ***************************************************************\n');
+
+matIdentifierTxt = 'M%d $ %s \n';
+matCompositionTxt = ' %d%s %.9f \n';
+
+for counterMaterial = 1:size(binIntervals,2)
+ fprintf(fileID_C_rest, matIdentifierTxt, counterMaterial, binIntervals(counterMaterial).name);
+ fprintf(fileID_C_rest,' plib=14p\n');
+ fprintf(fileID_C_rest,' hlib=70h\n');
+ for counterComponent = 1:size(binIntervals(counterMaterial).ZAID,2)
+ fprintf(fileID_C_rest,matCompositionTxt, binIntervals(counterMaterial).ZAID(counterComponent), crossSectionsLibrary(binIntervals(counterMaterial).crossSection(counterComponent),:), binIntervals(counterMaterial).percentageMass(counterComponent));
+ end
+end
+clear counterMaterial; clear counterComponent;
+
+% C.4 Tally
+matRad_makeTallyMCNP(ct, pln, fileID_C_rest, binIntervals)
+
+fclose(fileID_C_rest);
+
+%% Concatenate all blocks to one runfile for each ray
+matRad_concatenateRunfiles(varHelper, pathRunfiles);
+
+%% Generate dij matrix
+switch varHelper.runMCdoseCalc
+ case 1
+ dij = matRad_bixelDoseCalculatorMCNP(pathRunfiles, dij, stf, ct, pln, cst, binIntervals);
+ case 0
+ dij=zeros(size(ct.cubeHU));
+end
+
+%% Switch off diary
+diary off
diff --git a/MCNP/matRad_concatenateRunfiles.m b/MCNP/matRad_concatenateRunfiles.m
new file mode 100644
index 000000000..1bdac2790
--- /dev/null
+++ b/MCNP/matRad_concatenateRunfiles.m
@@ -0,0 +1,48 @@
+function matRad_concatenateRunfiles(varHelper, pathRunfiles)
+% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% Function concatenates blocks for MCNP input to one runfile for each bixel
+% calles 'MCNPrunfile_bixelN' where N is the bixel number.
+%
+% call
+% matRad_concatenateRunfiles(varHelper, pathRunfiles)
+%
+% input
+% varHelper: Helping variable with varHelper.totalNumberBixels and
+% varHelper.simPropMCNP.sourceBlockNames
+% pathRunfiles: Path to previously generated MCNP runfiles
+%
+% output
+% none
+%
+% Author: Lucas Sommer (Lucas.Sommer@tum.de), 12/2018
+%
+% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+oldPath = pwd;
+cd(pathRunfiles)
+
+if ismac || isunix
+ for counterRunfile=1:varHelper.totalNumberBixels
+ dummy_name = convertStringsToChars(varHelper.simPropMCNP.sourceBlockNames(counterRunfile));
+ dummy_nameRunfile = ['MCNPrunfile_', num2str(counterRunfile),'bixel'];
+ dummy_nameRunfile = convertStringsToChars(dummy_nameRunfile);
+ system(['cat blockA.txt >> ', dummy_nameRunfile]);
+ system(['cat blockB.txt >> ', dummy_nameRunfile]);
+ system(['cat ', dummy_name,' >> ', dummy_nameRunfile]);
+ system(['cat blockC_rest >> ', dummy_nameRunfile]);
+ end
+elseif ispc
+ for counterRunfile=1:varHelper.totalNumberBixels
+ dummy_name = convertStringsToChars(varHelper.simPropMCNP.sourceBlockNames(counterRunfile));
+ dummy_nameRunfile = ['MCNPrunfile_', num2str(counterRunfile),'bixel'];
+ dummy_nameRunfile = convertStringsToChars(dummy_nameRunfile);
+ system(['type blockA.txt > ', dummy_nameRunfile]);
+ system(['type blockB.txt >> ', dummy_nameRunfile]);
+ system(['type ', dummy_name,' >> ', dummy_nameRunfile]);
+ system(['type blockC_rest >> ', dummy_nameRunfile]);
+ end
+else
+ disp('Platform not supported but you can concatenate the blocks to one runfile by hand.')
+end
+
+cd(oldPath);
\ No newline at end of file
diff --git a/MCNP/matRad_definePhysicsMCNP.m b/MCNP/matRad_definePhysicsMCNP.m
new file mode 100644
index 000000000..8bde9bc87
--- /dev/null
+++ b/MCNP/matRad_definePhysicsMCNP.m
@@ -0,0 +1,118 @@
+function matRad_definePhysicsMCNP(fileID_C_rest, this, binIntervals, simPropMCNP)
+% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% Define physics that is needed in MCNP simulation according to the used
+% tally and the radiation type.
+%
+% Neutron dose engine A: Monte Carlo - MCNP6
+%
+% call
+% matRad_definePhysicsMCNP(fileID_C_rest)
+%
+% input
+% fileID_C_rest: File ID used for block C
+%
+% output
+%
+% none
+%
+% References
+% [1] PELOWITZ, D. B., et al. MCNP6 User�s Manual. LACP-00634, May, 2013.
+%
+% Author: Lucas Sommer (Lucas.Sommer@tum.de), 12/2018
+%
+% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+% Set Mode and Phys cards for particle transport
+% Set up TMESH tally for total dose calculation
+ % if isfield(this.propOpt, 'bioOptimization')
+ % fprintf(fileID_C_rest, 'MODE N P E H D T S A #\n');
+ % fprintf(fileID_C_rest, 'PHYS:N 100 0 0 J J J 4 -1 1 J J 0 0\n');
+ % fprintf(fileID_C_rest, 'PHYS:P 100 0 0 1 0 J 0\n');
+ % fprintf(fileID_C_rest, 'PHYS:E 100 0 0 0 0 1 1 1 1 0 0 J J 0.917 0.001 0\n');
+ % fprintf(fileID_C_rest, 'PHYS:H 100 0 -1 J 0 J 1 3J 0 0 0 0.917 J 0 -1\n');
+ % fprintf(fileID_C_rest, 'PHYS:D 16J -1\n'); % change default settings s. th. delta-rays production is on
+ % fprintf(fileID_C_rest, 'PHYS:T 16J -1\n');
+ % fprintf(fileID_C_rest, 'PHYS:S 16J -1\n');
+ % fprintf(fileID_C_rest, 'PHYS:A 16J -1\n');
+ % fprintf(fileID_C_rest, 'PHYS:# 16J -1\n');
+ % fprintf(fileID_C_rest, 'CUT:N J 0.00000000001\n');
+ % fprintf(fileID_C_rest, 'CUT:P J 0.003\n');
+ % fprintf(fileID_C_rest, 'CUT:E J 0.00001\n');
+ % fprintf(fileID_C_rest, 'CUT:H J 0.0009\n');
+ % fprintf(fileID_C_rest, 'CUT:D J 0.0009\n');
+ % fprintf(fileID_C_rest, 'CUT:T J 0.0009\n');
+ % fprintf(fileID_C_rest, 'CUT:S J 0.0009\n');
+ % fprintf(fileID_C_rest, 'CUT:A J 0.0009\n');
+ % fprintf(fileID_C_rest, 'CUT:# J 0.0009\n');
+ % else
+ fprintf(fileID_C_rest, 'MODE N P E H D T S A #\n');
+ fprintf(fileID_C_rest, 'PHYS:N 100 0 0 J J J 4 -1 1 J J 0 0\n');
+ fprintf(fileID_C_rest, 'PHYS:P 100 0 0 1 0 J 0\n');
+ fprintf(fileID_C_rest, 'PHYS:E 100 0 0 0 0 1 1 1 1 0 0 J J 0.917 0.001 0\n');
+ fprintf(fileID_C_rest, 'PHYS:H 100 0 -1 J 0 J 1 3J 0 0 0 0.917 J 0 -1\n');
+ fprintf(fileID_C_rest, 'PHYS:D 16J -1\n'); % change default settings s. th. delta-rays production is on
+ fprintf(fileID_C_rest, 'PHYS:T 16J -1\n');
+ fprintf(fileID_C_rest, 'PHYS:S 16J -1\n');
+ fprintf(fileID_C_rest, 'PHYS:A 16J -1\n');
+ fprintf(fileID_C_rest, 'PHYS:# 16J -1\n');
+ fprintf(fileID_C_rest, 'CUT:N J 0.00000000001\n');
+ fprintf(fileID_C_rest, 'CUT:P J 0.003\n');
+ fprintf(fileID_C_rest, 'CUT:E J 0.05\n');
+ fprintf(fileID_C_rest, 'CUT:H J 1\n');
+ fprintf(fileID_C_rest, 'CUT:D J 1\n');
+ fprintf(fileID_C_rest, 'CUT:T J 1\n');
+ fprintf(fileID_C_rest, 'CUT:S J 1\n');
+ fprintf(fileID_C_rest, 'CUT:A J 1\n');
+ fprintf(fileID_C_rest, 'CUT:# J 1\n');
+% case 'KERMA_F4'
+% switch pln.radiationMode
+% case 'neutrons'
+% fprintf(fileID_C_rest, 'MODE N\n');
+% fprintf(fileID_C_rest, 'PHYS:N 100 0 0 J J J 0 -1 0 J J 1 0\n');
+% fprintf(fileID_C_rest, 'CUT:N J 0.000000015\n');
+% case 'photons'
+% fprintf(fileID_C_rest, 'MODE P\n');
+% fprintf(fileID_C_rest, 'PHYS:P 100 0 0 0 0 J 0\n');
+% fprintf(fileID_C_rest, 'CUT:P J 0.005\n');
+% case'neutrons_PLUS_photons'
+% fprintf(fileID_C_rest, 'MODE N P\n');
+% fprintf(fileID_C_rest, 'PHYS:N 100 0 0 J J J 0 -1 1 J J 0 0\n');
+% fprintf(fileID_C_rest, 'PHYS:P 100 0 0 0 0 J 0\n');
+% fprintf(fileID_C_rest, 'CUT:N J 0.000000015\n');
+% fprintf(fileID_C_rest, 'CUT:P J 0.005\n');
+% end
+% end
+
+% Set random number generator properties
+fprintf(fileID_C_rest, 'RAND GEN=2 SEED=43 STRIDE=10000000001\n'); % Gen 2: period= 9.2e18
+ % Seed makes sense
+ % Stride: Number of random numbers between source particles
+switch simPropMCNP.geometryOption
+ case 'Lattice'
+ % Define temperature to be at body temperature
+ fprintf(fileID_C_rest, 'TMP 2.53e-08\n'); % air voxels are set to room temp
+ for iCellTemp=2:size(binIntervals,2)
+ fprintf(fileID_C_rest, ' 0.0000000266911575\n'); % tissue voxels are set to body temp = 309.75 K in MeV
+ end
+ for iCellImportance=size(binIntervals,2):size(binIntervals,2)+2
+ fprintf(fileID_C_rest, ' 2.53e-08\n'); % set temperature for helper cells
+ end
+ fprintf(fileID_C_rest, ' 2.53e-08\n'); % set temperature for cell outside sim volume
+
+
+ % Define importance for each assigned material individually
+ fprintf(fileID_C_rest, 'IMP:N,P,E,H,D,T,S,A,# \n'); % same importance for all particles
+ for iCellImportance=1:size(binIntervals,2)
+ fprintf(fileID_C_rest, [' ',num2str(binIntervals(iCellImportance).importance), '\n']); % set importance for all particle for each material type individually
+ end
+ for iCellImportance=size(binIntervals,2):size(binIntervals,2)+2
+ fprintf(fileID_C_rest, [' ','1', '\n']); % set importance in helper cells to 1
+ end
+ fprintf(fileID_C_rest, [' ','0', '\n']); % set importance to zero outside sim volume
+
+
+ otherwise
+ error('Geometry option not supported.')
+end
+
+fprintf(fileID_C_rest, ['NPS' ' ' num2str(this.config.Num_Primaries) '\n']);
\ No newline at end of file
diff --git a/MCNP/matRad_evaluateMeshTallyMCNP.m b/MCNP/matRad_evaluateMeshTallyMCNP.m
new file mode 100644
index 000000000..6afa8afaa
--- /dev/null
+++ b/MCNP/matRad_evaluateMeshTallyMCNP.m
@@ -0,0 +1,195 @@
+function doseMatrix = matRad_evaluateMeshTallyMCNP(fileName, pln, ct)
+% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% Evaluate files containing tally results of MCNP calculation.
+%
+% call
+% doseMatrix = matRad_evaluateMeshTallyMCNP(fileName, tallyType, ctData)
+%
+% input
+% fileName: file name of the text file to evaluate
+% pln.propMCNP.tallySpecifier: type of tally used for simulation
+% possible input: 'KERMA_F4' or
+% 'TotalDose_TMESH'
+% ctData: 3D volume from ct data containing tissue
+% characteristics for every voxel
+%
+%
+% output
+% doseMatrix: 3D matrix containing result of MCNP calculation
+% .neutronDose: KERMA from neutron interaction
+% (F4 tally)
+% .photonDose: KERMA from photon interaction
+% (F4 tally)
+% .dose: dose as total depositied energy in material
+% (TMESH tally)
+%
+% Author: Lucas Sommer (Lucas.Sommer@tum.de), 10/2018
+%
+% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% TMESH Tally for Total Dose
+% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% TMESH tally detects all energy deposited in the medium by taking account
+% also of secondary particles (if not switched off on mode card).
+%% Read MCNP result for TMESH type 3 tally
+% fid_read = fopen(fileName, 'r');
+% dummyLine = 'dummyLine'; % Use a dummy line to find data values
+% while ~strcmp(dummyLine, 'vals'), dummyLine = fgetl(fid_read); end % Set location in mctal file to position where values start
+
+% resultMCNP_dummy = zeros(prod(ct.cubeDim)*2,1)';
+% resultMCNP_dummy = fscanf(fid_read, '%f', [1 inf]); % Values are given with relative errors
+%
+% resultMCNP(:,1) = resultMCNP_dummy(1:2:end);
+% resultMCNP(:,2) = resultMCNP_dummy(2:2:end);
+
+resultMCNP = matRad_readDataFromText_TMESHvBioOpti(fileName, 'TMESH3', 2);
+resultMCNP = resultMCNP';
+doseMatrix.physicalDose = zeros(ct.cubeDim(2), ct.cubeDim(1), ct.cubeDim(3)); % Total dose
+doseMatrix.physicalDose(1:end) = resultMCNP(:,1);
+
+
+doseMatrix.physicalDose_relError = zeros(ct.cubeDim(2), ct.cubeDim(1), ct.cubeDim(3)); % Relative error of total dose
+doseMatrix.physicalDose_relError(1:end) = resultMCNP(:,2);
+
+clear resultMCNP
+% fclose(fid_read);
+
+doseMatrix.physicalDose = permute(doseMatrix.physicalDose, [2,1,3]); % Permute matrix to match matRad coordinate system
+for cellCounter = 1:size(ct.tissueBin,2)
+ if cellCounter == 1
+ doseMatrix.physicalDose(ct.tissueBin(cellCounter).linIndVol) = 0; % Dose deposition in air is neglected
+ else
+ doseMatrix.physicalDose(ct.tissueBin(cellCounter).linIndVol) = ...
+ doseMatrix.physicalDose(ct.tissueBin(cellCounter).linIndVol)./mean(ct.density{1,1}(ct.tissueBin(cellCounter).linIndVol)); % MCNP output is in MeV/cm^3/source particle & ct.density is given in g/cm^3
+ end
+ mean(ct.density{1,1}(ct.tissueBin(cellCounter).linIndVol))
+end
+doseMatrix.physicalDose = doseMatrix.physicalDose*1.602177e-19*1e6*1e3; % Convert MeV/g to J/kg, output is now in Gy/source particle
+
+doseMatrix.physicalDose_relError = permute(doseMatrix.physicalDose_relError, [2,1,3]);
+
+% Bad TMESH tally statistics can lead to negative results
+if sum(doseMatrix.physicalDose<0, 'all')
+ warning('*********************')
+ warning('Negative TMESH tally results detected. This is a hint for bad statistics!')
+ warning(['Minimum value: ', num2str(min(doseMatrix.physicalDose, [], 'all')), ' Gy and maximum value: ', num2str(max(doseMatrix.physicalDose, [], 'all')), ' Gy.'])
+ warning('*********************')
+
+ doseMatrix.physicalDose(doseMatrix.physicalDose<0) = 0;
+ doseMatrix.physicalDose_relError(doseMatrix.physicalDose<0) = 0;
+end
+%% Read RBE weighted dose
+if isfield(pln.propOpt,'bioOptimization')
+ if strcmp(pln.propOpt.bioOptimization,'RBExSecPartDose_MCDS_RMFmodel')
+ % Read data
+ tallyData = matRad_readDataFromText_TMESHvBioOpti(fileName, 'F6heating4RBEcalc', 2);
+
+ % Read proton data
+ % [doseMatrix.physicalDose_proton, doseMatrix.physicalDose_proton_relError] = convertDose4RBECalculation(ct, tallyData.tally1016);
+ % [doseMatrix.RBExDose_proton_aero, doseMatrix.RBExDose_proton_aero_relError] = convertDose4RBECalculation(ct, tallyData.tally1026);
+ % [doseMatrix.intraTrackTerm_aero_proton, doseMatrix.intraTrackTerm_proton_aero_relError] = convertDose4RBECalculation(ct, tallyData.tally1036);
+ % [doseMatrix.RBExDose_proton_anox, doseMatrix.RBExDose_proton_anox_relError] = convertDose4RBECalculation(ct, tallyData.tally1046);
+ % [doseMatrix.intraTrackTerm_anox_proton, doseMatrix.intraTrackTerm_proton_anox_relError] = convertDose4RBECalculation(ct, tallyData.tally1056);
+
+ % Read deuteron data
+ % [doseMatrix.physicalDose_deuteron, doseMatrix.physicalDose_deuteron_relError] = convertDose4RBECalculation(ct, tallyData.tally2016);
+ % [doseMatrix.RBExDose_deuteron_aero, doseMatrix.RBExDose_deuteron_aero_relError] = convertDose4RBECalculation(ct, tallyData.tally2026);
+ % [doseMatrix.intraTrackTerm_aero_deuteron, doseMatrix.intraTrackTerm_deuteron_aero_relError] = convertDose4RBECalculation(ct, tallyData.tally2036);
+ % [doseMatrix.RBExDose_deuteron_anox, doseMatrix.RBExDose_deuteron_anox_relError] = convertDose4RBECalculation(ct, tallyData.tally2046);
+ % [doseMatrix.intraTrackTerm_anox_deuteron, doseMatrix.intraTrackTerm_deuteron_anox_relError] = convertDose4RBECalculation(ct, tallyData.tally2056);
+
+ % Read triton data
+ % [doseMatrix.physicalDose_triton, doseMatrix.physicalDose_triton_relError] = convertDose4RBECalculation(ct, tallyData.tally3016);
+ % [doseMatrix.RBExDose_triton_aero, doseMatrix.RBExDose_triton_aero_relError] = convertDose4RBECalculation(ct, tallyData.tally3026);
+ % [doseMatrix.intraTrackTerm_aero_triton, doseMatrix.intraTrackTerm_triton_aero_relError] = convertDose4RBECalculation(ct, tallyData.tally3036);
+ % [doseMatrix.RBExDose_triton_anox, doseMatrix.RBExDose_triton_anox_relError] = convertDose4RBECalculation(ct, tallyData.tally3046);
+ % [doseMatrix.intraTrackTerm_anox_triton, doseMatrix.intraTrackTerm_triton_anox_relError] = convertDose4RBECalculation(ct, tallyData.tally3056);
+
+ % Read He3 data
+ % [doseMatrix.physicalDose_he3, doseMatrix.physicalDose_he3_relError] = convertDose4RBECalculation(ct, tallyData.tally4016);
+ % [doseMatrix.RBExDose_he3_aero, doseMatrix.RBExDose_he3_aero_relError] = convertDose4RBECalculation(ct, tallyData.tally4026);
+ % [doseMatrix.intraTrackTerm_aero_he3, doseMatrix.intraTrackTerm_he3_aero_relError] = convertDose4RBECalculation(ct, tallyData.tally4036);
+ % [doseMatrix.RBExDose_he3_anox, doseMatrix.RBExDose_he3_anox_relError] = convertDose4RBECalculation(ct, tallyData.tally4046);
+ % [doseMatrix.intraTrackTerm_anox_he3, doseMatrix.intraTrackTerm_he3_anox_relError] = convertDose4RBECalculation(ct, tallyData.tally4056);
+
+ % Read alpha data
+ % [doseMatrix.physicalDose_alpha, doseMatrix.physicalDose_alpha_relError] = convertDose4RBECalculation(ct, tallyData.tally5016);
+ % [doseMatrix.RBExDose_alpha_aero, doseMatrix.RBExDose_alpha_aero_relError] = convertDose4RBECalculation(ct, tallyData.tally5026);
+ % [doseMatrix.intraTrackTerm_aero_alpha, doseMatrix.intraTrackTerm_alpha_aero_relError] = convertDose4RBECalculation(ct, tallyData.tally5036);
+ % [doseMatrix.RBExDose_alpha_anox, doseMatrix.RBExDose_alpha_anox_relError] = convertDose4RBECalculation(ct, tallyData.tally5046);
+ % [doseMatrix.intraTrackTerm_anox_alpha, doseMatrix.intraTrackTerm_alpha_anox_relError] = convertDose4RBECalculation(ct, tallyData.tally5056);
+
+ % Read electron data
+ % [doseMatrix.physicalDose_electron, doseMatrix.physicalDose_electron_relError] = convertDose4RBECalculation(ct, tallyData.tally6016);
+ % [doseMatrix.RBExDose_electron_aero, doseMatrix.RBExDose_electron_aero_relError] = convertDose4RBECalculation(ct, tallyData.tally6026);
+ % [doseMatrix.intraTrackTerm_aero_electron, doseMatrix.intraTrackTerm_electron_aero_relError] = convertDose4RBECalculation(ct, tallyData.tally6036);
+ % [doseMatrix.RBExDose_electron_anox, doseMatrix.RBExDose_electron_anox_relError] = convertDose4RBECalculation(ct, tallyData.tally6046);
+ % [doseMatrix.intraTrackTerm_anox_electron, doseMatrix.intraTrackTerm_electron_anox_relError] = convertDose4RBECalculation(ct, tallyData.tally6056);
+
+ % Read lithium data
+ % [doseMatrix.physicalDose_lithium, doseMatrix.physicalDose_lithium_relError] = convertDose4RBECalculation(ct, tallyData.tally7016(:,1:size(tallyData.tally7016,2)/2));
+ % [doseMatrix.RBExDose_lithium_aero, doseMatrix.RBExDose_lithium_aero_relError] = convertDose4RBECalculation(ct, tallyData.tally7026(:,1:size(tallyData.tally7026,2)/2));
+ % [doseMatrix.intraTrackTerm_aero_lithium, doseMatrix.intraTrackTerm_lithium_aero_relError] = convertDose4RBECalculation(ct, tallyData.tally7036(:,1:size(tallyData.tally7036,2)/2));
+ % [doseMatrix.RBExDose_lithium_anox, doseMatrix.RBExDose_lithium_anox_relError] = convertDose4RBECalculation(ct, tallyData.tally7046(:,1:size(tallyData.tally7046,2)/2));
+ % [doseMatrix.intraTrackTerm_anox_lithium, doseMatrix.intraTrackTerm_lithium_anox_relError] = convertDose4RBECalculation(ct, tallyData.tally7056(:,1:size(tallyData.tally7056,2)/2));
+
+ % Read heavy ion data
+ % [doseMatrix.physicalDose_heavyIon, doseMatrix.physicalDose_heavyIon_relError] = convertDose4RBECalculation(ct, tallyData.tally8016);
+ % [doseMatrix.intraTrackTerm_aero_heavyIon, doseMatrix.intraTrackTerm_heavyIon_aero_relError] = convertDose4RBECalculation(ct, tallyData.tally8036);
+ % [doseMatrix.intraTrackTerm_anox_heavyIon, doseMatrix.intraTrackTerm_heavyIon_anox_relError] = convertDose4RBECalculation(ct, tallyData.tally8056);
+
+
+ % Read neutron heating data
+ % [doseMatrix.physicalDose_neutronHeating, doseMatrix.physicalDose_neutronHeating_relError] = convertDose4RBECalculation(ct, tallyData.tally9016);
+
+ % Read photon heating data
+ % [doseMatrix.physicalDose_photonHeating, doseMatrix.physicalDose_photonHeating_relError] = convertDose4RBECalculation(ct, tallyData.tally1116);
+ end
+end
+%% Function Definition: matRad_cart2linIndex gives back linear indices of tally cells/voxels
+ function linearIndex_Tally = matRad_cart2linIndex(resultMCNP,ct)
+
+ grid_matInd = zeros(prod(ct.cubeDim),3);
+
+ % MATLAB matrix indexing has to be considered: x-coordinate = column index
+ grid_matInd(:,1) = round((resultMCNP(:,2)+(ct.resolution.y/2))/ct.resolution.y); % row
+ grid_matInd(:,2) = round((resultMCNP(:,1)+(ct.resolution.x/2))/ct.resolution.x); % column
+ grid_matInd(:,3) = round((resultMCNP(:,3)+(ct.resolution.z/2))/ct.resolution.z);
+
+ % Calculate linear indices
+ linearIndex_Tally = sub2ind(ct.cubeDim, grid_matInd(:,1), grid_matInd(:,2), grid_matInd(:,3));
+ end
+
+%% Function definition to read physical and RBE weighted dose for secondary particles
+ function [physicalDose, physicalDose_relError] = convertDose4RBECalculation(ct, resultData)
+ resultData = resultData';
+
+ physicalDose = zeros(ct.cubeDim(2), ct.cubeDim(1), ct.cubeDim(3)); % Total dose
+ physicalDose(1:end) = resultData(:,1);
+
+
+ physicalDose_relError = zeros(ct.cubeDim(2), ct.cubeDim(1), ct.cubeDim(3)); % Relative error of total dose
+ physicalDose_relError(1:end) = resultData(:,2);
+
+ physicalDose = permute(physicalDose, [2,1,3]); % Permute matrix to match matRad coordinate system
+
+ % Conversion of tally data [MeV/g] where cell mass was set to 1g to Gy/source particle
+ dummyVoxelVolume = ct.resolution.x*ct.resolution.y*ct.resolution.z*1e-3; % voxel volume in ccm
+
+ for cellCounter_subFunc = 1:size(ct.tissueBin,2)
+ if cellCounter_subFunc == 1 || cellCounter_subFunc == 2
+ physicalDose(ct.tissueBin(cellCounter_subFunc).linIndVol) = 0; % Dose deposition in air is neglected
+ else
+ physicalDose(ct.tissueBin(cellCounter_subFunc).linIndVol) = ...
+ physicalDose(ct.tissueBin(cellCounter_subFunc).linIndVol)./(mean(ct.density{1,1}(ct.tissueBin(cellCounter_subFunc).linIndVol))*dummyVoxelVolume); % MCNP output is in MeV/cm^3/source particle & ct.density is given in g/cm^3
+ end
+ mean(ct.density{1,1}(ct.tissueBin(cellCounter_subFunc).linIndVol));
+ end
+
+ physicalDose = physicalDose*1.602177e-19*1e6*1e3; % Convert MeV/g to J/kg, output is now in Gy/source particle
+
+ physicalDose_relError = permute(physicalDose_relError, [2,1,3]);
+ end
+end
\ No newline at end of file
diff --git a/MCNP/matRad_evaluateTallyMCNP.m b/MCNP/matRad_evaluateTallyMCNP.m
new file mode 100644
index 000000000..55d069750
--- /dev/null
+++ b/MCNP/matRad_evaluateTallyMCNP.m
@@ -0,0 +1,120 @@
+function dij = matRad_evaluateTallyMCNP(dij, cst, ct)
+%% Read output from MCNP calculation and generate dij matix
+%% Preparation and get list of mctal data
+matRad_cfg = MatRad_Config.instance();
+cd(strcat(matRad_cfg.matRadRoot, filesep, 'MCNP', filesep, 'runfiles_tmp'));
+tallyDataList = dir('MCNPrunfile_*bixelm');
+% Re-organize list
+dummyList = struct;
+lengthList = dij.totalNumOfRays;
+for listCounter = 1:lengthList
+ i=1; while i<= lengthList && ~strcmp(tallyDataList(i).name, strcat('MCNPrunfile_', int2str(listCounter),'bixelm')); i=i+1; end
+ dummyList(listCounter).name = tallyDataList(i).name;
+ dummyList(listCounter).folder = tallyDataList(i).folder;
+ dummyList(listCounter).date = tallyDataList(i).date;
+ dummyList(listCounter).bytes = tallyDataList(i).bytes;
+ dummyList(listCounter).isdir = tallyDataList(i).isdir;
+ dummyList(listCounter).datenum = tallyDataList(i).datenum;
+end
+
+%% Resize cst (and forget about it)
+cst = matRad_resizeCstToGrid(cst,ct.resolution.y:ct.resolution.y:ct.cubeDim(1)*ct.resolution.y,...
+ ct.resolution.x:ct.resolution.x:ct.cubeDim(2)*ct.resolution.x,...
+ ct.resolution.z:ct.resolution.z:ct.cubeDim(3)*ct.resolution.z,...
+ dij.doseGrid.resolution.y:dij.doseGrid.resolution.y:dij.doseGrid.dimensions(1)*dij.doseGrid.resolution.y,...
+ dij.doseGrid.resolution.x:dij.doseGrid.resolution.x:dij.doseGrid.dimensions(2)*dij.doseGrid.resolution.x,...
+ dij.doseGrid.resolution.z:dij.doseGrid.resolution.z:dij.doseGrid.dimensions(3)*dij.doseGrid.resolution.z);
+
+%% Allocate dij dose matrix
+dij.physicalDose{1} = spalloc(prod(dij.doseGrid.dimensions),dij.totalNumOfBixels,1);
+for counterBixel=1:dij.totalNumOfBixels
+ dij.doseMatrixBixel(counterBixel).physicalDose_relError{1} = spalloc(prod(dij.doseGrid.dimensions),1,1);
+end
+
+%% Read TMESH results
+counterDijColumns = 0; % counter to go through the columns of dij
+
+for counterBeam = 1:dij.numOfBeams
+ for counterBixel = 1:dij.numOfRaysPerBeam(counterBeam)
+ counterDijColumns = counterDijColumns+1;
+
+ dij.bixelNum(counterDijColumns) = counterBixel;
+ dij.rayNum(counterDijColumns) = counterBixel;
+ dij.beamNum(counterDijColumns) = counterBeam;
+
+ % Evaluate mesh tally and store neutron and photon dose
+ matRad_cfg.dispInfo('*****\n')
+ matRad_cfg.dispInfo('Evaluate Tally Data.\n')
+ matRad_cfg.dispInfo('*****\n')
+ tic;
+
+ % Read TMESH results
+ resultMCNP = matRad_readDataFromText_TMESHvBioOpti(dummyList(counterDijColumns).name, 'TMESH3', 2);
+ resultMCNP = resultMCNP';
+ doseMatrixBixel.physicalDose = zeros(dij.doseGrid.dimensions(2), dij.doseGrid.dimensions(1), dij.doseGrid.dimensions(3)); % Total dose
+ doseMatrixBixel.physicalDose(1:end) = resultMCNP(:,1);
+
+
+ doseMatrixBixel.physicalDose_relError = zeros(dij.doseGrid.dimensions(2), dij.doseGrid.dimensions(1), dij.doseGrid.dimensions(3)); % Relative error of total dose
+ doseMatrixBixel.physicalDose_relError(1:end) = resultMCNP(:,2);
+
+ clear resultMCNP
+
+ doseMatrixBixel.physicalDose = permute(doseMatrixBixel.physicalDose, [2,1,3]); % Permute matrix to match matRad coordinate system
+ for cellCounter = 1:size(ct.doseGridCT.tissueBin,2)
+ if cellCounter == 1
+ doseMatrixBixel.physicalDose(ct.doseGridCT.tissueBin(cellCounter).linIndVol) = 0; % Dose deposition in air is neglected
+ else
+ doseMatrixBixel.physicalDose(ct.doseGridCT.tissueBin(cellCounter).linIndVol) = ...
+ doseMatrixBixel.physicalDose(ct.doseGridCT.tissueBin(cellCounter).linIndVol)./mean(ct.doseGridCT.density{1,1}(ct.doseGridCT.tissueBin(cellCounter).linIndVol)); % MCNP output is in MeV/cm^3/source particle & ct.doseGridCT.density is given in g/cm^3
+ end
+ % mean(ct.doseGridCT.density{1,1}(ct.doseGridCT.tissueBin(cellCounter).linIndVol))
+ end
+ doseMatrixBixel.physicalDose = doseMatrixBixel.physicalDose*1.602177e-19*1e6*1e3; % Convert MeV/g to J/kg, output is now in Gy/source particle
+ doseMatrixBixel.physicalDose = doseMatrixBixel.physicalDose./max(doseMatrixBixel.physicalDose, [], 'all');
+
+ doseMatrixBixel.physicalDose_relError = permute(doseMatrixBixel.physicalDose_relError, [2,1,3]);
+
+ % Bad TMESH tally statistics can lead to negative results
+ if sum(doseMatrixBixel.physicalDose<0, 'all')
+ matRad_cfg.dispWarning('*********************\n')
+ matRad_cfg.dispWarning('Negative TMESH tally results detected. This is a hint for bad statistics!')
+ matRad_cfg.dispWarning('Negative results set to zero.')
+ matRad_cfg.dispWarning(['Minimum value: ', num2str(min(doseMatrixBixel.physicalDose, [], 'all')), ' Gy and maximum value: ', num2str(max(doseMatrixBixel.physicalDose, [], 'all')), ' Gy.'])
+ matRad_cfg.dispWarning('*********************')
+
+ doseMatrixBixel.physicalDose(doseMatrixBixel.physicalDose<0) = 0;
+ doseMatrixBixel.physicalDose_relError(doseMatrixBixel.physicalDose<0) = 0;
+ end
+
+ matRad_cfg.dispInfo(['Reading out tally data took: ', num2str(toc), ' seconds.\n'])
+ matRad_cfg.dispInfo('*****\n')
+
+ dij.doseMatrixBixel(counterDijColumns).physicalDose_relError{1} = ...
+ sparse(find(doseMatrixBixel.physicalDose_relError),1,doseMatrixBixel.physicalDose_relError(doseMatrixBixel.physicalDose_relError~=0),dij.doseGrid.numOfVoxels,1);
+
+ % Store total dose from TMESH tally
+ dij.physicalDose{1}(:,counterDijColumns) = ...
+ sparse(find(doseMatrixBixel.physicalDose), 1, doseMatrixBixel.physicalDose(doseMatrixBixel.physicalDose~=0), dij.doseGrid.numOfVoxels,1);
+
+ % Save relative error for each radiotherapy structure and bixel
+ for counterRTStruct=1:size(cst,1)
+ dij.relError_radioTherpyStruct(counterRTStruct,counterDijColumns).name = cst{counterRTStruct,2};
+ dij.relError_radioTherpyStruct(counterRTStruct,counterDijColumns).bixelNumber = counterDijColumns;
+ dij.relError_radioTherpyStruct(counterRTStruct,counterDijColumns).meanError = mean(doseMatrixBixel.physicalDose_relError(cst{counterRTStruct,4}{1,1}));
+ dij.relError_radioTherpyStruct(counterRTStruct,counterDijColumns).maxError = max(doseMatrixBixel.physicalDose_relError(cst{counterRTStruct,4}{1,1}));
+ dij.relError_radioTherpyStruct(counterRTStruct,counterDijColumns).medianError = median(doseMatrixBixel.physicalDose_relError(cst{counterRTStruct,4}{1,1}));
+ end
+
+ %% Calculate RMF parameters
+ % if isfield(pln.propOpt,'bioOptimization')
+ % if strcmp(pln.propOpt.bioOptimization,'RBExSecPartDose_MCDS_RMFmodel')
+ % [dij, cst] = matRad_getRMFmodelParameters4neutrons(dij, counterDijColumns, doseMatrixBixel, pln, ct, cst);
+ % else
+ % % error('Biological optimization mode unknown for neutrons.')
+ % end
+ % end
+
+
+ end
+end
\ No newline at end of file
diff --git a/MCNP/matRad_findBodyStructureCST.m b/MCNP/matRad_findBodyStructureCST.m
new file mode 100644
index 000000000..b04892ed9
--- /dev/null
+++ b/MCNP/matRad_findBodyStructureCST.m
@@ -0,0 +1,28 @@
+function cstBodyIndex = matRad_findBodyStructureCST(cst, bodyStructureName)
+% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% MATLAB function to find the index of the radiotherapy structure body.
+%
+% Note: Body structure is the only structure that has to be contoured.
+%
+% call
+% cstBodyIndex = matRad_findBodyStructureCST(cst)
+%
+% input
+% cst
+% bodyStructureName
+%
+% output:
+% cstBodyIndex
+%
+% Author: Lucas Sommer (Lucas.Sommer@tum.de), 05/2019
+%
+% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+cstBodyIndex = 1;
+
+while ~strcmpi(cst{cstBodyIndex,2}, bodyStructureName)
+ cstBodyIndex = cstBodyIndex +1;
+ if cstBodyIndex > size(cst,1)
+ error('No body structure contoured or structure not found! Note: Body structure has to be named BODY (case insensitive).')
+ end
+end
\ No newline at end of file
diff --git a/MCNP/matRad_findTargetStructureCST.m b/MCNP/matRad_findTargetStructureCST.m
new file mode 100644
index 000000000..39eda8cf5
--- /dev/null
+++ b/MCNP/matRad_findTargetStructureCST.m
@@ -0,0 +1,29 @@
+function cstTargetIndex = matRad_findTargetStructureCST(cst)
+% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% MATLAB function to find the index of the radiotherapy target structure.
+%
+%
+% call
+% cstTargetIndex = matRad_findTargetStructureCST(cst)
+%
+% input
+% cst
+%
+% output:
+% cstTargetIndex as array
+%
+% Author: Lucas Sommer (Lucas.Sommer@tum.de), 01/2024
+%
+% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+cstTargetIndex = [];
+
+for counter =1:size(cst,1)
+ if strcmp(cst{counter,3}, 'TARGET')
+ cstTargetIndex = [cstTargetIndex, counter];
+ end
+end
+
+if isempty(cstTargetIndex)
+ error('No target structure contoured or structure not found! Note: Target structure has to be set in matRad.')
+end
\ No newline at end of file
diff --git a/MCNP/matRad_genVarCT2tissueConversion.m b/MCNP/matRad_genVarCT2tissueConversion.m
new file mode 100644
index 000000000..43fdf97e8
--- /dev/null
+++ b/MCNP/matRad_genVarCT2tissueConversion.m
@@ -0,0 +1,273 @@
+% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% Decription: Generate variable 'conversionCT2tissue.mat' where HU
+% intervals for tissue identification are defined
+%
+% References:
+% [1] Schneider et al. Correlation between CT numbers and
+% tissue parameters needed for Monte Carlo simulations of clinical
+% dose distribution, Phys. Med. Biol. 45 (2000)
+% [2] Schneider et al. The calibration of CT HU for RT treatment
+% planning, Phys. Med. Bio. 41 (1996)
+% [3] ICRU 46
+% [4] MCNP6 Manual Part 3 Appendix G
+% [5] DeMarco et al. A CTbased Monte Carlo simulation tool for dosimetry
+% planning and analysis. Medical physics 25.1 (1998)
+%
+% Author: Lucas Sommer (Lucas.Sommer@tum.de), 10/2018
+%
+% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+clear; clc; close all;
+
+
+binIntervals(1).name = 'air';
+binIntervals(2).name = 'lung';
+binIntervals(3).name = 'softTissue';
+binIntervals(4).name = 'bone';
+binIntervals(5).name = 'skin';
+binIntervals(6).name = 'ptv_bnct';
+
+% Define parameter for segementation
+segVar.upperLimitAir = 50; % upper limit for scaled HU below which all material is assigned to air, chosen according to Schneider et al. (2000)
+segVar.densityAir = 1.205e-3; % density air in g/cm^3 from NIST database
+
+binIntervals(1).HUbin = [0 segVar.upperLimitAir];
+binIntervals(2).HUbin = [segVar.upperLimitAir 830]; % lung tissue has HU_lung = 259 -> see paper Schneider et al. (1996)
+binIntervals(3).HUbin = [830 1280]; % all limits according to Schneider et al. 1996/2000 except upper limit soft tissue according to DeMarco et al. 1998
+binIntervals(4).HUbin = [1280 5000];
+binIntervals(5).HUbin = [];
+binIntervals(6).HUbin = [];
+
+binIntervals(1).importance = 1; % importance for particles: 'MODE N P E H D T S A #' is automatically adjusted for KERMA calculations
+binIntervals(2).importance = 5;
+binIntervals(3).importance = 5;
+binIntervals(4).importance = 5;
+binIntervals(5).importance = 5;
+binIntervals(6).importance = 5;
+
+
+%% Define the compositon of the material used for the simulation according to ICRU Report 46 and MCNP Appendix G for cross sections
+
+%% Cross sections
+
+crossSectionsLibrary(1,:)='.20c';
+crossSectionsLibrary(2,:)= '.00c';
+
+%% Material Definition: Isotopes only added, when rounded percentage is at least 1%
+%% Air - Taken from Schneider et al. (2000)
+binIntervals(1).ZAID(1,1) = 7014; % N
+binIntervals(1).crossSection(1,1) = 2;
+binIntervals(1).percentageMass(1,1) = -0.755; %
+
+binIntervals(1).ZAID(1,2) = 8016; % O
+binIntervals(1).crossSection(1,2) = 2;
+binIntervals(1).percentageMass(1,2) = -0.232;
+
+binIntervals(1).ZAID(1,3) = 18040; % Ar
+binIntervals(1).crossSection(1,3) = 2;
+binIntervals(1).percentageMass(1,3) = -0.013;
+
+%% Lung
+binIntervals(2).ZAID(1,1) = 1001; % H from ICRU Report 46
+binIntervals(2).crossSection(1,1) = 2;
+binIntervals(2).percentageMass(1,1) = -0.103;
+
+binIntervals(2).ZAID(1,2) = 6012; % C from ICRU Report 46
+binIntervals(2).crossSection(1,2) = 2;
+binIntervals(2).percentageMass(1,2) = -0.104;
+
+binIntervals(2).ZAID(1,2) = 6013; % C from ICRU Report 46
+binIntervals(2).crossSection(1,3) = 2;
+binIntervals(2).percentageMass(1,3) = -0.001;
+
+binIntervals(2).ZAID(1,3) = 7014; % N from ICRU Report 46
+binIntervals(2).crossSection(1,4) = 2;
+binIntervals(2).percentageMass(1,4) = -0.031;
+
+binIntervals(2).ZAID(1,4) = 8016; % O from ICRU Report 46
+binIntervals(2).crossSection(1,5) = 2;
+binIntervals(2).percentageMass(1,5) = -0.749;
+
+binIntervals(2).ZAID(1,5) = 11023; % Na from ICRU Report 46
+binIntervals(2).crossSection(1,6) = 2;
+binIntervals(2).percentageMass(1,6) = -0.002;
+
+binIntervals(2).ZAID(1,6) = 15031; % P from ICRU Report 46
+binIntervals(2).crossSection(1,7) = 2;
+binIntervals(2).percentageMass(1,7) = -0.002;
+
+binIntervals(2).ZAID(1,7) = 16032; % S from ICRU Report 46
+binIntervals(2).crossSection(1,8) = 2;
+binIntervals(2).percentageMass(1,8) = -0.003*0.95;
+binIntervals(2).ZAID(1,8) = 16033; % S from ICRU Report 46
+binIntervals(2).crossSection(1,9) = 2;
+binIntervals(2).percentageMass(1,9) = -0.003*0.01;
+binIntervals(2).ZAID(1,9) = 16034; % S from ICRU Report 46
+binIntervals(2).crossSection(1,10) = 2;
+binIntervals(2).percentageMass(1,10) = -0.003*0.04;
+
+binIntervals(2).ZAID(1,10) = 17035; % Cl from ICRU Report 46
+binIntervals(2).crossSection(1,11) = 2;
+binIntervals(2).percentageMass(1,11) = -0.003*0.76;
+binIntervals(2).ZAID(1,11) = 17037; % Cl from ICRU Report 46
+binIntervals(2).crossSection(1,12) = 2;
+binIntervals(2).percentageMass(1,12) = -0.003*0.24;
+
+binIntervals(2).ZAID(1,12) = 19039; % K from ICRU Report 46
+binIntervals(2).crossSection(1,13) = 2;
+binIntervals(2).percentageMass(1,13) = -0.002*0.93;
+binIntervals(2).ZAID(1,13) = 19041; % K from ICRU Report 46
+binIntervals(2).crossSection(1,14) = 2;
+binIntervals(2).percentageMass(1,14) = -0.002*0.07;
+
+%% Soft Tissue
+binIntervals(3).ZAID(1,1) = 1001; % H from ICRU Report 46
+binIntervals(3).crossSection(1,1) = 1;
+binIntervals(3).percentageMass(1,1) = -0.101;
+
+binIntervals(3).ZAID(1,2) = 6012; % C from ICRU Report 46
+binIntervals(3).crossSection(1,2) = 2;
+binIntervals(3).percentageMass(1,2) = -0.110;
+
+binIntervals(2).ZAID(1,2) = 6013; % C from ICRU Report 46
+binIntervals(2).crossSection(1,3) = 2;
+binIntervals(2).percentageMass(1,3) = -0.001;
+
+binIntervals(3).ZAID(1,3) = 7014; % N from ICRU Report 46
+binIntervals(3).crossSection(1,4) = 2;
+binIntervals(3).percentageMass(1,4) = -0.026;
+
+binIntervals(3).ZAID(1,4) = 8016; % O from ICRU Report 46
+binIntervals(3).crossSection(1,5) = 2;
+binIntervals(3).percentageMass(1,5) = -0.762;
+
+%% Bone
+binIntervals(4).ZAID(1,1) = 1001; % H from ICRU Report 44; all taken from DeMarco et al. 1998
+binIntervals(4).crossSection(1,1) = 2;
+binIntervals(4).percentageMass(1,1) = -0.034;
+
+binIntervals(4).ZAID(1,2) = 6012; % C from ICRU Report 46
+binIntervals(4).crossSection(1,2) = 2;
+binIntervals(4).percentageMass(1,2) = -0.153;
+
+binIntervals(2).ZAID(1,2) = 6013; % C from ICRU Report 46
+binIntervals(2).crossSection(1,3) = 2;
+binIntervals(2).percentageMass(1,3) = -0.002;
+
+binIntervals(4).ZAID(1,3) = 7014; % N from ICRU Report 46
+binIntervals(4).crossSection(1,4) = 2;
+binIntervals(4).percentageMass(1,4) = -0.042;
+
+binIntervals(4).ZAID(1,4) = 8016; % O from ICRU Report 44
+binIntervals(4).crossSection(1,5) = 2;
+binIntervals(4).percentageMass(1,5) = -0.435;
+
+binIntervals(4).ZAID(1,5) = 15031; % P from ICRU Report 44
+binIntervals(4).crossSection(1,6) = 2;
+binIntervals(4).percentageMass(1,6) = -0.103;
+
+binIntervals(4).ZAID(1,6) = 20040; % Ca from ICRU Report 44
+binIntervals(4).crossSection(1,7) = 2;
+binIntervals(4).percentageMass(1,7) = -0.225*0.97;
+binIntervals(4).ZAID(1,7) = 20042; % Ca from ICRU Report 44
+binIntervals(4).crossSection(1,8) = 2;
+binIntervals(4).percentageMass(1,8) = -0.225*0.01;
+binIntervals(4).ZAID(1,8) = 20044; % Ca from ICRU Report 44
+binIntervals(4).crossSection(1,9) = 2;
+binIntervals(4).percentageMass(1,9) = -0.225*0.02;
+
+%% Skin
+binIntervals(5).ZAID(1,1) = 1001; % H from ICRU Report 46
+binIntervals(5).crossSection(1,1) = 2;
+binIntervals(5).percentageMass(1,1) = -0.100;
+
+binIntervals(5).ZAID(1,2) = 6012; % C from ICRU Report 46
+binIntervals(5).crossSection(1,2) = 2;
+binIntervals(5).percentageMass(1,2) = -0.202*0.99;
+
+binIntervals(5).ZAID(1,2) = 6013; % C from ICRU Report 46
+binIntervals(5).crossSection(1,3) = 2;
+binIntervals(5).percentageMass(1,3) = -0.002*0.99;
+
+binIntervals(5).ZAID(1,3) = 7014; % N from ICRU Report 46
+binIntervals(5).crossSection(1,4) = 2;
+binIntervals(5).percentageMass(1,4) = -0.042;
+
+binIntervals(5).ZAID(1,4) = 8016; % O from ICRU Report 46
+binIntervals(5).crossSection(1,5) = 2;
+binIntervals(5).percentageMass(1,5) = -0.645;
+
+binIntervals(5).ZAID(1,5) = 11023; % Na from ICRU Report 46
+binIntervals(5).crossSection(1,6) = 2;
+binIntervals(5).percentageMass(1,6) = -0.002;
+
+binIntervals(5).ZAID(1,6) = 15031; % P from ICRU Report 44
+binIntervals(5).crossSection(1,7) = 2;
+binIntervals(5).percentageMass(1,7) = -0.001;
+
+binIntervals(5).ZAID(1,7) = 16032; % S from ICRU Report 46
+binIntervals(5).crossSection(1,8) = 2;
+binIntervals(5).percentageMass(1,8) = -0.002*0.95;
+binIntervals(5).ZAID(1,8) = 16033; % S from ICRU Report 46
+binIntervals(5).crossSection(1,9) = 2;
+binIntervals(5).percentageMass(1,9) = -0.002*0.01;
+binIntervals(5).ZAID(1,9) = 16034; % S from ICRU Report 46
+binIntervals(5).crossSection(1,10) = 2;
+binIntervals(5).percentageMass(1,10) = -0.002*0.04;
+
+binIntervals(5).ZAID(1,10) = 17035; % Cl from ICRU Report 46
+binIntervals(5).crossSection(1,11) = 2;
+binIntervals(5).percentageMass(1,11) = -0.003*0.76;
+binIntervals(5).ZAID(1,11) = 17037; % Cl from ICRU Report 46
+binIntervals(5).crossSection(1,12) = 2;
+binIntervals(5).percentageMass(1,12) = -0.003*0.24;
+
+binIntervals(5).ZAID(1,12) = 19039; % K from ICRU Report 46
+binIntervals(5).crossSection(1,13) = 2;
+binIntervals(5).percentageMass(1,13) = -0.001*0.93;
+binIntervals(5).ZAID(1,13) = 19041; % K from ICRU Report 46
+binIntervals(5).crossSection(1,14) = 2;
+binIntervals(5).percentageMass(1,14) = -0.001*0.07;
+
+%% Soft Tissue with Boron Content
+% Fraction of mass necessary for BNCT (Chandra et al., 2015): 20mug/g
+
+boronPercentPerMass = 30e-6; %30e-6; %20e-6;
+
+binIntervals(6).ZAID(1,1) = 1001; % H from ICRU Report 46
+binIntervals(6).crossSection(1,1) = 2;
+binIntervals(6).percentageMass(1,1) = -0.101 * (1 - boronPercentPerMass);
+
+binIntervals(6).ZAID(1,2) = 6012; % C from ICRU Report 46
+binIntervals(6).crossSection(1,2) = 2;
+binIntervals(6).percentageMass(1,2) = -0.104*0.99 * (1 - boronPercentPerMass);
+
+binIntervals(6).ZAID(1,2) = 6013; % C from ICRU Report 46
+binIntervals(6).crossSection(1,3) = 2;
+binIntervals(6).percentageMass(1,3) = -0.001*0.99 * (1 - boronPercentPerMass);
+
+binIntervals(6).ZAID(1,3) = 7014; % N from ICRU Report 46
+binIntervals(6).crossSection(1,4) = 2;
+binIntervals(6).percentageMass(1,4) = -0.026 * (1 - boronPercentPerMass);
+
+binIntervals(6).ZAID(1,4) = 8016; % O from ICRU Report 46
+binIntervals(6).crossSection(1,5) = 2;
+binIntervals(6).percentageMass(1,5) = -0.762 * (1 - boronPercentPerMass);
+
+binIntervals(6).ZAID(1,5) = 5010; % B-10
+binIntervals(6).crossSection(1,6) = 1;
+binIntervals(6).percentageMass(1,6) = -boronPercentPerMass;
+
+%% Controle whether percentages are all one
+dummySummy = 0;
+for i=1:size(binIntervals,2)
+ dummySummy = dummySummy + sum(binIntervals(i).percentageMass(1,:));
+end
+clear i;
+if abs(dummySummy)~=size(binIntervals,2)
+ warning('One of the material definitions is missing one or more components. Change here otherwise MCNP will normalize automatically...')
+end
+clear dummySummy;
+
+%% Save
+save('conversionCT2tissue.mat', 'binIntervals', 'segVar','crossSectionsLibrary')
diff --git a/MCNP/matRad_makeSourceMCNP.m b/MCNP/matRad_makeSourceMCNP.m
new file mode 100644
index 000000000..110043f0c
--- /dev/null
+++ b/MCNP/matRad_makeSourceMCNP.m
@@ -0,0 +1,526 @@
+function [control_makeSourceMCNP, varHelper] = matRad_makeSourceMCNP(this,stf, ct, varHelper, counterField, counterRay)
+% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% Write source data as MCNP input file. For each bixel/ray an individual
+% MCNP input file is generated, where position of the source is defined by
+% opening of Multi-Leaf Collimator and optional energyspectrum of
+% particles.
+% Note: Dose calculation for radiation fields based on RSSA data is
+% selected by setting pln.propStf.bixelWidth to 'field'. IMRT or square
+% field dose calculation for pure neutron or mixed neutron-gamma sources is
+% selected from selected machine (please check readme.txt in the
+% MCNP dose engine folder).
+%
+% call
+% [control_makeSourceMCNP, fileID_C, nameListRays] = matRad_makeSourceMCNP(stf, varHelper, counterField, counterRay)
+%
+% input
+% stf: steering information structure used to position square source
+% for every ray individually in lps system and control source
+% particles, spectral information and initial direction of flight
+%
+% output: varHelper with new element .simPropMCNP.fileID_C containing
+% individual file IDs for all bixels s.th. runfiles can be put
+% together later
+%
+% References
+% [1] PELOWITZ, D. B., et al. MCNP6 Users Manual. LACP-00634, May, 2013.
+%
+% Author: Lucas Sommer (Lucas.Sommer@tum.de), 11/2018
+%
+% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+matRad_cfg = MatRad_Config.instance();
+
+%% Check source input and create source part of runfile
+pathRunfiles = fullfile(matRad_cfg.matRadRoot, 'MCNP', filesep, 'runfiles_tmp', filesep);
+
+%% Reset isocenter coordinates to cube coodinates (and forget)
+stf(counterField).isoCenter = matRad_world2cubeCoords(stf(counterField).isoCenter, ct, 0);
+
+%% Option A: Predefined field using RSSA file
+if strcmp(num2str(stf(1).bixelWidth),'field')
+ pathRSSA = fullfile(matRad_cfg.matRadRoot, 'MCNP', filesep, 'RSSA_depot', filesep);
+ makeSource_readRSSA(stf, varHelper, pathRunfiles, pathRSSA)
+ control_makeSourceMCNP = 1;
+
+%% Option B: neutrons or mixed field but with spectral information
+elseif strcmp(this.machine.meta.radiationMode, 'neutrons') ...
+ && ~isstring(stf(1).bixelWidth) ...
+ && isfield(this.machine.data, 'neutronSpec') ...
+ && ~isfield(this.machine.data, 'neutronMonoEn')
+ if isfield(this.machine.data, 'photonSpec')
+ if counterField==1 && counterRay==1
+ matRad_cfg.dispInfo('***\n')
+ matRad_cfg.dispInfo('Neutron spectrum loaded from machine file.\n')
+ matRad_cfg.dispInfo('***\n')
+ matRad_cfg.dispInfo('Gamma/photon spectrum found in neutron machine. Will be included in the simulation as primary particles.\n')
+ matRad_cfg.dispInfo('***\n')
+ end
+ makeSource_spectralInformationNeutronsPlusPhotons(stf, varHelper, pathRunfiles, counterField, counterRay,this.machine)
+ control_makeSourceMCNP = 1;
+ else
+ if counterField==1 && counterRay==1
+ matRad_cfg.dispInfo('***\n')
+ matRad_cfg.dispInfo('Neutron spectrum loaded from machine file.\n')
+ matRad_cfg.dispInfo('***\n')
+ end
+ makeSource_spectralInformationNeutrons(stf, varHelper, pathRunfiles, counterField, counterRay,this.machine)
+ control_makeSourceMCNP = 1;
+ end
+%% Option C: only photons but with spectral information
+elseif strcmp(this.machine.meta.radiationMode, 'photons') ...
+ && ~isstring(stf(1).bixelWidth) ...
+ && isfield(this.machine.data, 'photonSpec')
+ if counterField==1 && counterRay==1
+ matRad_cfg.dispInfo('***\n')
+ matRad_cfg.dispInfo('Photon spectrum loaded from machine file.\n')
+ matRad_cfg.dispInfo('***\n')
+ end
+ makeSource_spectralInformationPhotons(stf, varHelper, pathRunfiles, counterField, counterRay, this.machine)
+ control_makeSourceMCNP = 1;
+%% Option D: monoenergetic neutrons
+elseif strcmp(this.machine.meta.radiationMode,'neutrons') ...
+ && ~isstring(stf(1).bixelWidth) ...
+ && isfield(this.machine.data,'neutronMonoEn') ...
+ && ~isfield(this.machine.data, 'neutronSpec')
+ if counterField==1 && counterRay==1
+ disp('*****\n')
+ disp('Monoenergetic neutrons used for simulation.\n')
+ disp('*****\n')
+ end
+ makeSource_monoenN(stf, varHelper, pathRunfiles, counterField, counterRay, this.machine)
+ control_makeSourceMCNP = 1;
+
+else
+ error('No valid energy input for particle energy!')
+end
+
+%% Define functions here
+ function makeSource_monoenN(stf, varHelper, pathRunfiles, counterField, counterRay, spectralInformation)
+ % Get rotation matrix
+ rotMatrix = matRad_calcMCNProtMatrix(stf.gantryAngle, stf.couchAngle);
+ % Calculate source position in original coordinate system
+ sourcePoint = stf.sourcePoint_bev + stf(counterField).ray(counterRay).rayPos_bev;
+
+
+ fileID_C = fopen(strcat(pathRunfiles,'blockC_source', int2str(varHelper.totalNumberBixels)), 'w');
+ % Define source card, note: VEC=reference vector for the direction
+ % sampling, DIR=cosine of angle between VEC and partice direction,
+ % in case DIR=-1 a monodirectional source in counter direction of VEC
+ source.sourceCard_0 = 'SDEF\n X=d1 Y=%.4f Z=d2\n VEC=0 1 0\n DIR=1 PAR=1 ERG=%.4f TR=1\n';
+ source.sourceCard_1_i = 'SI1 %.4f %.4f\n'; % Initial position and source extension
+ source.sourceCard_1_p = 'SP1 0 1\n';
+ source.sourceCard_2_i = 'SI2 %.4f %.4f\n'; % ...
+ source.sourceCard_2_p = 'SP2 0 1\n';
+
+ % Define coordinate transformation card
+ coordTrafo.TRcard = 'TR1\n %.4f %.4f %.4f\n %.4f %.4f %.4f\n %.4f %.4f %.4f\n %.4f %.4f %.4f\n\n';
+
+ % Write Block C
+ fprintf(fileID_C, 'C ***************************************************************\n');
+ fprintf(fileID_C, 'C C.1: Source\n');
+ fprintf(fileID_C, 'C ***************************************************************\n');
+
+ % Write initial source position and extension
+ fprintf(fileID_C, source.sourceCard_0, ...
+ sourcePoint(2)*varHelper.rescaleFactor);
+ fprintf(fileID_C, source.sourceCard_1_i, ...
+ (-stf(varHelper.simPropMCNP.counterField).bixelWidth/2)*varHelper.rescaleFactor, ...
+ (stf(varHelper.simPropMCNP.counterField).bixelWidth/2)*varHelper.rescaleFactor);
+ fprintf(fileID_C, source.sourceCard_1_p);
+ fprintf(fileID_C, source.sourceCard_2_i, ...
+ (-stf(varHelper.simPropMCNP.counterField).bixelWidth/2)*varHelper.rescaleFactor, ...
+ (stf(varHelper.simPropMCNP.counterField).bixelWidth/2)*varHelper.rescaleFactor);
+ fprintf(fileID_C, source.sourceCard_2_p);
+
+ % Write TR card for spatial source transformation
+ fprintf(fileID_C, coordTrafo.TRcard, ...
+ (stf(counterField).isoCenter(1)+stf(counterField).ray(counterRay).rayPos(1))*varHelper.rescaleFactor, ...
+ (stf(counterField).isoCenter(2)+stf(counterField).ray(counterRay).rayPos(2))*varHelper.rescaleFactor, ...
+ (stf(counterField).isoCenter(3)+stf(counterField).ray(counterRay).rayPos(3))*varHelper.rescaleFactor, ...
+ rotMatrix(1,1), rotMatrix(1,2), rotMatrix(1,3),...
+ rotMatrix(2,1), rotMatrix(2,2), rotMatrix(2,3),...
+ rotMatrix(3,1), rotMatrix(3,2), rotMatrix(3,3));
+
+ fclose(fileID_C);
+ end
+
+ function makeSource_spectralInformationNeutrons(stf, varHelper, pathRunfiles, counterField, counterRay, machineInformation)
+ % Get rotation matrix
+ rotMatrix = matRad_calcMCNProtMatrix(stf(counterField).gantryAngle, stf(counterField).couchAngle);
+ % Calculate source position in original coordinate system
+ sourcePoint = stf(counterField).sourcePoint_bev + stf(counterField).ray(counterRay).rayPos_bev;
+
+
+ fileID_C = fopen(strcat(pathRunfiles,'blockC_source', int2str(varHelper.totalNumberBixels)), 'w');
+ % Define source card, note: VEC=reference vector for the direction
+ % sampling, DIR=cosine of angle between VEC and partice direction,
+ % in case DIR=-1 a monodirectional source in counter direction of
+ % VEC.
+ % ERG=d3 used to define spectrum according to information read from
+ % tabulated data in ..\MATRAD\MCNP\SpectralInformation
+ % Added for BNCT: circular field shape with diameter equal to bixel
+ % size. Attention: matRad machine has to be named leading with BNCT
+
+ if size(machineInformation.meta.name,2)>=4 && strcmp(machineInformation.meta.name(1:4), 'BNCT')
+ source.sourceCard_0 = 'SDEF\n POS=0 %.4f 0 AXS=0 1 0\n EXT=0 RAD=d1\n VEC=0 1 0 DIR=1\n PAR=1 ERG=d3 TR=1\n';
+ source.sourceCard_1_i = 'SI1 0 %.4f\n'; % Initial position and source extension
+ source.sourceCard_1_p = 'SP1 -21 1\n';
+ else
+ source.sourceCard_0 = 'SDEF\n X=d1 Y=%.4f Z=d2\n VEC=0 1 0\n DIR=1 PAR=1 ERG=d3 TR=1\n';
+ source.sourceCard_1_i = 'SI1 %.4f %.4f\n'; % Initial position and source extension
+ source.sourceCard_1_p = 'SP1 0 1\n';
+ source.sourceCard_2_i = 'SI2 %.4f %.4f\n'; % ...
+ source.sourceCard_2_p = 'SP2 0 1\n';
+ end
+
+ source.energyCard_3_i_0 = 'SI3 H\n'; % Energy bins
+ source.energyCard_3_i = ' %8d\n';
+ source.energyCard_3_p_0 = 'SP3 D\n'; % Spectral information
+ source.energyCard_3_p = ' %8d\n';
+
+ % Define coordinate transformation card
+ coordTrafo.TRcard = 'TR1\n %.4f %.4f %.4f\n %.4f %.4f %.4f\n %.4f %.4f %.4f\n %.4f %.4f %.4f\n';
+
+ % Write Block C
+ fprintf(fileID_C, 'C ***************************************************************\n');
+ fprintf(fileID_C, 'C C.1: Source\n');
+ fprintf(fileID_C, 'C ***************************************************************\n');
+
+ % Write initial source position and extension
+ fprintf(fileID_C, source.sourceCard_0, ...
+ sourcePoint(2)*varHelper.rescaleFactor);
+ if size(machineInformation.meta.name,2)>=4 && strcmp(machineInformation.meta.name(1:4), 'BNCT')
+ fprintf(fileID_C, source.sourceCard_1_i, ...
+ (sourcePoint(1)+stf(varHelper.simPropMCNP.counterField).bixelWidth/2)*varHelper.rescaleFactor);
+ fprintf(fileID_C, source.sourceCard_1_p);
+ else
+ fprintf(fileID_C, source.sourceCard_1_i, ...
+ (-stf(varHelper.simPropMCNP.counterField).bixelWidth/2)*varHelper.rescaleFactor, ...
+ (stf(varHelper.simPropMCNP.counterField).bixelWidth/2)*varHelper.rescaleFactor);
+ fprintf(fileID_C, source.sourceCard_1_p);
+ fprintf(fileID_C, source.sourceCard_2_i, ...
+ (-stf(varHelper.simPropMCNP.counterField).bixelWidth/2)*varHelper.rescaleFactor, ...
+ (stf(varHelper.simPropMCNP.counterField).bixelWidth/2)*varHelper.rescaleFactor);
+ fprintf(fileID_C, source.sourceCard_2_p);
+ end
+
+ % Write spectral distribution
+ fprintf(fileID_C, source.energyCard_3_i_0);
+ fprintf(fileID_C, source.energyCard_3_i, ...
+ machineInformation.data.neutronSpec(:,1));
+ fprintf(fileID_C, source.energyCard_3_p_0);
+ fprintf(fileID_C, source.energyCard_3_p, ...
+ machineInformation.data.neutronSpec(:,2));
+
+ % Write TR card for spatial source transformation
+ fprintf(fileID_C, coordTrafo.TRcard, ...
+ (stf(counterField).isoCenter(1)+stf(counterField).ray(counterRay).rayPos(1))*varHelper.rescaleFactor, ...
+ (stf(counterField).isoCenter(2)+stf(counterField).ray(counterRay).rayPos(2))*varHelper.rescaleFactor, ...
+ (stf(counterField).isoCenter(3)+stf(counterField).ray(counterRay).rayPos(3))*varHelper.rescaleFactor, ...
+ rotMatrix(1,1), rotMatrix(1,2), rotMatrix(1,3),...
+ rotMatrix(2,1), rotMatrix(2,2), rotMatrix(2,3),...
+ rotMatrix(3,1), rotMatrix(3,2), rotMatrix(3,3));
+
+ % Close blockC_source file
+ fclose(fileID_C);
+ end
+
+ function makeSource_spectralInformationPhotons(stf, varHelper, pathRunfiles, spectralInformation)
+ % Get rotation matrix
+ rotMatrix = matRad_calcMCNProtMatrix(stf(counterField).gantryAngle, stf(counterField).couchAngle);
+ % Calculate source position in original coordinate system
+ sourcePoint = stf(counterField).sourcePoint_bev + stf(counterField).ray(counterRay).rayPos_bev;
+
+ fileID_C = fopen(strcat(pathRunfiles,'blockC_source', int2str(varHelper.totalNumberBixels)), 'w');
+ % Define source card, note: VEC=reference vector for the direction
+ % sampling, DIR=cosine of angle between VEC and partice direction,
+ % in case DIR=-1 a monodirectional source in counter direction of
+ % VEC.
+ % ERG=d3 used to define spectrum according to information read from
+ % tabulated data in ..\MATRAD\MCNP\SpectralInformation
+
+ source.sourceCard_0 = 'SDEF\n X=d1 Y=%.4f Z=d2\n VEC=0 1 0\n DIR=1 PAR=2 ERG=d3 TR=1\n';
+ source.sourceCard_1_i = 'SI1 %.4f %.4f\n'; % Initial position and source extension
+ source.sourceCard_1_p = 'SP1 0 1\n';
+ source.sourceCard_2_i = 'SI2 %.4f %.4f\n'; % ...
+ source.sourceCard_2_p = 'SP2 0 1\n';
+ source.energyCard_3_i_0 = 'SI3 H\n'; % Energy bins
+ source.energyCard_3_i = ' %8d\n';
+ source.energyCard_3_p_0 = 'SP3 D\n'; % Spectral information
+ source.energyCard_3_p = ' %8d\n';
+
+ % Define coordinate transformation card
+ coordTrafo.TRcard = 'TR1\n %.4f %.4f %.4f\n %.4f %.4f %.4f\n %.4f %.4f %.4f\n %.4f %.4f %.4f\n';
+
+ % Write Block C
+ fprintf(fileID_C, 'C ***************************************************************\n');
+ fprintf(fileID_C, 'C C.1: Source\n');
+ fprintf(fileID_C, 'C ***************************************************************\n');
+
+ % Write initial source position and extension
+ fprintf(fileID_C, source.sourceCard_0, ...
+ sourcePoint(2)*varHelper.rescaleFactor);
+
+ fprintf(fileID_C, source.sourceCard_1_i, ...
+ (-stf(varHelper.simPropMCNP.counterField).bixelWidth/2)*varHelper.rescaleFactor, ...
+ (stf(varHelper.simPropMCNP.counterField).bixelWidth/2)*varHelper.rescaleFactor);
+ fprintf(fileID_C, source.sourceCard_1_p);
+ fprintf(fileID_C, source.sourceCard_2_i, ...
+ (-stf(varHelper.simPropMCNP.counterField).bixelWidth/2)*varHelper.rescaleFactor, ...
+ (stf(varHelper.simPropMCNP.counterField).bixelWidth/2)*varHelper.rescaleFactor);
+ fprintf(fileID_C, source.sourceCard_2_p);
+
+
+ % Write spectral distribution
+ fprintf(fileID_C, source.energyCard_3_i_0);
+ fprintf(fileID_C, source.energyCard_3_i, ...
+ spectralInformation.neutronSpec(:,1));
+ fprintf(fileID_C, source.energyCard_3_p_0);
+ fprintf(fileID_C, source.energyCard_3_p, ...
+ spectralInformation.neutronSpec(:,2));
+
+ % Write TR card for spatial source transformation
+ fprintf(fileID_C, coordTrafo.TRcard, ...
+ (stf(counterField).isoCenter(1)+stf(counterField).ray(counterRay).rayPos(1))*varHelper.rescaleFactor, ...
+ (stf(counterField).isoCenter(2)+stf(counterField).ray(counterRay).rayPos(2))*varHelper.rescaleFactor, ...
+ (stf(counterField).isoCenter(3)+stf(counterField).ray(counterRay).rayPos(3))*varHelper.rescaleFactor, ...
+ rotMatrix(1,1), rotMatrix(1,2), rotMatrix(1,3),...
+ rotMatrix(2,1), rotMatrix(2,2), rotMatrix(2,3),...
+ rotMatrix(3,1), rotMatrix(3,2), rotMatrix(3,3));
+
+ % Close blockC_source file
+ fclose(fileID_C);
+ end
+
+ function makeSource_spectralInformationNeutronsPlusPhotons(stf, varHelper, pathRunfiles, counterField, counterRay, machineInformation)
+ % Get rotation matrix
+ rotMatrix = matRad_calcMCNProtMatrix(stf(counterField).gantryAngle, stf(counterField).couchAngle);
+ % Calculate source position in original coordinate system
+ sourcePoint = stf(counterField).sourcePoint_bev + stf(counterField).ray(counterRay).rayPos_bev;
+
+ fileID_C = fopen(strcat(pathRunfiles,'blockC_source', int2str(varHelper.totalNumberBixels)), 'w');
+ % Define source card, note: VEC=reference vector for the direction
+ % sampling, DIR=cosine of angle between VEC and partice direction,
+ % in case DIR=-1 a monodirectional source in counter direction of
+ % VEC.
+ % ERG=d3 used to define spectrum according to information read from
+ % tabulated data in ..\MATRAD\MCNP\SpectralInformation
+ if size(machineInformation.meta.name,2)>=4 && strcmp(machineInformation.meta.name(1:4), 'BNCT')
+ source.sourceCard_0 = 'SDEF\n POS=0 %.4f 0 AXS=0 1 0\n EXT=0 RAD=d1\n VEC=0 1 0 DIR=1\n PAR=d3 ERG=fpar=d4 TR=1\n';
+ source.sourceCard_1_i = 'SI1 0 %.4f\n'; % Initial position and source extension
+ source.sourceCard_1_p = 'SP1 -21 1\n';
+ else
+ source.sourceCard_0 = 'SDEF\n X=d1 Y=%.4f Z=d2\n VEC=0 1 0\n DIR=1 PAR=d3 ERG=fpar=d4 TR=1\n';
+ source.sourceCard_1_i = 'SI1 %.4f %.4f\n'; % Initial position and source extension
+ source.sourceCard_1_p = 'SP1 0 1\n';
+ source.sourceCard_2_i = 'SI2 %.4f %.4f\n'; % ...
+ source.sourceCard_2_p = 'SP2 0 1\n';
+ end
+ source.particleDistribution_i = 'SI3 L 1 2\n';
+ source.particleDistribution_p = 'SP3 1 1\n';
+ source.particleEnergyDistributions = 'DS4 S 5 6\n';
+ source.neutronEnergyCard_5_i_0 = 'SI5 H\n'; % Energy bins neutrons
+ source.neutronEnergyCard_5_i = ' %8d\n';
+ source.neutronEnergyCard_5_p_0 = 'SP5 D\n'; % Spectral information neutrons
+ source.neutronEnergyCard_5_p = ' %8d\n';
+ source.photonEnergyCard_6_i_0 = 'SI6 H\n'; % Energy bins photons
+ source.photonEnergyCard_6_i = ' %8d\n';
+ source.photonEnergyCard_6_p_0 = 'SP6 D\n'; % Spectral information photons
+ source.photonEnergyCard_6_p = ' %8d\n';
+
+ % Define coordinate transformation card
+ coordTrafo.TRcard = 'TR1\n %.4f %.4f %.4f\n %.4f %.4f %.4f\n %.4f %.4f %.4f\n %.4f %.4f %.4f\n';
+
+ % Write Block C
+ fprintf(fileID_C, 'C ***************************************************************\n');
+ fprintf(fileID_C, 'C C.1: Source\n');
+ fprintf(fileID_C, 'C ***************************************************************\n');
+
+ % Write initial source position and extension
+ fprintf(fileID_C, source.sourceCard_0, ...
+ sourcePoint(2)*varHelper.rescaleFactor);
+ if size(machineInformation.meta.name,2)>=4 && strcmp(machineInformation.meta.name(1:4), 'BNCT')
+ fprintf(fileID_C, source.sourceCard_1_i, ...
+ (sourcePoint(1)+stf(varHelper.simPropMCNP.counterField).bixelWidth/2)*varHelper.rescaleFactor);
+ fprintf(fileID_C, source.sourceCard_1_p);
+ else
+ fprintf(fileID_C, source.sourceCard_1_i, ...
+ (-stf(varHelper.simPropMCNP.counterField).bixelWidth/2)*varHelper.rescaleFactor, ...
+ (stf(varHelper.simPropMCNP.counterField).bixelWidth/2)*varHelper.rescaleFactor);
+ fprintf(fileID_C, source.sourceCard_1_p);
+ fprintf(fileID_C, source.sourceCard_2_i, ...
+ (-stf(varHelper.simPropMCNP.counterField).bixelWidth/2)*varHelper.rescaleFactor, ...
+ (stf(varHelper.simPropMCNP.counterField).bixelWidth/2)*varHelper.rescaleFactor);
+ fprintf(fileID_C, source.sourceCard_2_p);
+ end
+
+ % Write spectral distribution
+ fprintf(fileID_C, source.particleDistribution_i);
+ fprintf(fileID_C, source.particleDistribution_p);
+ fprintf(fileID_C, source.particleEnergyDistributions);
+ % Neutrons
+ fprintf(fileID_C, source.neutronEnergyCard_5_i_0);
+ fprintf(fileID_C, source.neutronEnergyCard_5_i, ...
+ machineInformation.data.neutronSpec(:,1));
+ fprintf(fileID_C, source.neutronEnergyCard_5_p_0);
+ fprintf(fileID_C, source.neutronEnergyCard_5_p, ...
+ machineInformation.data.neutronSpec(:,2));
+ % Photons
+ fprintf(fileID_C, source.photonEnergyCard_6_i_0);
+ fprintf(fileID_C, source.photonEnergyCard_6_i, ...
+ machineInformation.data.photonSpec(:,1));
+ fprintf(fileID_C, source.photonEnergyCard_6_p_0);
+ fprintf(fileID_C, source.photonEnergyCard_6_p, ...
+ machineInformation.data.photonSpec(:,2));
+
+ % Write TR card for spatial source transformation
+ fprintf(fileID_C, coordTrafo.TRcard, ...
+ (stf(counterField).isoCenter(1)+stf(counterField).ray(counterRay).rayPos(1))*varHelper.rescaleFactor, ...
+ (stf(counterField).isoCenter(2)+stf(counterField).ray(counterRay).rayPos(2))*varHelper.rescaleFactor, ...
+ (stf(counterField).isoCenter(3)+stf(counterField).ray(counterRay).rayPos(3))*varHelper.rescaleFactor, ...
+ rotMatrix(1,1), rotMatrix(1,2), rotMatrix(1,3),...
+ rotMatrix(2,1), rotMatrix(2,2), rotMatrix(2,3),...
+ rotMatrix(3,1), rotMatrix(3,2), rotMatrix(3,3));
+ % Close blockC_source file
+ fclose(fileID_C);
+ end
+
+ function makeSource_readRSSA(stf, pln, varHelper, pathRunfiles, pathRSSA)
+ if (strcmp(pln.machine, 'MCNP_MLC1') && ~varHelper.calcDoseDirect && stf(1).bixelWidth==15)
+ copyfile([pathRSSA, 'BixelWidth15mm', filesep, 'RSSA'], [pathRunfiles,'RSSA']);
+ fileID_C = fopen(strcat(pathRunfiles,'blockC_source', int2str(varHelper.totalNumberBixels)), 'w');
+ % Define source card
+ source.sourceCard_0 = ['SSR OLD ', varHelper.positioningRSSA.numberRSSAsurfaceString,' NEW 1001 TR=1\n'];
+
+ % Define coordinate transformation card
+ coordTrafo.TRcard = 'TR1\n %.4f %.4f %.4f\n %.4f %.4f 0\n 0 0 -1\n %.4f %.4f 0\n';
+
+ % Write Block C
+ fprintf(fileID_C, 'C ***************************************************************\n');
+ fprintf(fileID_C, 'C C.1: Source\n');
+ fprintf(fileID_C, 'C ***************************************************************\n');
+
+ % Write source read
+ fprintf(fileID_C, source.sourceCard_0);
+
+ % Write TR card for spatial source transformation
+ fprintf(fileID_C, coordTrafo.TRcard, ...
+ stf(varHelper.simPropMCNP.counterField).ray(varHelper.simPropMCNP.counterRay).rayPosMLC(1)*varHelper.rescaleFactor + varHelper.positioningRSSA.LocationRSSASurf.x*cosd(stf(varHelper.simPropMCNP.counterField).couchAngle), ...
+ stf(varHelper.simPropMCNP.counterField).ray(varHelper.simPropMCNP.counterRay).rayPosMLC(2)*varHelper.rescaleFactor, ... -varHelper.positioningRSSA.LocationRSSASurf.y, ...
+ stf(varHelper.simPropMCNP.counterField).ray(varHelper.simPropMCNP.counterRay).rayPosMLC(3)*varHelper.rescaleFactor - varHelper.positioningRSSA.LocationRSSASurf.x*sind(stf(varHelper.simPropMCNP.counterField).couchAngle), ...
+ -cosd(-stf(varHelper.simPropMCNP.counterField).couchAngle), ...
+ -sind(-stf(varHelper.simPropMCNP.counterField).couchAngle), ...
+ sind(-stf(varHelper.simPropMCNP.counterField).couchAngle), ...
+ -cosd(-stf(varHelper.simPropMCNP.counterField).couchAngle));
+
+ % Close blockC_source file
+ fclose(fileID_C);
+
+ elseif varHelper.calcDoseDirect && strcmp(pln.machine, 'MCNP_MLC1')
+ copyfile([pathRSSA, 'FieldRSSA_temp', filesep, 'RSSA'], [pathRunfiles,'RSSA']);
+ fileID_C = fopen(strcat(pathRunfiles,'blockC_source', int2str(varHelper.totalNumberBixels)), 'w');
+ varHelper.positioningRSSA.numberRSSAsurfaceString = '9.1';
+ % Define source card
+ source.sourceCard_0 = ['SSR OLD ', varHelper.positioningRSSA.numberRSSAsurfaceString,' NEW 1001 TR=2\n'];
+
+ % Define coordinate transformation card
+ coordTrafo.TRcard_1 = 'TR1\n %.4f %.4f %.4f\n %.4f 0 %.4f\n 0 1 0\n %.4f 0 %.4f\n';
+ coordTrafo.TRcard_2 = 'TR2\n %.4f %.4f %.4f\n %.4f 0 %.4f\n 0 -1 0\n %.4f 0 %.4f\n';
+
+ % Write Block C
+ fprintf(fileID_C, 'C ***************************************************************\n');
+ fprintf(fileID_C, 'C C.1: Source\n');
+ fprintf(fileID_C, 'C ***************************************************************\n');
+
+ % Write source read
+ fprintf(fileID_C, source.sourceCard_0);
+ dummyDistConverter = 4930; % distance MLC exit to converter plates
+ % Set surface for source positioning, auxiliary coordinate
+ % system origin, and trafo matrices
+ % Case-by-cas definition:
+ if length(pln.propStf.gantryAngles)~=1 || length(pln.propStf.couchAngles)~=1
+ error('Simulation of only one predefined field using RSSA file currently supported.')
+ elseif (pln.propStf.gantryAngles~=90 && pln.propStf.gantryAngles~=270)
+ error('For simulation of irradiation at FRM 2 only gantry angles of 90 and 270 are allowed.')
+ elseif pln.propStf.couchAngles > 180
+ error('For simulation of irradiation at FRM 2 only couch angles of 0 to 180 are allowed. Consider opposing gantry angle.')
+ elseif pln.propStf.gantryAngles==90 && pln.propStf.couchAngles <= 90
+ % Define position of surface for RSSA positioning
+ pos_tr1 = [cosd(pln.propStf.couchAngles)*stf.SAD, 0, -sind(pln.propStf.couchAngles)*stf.SAD];
+ pos_tr1 = pos_tr1 + stf.isoCenter;
+ % Define rotation of surface for RSSA positioning
+ mat_tr1 = [cosd(pln.propStf.couchAngles) cosd(90-pln.propStf.couchAngles)...
+ cosd(90+pln.propStf.couchAngles) cosd(pln.propStf.couchAngles)];
+ % Define position of RSSA auxiliary coordinatsystem origin
+ pos_tr2 = [cosd(pln.propStf.couchAngles)*(stf.SAD+dummyDistConverter), 0, -sind(pln.propStf.couchAngles)*(stf.SAD+dummyDistConverter)];
+ pos_tr2 = pos_tr2 + stf.isoCenter;
+ % Define rotation for RSSA positioning
+ mat_tr2 = [cosd(180-pln.propStf.couchAngles) cosd(90-pln.propStf.couchAngles)...
+ cosd(90-pln.propStf.couchAngles) cosd(pln.propStf.couchAngles)];
+ elseif pln.propStf.gantryAngles==90 && pln.propStf.couchAngles > 90
+ % Define position of surface for RSSA positioning
+ pos_tr1 = [-sind(pln.propStf.couchAngles-90)*stf.SAD, 0, -cosd(pln.propStf.couchAngles-90)*stf.SAD];
+ pos_tr1 = pos_tr1 + stf.isoCenter;
+ % Define rotation of surface for RSSA positioning
+ mat_tr1 = [cosd(pln.propStf.couchAngles) cosd(pln.propStf.couchAngles-90)...
+ cosd(180-(pln.propStf.couchAngles-90)) cosd(pln.propStf.couchAngles)];
+ % Define position of RSSA auxiliary coordinatsystem origin
+ pos_tr2 = [-sind(pln.propStf.couchAngles-90)*(stf.SAD+dummyDistConverter), 0, -cosd(pln.propStf.couchAngles-90)*(stf.SAD+dummyDistConverter)];
+ pos_tr2 = pos_tr2 + stf.isoCenter;
+ % Define rotation for RSSA positioning
+ mat_tr2 = [cosd(180-pln.propStf.couchAngles) cosd(pln.propStf.couchAngles-90)...
+ cosd(pln.propStf.couchAngles-90) cosd(pln.propStf.couchAngles)];
+ elseif pln.propStf.gantryAngles==270 && pln.propStf.couchAngles <= 90
+ % Define position of surface for RSSA positioning
+ pos_tr1 = [-cosd(pln.propStf.couchAngles)*stf.SAD, 0, sind(pln.propStf.couchAngles)*stf.SAD];
+ pos_tr1 = pos_tr1 + stf.isoCenter;
+ % Define rotation of surface for RSSA positioning
+ mat_tr1 = [cosd(pln.propStf.couchAngles) cosd(90-pln.propStf.couchAngles)...
+ cosd(90+pln.propStf.couchAngles) cosd(pln.propStf.couchAngles)];
+ % Define position of RSSA auxiliary coordinatsystem origin
+ pos_tr2 = [-cosd(pln.propStf.couchAngles)*(stf.SAD+dummyDistConverter), 0, sind(pln.propStf.couchAngles)*(stf.SAD+dummyDistConverter)];
+ pos_tr2 = pos_tr2 + stf.isoCenter;
+ % Define rotation for RSSA positioning
+ mat_tr2 = [cosd(pln.propStf.couchAngles) cosd(90+pln.propStf.couchAngles)...
+ cosd(90+pln.propStf.couchAngles) cosd(180-pln.propStf.couchAngles)];
+ elseif pln.propStf.gantryAngles==270 && pln.propStf.couchAngles > 90
+ % Define position of surface for RSSA positioning
+ pos_tr1 = [sind(pln.propStf.couchAngles-90)*stf.SAD, 0, cosd(pln.propStf.couchAngles-90)*stf.SAD];
+ pos_tr1 = pos_tr1 + stf.isoCenter;
+ % Define rotation of surface for RSSA positioning
+ mat_tr1 = [cosd(pln.propStf.couchAngles) cosd(pln.propStf.couchAngles-90)...
+ cosd(180-(pln.propStf.couchAngles-90)) cosd(pln.propStf.couchAngles)];
+ % Define position of RSSA auxiliary coordinatsystem origin
+ pos_tr2 = [sind(pln.propStf.couchAngles-90)*(stf.SAD+dummyDistConverter), 0, cosd(pln.propStf.couchAngles-90)*(stf.SAD+dummyDistConverter)];
+ pos_tr2 = pos_tr2 + stf.isoCenter;
+ % Define rotation for RSSA positioning
+ mat_tr2 = [cosd(pln.propStf.couchAngles) cosd(180-(pln.propStf.couchAngles-90))...
+ cosd(180-(pln.propStf.couchAngles-90)) cosd(180-pln.propStf.couchAngles)];
+ end
+
+ varHelper.sourcePos_tr1 = [pos_tr1(1) pos_tr1(2) pos_tr1(3)]*varHelper.rescaleFactor;
+ varHelper.rotMatrix_tr1 = [mat_tr1(1) 0 mat_tr1(2); 0 1 0; mat_tr1(3) 0 mat_tr1(4)];
+
+ varHelper.sourcePos_tr2 = [pos_tr2(1) pos_tr2(2) pos_tr2(3)]*varHelper.rescaleFactor;
+ varHelper.rotMatrix_tr2 = [mat_tr2(1) 0 mat_tr2(2); 0 -1 0; mat_tr2(3) 0 mat_tr2(4)];
+
+ pos_tr1 = pos_tr1*varHelper.rescaleFactor;
+ pos_tr2 = pos_tr2*varHelper.rescaleFactor;
+ % Write TR card for RSSA surface positioning
+ fprintf(fileID_C, coordTrafo.TRcard_1, ...
+ pos_tr1(1), pos_tr1(2), pos_tr1(3),...
+ mat_tr1(1), mat_tr1(2), mat_tr1(3), mat_tr1(4));
+ % Write TR card for RSAA source transformation
+ fprintf(fileID_C, coordTrafo.TRcard_2, ...
+ pos_tr2(1), pos_tr2(2), pos_tr2(3),...
+ mat_tr2(1), mat_tr2(2), mat_tr2(3), mat_tr2(4));
+
+ % Close blockC_source file
+ fclose(fileID_C);
+ else
+ error('No RSSA file exist for this bixel width/radiation field. Please generate one...')
+ end
+ end
+
+end
diff --git a/MCNP/matRad_makeTallyMCNP.m b/MCNP/matRad_makeTallyMCNP.m
new file mode 100644
index 000000000..ce86340c6
--- /dev/null
+++ b/MCNP/matRad_makeTallyMCNP.m
@@ -0,0 +1,47 @@
+function matRad_makeTallyMCNP(this, ct, fileID_C_rest, binIntervals)
+% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% Description goes here.
+%
+% call
+% matRad_makeTallyMCNP()
+%
+% input
+% stf:
+%
+% output:
+%
+% References
+% [1] PELOWITZ, D. B., et al. MCNP6 User�s Manual. LACP-00634, May, 2013.
+%
+% Author: Lucas Sommer (Lucas.Sommer@tum.de), 11/2018
+%
+% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+disp('*****')
+disp('Tally type: TMESH3...')
+disp('*****')
+meshTally.typeCard = 'TMESH\n';
+meshTally.geometry = 'RMESH3 %s\n';
+meshTally.corA = 'CORA3 %.4f %dI %.4f\n';
+meshTally.corB = 'CORB3 %.4f %dI %.4f\n';
+meshTally.corC = 'CORC3 %.4f %dI %.4f\n';
+meshTally.tallyKeyword= 'TOTAL';
+
+%Write to text file
+fprintf(fileID_C_rest, 'C ***************************************************************\n');
+fprintf(fileID_C_rest, 'C C: Heating tally (one tally located in each voxel of the CT-data)\n');
+fprintf(fileID_C_rest, 'C ***************************************************************\n');
+fprintf(fileID_C_rest, meshTally.typeCard);
+fprintf(fileID_C_rest, meshTally.geometry, meshTally.tallyKeyword);
+%Keep in mind matRad LPS coordinate system convention
+fprintf(fileID_C_rest, meshTally.corA, .5*ct.doseGridCT.x_MCNP, (ct.doseGridCT.cubeDim(2)-1), ct.doseGridCT.cubeDim(2)*ct.doseGridCT.x_MCNP+.5*ct.doseGridCT.x_MCNP); % Caution: MATLAB indexing
+fprintf(fileID_C_rest, meshTally.corB, .5*ct.doseGridCT.y_MCNP, (ct.doseGridCT.cubeDim(1)-1), ct.doseGridCT.cubeDim(1)*ct.doseGridCT.y_MCNP+.5*ct.doseGridCT.y_MCNP);
+fprintf(fileID_C_rest, meshTally.corC, .5*ct.doseGridCT.z_MCNP, (ct.doseGridCT.cubeDim(3)-1), ct.doseGridCT.cubeDim(3)*ct.doseGridCT.z_MCNP+.5*ct.doseGridCT.z_MCNP);
+
+fprintf(fileID_C_rest, 'ENDMD\n');
+
+% Add tallies for RBE weighted dose here
+
+fprintf(fileID_C_rest, 'PRINT 110\n');
+fprintf(fileID_C_rest, ['PRDMP ',num2str(ceil(this.config.Num_Primaries)),' ',num2str(ceil(this.config.Num_Primaries)), ' 1 ', num2str(ceil(this.config.Num_Primaries)), '\n']); % Control optional MCTAL textfile and set # dumps in RUNTPE to 1
+
+end
\ No newline at end of file
diff --git a/MCNP/matRad_makeTallyMCNP4biolOptiRMF.m b/MCNP/matRad_makeTallyMCNP4biolOptiRMF.m
new file mode 100644
index 000000000..caae954b5
--- /dev/null
+++ b/MCNP/matRad_makeTallyMCNP4biolOptiRMF.m
@@ -0,0 +1,1138 @@
+function matRad_makeTallyMCNP4biolOptiRMF(ct, pln, fileID_C_rest, binIntervals)
+% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% Description goes here.
+%
+% call
+% matRad_makeTallyMCNP4biolOptiRMF(ct, pln, fileID_C_rest, binIntervals)
+%
+% input
+% ct, pln, fileID_C_rest, binIntervals
+% output:
+%
+% References
+% [1] PELOWITZ, D. B., et al. MCNP6 User�s Manual. LACP-00634, May, 2013.
+% [2] Stewart et al., Phys. Med. Biol.,2015
+%
+% Author: Lucas Sommer (Lucas.Sommer@tum.de), 11/2020
+%
+% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+%% Write/read parameters for repeated lattice tally
+pln.propMCNP.latticeTally.cellLocal = ['((',int2str(2:size(binIntervals,2)), ')<', ...
+ int2str(size(binIntervals,2)+1),'[0:', num2str(ct.cubeDim(2)-1), ' 0:', num2str(ct.cubeDim(1)-1), ' 0:', num2str(ct.cubeDim(3)-1), ']<',...
+ int2str(size(binIntervals,2)+2), ')'];
+pln.propMCNP.sdCardInfo = 1;
+
+%% A. Read RBE DSB values
+%% A.1 Identify source files
+% Read RBE values for aerobic environment
+fileNameRBEvalues.proton_aero = 'MCDS_protonRBE_DSB_aerobic*';
+fileNameRBEvalues.deuteron_aero = 'MCDS_deuteronRBE_DSB_aerobic*';
+fileNameRBEvalues.triton_aero = 'MCDS_tritonRBE_DSB_aerobic*';
+fileNameRBEvalues.he3_aero = 'MCDS_3HeRBE_DSB_aerobic*';
+fileNameRBEvalues.alpha_aero = 'MCDS_alphaRBE_DSB_aerobic*';
+fileNameRBEvalues.electron_aero = 'MCDS_electronRBE_DSB_aerobic*';
+fileNameRBEvalues.lithium_aero = 'MCDS_lithiumRBE_DSB_aerobic*';
+% Read intra track values for aerobic environment
+fileNameIntraTrackvalues.proton_aero = 'MCDS_protonIntraTrack_intraT_aerobic*';
+fileNameIntraTrackvalues.deuteron_aero = 'MCDS_deuteronIntraTrack_intraT_aerobic*';
+fileNameIntraTrackvalues.triton_aero = 'MCDS_tritonIntraTrack_intraT_aerobic*';
+fileNameIntraTrackvalues.he3_aero = 'MCDS_3HeIntraTrack_intraT_aerobic*';
+fileNameIntraTrackvalues.alpha_aero = 'MCDS_alphaIntraTrack_intraT_aerobic*';
+fileNameIntraTrackvalues.electron_aero = 'MCDS_electronIntraTrack_intraT_aerobic*';
+fileNameIntraTrackvalues.lithium_aero = 'MCDS_lithiumIntraTrack_intraT_aerobic*';
+fileNameIntraTrackvalues.heavyIons_aero = 'MCDS_heavyIonsIntraTrack_intraT_aerobic*';
+
+% Read RBE values for anoxic envirnmoent
+fileNameRBEvalues.proton_anox = 'MCDS_protonRBE_DSB_anoxic*';
+fileNameRBEvalues.deuteron_anox = 'MCDS_deuteronRBE_DSB_anoxic*';
+fileNameRBEvalues.triton_anox = 'MCDS_tritonRBE_DSB_anoxic*';
+fileNameRBEvalues.he3_anox = 'MCDS_3HeRBE_DSB_anoxic*';
+fileNameRBEvalues.alpha_anox = 'MCDS_alphaRBE_DSB_anoxic*';
+fileNameRBEvalues.electron_anox = 'MCDS_electronRBE_DSB_anoxic*';
+fileNameRBEvalues.lithium_anox = 'MCDS_lithiumRBE_DSB_anoxic*';
+% Read intra track values for anoxic envirnmoent
+fileNameIntraTrackvalues.proton_anox = 'MCDS_protonIntraTrack_intraT_anoxic*';
+fileNameIntraTrackvalues.deuteron_anox = 'MCDS_deuteronIntraTrack_intraT_anoxic*';
+fileNameIntraTrackvalues.triton_anox = 'MCDS_tritonIntraTrack_intraT_anoxic*';
+fileNameIntraTrackvalues.he3_anox = 'MCDS_3HeIntraTrack_intraT_anoxic*';
+fileNameIntraTrackvalues.alpha_anox = 'MCDS_alphaIntraTrack_intraT_anoxic*';
+fileNameIntraTrackvalues.electron_anox = 'MCDS_electronIntraTrack_intraT_anoxic*';
+fileNameIntraTrackvalues.lithium_anox = 'MCDS_lithiumIntraTrack_intraT_anoxic*';
+fileNameIntraTrackvalues.heavyIons_anox = 'MCDS_heavyIonsIntraTrack_intraT_anoxic*';
+
+%% A.2 RBE values aerobic envirnment
+% Read data from file: RBE factors for DSB in aerobic envirnmoent
+RBEValues.pathLocation = fullfile(matRad_getMATRADdirectory, 'MCNP', 'RBEfactors', filesep);
+% Proton
+RBEValues.RBEValuesList = dir([RBEValues.pathLocation, fileNameRBEvalues.proton_aero]);
+fid_RBEVal = fopen([RBEValues.RBEValuesList.folder, filesep, RBEValues.RBEValuesList.name], 'r');
+RBEValue = fscanf(fid_RBEVal, '%f', [2,inf]);
+proton.RBEValue_aero = RBEValue';
+fclose(fid_RBEVal);
+RBEValues = rmfield(RBEValues, 'RBEValuesList');
+% Deuteron
+RBEValues.RBEValuesList = dir([RBEValues.pathLocation, fileNameRBEvalues.deuteron_aero]);
+fid_RBEVal = fopen([RBEValues.RBEValuesList.folder, filesep, RBEValues.RBEValuesList.name], 'r');
+RBEValue = fscanf(fid_RBEVal, '%f', [2,inf]);
+deuteron.RBEValue_aero = RBEValue';
+fclose(fid_RBEVal);
+% Triton
+RBEValues.RBEValuesList = dir([RBEValues.pathLocation, fileNameRBEvalues.triton_aero]);
+fid_RBEVal = fopen([RBEValues.RBEValuesList.folder, filesep, RBEValues.RBEValuesList.name], 'r');
+RBEValue = fscanf(fid_RBEVal, '%f', [2,inf]);
+triton.RBEValue_aero = RBEValue';
+fclose(fid_RBEVal);
+% He3
+RBEValues.RBEValuesList = dir([RBEValues.pathLocation, fileNameRBEvalues.he3_aero]);
+fid_RBEVal = fopen([RBEValues.RBEValuesList.folder, filesep, RBEValues.RBEValuesList.name], 'r');
+RBEValue = fscanf(fid_RBEVal, '%f', [2,inf]);
+he3.RBEValue_aero = RBEValue';
+fclose(fid_RBEVal);
+% Alpha
+RBEValues.RBEValuesList = dir([RBEValues.pathLocation, fileNameRBEvalues.alpha_aero]);
+fid_RBEVal = fopen([RBEValues.RBEValuesList.folder, filesep, RBEValues.RBEValuesList.name], 'r');
+RBEValue = fscanf(fid_RBEVal, '%f', [2,inf]);
+alpha.RBEValue_aero = RBEValue';
+fclose(fid_RBEVal);
+% Electron
+RBEValues.RBEValuesList = dir([RBEValues.pathLocation, fileNameRBEvalues.electron_aero]);
+fid_RBEVal = fopen([RBEValues.RBEValuesList.folder, filesep, RBEValues.RBEValuesList.name], 'r');
+RBEValue = fscanf(fid_RBEVal, '%f', [2,inf]);
+electron.RBEValue_aero = RBEValue';
+fclose(fid_RBEVal);
+% Lithium
+RBEValues.RBEValuesList = dir([RBEValues.pathLocation, fileNameRBEvalues.lithium_aero]);
+fid_RBEVal = fopen([RBEValues.RBEValuesList.folder, filesep, RBEValues.RBEValuesList.name], 'r');
+RBEValue = fscanf(fid_RBEVal, '%f', [2,inf]);
+lithium.RBEValue_aero = RBEValue';
+fclose(fid_RBEVal);
+
+% Read data from file: Intra track term for RMF in aerobic envirnmoent
+intraTrackValues.pathLocation = fullfile(matRad_getMATRADdirectory, 'MCNP', 'RBEfactors', filesep);
+% Proton
+intraTrackValues.intraTrackValuesList = dir([intraTrackValues.pathLocation, fileNameIntraTrackvalues.proton_aero]);
+fid_intraTrackVal = fopen([intraTrackValues.intraTrackValuesList.folder, filesep, intraTrackValues.intraTrackValuesList.name], 'r');
+intraTrackValue = fscanf(fid_intraTrackVal, '%f', [2,inf]);
+proton.intraTrackValue_aero = intraTrackValue';
+fclose(fid_intraTrackVal);
+intraTrackValues = rmfield(intraTrackValues, 'intraTrackValuesList');
+% Deuteron
+intraTrackValues.intraTrackValuesList = dir([intraTrackValues.pathLocation, fileNameIntraTrackvalues.deuteron_aero]);
+fid_intraTrackVal = fopen([intraTrackValues.intraTrackValuesList.folder, filesep, intraTrackValues.intraTrackValuesList.name], 'r');
+intraTrackValue = fscanf(fid_intraTrackVal, '%f', [2,inf]);
+deuteron.intraTrackValue_aero = intraTrackValue';
+fclose(fid_intraTrackVal);
+% Triton
+intraTrackValues.intraTrackValuesList = dir([intraTrackValues.pathLocation, fileNameIntraTrackvalues.triton_aero]);
+fid_intraTrackVal = fopen([intraTrackValues.intraTrackValuesList.folder, filesep, intraTrackValues.intraTrackValuesList.name], 'r');
+intraTrackValue = fscanf(fid_intraTrackVal, '%f', [2,inf]);
+triton.intraTrackValue_aero = intraTrackValue';
+fclose(fid_intraTrackVal);
+% He3
+intraTrackValues.intraTrackValuesList = dir([intraTrackValues.pathLocation, fileNameIntraTrackvalues.he3_aero]);
+fid_intraTrackVal = fopen([intraTrackValues.intraTrackValuesList.folder, filesep, intraTrackValues.intraTrackValuesList.name], 'r');
+intraTrackValue = fscanf(fid_intraTrackVal, '%f', [2,inf]);
+he3.intraTrackValue_aero = intraTrackValue';
+fclose(fid_intraTrackVal);
+% Alpha
+intraTrackValues.intraTrackValuesList = dir([intraTrackValues.pathLocation, fileNameIntraTrackvalues.alpha_aero]);
+fid_intraTrackVal = fopen([intraTrackValues.intraTrackValuesList.folder, filesep, intraTrackValues.intraTrackValuesList.name], 'r');
+intraTrackValue = fscanf(fid_intraTrackVal, '%f', [2,inf]);
+alpha.intraTrackValue_aero = intraTrackValue';
+fclose(fid_intraTrackVal);
+% Electron
+intraTrackValues.intraTrackValuesList = dir([intraTrackValues.pathLocation, fileNameIntraTrackvalues.electron_aero]);
+fid_intraTrackVal = fopen([intraTrackValues.intraTrackValuesList.folder, filesep, intraTrackValues.intraTrackValuesList.name], 'r');
+intraTrackValue = fscanf(fid_intraTrackVal, '%f', [2,inf]);
+electron.intraTrackValue_aero = intraTrackValue';
+fclose(fid_intraTrackVal);
+% Lithium
+intraTrackValues.intraTrackValuesList = dir([intraTrackValues.pathLocation, fileNameIntraTrackvalues.lithium_aero]);
+fid_intraTrackVal = fopen([intraTrackValues.intraTrackValuesList.folder, filesep, intraTrackValues.intraTrackValuesList.name], 'r');
+intraTrackValue = fscanf(fid_intraTrackVal, '%f', [2,inf]);
+lithium.intraTrackValue_aero = intraTrackValue';
+fclose(fid_intraTrackVal);
+% Heavy ion
+intraTrackValues.intraTrackValuesList = dir([intraTrackValues.pathLocation, fileNameIntraTrackvalues.heavyIons_aero]);
+fid_intraTrackVal = fopen([intraTrackValues.intraTrackValuesList.folder, filesep, intraTrackValues.intraTrackValuesList.name], 'r');
+intraTrackValue = fscanf(fid_intraTrackVal, '%f', [2,inf]);
+heavyIons.intraTrackValue_aero = intraTrackValue';
+fclose(fid_intraTrackVal);
+
+%% A.3 RBE values anoxic envirnment
+% Read data from file: RBE factors for DSB in anoxic envirnmoent
+RBEValues.pathLocation = fullfile(matRad_getMATRADdirectory, 'MCNP', 'RBEfactors', filesep);
+% Proton
+RBEValues.RBEValuesList = dir([RBEValues.pathLocation, fileNameRBEvalues.proton_anox]);
+fid_RBEVal = fopen([RBEValues.RBEValuesList.folder, filesep, RBEValues.RBEValuesList.name], 'r');
+RBEValue = fscanf(fid_RBEVal, '%f', [2,inf]);
+proton.RBEValue_anox = RBEValue';
+fclose(fid_RBEVal);
+RBEValues = rmfield(RBEValues, 'RBEValuesList');
+% Deuteron
+RBEValues.RBEValuesList = dir([RBEValues.pathLocation, fileNameRBEvalues.deuteron_anox]);
+fid_RBEVal = fopen([RBEValues.RBEValuesList.folder, filesep, RBEValues.RBEValuesList.name], 'r');
+RBEValue = fscanf(fid_RBEVal, '%f', [2,inf]);
+deuteron.RBEValue_anox = RBEValue';
+fclose(fid_RBEVal);
+% Triton
+RBEValues.RBEValuesList = dir([RBEValues.pathLocation, fileNameRBEvalues.triton_anox]);
+fid_RBEVal = fopen([RBEValues.RBEValuesList.folder, filesep, RBEValues.RBEValuesList.name], 'r');
+RBEValue = fscanf(fid_RBEVal, '%f', [2,inf]);
+triton.RBEValue_anox = RBEValue';
+fclose(fid_RBEVal);
+% He3
+RBEValues.RBEValuesList = dir([RBEValues.pathLocation, fileNameRBEvalues.he3_anox]);
+fid_RBEVal = fopen([RBEValues.RBEValuesList.folder, filesep, RBEValues.RBEValuesList.name], 'r');
+RBEValue = fscanf(fid_RBEVal, '%f', [2,inf]);
+he3.RBEValue_anox = RBEValue';
+fclose(fid_RBEVal);
+% Alpha
+RBEValues.RBEValuesList = dir([RBEValues.pathLocation, fileNameRBEvalues.alpha_anox]);
+fid_RBEVal = fopen([RBEValues.RBEValuesList.folder, filesep, RBEValues.RBEValuesList.name], 'r');
+RBEValue = fscanf(fid_RBEVal, '%f', [2,inf]);
+alpha.RBEValue_anox = RBEValue';
+fclose(fid_RBEVal);
+% Electron
+RBEValues.RBEValuesList = dir([RBEValues.pathLocation, fileNameRBEvalues.electron_anox]);
+fid_RBEVal = fopen([RBEValues.RBEValuesList.folder, filesep, RBEValues.RBEValuesList.name], 'r');
+RBEValue = fscanf(fid_RBEVal, '%f', [2,inf]);
+electron.RBEValue_anox = RBEValue';
+fclose(fid_RBEVal);
+% Lithium
+RBEValues.RBEValuesList = dir([RBEValues.pathLocation, fileNameRBEvalues.lithium_anox]);
+fid_RBEVal = fopen([RBEValues.RBEValuesList.folder, filesep, RBEValues.RBEValuesList.name], 'r');
+RBEValue = fscanf(fid_RBEVal, '%f', [2,inf]);
+lithium.RBEValue_anox = RBEValue';
+fclose(fid_RBEVal);
+
+% Read data from file: Intra track term for RMF in anoxic envirnmoent
+intraTrackValues.pathLocation = fullfile(matRad_getMATRADdirectory, 'MCNP', 'RBEfactors', filesep);
+% Proton
+intraTrackValues.intraTrackValuesList = dir([intraTrackValues.pathLocation, fileNameIntraTrackvalues.proton_anox]);
+fid_intraTrackVal = fopen([intraTrackValues.intraTrackValuesList.folder, filesep, intraTrackValues.intraTrackValuesList.name], 'r');
+intraTrackValue = fscanf(fid_intraTrackVal, '%f', [2,inf]);
+proton.intraTrackValue_anox = intraTrackValue';
+fclose(fid_intraTrackVal);
+intraTrackValues = rmfield(intraTrackValues, 'intraTrackValuesList');
+% Deuteron
+intraTrackValues.intraTrackValuesList = dir([intraTrackValues.pathLocation, fileNameIntraTrackvalues.deuteron_anox]);
+fid_intraTrackVal = fopen([intraTrackValues.intraTrackValuesList.folder, filesep, intraTrackValues.intraTrackValuesList.name], 'r');
+intraTrackValue = fscanf(fid_intraTrackVal, '%f', [2,inf]);
+deuteron.intraTrackValue_anox = intraTrackValue';
+fclose(fid_intraTrackVal);
+% Triton
+intraTrackValues.intraTrackValuesList = dir([intraTrackValues.pathLocation, fileNameIntraTrackvalues.triton_anox]);
+fid_intraTrackVal = fopen([intraTrackValues.intraTrackValuesList.folder, filesep, intraTrackValues.intraTrackValuesList.name], 'r');
+intraTrackValue = fscanf(fid_intraTrackVal, '%f', [2,inf]);
+triton.intraTrackValue_anox = intraTrackValue';
+fclose(fid_intraTrackVal);
+% He3
+intraTrackValues.intraTrackValuesList = dir([intraTrackValues.pathLocation, fileNameIntraTrackvalues.he3_anox]);
+fid_intraTrackVal = fopen([intraTrackValues.intraTrackValuesList.folder, filesep, intraTrackValues.intraTrackValuesList.name], 'r');
+intraTrackValue = fscanf(fid_intraTrackVal, '%f', [2,inf]);
+he3.intraTrackValue_anox = intraTrackValue';
+fclose(fid_intraTrackVal);
+% Alpha
+intraTrackValues.intraTrackValuesList = dir([intraTrackValues.pathLocation, fileNameIntraTrackvalues.alpha_anox]);
+fid_intraTrackVal = fopen([intraTrackValues.intraTrackValuesList.folder, filesep, intraTrackValues.intraTrackValuesList.name], 'r');
+intraTrackValue = fscanf(fid_intraTrackVal, '%f', [2,inf]);
+alpha.intraTrackValue_anox = intraTrackValue';
+fclose(fid_intraTrackVal);
+% Electron
+intraTrackValues.intraTrackValuesList = dir([intraTrackValues.pathLocation, fileNameIntraTrackvalues.electron_anox]);
+fid_intraTrackVal = fopen([intraTrackValues.intraTrackValuesList.folder, filesep, intraTrackValues.intraTrackValuesList.name], 'r');
+intraTrackValue = fscanf(fid_intraTrackVal, '%f', [2,inf]);
+electron.intraTrackValue_anox = intraTrackValue';
+fclose(fid_intraTrackVal);
+% Lithium
+intraTrackValues.intraTrackValuesList = dir([intraTrackValues.pathLocation, fileNameIntraTrackvalues.lithium_anox]);
+fid_intraTrackVal = fopen([intraTrackValues.intraTrackValuesList.folder, filesep, intraTrackValues.intraTrackValuesList.name], 'r');
+intraTrackValue = fscanf(fid_intraTrackVal, '%f', [2,inf]);
+lithium.intraTrackValue_anox = intraTrackValue';
+fclose(fid_intraTrackVal);
+% Heavy ion
+intraTrackValues.intraTrackValuesList = dir([intraTrackValues.pathLocation, fileNameIntraTrackvalues.heavyIons_anox]);
+fid_intraTrackVal = fopen([intraTrackValues.intraTrackValuesList.folder, filesep, intraTrackValues.intraTrackValuesList.name], 'r');
+intraTrackValue = fscanf(fid_intraTrackVal, '%f', [2,inf]);
+heavyIons.intraTrackValue_anox = intraTrackValue';
+fclose(fid_intraTrackVal);
+
+%% B. Set up tallies: Dose and RBE calculation
+%% B.1 Proton dose and RBE calculation
+% Dose
+disp('*****')
+disp('Tally type: Lattice tally for proton dose calculation...')
+disp('*****')
+latticeTally.geometry = ['F1016:h ', pln.propMCNP.latticeTally.cellLocal, '\n'];
+latticeTally.cellVolumeCard = ['SD1016 ', num2str(pln.propMCNP.sdCardInfo), ' ', num2str(pln.numOfVoxels-1), 'R\n'];
+
+%Write to text file
+fprintf(fileID_C_rest, 'C ***************************************************************\n');
+fprintf(fileID_C_rest, 'C C: Proton dose (one tally located in each voxel of the CT-data)\n');
+fprintf(fileID_C_rest, 'C ***************************************************************\n');
+fprintf(fileID_C_rest, latticeTally.geometry);
+fprintf(fileID_C_rest, latticeTally.cellVolumeCard);
+
+% RBExDose for aerobic environment
+disp('*****')
+disp('Tally type: Lattice tally for biological optimization (RBE*protonDose for aerobic environment)...')
+disp('*****')
+latticeTally.geometry = ['F1026:h ', pln.propMCNP.latticeTally.cellLocal, '\n'];
+latticeTally.cellVolumeCard = ['SD1026 ', num2str(pln.propMCNP.sdCardInfo), ' ', num2str(pln.numOfVoxels-1), 'R\n'];
+
+%Write to text file
+fprintf(fileID_C_rest, 'C ***************************************************************\n');
+fprintf(fileID_C_rest, 'C C: RBExDose(proton) for aerobic environment (one tally located in each voxel of the CT-data)\n');
+fprintf(fileID_C_rest, 'C ***************************************************************\n');
+fprintf(fileID_C_rest, latticeTally.geometry);
+fprintf(fileID_C_rest, latticeTally.cellVolumeCard);
+
+% Write proton DE/DF cards
+fprintf(fileID_C_rest, 'DE1026\n');
+for counterRBEvalues = 1:size(proton.RBEValue_aero,1)
+ fprintf(fileID_C_rest, [' ', num2str(proton.RBEValue_aero(counterRBEvalues,1)), '\n']);
+end
+fprintf(fileID_C_rest, 'DF1026\n');
+for counterRBEvalues = 1:size(proton.RBEValue_aero,1)
+ fprintf(fileID_C_rest, [' ', num2str(proton.RBEValue_aero(counterRBEvalues,2)), '\n']);
+end
+
+% Intra Track Term RMF model
+disp('*****')
+disp('Tally type: Lattice tally for biological optimization (intra track term for aerobic environment)...')
+disp('*****')
+latticeTally.geometry = ['F1036:h ', pln.propMCNP.latticeTally.cellLocal, '\n'];
+latticeTally.cellVolumeCard = ['SD1036 ', num2str(pln.propMCNP.sdCardInfo), ' ', num2str(pln.numOfVoxels-1), 'R\n'];
+
+%Write to text file
+fprintf(fileID_C_rest, 'C ***************************************************************\n');
+fprintf(fileID_C_rest, 'C C: Intra Track Term(proton) for aerobic environment (one tally located in each voxel of the CT-data)\n');
+fprintf(fileID_C_rest, 'C ***************************************************************\n');
+fprintf(fileID_C_rest, latticeTally.geometry);
+fprintf(fileID_C_rest, latticeTally.cellVolumeCard);
+
+% Write proton DE/DF cards
+fprintf(fileID_C_rest, 'DE1036\n');
+for counterIntraTrackValues = 1:size(proton.intraTrackValue_aero,1)
+ fprintf(fileID_C_rest, [' ', num2str(proton.intraTrackValue_aero(counterIntraTrackValues,1)), '\n']);
+end
+fprintf(fileID_C_rest, 'DF1036\n');
+for counterIntraTrackValues = 1:size(proton.intraTrackValue_aero,1)
+ fprintf(fileID_C_rest, [' ', num2str(proton.intraTrackValue_aero(counterIntraTrackValues,2)), '\n']);
+end
+
+% RBExDose for anoxic environment
+disp('*****')
+disp('Tally type: Lattice tally for biological optimization (RBE*protonDose for anoxic environment)...')
+disp('*****')
+latticeTally.geometry = ['F1046:h ', pln.propMCNP.latticeTally.cellLocal, '\n'];
+latticeTally.cellVolumeCard = ['SD1046 ', num2str(pln.propMCNP.sdCardInfo), ' ', num2str(pln.numOfVoxels-1), 'R\n'];
+
+%Write to text file
+fprintf(fileID_C_rest, 'C ***************************************************************\n');
+fprintf(fileID_C_rest, 'C C: RBExDose(proton) for anoxic environment (one tally located in each voxel of the CT-data)\n');
+fprintf(fileID_C_rest, 'C ***************************************************************\n');
+fprintf(fileID_C_rest, latticeTally.geometry);
+fprintf(fileID_C_rest, latticeTally.cellVolumeCard);
+
+% Write proton DE/DF cards
+fprintf(fileID_C_rest, 'DE1046\n');
+for counterRBEvalues = 1:size(proton.RBEValue_anox,1)
+ fprintf(fileID_C_rest, [' ', num2str(proton.RBEValue_anox(counterRBEvalues,1)), '\n']);
+end
+fprintf(fileID_C_rest, 'DF1046\n');
+for counterRBEvalues = 1:size(proton.RBEValue_anox,1)
+ fprintf(fileID_C_rest, [' ', num2str(proton.RBEValue_anox(counterRBEvalues,2)), '\n']);
+end
+
+% Intra Track Term RMF model
+disp('*****')
+disp('Tally type: Lattice tally for biological optimization (intra track term for anoxic environment)...')
+disp('*****')
+latticeTally.geometry = ['F1056:h ', pln.propMCNP.latticeTally.cellLocal, '\n'];
+latticeTally.cellVolumeCard = ['SD1056 ', num2str(pln.propMCNP.sdCardInfo), ' ', num2str(pln.numOfVoxels-1), 'R\n'];
+
+%Write to text file
+fprintf(fileID_C_rest, 'C ***************************************************************\n');
+fprintf(fileID_C_rest, 'C C: Intra Track Term(proton) for anoxic environment (one tally located in each voxel of the CT-data)\n');
+fprintf(fileID_C_rest, 'C ***************************************************************\n');
+fprintf(fileID_C_rest, latticeTally.geometry);
+fprintf(fileID_C_rest, latticeTally.cellVolumeCard);
+
+% Write proton DE/DF cards
+fprintf(fileID_C_rest, 'DE1056\n');
+for counterIntraTrackValues = 1:size(proton.intraTrackValue_anox,1)
+ fprintf(fileID_C_rest, [' ', num2str(proton.intraTrackValue_anox(counterIntraTrackValues,1)), '\n']);
+end
+fprintf(fileID_C_rest, 'DF1056\n');
+for counterIntraTrackValues = 1:size(proton.intraTrackValue_anox,1)
+ fprintf(fileID_C_rest, [' ', num2str(proton.intraTrackValue_anox(counterIntraTrackValues,2)), '\n']);
+end
+
+%% B.2 Deuteron dose and RBE calculation
+% Dose
+disp('*****')
+disp('Tally type: Lattice tally for deuteron dose calculation...')
+disp('*****')
+latticeTally.geometry = ['F2016:d ', pln.propMCNP.latticeTally.cellLocal, '\n'];
+latticeTally.cellVolumeCard = ['SD2016 ', num2str(pln.propMCNP.sdCardInfo), ' ', num2str(pln.numOfVoxels-1), 'R\n'];
+
+%Write to text file
+fprintf(fileID_C_rest, 'C ***************************************************************\n');
+fprintf(fileID_C_rest, 'C C: Deuteron dose (one tally located in each voxel of the CT-data)\n');
+fprintf(fileID_C_rest, 'C ***************************************************************\n');
+fprintf(fileID_C_rest, latticeTally.geometry);
+fprintf(fileID_C_rest, latticeTally.cellVolumeCard);
+
+% RBExDose for aerobic environment
+disp('*****')
+disp('Tally type: Lattice tally for biological optimization for aerobic environment (RBE*deuteronDose)...')
+disp('*****')
+latticeTally.geometry = ['F2026:d ', pln.propMCNP.latticeTally.cellLocal, '\n'];
+latticeTally.cellVolumeCard = ['SD2026 ', num2str(pln.propMCNP.sdCardInfo), ' ', num2str(pln.numOfVoxels-1), 'R\n'];
+
+%Write to text file
+fprintf(fileID_C_rest, 'C ***************************************************************\n');
+fprintf(fileID_C_rest, 'C C: RBExDose(deuteron) for aerobic environment (one tally located in each voxel of the CT-data)\n');
+fprintf(fileID_C_rest, 'C ***************************************************************\n');
+fprintf(fileID_C_rest, latticeTally.geometry);
+fprintf(fileID_C_rest, latticeTally.cellVolumeCard);
+
+% Write proton DE/DF cards
+fprintf(fileID_C_rest, 'DE2026\n');
+for counterRBEvalues = 1:size(deuteron.RBEValue_aero,1)
+ fprintf(fileID_C_rest, [' ', num2str(deuteron.RBEValue_aero(counterRBEvalues,1)), '\n']);
+end
+fprintf(fileID_C_rest, 'DF2026\n');
+for counterRBEvalues = 1:size(deuteron.RBEValue_aero,1)
+ fprintf(fileID_C_rest, [' ', num2str(deuteron.RBEValue_aero(counterRBEvalues,2)), '\n']);
+end
+
+% Intra Track Term RMF model
+disp('*****')
+disp('Tally type: Lattice tally for biological optimization for aerobic environment (intra track term)...')
+disp('*****')
+latticeTally.geometry = ['F2036:d ', pln.propMCNP.latticeTally.cellLocal, '\n'];
+latticeTally.cellVolumeCard = ['SD2036 ', num2str(pln.propMCNP.sdCardInfo), ' ', num2str(pln.numOfVoxels-1), 'R\n'];
+
+%Write to text file
+fprintf(fileID_C_rest, 'C ***************************************************************\n');
+fprintf(fileID_C_rest, 'C C: Intra Track Term(deuteron) for aerobic environment (one tally located in each voxel of the CT-data)\n');
+fprintf(fileID_C_rest, 'C ***************************************************************\n');
+fprintf(fileID_C_rest, latticeTally.geometry);
+fprintf(fileID_C_rest, latticeTally.cellVolumeCard);
+
+% Write proton DE/DF cards
+fprintf(fileID_C_rest, 'DE2036\n');
+for counterIntraTrackValues = 1:size(deuteron.intraTrackValue_aero,1)
+ fprintf(fileID_C_rest, [' ', num2str(deuteron.intraTrackValue_aero(counterIntraTrackValues,1)), '\n']);
+end
+fprintf(fileID_C_rest, 'DF2036\n');
+for counterIntraTrackValues = 1:size(deuteron.intraTrackValue_aero,1)
+ fprintf(fileID_C_rest, [' ', num2str(deuteron.intraTrackValue_aero(counterIntraTrackValues,2)), '\n']);
+end
+
+% RBExDose for anoxic environment
+disp('*****')
+disp('Tally type: Lattice tally for biological optimization for anoxic environment (RBE*deuteronDose)...')
+disp('*****')
+latticeTally.geometry = ['F2046:d ', pln.propMCNP.latticeTally.cellLocal, '\n'];
+latticeTally.cellVolumeCard = ['SD2046 ', num2str(pln.propMCNP.sdCardInfo), ' ', num2str(pln.numOfVoxels-1), 'R\n'];
+
+%Write to text file
+fprintf(fileID_C_rest, 'C ***************************************************************\n');
+fprintf(fileID_C_rest, 'C C: RBExDose(deuteron) for anoxic environment (one tally located in each voxel of the CT-data)\n');
+fprintf(fileID_C_rest, 'C ***************************************************************\n');
+fprintf(fileID_C_rest, latticeTally.geometry);
+fprintf(fileID_C_rest, latticeTally.cellVolumeCard);
+
+% Write proton DE/DF cards
+fprintf(fileID_C_rest, 'DE2046\n');
+for counterRBEvalues = 1:size(deuteron.RBEValue_anox,1)
+ fprintf(fileID_C_rest, [' ', num2str(deuteron.RBEValue_anox(counterRBEvalues,1)), '\n']);
+end
+fprintf(fileID_C_rest, 'DF2046\n');
+for counterRBEvalues = 1:size(deuteron.RBEValue_anox,1)
+ fprintf(fileID_C_rest, [' ', num2str(deuteron.RBEValue_anox(counterRBEvalues,2)), '\n']);
+end
+
+% Intra Track Term RMF model
+disp('*****')
+disp('Tally type: Lattice tally for biological optimization for anoxic environment (intra track term)...')
+disp('*****')
+latticeTally.geometry = ['F2056:d ', pln.propMCNP.latticeTally.cellLocal, '\n'];
+latticeTally.cellVolumeCard = ['SD2056 ', num2str(pln.propMCNP.sdCardInfo), ' ', num2str(pln.numOfVoxels-1), 'R\n'];
+
+%Write to text file
+fprintf(fileID_C_rest, 'C ***************************************************************\n');
+fprintf(fileID_C_rest, 'C C: Intra Track Term(deuteron) for anoxic environment (one tally located in each voxel of the CT-data)\n');
+fprintf(fileID_C_rest, 'C ***************************************************************\n');
+fprintf(fileID_C_rest, latticeTally.geometry);
+fprintf(fileID_C_rest, latticeTally.cellVolumeCard);
+
+% Write proton DE/DF cards
+fprintf(fileID_C_rest, 'DE2056\n');
+for counterIntraTrackValues = 1:size(deuteron.intraTrackValue_anox,1)
+ fprintf(fileID_C_rest, [' ', num2str(deuteron.intraTrackValue_anox(counterIntraTrackValues,1)), '\n']);
+end
+fprintf(fileID_C_rest, 'DF2056\n');
+for counterIntraTrackValues = 1:size(deuteron.intraTrackValue_anox,1)
+ fprintf(fileID_C_rest, [' ', num2str(deuteron.intraTrackValue_anox(counterIntraTrackValues,2)), '\n']);
+end
+
+%% B.3 Triton dose and RBE calculation
+% Dose
+disp('*****')
+disp('Tally type: Lattice tally for triton dose calculation...')
+disp('*****')
+latticeTally.geometry = ['F3016:t ', pln.propMCNP.latticeTally.cellLocal, '\n'];
+latticeTally.cellVolumeCard = ['SD3016 ', num2str(pln.propMCNP.sdCardInfo), ' ', num2str(pln.numOfVoxels-1), 'R\n'];
+
+%Write to text file
+fprintf(fileID_C_rest, 'C ***************************************************************\n');
+fprintf(fileID_C_rest, 'C C: Triton dose (one tally located in each voxel of the CT-data)\n');
+fprintf(fileID_C_rest, 'C ***************************************************************\n');
+fprintf(fileID_C_rest, latticeTally.geometry);
+fprintf(fileID_C_rest, latticeTally.cellVolumeCard);
+
+% RBExDose for aerobic environment
+disp('*****')
+disp('Tally type: Lattice tally for biological optimization for aerobic environment (RBE*tritonDose)...')
+disp('*****')
+latticeTally.geometry = ['F3026:t ', pln.propMCNP.latticeTally.cellLocal, '\n'];
+latticeTally.cellVolumeCard = ['SD3026 ', num2str(pln.propMCNP.sdCardInfo), ' ', num2str(pln.numOfVoxels-1), 'R\n'];
+
+%Write to text file
+fprintf(fileID_C_rest, 'C ***************************************************************\n');
+fprintf(fileID_C_rest, 'C C: RBExDose(triton) for aerobic environment (one tally located in each voxel of the CT-data)\n');
+fprintf(fileID_C_rest, 'C ***************************************************************\n');
+fprintf(fileID_C_rest, latticeTally.geometry);
+fprintf(fileID_C_rest, latticeTally.cellVolumeCard);
+
+% Write proton DE/DF cards
+fprintf(fileID_C_rest, 'DE3026\n');
+for counterRBEvalues = 1:size(triton.RBEValue_aero,1)
+ fprintf(fileID_C_rest, [' ', num2str(triton.RBEValue_aero(counterRBEvalues,1)), '\n']);
+end
+fprintf(fileID_C_rest, 'DF3026\n');
+for counterRBEvalues = 1:size(triton.RBEValue_aero,1)
+ fprintf(fileID_C_rest, [' ', num2str(triton.RBEValue_aero(counterRBEvalues,2)), '\n']);
+end
+
+% Intra Track Term RMF model for aerobic environment
+disp('*****')
+disp('Tally type: Lattice tally for biological optimization for aerobic environment (intra track term)...')
+disp('*****')
+latticeTally.geometry = ['F3036:t ', pln.propMCNP.latticeTally.cellLocal, '\n'];
+latticeTally.cellVolumeCard = ['SD3036 ', num2str(pln.propMCNP.sdCardInfo), ' ', num2str(pln.numOfVoxels-1), 'R\n'];
+
+%Write to text file
+fprintf(fileID_C_rest, 'C ***************************************************************\n');
+fprintf(fileID_C_rest, 'C C: Intra Track Term(triton) for aerobic environment (one tally located in each voxel of the CT-data)\n');
+fprintf(fileID_C_rest, 'C ***************************************************************\n');
+fprintf(fileID_C_rest, latticeTally.geometry);
+fprintf(fileID_C_rest, latticeTally.cellVolumeCard);
+
+% Write triton DE/DF cards
+fprintf(fileID_C_rest, 'DE3036\n');
+for counterIntraTrackValues = 1:size(triton.intraTrackValue_aero,1)
+ fprintf(fileID_C_rest, [' ', num2str(triton.intraTrackValue_aero(counterIntraTrackValues,1)), '\n']);
+end
+fprintf(fileID_C_rest, 'DF3036\n');
+for counterIntraTrackValues = 1:size(triton.intraTrackValue_aero,1)
+ fprintf(fileID_C_rest, [' ', num2str(triton.intraTrackValue_aero(counterIntraTrackValues,2)), '\n']);
+end
+
+% RBExDose for anoxic environment
+disp('*****')
+disp('Tally type: Lattice tally for biological optimization for anoxic environment (RBE*tritonDose)...')
+disp('*****')
+latticeTally.geometry = ['F3046:t ', pln.propMCNP.latticeTally.cellLocal, '\n'];
+latticeTally.cellVolumeCard = ['SD3046 ', num2str(pln.propMCNP.sdCardInfo), ' ', num2str(pln.numOfVoxels-1), 'R\n'];
+
+%Write to text file
+fprintf(fileID_C_rest, 'C ***************************************************************\n');
+fprintf(fileID_C_rest, 'C C: RBExDose(triton) for anoxic environment (one tally located in each voxel of the CT-data)\n');
+fprintf(fileID_C_rest, 'C ***************************************************************\n');
+fprintf(fileID_C_rest, latticeTally.geometry);
+fprintf(fileID_C_rest, latticeTally.cellVolumeCard);
+
+% Write proton DE/DF cards
+fprintf(fileID_C_rest, 'DE3046\n');
+for counterRBEvalues = 1:size(triton.RBEValue_anox,1)
+ fprintf(fileID_C_rest, [' ', num2str(triton.RBEValue_anox(counterRBEvalues,1)), '\n']);
+end
+fprintf(fileID_C_rest, 'DF3046\n');
+for counterRBEvalues = 1:size(triton.RBEValue_anox,1)
+ fprintf(fileID_C_rest, [' ', num2str(triton.RBEValue_anox(counterRBEvalues,2)), '\n']);
+end
+
+% Intra Track Term RMF model for aerobic environment
+disp('*****')
+disp('Tally type: Lattice tally for biological optimization for anoxic environment (intra track term)...')
+disp('*****')
+latticeTally.geometry = ['F3056:t ', pln.propMCNP.latticeTally.cellLocal, '\n'];
+latticeTally.cellVolumeCard = ['SD3056 ', num2str(pln.propMCNP.sdCardInfo), ' ', num2str(pln.numOfVoxels-1), 'R\n'];
+
+%Write to text file
+fprintf(fileID_C_rest, 'C ***************************************************************\n');
+fprintf(fileID_C_rest, 'C C: Intra Track Term(triton) for anoxic environment (one tally located in each voxel of the CT-data)\n');
+fprintf(fileID_C_rest, 'C ***************************************************************\n');
+fprintf(fileID_C_rest, latticeTally.geometry);
+fprintf(fileID_C_rest, latticeTally.cellVolumeCard);
+
+% Write triton DE/DF cards
+fprintf(fileID_C_rest, 'DE3056\n');
+for counterIntraTrackValues = 1:size(triton.intraTrackValue_anox,1)
+ fprintf(fileID_C_rest, [' ', num2str(triton.intraTrackValue_anox(counterIntraTrackValues,1)), '\n']);
+end
+fprintf(fileID_C_rest, 'DF3056\n');
+for counterIntraTrackValues = 1:size(triton.intraTrackValue_anox,1)
+ fprintf(fileID_C_rest, [' ', num2str(triton.intraTrackValue_anox(counterIntraTrackValues,2)), '\n']);
+end
+
+%% B.4 He3 dose and RBE calculation
+% Dose
+disp('*****')
+disp('Tally type: Lattice tally for He3 dose calculation...')
+disp('*****')
+latticeTally.geometry = ['F4016:s ', pln.propMCNP.latticeTally.cellLocal, '\n'];
+latticeTally.cellVolumeCard = ['SD4016 ', num2str(pln.propMCNP.sdCardInfo), ' ', num2str(pln.numOfVoxels-1), 'R\n'];
+
+%Write to text file
+fprintf(fileID_C_rest, 'C ***************************************************************\n');
+fprintf(fileID_C_rest, 'C C: He3Dose dose (one tally located in each voxel of the CT-data)\n');
+fprintf(fileID_C_rest, 'C ***************************************************************\n');
+fprintf(fileID_C_rest, latticeTally.geometry);
+fprintf(fileID_C_rest, latticeTally.cellVolumeCard);
+
+% RBExDose for aerobic environment
+disp('*****')
+disp('Tally type: Lattice tally for biological optimization for aerobic environment (RBE*He3Dose)...')
+disp('*****')
+latticeTally.geometry = ['F4026:s ', pln.propMCNP.latticeTally.cellLocal, '\n'];
+latticeTally.cellVolumeCard = ['SD4026 ', num2str(pln.propMCNP.sdCardInfo), ' ', num2str(pln.numOfVoxels-1), 'R\n'];
+
+%Write to text file
+fprintf(fileID_C_rest, 'C ***************************************************************\n');
+fprintf(fileID_C_rest, 'C C: RBExDose(He3Dose) for aerobic environment (one tally located in each voxel of the CT-data)\n');
+fprintf(fileID_C_rest, 'C ***************************************************************\n');
+fprintf(fileID_C_rest, latticeTally.geometry);
+fprintf(fileID_C_rest, latticeTally.cellVolumeCard);
+
+% Write proton DE/DF cards
+fprintf(fileID_C_rest, 'DE4026\n');
+for counterRBEvalues = 1:size(he3.RBEValue_aero,1)
+ fprintf(fileID_C_rest, [' ', num2str(he3.RBEValue_aero(counterRBEvalues,1)), '\n']);
+end
+fprintf(fileID_C_rest, 'DF4026\n');
+for counterRBEvalues = 1:size(he3.RBEValue_aero,1)
+ fprintf(fileID_C_rest, [' ', num2str(he3.RBEValue_aero(counterRBEvalues,2)), '\n']);
+end
+
+% Intra Track Term RMF model for aerobic environment
+disp('*****')
+disp('Tally type: Lattice tally for biological optimization for aerobic environment (intra track term)...')
+disp('*****')
+latticeTally.geometry = ['F4036:s ', pln.propMCNP.latticeTally.cellLocal, '\n'];
+latticeTally.cellVolumeCard = ['SD4036 ', num2str(pln.propMCNP.sdCardInfo), ' ', num2str(pln.numOfVoxels-1), 'R\n'];
+
+%Write to text file
+fprintf(fileID_C_rest, 'C ***************************************************************\n');
+fprintf(fileID_C_rest, 'C C: Intra Track Term(he3) for aerobic environment (one tally located in each voxel of the CT-data)\n');
+fprintf(fileID_C_rest, 'C ***************************************************************\n');
+fprintf(fileID_C_rest, latticeTally.geometry);
+fprintf(fileID_C_rest, latticeTally.cellVolumeCard);
+
+% Write He3 DE/DF cards
+fprintf(fileID_C_rest, 'DE4036\n');
+for counterIntraTrackValues = 1:size(he3.intraTrackValue_aero,1)
+ fprintf(fileID_C_rest, [' ', num2str(he3.intraTrackValue_aero(counterIntraTrackValues,1)), '\n']);
+end
+fprintf(fileID_C_rest, 'DF4036\n');
+for counterIntraTrackValues = 1:size(he3.intraTrackValue_aero,1)
+ fprintf(fileID_C_rest, [' ', num2str(he3.intraTrackValue_aero(counterIntraTrackValues,2)), '\n']);
+end
+
+% RBExDose for anoxic environment
+disp('*****')
+disp('Tally type: Lattice tally for biological optimization for anoxic environment (RBE*He3Dose)...')
+disp('*****')
+latticeTally.geometry = ['F4046:s ', pln.propMCNP.latticeTally.cellLocal, '\n'];
+latticeTally.cellVolumeCard = ['SD4046 ', num2str(pln.propMCNP.sdCardInfo), ' ', num2str(pln.numOfVoxels-1), 'R\n'];
+
+%Write to text file
+fprintf(fileID_C_rest, 'C ***************************************************************\n');
+fprintf(fileID_C_rest, 'C C: RBExDose(He3Dose) for anoxic environment (one tally located in each voxel of the CT-data)\n');
+fprintf(fileID_C_rest, 'C ***************************************************************\n');
+fprintf(fileID_C_rest, latticeTally.geometry);
+fprintf(fileID_C_rest, latticeTally.cellVolumeCard);
+
+% Write proton DE/DF cards
+fprintf(fileID_C_rest, 'DE4046\n');
+for counterRBEvalues = 1:size(he3.RBEValue_anox,1)
+ fprintf(fileID_C_rest, [' ', num2str(he3.RBEValue_anox(counterRBEvalues,1)), '\n']);
+end
+fprintf(fileID_C_rest, 'DF4046\n');
+for counterRBEvalues = 1:size(he3.RBEValue_anox,1)
+ fprintf(fileID_C_rest, [' ', num2str(he3.RBEValue_anox(counterRBEvalues,2)), '\n']);
+end
+
+% Intra Track Term RMF model for aerobic environment
+disp('*****')
+disp('Tally type: Lattice tally for biological optimization for anoxic environment (intra track term)...')
+disp('*****')
+latticeTally.geometry = ['F4056:s ', pln.propMCNP.latticeTally.cellLocal, '\n'];
+latticeTally.cellVolumeCard = ['SD4056 ', num2str(pln.propMCNP.sdCardInfo), ' ', num2str(pln.numOfVoxels-1), 'R\n'];
+
+%Write to text file
+fprintf(fileID_C_rest, 'C ***************************************************************\n');
+fprintf(fileID_C_rest, 'C C: Intra Track Term(he3) for anoxic environment (one tally located in each voxel of the CT-data)\n');
+fprintf(fileID_C_rest, 'C ***************************************************************\n');
+fprintf(fileID_C_rest, latticeTally.geometry);
+fprintf(fileID_C_rest, latticeTally.cellVolumeCard);
+
+% Write He3 DE/DF cards
+fprintf(fileID_C_rest, 'DE4056\n');
+for counterIntraTrackValues = 1:size(he3.intraTrackValue_anox,1)
+ fprintf(fileID_C_rest, [' ', num2str(he3.intraTrackValue_anox(counterIntraTrackValues,1)), '\n']);
+end
+fprintf(fileID_C_rest, 'DF4056\n');
+for counterIntraTrackValues = 1:size(he3.intraTrackValue_anox,1)
+ fprintf(fileID_C_rest, [' ', num2str(he3.intraTrackValue_anox(counterIntraTrackValues,2)), '\n']);
+end
+
+%% B.5 Alpha dose and RBE calculation
+% Dose
+disp('*****')
+disp('Tally type: Lattice tally for alpha dose calculation...')
+disp('*****')
+latticeTally.geometry = ['F5016:a ', pln.propMCNP.latticeTally.cellLocal, '\n'];
+latticeTally.cellVolumeCard = ['SD5016 ', num2str(pln.propMCNP.sdCardInfo), ' ', num2str(pln.numOfVoxels-1), 'R\n'];
+
+%Write to text file
+fprintf(fileID_C_rest, 'C ***************************************************************\n');
+fprintf(fileID_C_rest, 'C C: Alpha dose (one tally located in each voxel of the CT-data)\n');
+fprintf(fileID_C_rest, 'C ***************************************************************\n');
+fprintf(fileID_C_rest, latticeTally.geometry);
+fprintf(fileID_C_rest, latticeTally.cellVolumeCard);
+
+% RBExDose for aerobic environment
+disp('*****')
+disp('Tally type: Lattice tally for biological optimization for aerobic environment (RBE*alphaDose)...')
+disp('*****')
+latticeTally.geometry = ['F5026:a ', pln.propMCNP.latticeTally.cellLocal, '\n'];
+latticeTally.cellVolumeCard = ['SD5026 ', num2str(pln.propMCNP.sdCardInfo), ' ', num2str(pln.numOfVoxels-1), 'R\n'];
+
+%Write to text file
+fprintf(fileID_C_rest, 'C ***************************************************************\n');
+fprintf(fileID_C_rest, 'C C: RBExDose(alphaDose) for aerobic environment (one tally located in each voxel of the CT-data)\n');
+fprintf(fileID_C_rest, 'C ***************************************************************\n');
+fprintf(fileID_C_rest, latticeTally.geometry);
+fprintf(fileID_C_rest, latticeTally.cellVolumeCard);
+
+% Write proton DE/DF cards
+fprintf(fileID_C_rest, 'DE5026\n');
+for counterRBEvalues = 1:size(alpha.RBEValue_aero,1)
+ fprintf(fileID_C_rest, [' ', num2str(alpha.RBEValue_aero(counterRBEvalues,1)), '\n']);
+end
+fprintf(fileID_C_rest, 'DF5026\n');
+for counterRBEvalues = 1:size(alpha.RBEValue_aero,1)
+ fprintf(fileID_C_rest, [' ', num2str(alpha.RBEValue_aero(counterRBEvalues,2)), '\n']);
+end
+
+% Intra Track Term RMF model for aerobic environment
+disp('*****')
+disp('Tally type: Lattice tally for biological optimization for aerobic environment (intra track term)...')
+disp('*****')
+latticeTally.geometry = ['F5036:a ', pln.propMCNP.latticeTally.cellLocal, '\n'];
+latticeTally.cellVolumeCard = ['SD5036 ', num2str(pln.propMCNP.sdCardInfo), ' ', num2str(pln.numOfVoxels-1), 'R\n'];
+
+%Write to text file
+fprintf(fileID_C_rest, 'C ***************************************************************\n');
+fprintf(fileID_C_rest, 'C C: Intra Track Term(alpha) for aerobic environment (one tally located in each voxel of the CT-data)\n');
+fprintf(fileID_C_rest, 'C ***************************************************************\n');
+fprintf(fileID_C_rest, latticeTally.geometry);
+fprintf(fileID_C_rest, latticeTally.cellVolumeCard);
+
+% Write alpha DE/DF cards
+fprintf(fileID_C_rest, 'DE5036\n');
+for counterIntraTrackValues = 1:size(alpha.intraTrackValue_aero,1)
+ fprintf(fileID_C_rest, [' ', num2str(alpha.intraTrackValue_aero(counterIntraTrackValues,1)), '\n']);
+end
+fprintf(fileID_C_rest, 'DF5036\n');
+for counterIntraTrackValues = 1:size(alpha.intraTrackValue_aero,1)
+ fprintf(fileID_C_rest, [' ', num2str(alpha.intraTrackValue_aero(counterIntraTrackValues,2)), '\n']);
+end
+
+% RBExDose for anoxic environment
+disp('*****')
+disp('Tally type: Lattice tally for biological optimization for anoxic environment (RBE*alphaDose)...')
+disp('*****')
+latticeTally.geometry = ['F5046:a ', pln.propMCNP.latticeTally.cellLocal, '\n'];
+latticeTally.cellVolumeCard = ['SD5046 ', num2str(pln.propMCNP.sdCardInfo), ' ', num2str(pln.numOfVoxels-1), 'R\n'];
+
+%Write to text file
+fprintf(fileID_C_rest, 'C ***************************************************************\n');
+fprintf(fileID_C_rest, 'C C: RBExDose(alphaDose) for anoxic environment (one tally located in each voxel of the CT-data)\n');
+fprintf(fileID_C_rest, 'C ***************************************************************\n');
+fprintf(fileID_C_rest, latticeTally.geometry);
+fprintf(fileID_C_rest, latticeTally.cellVolumeCard);
+
+% Write proton DE/DF cards
+fprintf(fileID_C_rest, 'DE5046\n');
+for counterRBEvalues = 1:size(alpha.RBEValue_anox,1)
+ fprintf(fileID_C_rest, [' ', num2str(alpha.RBEValue_anox(counterRBEvalues,1)), '\n']);
+end
+fprintf(fileID_C_rest, 'DF5046\n');
+for counterRBEvalues = 1:size(alpha.RBEValue_anox,1)
+ fprintf(fileID_C_rest, [' ', num2str(alpha.RBEValue_anox(counterRBEvalues,2)), '\n']);
+end
+
+% Intra Track Term RMF model for aerobic environment
+disp('*****')
+disp('Tally type: Lattice tally for biological optimization for anoxic environment (intra track term)...')
+disp('*****')
+latticeTally.geometry = ['F5056:a ', pln.propMCNP.latticeTally.cellLocal, '\n'];
+latticeTally.cellVolumeCard = ['SD5056 ', num2str(pln.propMCNP.sdCardInfo), ' ', num2str(pln.numOfVoxels-1), 'R\n'];
+
+%Write to text file
+fprintf(fileID_C_rest, 'C ***************************************************************\n');
+fprintf(fileID_C_rest, 'C C: Intra Track Term(alpha) for anoxic environment (one tally located in each voxel of the CT-data)\n');
+fprintf(fileID_C_rest, 'C ***************************************************************\n');
+fprintf(fileID_C_rest, latticeTally.geometry);
+fprintf(fileID_C_rest, latticeTally.cellVolumeCard);
+
+% Write alpha DE/DF cards
+fprintf(fileID_C_rest, 'DE5056\n');
+for counterIntraTrackValues = 1:size(alpha.intraTrackValue_anox,1)
+ fprintf(fileID_C_rest, [' ', num2str(alpha.intraTrackValue_anox(counterIntraTrackValues,1)), '\n']);
+end
+fprintf(fileID_C_rest, 'DF5056\n');
+for counterIntraTrackValues = 1:size(alpha.intraTrackValue_anox,1)
+ fprintf(fileID_C_rest, [' ', num2str(alpha.intraTrackValue_anox(counterIntraTrackValues,2)), '\n']);
+end
+%% B.6 Electron dose and RBE calculation
+% Dose
+disp('*****')
+disp('Tally type: Lattice tally for electron dose calculation...')
+disp('*****')
+latticeTally.geometry = ['F6016:e ', pln.propMCNP.latticeTally.cellLocal, '\n'];
+latticeTally.cellVolumeCard = ['SD6016 ', num2str(pln.propMCNP.sdCardInfo), ' ', num2str(pln.numOfVoxels-1), 'R\n'];
+
+%Write to text file
+fprintf(fileID_C_rest, 'C ***************************************************************\n');
+fprintf(fileID_C_rest, 'C C: Electron dose (one tally located in each voxel of the CT-data)\n');
+fprintf(fileID_C_rest, 'C ***************************************************************\n');
+fprintf(fileID_C_rest, latticeTally.geometry);
+fprintf(fileID_C_rest, latticeTally.cellVolumeCard);
+
+% RBExDose for aerobic environment
+disp('*****')
+disp('Tally type: Lattice tally for biological optimization for aerobic environment (RBE*electronDose)...')
+disp('*****')
+latticeTally.geometry = ['F6026:e ', pln.propMCNP.latticeTally.cellLocal, '\n'];
+latticeTally.cellVolumeCard = ['SD6026 ', num2str(pln.propMCNP.sdCardInfo), ' ', num2str(pln.numOfVoxels-1), 'R\n'];
+
+%Write to text file
+fprintf(fileID_C_rest, 'C ***************************************************************\n');
+fprintf(fileID_C_rest, 'C C: RBExDose(electronDose) for aerobic environment (one tally located in each voxel of the CT-data)\n');
+fprintf(fileID_C_rest, 'C ***************************************************************\n');
+fprintf(fileID_C_rest, latticeTally.geometry);
+fprintf(fileID_C_rest, latticeTally.cellVolumeCard);
+
+% Write electron DE/DF cards
+fprintf(fileID_C_rest, 'DE6026\n');
+for counterRBEvalues = 1:size(electron.RBEValue_aero,1)
+ fprintf(fileID_C_rest, [' ', num2str(electron.RBEValue_aero(counterRBEvalues,1)), '\n']);
+end
+fprintf(fileID_C_rest, 'DF6026\n');
+for counterRBEvalues = 1:size(electron.RBEValue_aero,1)
+ fprintf(fileID_C_rest, [' ', num2str(electron.RBEValue_aero(counterRBEvalues,2)), '\n']);
+end
+
+% Intra Track Term RMF model for aerobic environment
+disp('*****')
+disp('Tally type: Lattice tally for biological optimization for aerobic environment (intra track term)...')
+disp('*****')
+latticeTally.geometry = ['F6036:e ', pln.propMCNP.latticeTally.cellLocal, '\n'];
+latticeTally.cellVolumeCard = ['SD6036 ', num2str(pln.propMCNP.sdCardInfo), ' ', num2str(pln.numOfVoxels-1), 'R\n'];
+
+%Write to text file
+fprintf(fileID_C_rest, 'C ***************************************************************\n');
+fprintf(fileID_C_rest, 'C C: Intra Track Term(electron) for aerobic environment (one tally located in each voxel of the CT-data)\n');
+fprintf(fileID_C_rest, 'C ***************************************************************\n');
+fprintf(fileID_C_rest, latticeTally.geometry);
+fprintf(fileID_C_rest, latticeTally.cellVolumeCard);
+
+% Write electron DE/DF cards
+fprintf(fileID_C_rest, 'DE6036\n');
+for counterIntraTrackValues = 1:size(electron.intraTrackValue_aero,1)
+ fprintf(fileID_C_rest, [' ', num2str(electron.intraTrackValue_aero(counterIntraTrackValues,1)), '\n']);
+end
+fprintf(fileID_C_rest, 'DF6036\n');
+for counterIntraTrackValues = 1:size(electron.intraTrackValue_aero,1)
+ fprintf(fileID_C_rest, [' ', num2str(electron.intraTrackValue_aero(counterIntraTrackValues,2)), '\n']);
+end
+
+% RBExDose for anoxic environment
+disp('*****')
+disp('Tally type: Lattice tally for biological optimization for anoxic environment (RBE*electronDose)...')
+disp('*****')
+latticeTally.geometry = ['F6046:e ', pln.propMCNP.latticeTally.cellLocal, '\n'];
+latticeTally.cellVolumeCard = ['SD6046 ', num2str(pln.propMCNP.sdCardInfo), ' ', num2str(pln.numOfVoxels-1), 'R\n'];
+
+%Write to text file
+fprintf(fileID_C_rest, 'C ***************************************************************\n');
+fprintf(fileID_C_rest, 'C C: RBExDose(electronDose) for anoxic environment (one tally located in each voxel of the CT-data)\n');
+fprintf(fileID_C_rest, 'C ***************************************************************\n');
+fprintf(fileID_C_rest, latticeTally.geometry);
+fprintf(fileID_C_rest, latticeTally.cellVolumeCard);
+
+% Write electron DE/DF cards
+fprintf(fileID_C_rest, 'DE6046\n');
+for counterRBEvalues = 1:size(electron.RBEValue_anox,1)
+ fprintf(fileID_C_rest, [' ', num2str(electron.RBEValue_anox(counterRBEvalues,1)), '\n']);
+end
+fprintf(fileID_C_rest, 'DF6046\n');
+for counterRBEvalues = 1:size(electron.RBEValue_anox,1)
+ fprintf(fileID_C_rest, [' ', num2str(electron.RBEValue_anox(counterRBEvalues,2)), '\n']);
+end
+
+% Intra Track Term RMF model for anoxic environment
+disp('*****')
+disp('Tally type: Lattice tally for biological optimization for anoxic environment (intra track term)...')
+disp('*****')
+latticeTally.geometry = ['F6056:e ', pln.propMCNP.latticeTally.cellLocal, '\n'];
+latticeTally.cellVolumeCard = ['SD6056 ', num2str(pln.propMCNP.sdCardInfo), ' ', num2str(pln.numOfVoxels-1), 'R\n'];
+
+%Write to text file
+fprintf(fileID_C_rest, 'C ***************************************************************\n');
+fprintf(fileID_C_rest, 'C C: Intra Track Term(electron) for anoxic environment (one tally located in each voxel of the CT-data)\n');
+fprintf(fileID_C_rest, 'C ***************************************************************\n');
+fprintf(fileID_C_rest, latticeTally.geometry);
+fprintf(fileID_C_rest, latticeTally.cellVolumeCard);
+
+% Write electron DE/DF cards
+fprintf(fileID_C_rest, 'DE6056\n');
+for counterIntraTrackValues = 1:size(electron.intraTrackValue_anox,1)
+ fprintf(fileID_C_rest, [' ', num2str(electron.intraTrackValue_anox(counterIntraTrackValues,1)), '\n']);
+end
+fprintf(fileID_C_rest, 'DF6056\n');
+for counterIntraTrackValues = 1:size(electron.intraTrackValue_anox,1)
+ fprintf(fileID_C_rest, [' ', num2str(electron.intraTrackValue_anox(counterIntraTrackValues,2)), '\n']);
+end
+
+%% B.7 Li-7 dose and RBE calculation
+% Dose
+disp('*****')
+disp('Tally type: Lattice tally for lithium dose calculation...')
+disp('*****')
+latticeTally.geometry = ['F7016:# ', pln.propMCNP.latticeTally.cellLocal, '\n'];
+latticeTally.cellVolumeCard = ['SD7016 ', num2str(pln.propMCNP.sdCardInfo), ' ', num2str(pln.numOfVoxels-1), 'R\n'];
+latticeTally.particleExtractionCard = 'FT7016 res 3007\n';
+
+%Write to text file
+fprintf(fileID_C_rest, 'C ***************************************************************\n');
+fprintf(fileID_C_rest, 'C C: Lithium dose for aerobic environment (one tally located in each voxel of the CT-data)\n');
+fprintf(fileID_C_rest, 'C ***************************************************************\n');
+fprintf(fileID_C_rest, latticeTally.geometry);
+fprintf(fileID_C_rest, latticeTally.cellVolumeCard);
+fprintf(fileID_C_rest, latticeTally.particleExtractionCard);
+
+% RBExDose for aerobic environment
+disp('*****')
+disp('Tally type: Lattice tally for biological optimization for aerobic environment (RBE*lithiumDose)...')
+disp('*****')
+latticeTally.geometry = ['F7026:# ', pln.propMCNP.latticeTally.cellLocal, '\n'];
+latticeTally.cellVolumeCard = ['SD7026 ', num2str(pln.propMCNP.sdCardInfo), ' ', num2str(pln.numOfVoxels-1), 'R\n'];
+latticeTally.particleExtractionCard = 'FT7026 res 3007\n';
+
+%Write to text file
+fprintf(fileID_C_rest, 'C ***************************************************************\n');
+fprintf(fileID_C_rest, 'C C: RBExDose(lithiumDose) for aerobic environment (one tally located in each voxel of the CT-data)\n');
+fprintf(fileID_C_rest, 'C ***************************************************************\n');
+fprintf(fileID_C_rest, latticeTally.geometry);
+fprintf(fileID_C_rest, latticeTally.cellVolumeCard);
+fprintf(fileID_C_rest, latticeTally.particleExtractionCard);
+
+% Write electron DE/DF cards
+fprintf(fileID_C_rest, 'DE7026\n');
+for counterRBEvalues = 1:size(lithium.RBEValue_aero,1)
+ fprintf(fileID_C_rest, [' ', num2str(lithium.RBEValue_aero(counterRBEvalues,1)), '\n']);
+end
+fprintf(fileID_C_rest, 'DF7026\n');
+for counterRBEvalues = 1:size(lithium.RBEValue_aero,1)
+ fprintf(fileID_C_rest, [' ', num2str(lithium.RBEValue_aero(counterRBEvalues,2)), '\n']);
+end
+
+% Intra Track Term RMF model
+disp('*****')
+disp('Tally type: Lattice tally for biological optimization for aerobic environment (intra track term)...')
+disp('*****')
+latticeTally.geometry = ['F7036:# ', pln.propMCNP.latticeTally.cellLocal, '\n'];
+latticeTally.cellVolumeCard = ['SD7036 ', num2str(pln.propMCNP.sdCardInfo), ' ', num2str(pln.numOfVoxels-1), 'R\n'];
+latticeTally.particleExtractionCard = 'FT7036 res 3007\n';
+
+%Write to text file
+fprintf(fileID_C_rest, 'C ***************************************************************\n');
+fprintf(fileID_C_rest, 'C C: Intra Track Term(lithium) for aerobic environment (one tally located in each voxel of the CT-data)\n');
+fprintf(fileID_C_rest, 'C ***************************************************************\n');
+fprintf(fileID_C_rest, latticeTally.geometry);
+fprintf(fileID_C_rest, latticeTally.cellVolumeCard);
+fprintf(fileID_C_rest, latticeTally.particleExtractionCard);
+
+% Write electron DE/DF cards
+fprintf(fileID_C_rest, 'DE7036\n');
+for counterIntraTrackValues = 1:size(lithium.intraTrackValue_aero,1)
+ fprintf(fileID_C_rest, [' ', num2str(lithium.intraTrackValue_aero(counterIntraTrackValues,1)), '\n']);
+end
+fprintf(fileID_C_rest, 'DF7036\n');
+for counterIntraTrackValues = 1:size(lithium.intraTrackValue_aero,1)
+ fprintf(fileID_C_rest, [' ', num2str(lithium.intraTrackValue_aero(counterIntraTrackValues,2)), '\n']);
+end
+
+% RBExDose for anoxic environment
+disp('*****')
+disp('Tally type: Lattice tally for biological optimization for anoxic environment (RBE*lithiumDose)...')
+disp('*****')
+latticeTally.geometry = ['F7046:# ', pln.propMCNP.latticeTally.cellLocal, '\n'];
+latticeTally.cellVolumeCard = ['SD7046 ', num2str(pln.propMCNP.sdCardInfo), ' ', num2str(pln.numOfVoxels-1), 'R\n'];
+latticeTally.particleExtractionCard = 'FT7046 res 3007\n';
+
+%Write to text file
+fprintf(fileID_C_rest, 'C ***************************************************************\n');
+fprintf(fileID_C_rest, 'C C: RBExDose(lithiumDose) for anoxic environment (one tally located in each voxel of the CT-data)\n');
+fprintf(fileID_C_rest, 'C ***************************************************************\n');
+fprintf(fileID_C_rest, latticeTally.geometry);
+fprintf(fileID_C_rest, latticeTally.cellVolumeCard);
+fprintf(fileID_C_rest, latticeTally.particleExtractionCard);
+
+% Write lithium DE/DF cards
+fprintf(fileID_C_rest, 'DE7046\n');
+for counterRBEvalues = 1:size(lithium.RBEValue_anox,1)
+ fprintf(fileID_C_rest, [' ', num2str(lithium.RBEValue_anox(counterRBEvalues,1)), '\n']);
+end
+fprintf(fileID_C_rest, 'DF7046\n');
+for counterRBEvalues = 1:size(lithium.RBEValue_anox,1)
+ fprintf(fileID_C_rest, [' ', num2str(lithium.RBEValue_anox(counterRBEvalues,2)), '\n']);
+end
+
+% Intra Track Term RMF model for anoxic environment
+disp('*****')
+disp('Tally type: Lattice tally for biological optimization for anoxic environment (intra track term)...')
+disp('*****')
+latticeTally.geometry = ['F7056:# ', pln.propMCNP.latticeTally.cellLocal, '\n'];
+latticeTally.cellVolumeCard = ['SD7056 ', num2str(pln.propMCNP.sdCardInfo), ' ', num2str(pln.numOfVoxels-1), 'R\n'];
+latticeTally.particleExtractionCard = 'FT7056 res 3007\n';
+
+%Write to text file
+fprintf(fileID_C_rest, 'C ***************************************************************\n');
+fprintf(fileID_C_rest, 'C C: Intra Track Term(lithium) for anoxic environment (one tally located in each voxel of the CT-data)\n');
+fprintf(fileID_C_rest, 'C ***************************************************************\n');
+fprintf(fileID_C_rest, latticeTally.geometry);
+fprintf(fileID_C_rest, latticeTally.cellVolumeCard);
+fprintf(fileID_C_rest, latticeTally.particleExtractionCard);
+
+% Write lithium DE/DF cards
+fprintf(fileID_C_rest, 'DE7056\n');
+for counterIntraTrackValues = 1:size(lithium.intraTrackValue_anox,1)
+ fprintf(fileID_C_rest, [' ', num2str(lithium.intraTrackValue_anox(counterIntraTrackValues,1)), '\n']);
+end
+fprintf(fileID_C_rest, 'DF7056\n');
+for counterIntraTrackValues = 1:size(lithium.intraTrackValue_anox,1)
+ fprintf(fileID_C_rest, [' ', num2str(lithium.intraTrackValue_anox(counterIntraTrackValues,2)), '\n']);
+end
+
+%% B.8 Heavy ion dose and RBE calculation
+% Dose
+disp('*****')
+disp('Tally type: Lattice tally for heavy ion dose calculation...')
+disp('*****')
+latticeTally.geometry = ['F8016:# ', pln.propMCNP.latticeTally.cellLocal, '\n'];
+latticeTally.cellVolumeCard = ['SD8016 ', num2str(pln.propMCNP.sdCardInfo), ' ', num2str(pln.numOfVoxels-1), 'R\n'];
+
+%Write to text file
+fprintf(fileID_C_rest, 'C ***************************************************************\n');
+fprintf(fileID_C_rest, 'C C: Heavy ion dose (one tally located in each voxel of the CT-data)\n');
+fprintf(fileID_C_rest, 'C ***************************************************************\n');
+fprintf(fileID_C_rest, latticeTally.geometry);
+fprintf(fileID_C_rest, latticeTally.cellVolumeCard);
+
+% Intra Track Term RMF model for aerobic environment
+disp('*****')
+disp('Tally type: Lattice tally for biological optimization for aerobic environment (intra track term)...')
+disp('*****')
+latticeTally.geometry = ['F8036:# ', pln.propMCNP.latticeTally.cellLocal, '\n'];
+latticeTally.cellVolumeCard = ['SD8036 ', num2str(pln.propMCNP.sdCardInfo), ' ', num2str(pln.numOfVoxels-1), 'R\n'];
+
+%Write to text file
+fprintf(fileID_C_rest, 'C ***************************************************************\n');
+fprintf(fileID_C_rest, 'C C: Intra Track Term(heavyIon) for aerobic environment (one tally located in each voxel of the CT-data)\n');
+fprintf(fileID_C_rest, 'C ***************************************************************\n');
+fprintf(fileID_C_rest, latticeTally.geometry);
+fprintf(fileID_C_rest, latticeTally.cellVolumeCard);
+
+% Write heavy ion DE/DF cards
+fprintf(fileID_C_rest, 'DE8036\n');
+for counterIntraTrackValues = 1:size(heavyIons.intraTrackValue_aero,1)
+ fprintf(fileID_C_rest, [' ', num2str(heavyIons.intraTrackValue_aero(counterIntraTrackValues,1)), '\n']);
+end
+fprintf(fileID_C_rest, 'DF8036\n');
+for counterIntraTrackValues = 1:size(heavyIons.intraTrackValue_aero,1)
+ fprintf(fileID_C_rest, [' ', num2str(heavyIons.intraTrackValue_aero(counterIntraTrackValues,2)), '\n']);
+end
+
+% Intra Track Term RMF model for anoxic environment
+disp('*****')
+disp('Tally type: Lattice tally for biological optimization for anoxic environment (intra track term)...')
+disp('*****')
+latticeTally.geometry = ['F8056:# ', pln.propMCNP.latticeTally.cellLocal, '\n'];
+latticeTally.cellVolumeCard = ['SD8056 ', num2str(pln.propMCNP.sdCardInfo), ' ', num2str(pln.numOfVoxels-1), 'R\n'];
+
+%Write to text file
+fprintf(fileID_C_rest, 'C ***************************************************************\n');
+fprintf(fileID_C_rest, 'C C: Intra Track Term(heavyIon) for anoxic environment (one tally located in each voxel of the CT-data)\n');
+fprintf(fileID_C_rest, 'C ***************************************************************\n');
+fprintf(fileID_C_rest, latticeTally.geometry);
+fprintf(fileID_C_rest, latticeTally.cellVolumeCard);
+
+% Write heavy ion DE/DF cards
+fprintf(fileID_C_rest, 'DE8056\n');
+for counterIntraTrackValues = 1:size(heavyIons.intraTrackValue_anox,1)
+ fprintf(fileID_C_rest, [' ', num2str(heavyIons.intraTrackValue_anox(counterIntraTrackValues,1)), '\n']);
+end
+fprintf(fileID_C_rest, 'DF8056\n');
+for counterIntraTrackValues = 1:size(heavyIons.intraTrackValue_anox,1)
+ fprintf(fileID_C_rest, [' ', num2str(heavyIons.intraTrackValue_anox(counterIntraTrackValues,2)), '\n']);
+end
+
+%% B.9 Neutron heating
+disp('*****')
+disp('Tally type: Lattice tally for neutron dose calculation...')
+disp('*****')
+latticeTally.geometry = ['F9016:n ', pln.propMCNP.latticeTally.cellLocal, '\n'];
+latticeTally.cellVolumeCard = ['SD9016 ', num2str(pln.propMCNP.sdCardInfo), ' ', num2str(pln.numOfVoxels-1), 'R\n'];
+
+%Write to text file
+fprintf(fileID_C_rest, 'C ***************************************************************\n');
+fprintf(fileID_C_rest, 'C C: Neutron dose (one tally located in each voxel of the CT-data)\n');
+fprintf(fileID_C_rest, 'C ***************************************************************\n');
+fprintf(fileID_C_rest, latticeTally.geometry);
+fprintf(fileID_C_rest, latticeTally.cellVolumeCard);
+
+%% B.10 Photon heating
+disp('*****')
+disp('Tally type: Lattice tally for photon dose calculation...')
+disp('*****')
+latticeTally.geometry = ['F1116:p ', pln.propMCNP.latticeTally.cellLocal, '\n'];
+latticeTally.cellVolumeCard = ['SD1116 ', num2str(pln.propMCNP.sdCardInfo), ' ', num2str(pln.numOfVoxels-1), 'R\n'];
+
+%Write to text file
+fprintf(fileID_C_rest, 'C ***************************************************************\n');
+fprintf(fileID_C_rest, 'C C: Photon dose (one tally located in each voxel of the CT-data)\n');
+fprintf(fileID_C_rest, 'C ***************************************************************\n');
+fprintf(fileID_C_rest, latticeTally.geometry);
+fprintf(fileID_C_rest, latticeTally.cellVolumeCard);
diff --git a/MCNP/matRad_makeTargetMCNP.m b/MCNP/matRad_makeTargetMCNP.m
new file mode 100644
index 000000000..5c57733d1
--- /dev/null
+++ b/MCNP/matRad_makeTargetMCNP.m
@@ -0,0 +1,193 @@
+function [control_makeTargetMCNP, fileID_A, fileID_B, geometryOption] = matRad_makeTargetMCNP(ct, simPropMCNP)
+% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% Write target as MCNP input file using ct data, predefined simulation
+% properties and tissue specific HU intervals defined for segmentation
+%
+% call
+% [control_makeTargetMCNP, fileID_A, fileID_B] = matRad_makeTargetMCNP(ct, simPropMCNP)
+%
+% input
+% ct: ct cube
+% simPropMCNP: includes .MCNP_limitNumberOfElements and .loopCounter
+% to control number of elements and loop counter to
+% rerun creation if not successful
+%
+% output
+% control_makeTargetMCNP: Control variable to check if target was created
+% sucessfully
+% fileID_A/B: File IDs to control block A and B txt-files
+%
+% References
+% [1] PELOWITZ, D. B., et al. MCNP6 User�s Manual. LACP-00634, May, 2013.
+%
+% Author: Lucas Sommer (Lucas.Sommer@tum.de), 11/2018
+%
+% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+matRad_cfg = MatRad_Config.instance();
+
+%% Check if geometry option is defined, otherwise set to default, i.e. use repeated structure option (lattice)
+if ~isfield(simPropMCNP, 'geometryOption')
+ simPropMNCP.geometryOption = 'Lattice';
+ geometryOption = 'Lattice'; % dummy to give back by function
+end
+
+%% Define voxel phantom for MCNP calculation
+switch simPropMNCP.geometryOption
+ case 'Lattice'
+ %% Generate universe matrix and open text files
+ universeMatrix = zeros(ct.doseGridCT.cubeDim, 'uint8'); % create a 3D matrix and fill with material/universe indices
+ % note: every universe corresponds to one material
+ for counterMaterial = 1:size(ct.doseGridCT.tissueBin,2)
+ universeMatrix(ct.doseGridCT.tissueBin(counterMaterial).linIndVol) = counterMaterial; % fill
+ end
+ clear counterMaterial
+
+ % Generate log-file
+ pathRunfiles = strcat(matRad_cfg.matRadRoot,filesep,'MCNP', filesep, 'runfiles_tmp', filesep);
+ fileID_A = fopen(strcat(pathRunfiles,'blockA.txt'), 'w');
+ fileID_B = fopen(strcat(pathRunfiles,'blockB.txt'), 'w');
+
+ %% Write block A: Cells
+ fprintf(fileID_A, 'MCNP Runfile for Dose Calculation\n');
+ fprintf(fileID_A, 'C ***************************************************************\n');
+ fprintf(fileID_A, 'C ***************************************************************\n');
+ fprintf(fileID_A, 'C Block A: Cells\n');
+ fprintf(fileID_A, 'C ***************************************************************\n');
+
+ % Start with definition of cells where cell index equals material index equals universe index
+ blockA.universeSpec = '%d %d %.9f %d u=%d $ Material %d\n';
+ blockA.universeSpecLikeBut = '%d like 1 but mat=%d rho=%.9f u=%d $ Material %d\n';
+ for cellCounter = 1:size(ct.doseGridCT.tissueBin,2)
+ if ~isnan(mean(ct.doseGridCT.density{1,1}(ct.doseGridCT.tissueBin(cellCounter).linIndVol)))
+ if cellCounter==1
+ fprintf(fileID_A, blockA.universeSpec, ...
+ cellCounter, ... % cell number
+ cellCounter, ... % material number
+ -mean(ct.doseGridCT.density{1,1}(ct.doseGridCT.tissueBin(cellCounter).linIndVol)), ... % material density
+ -(100+cellCounter), ... % surface
+ cellCounter, ... % universe number
+ cellCounter); % material number for comment in runfile
+ else
+ fprintf(fileID_A, blockA.universeSpecLikeBut, ...
+ cellCounter, ... % cell number
+ cellCounter, ... % material number
+ -mean(ct.doseGridCT.density{1,1}(ct.doseGridCT.tissueBin(cellCounter).linIndVol)), ... % material density
+ cellCounter, ... % universe number
+ cellCounter); % material number for comment in runfile
+ end
+ elseif isnan(mean(ct.doseGridCT.density{1,1}(ct.doseGridCT.tissueBin(cellCounter).linIndVol)))
+ if cellCounter==1
+ fprintf(fileID_A, blockA.universeSpec, ...
+ cellCounter, ... % cell number
+ cellCounter, ... % material number
+ 1,... % set material density to one
+ -(100+cellCounter), ... % surface
+ cellCounter, ... % universe number
+ cellCounter); % material number for comment in runfile
+ else
+ fprintf(fileID_A, blockA.universeSpecLikeBut, ...
+ cellCounter, ... % cell number
+ cellCounter, ... % material number
+ 1,... % set material density to one
+ cellCounter, ... % universe number
+ cellCounter); % material number for comment in runfile
+ end
+ end
+ end
+
+ % Define lattice cell and fill with universes
+ cellCounter = cellCounter +1;
+ blockA.latticeSpec = '%d 0 -505 506 -507 508 -509 510 lat=1 u=%d fill=0:%d 0:%d 0:%d\n'; % surfaces 505:510 always define lattice cell [0,0,0]
+ fprintf(fileID_A, blockA.latticeSpec, ...
+ cellCounter, ...
+ cellCounter, ...
+ ct.doseGridCT.cubeDim(2)-1, ...
+ ct.doseGridCT.cubeDim(1)-1, ...
+ ct.doseGridCT.cubeDim(3)-1);
+ for i3 = 1:ct.doseGridCT.cubeDim(3) % write universe index for each cell
+ for i1 = 1:ct.doseGridCT.cubeDim(1)
+ for i2 = 1:ct.doseGridCT.cubeDim(2)
+ fprintf(fileID_A, [' ', int2str(universeMatrix(i1,i2,i3)), '\n']);
+ end
+ end
+ end
+
+ % Define inner world for universe to position ct grid
+ cellCounter = cellCounter +1;
+ blockA.innerWorldSpec = '%d 0 -911 fill=%d\n';
+ fprintf(fileID_A, blockA.innerWorldSpec, cellCounter, cellCounter-1);
+
+ % Define inner world layer around ct grid to simulate additional air
+ cellCounter = cellCounter +1;
+ blockA.innerWorldSpec = '%d 1 -0.001205000 911 -912\n';
+ fprintf(fileID_A, blockA.innerWorldSpec, cellCounter);
+
+
+ % Define outer world as particle graveyard
+ cellCounter = cellCounter +1;
+ blockA.outerWorldSpec = '%d 0 912\n';
+ fprintf(fileID_A, blockA.outerWorldSpec, cellCounter);
+
+ clear cellCounter
+
+ fprintf(fileID_A, '\n');
+ fclose(fileID_A);
+
+ %% Write block B: Surfaces
+ fprintf(fileID_B, 'C ***************************************************************\n');
+ fprintf(fileID_B, 'C ***************************************************************\n');
+ fprintf(fileID_B, 'C Block B: Surfaces\n');
+ fprintf(fileID_B, 'C ***************************************************************\n');
+
+ % Write universe voxel: cell 101
+ blockB.universeVoxelSpec = '101 RPP %.13f %.13f %.13f %.13f %.13f %.13f $ voxel surface for universe 1\n';
+ fprintf(fileID_B, blockB.universeVoxelSpec, ...
+ 0.25*ct.doseGridCT.x_MCNP, ...
+ 1.75*ct.doseGridCT.x_MCNP, ...
+ 0.25*ct.doseGridCT.y_MCNP, ...
+ 1.75*ct.doseGridCT.y_MCNP, ...
+ 0.25*ct.doseGridCT.z_MCNP, ...
+ 1.75*ct.doseGridCT.z_MCNP);
+
+ % Write surfaces for lattice orientation: lattice cell (0,0,0)
+ fprintf(fileID_B, ['505 PX ', num2str(ct.doseGridCT.x_MCNP*1.5), ' $ defines x-direction\n']);
+ fprintf(fileID_B, ['506 PX ', num2str(ct.doseGridCT.x_MCNP/2), '\n']);
+ fprintf(fileID_B, ['507 PY ', num2str(ct.doseGridCT.y_MCNP*1.5), '$ defines y-direction\n']);
+ fprintf(fileID_B, ['508 PY ', num2str(ct.doseGridCT.y_MCNP/2), '\n']);
+ fprintf(fileID_B, ['509 PZ ', num2str(ct.doseGridCT.z_MCNP*1.5), '$ defines z-direction\n']);
+ fprintf(fileID_B, ['510 PZ ', num2str(ct.doseGridCT.z_MCNP/2), '\n']);
+
+
+
+ % Write additional surfaces for universe box:
+ latticeMargin = 0.005; % [cm] -> avoid problems with outer surfaces of lattice, otherwise particles might get lost
+ fprintf(fileID_B, ['911 RPP ', ...
+ num2str(latticeMargin+ct.doseGridCT.x_MCNP/2), ' ',...
+ num2str(ct.doseGridCT.cubeDim(2)*ct.doseGridCT.x_MCNP+ct.doseGridCT.x_MCNP/2-latticeMargin),' ',...
+ num2str(latticeMargin+ct.doseGridCT.y_MCNP/2), ' ',...
+ num2str(ct.doseGridCT.cubeDim(1)*ct.doseGridCT.y_MCNP+ct.doseGridCT.y_MCNP/2-latticeMargin), ' ',...
+ num2str(latticeMargin+ct.doseGridCT.z_MCNP/2), ' ',...
+ num2str(ct.doseGridCT.cubeDim(3)*ct.doseGridCT.z_MCNP+ct.doseGridCT.z_MCNP/2-latticeMargin),'\n']);
+
+ % Write additional surfaces for layer around ct grid
+ additionalLayerThickness = 180; % this value defines the maximum source-to-axis (SAD) distance that can be simulated before particles start in imp:0 cell,
+ % holds only for 0degree couch rotation and gantry 0, 90, 180, 270 degree, shorter SAD necessary otherwise due to rotated surface source
+
+ fprintf(fileID_B, ['912 RPP ',num2str(-(ct.doseGridCT.x_MCNP/2+additionalLayerThickness)), ' ',...
+ num2str(ct.doseGridCT.cubeDim(2)*ct.doseGridCT.x_MCNP-ct.doseGridCT.x_MCNP/2+additionalLayerThickness), ' ',...
+ num2str(-(ct.doseGridCT.y_MCNP/2+additionalLayerThickness)), ' ',...
+ num2str(ct.doseGridCT.cubeDim(1)*ct.doseGridCT.y_MCNP-ct.doseGridCT.y_MCNP/2+additionalLayerThickness), ' ', ...
+ num2str(-(ct.doseGridCT.z_MCNP/2+additionalLayerThickness)), ' ', ...
+ num2str(ct.doseGridCT.cubeDim(3)*ct.doseGridCT.z_MCNP-ct.doseGridCT.z_MCNP/2+additionalLayerThickness), '\n']);
+
+ % Write dummy surface to position RSSA input:
+ fprintf(fileID_B, '1001 1 PX 0 $ dummy surface for RSSA positioning\n');
+
+
+ fprintf(fileID_B, '\n');
+
+ fclose(fileID_B);
+
+ control_makeTargetMCNP =true;
+end
\ No newline at end of file
diff --git a/MCNP/matRad_segmentationPlotCTBins.m b/MCNP/matRad_segmentationPlotCTBins.m
new file mode 100644
index 000000000..dd47c147a
--- /dev/null
+++ b/MCNP/matRad_segmentationPlotCTBins.m
@@ -0,0 +1,102 @@
+function matRad_segmentationPlotCTBins(ct, plane, sliceOfInt)
+% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% matRad visualization of tissue segmentation on CT-data
+%
+% call
+% matRad_segmentationPlotCTBins(ct, plane, slice)
+%
+% input
+% ct: CT-data with HU in ct.cubeHU and linear indices of
+% segmenation in ct.tissueBin.linIndVol and ct.cubeDim
+% plane: view options ('axial' (default), 'sagital', 'coronal')
+% slice: slice you would like to view (default = half of
+% dimension)
+%
+% output
+% ...
+%
+% Author: Lucas Sommer (Lucas.Sommer@tum.de), 03/2019
+%
+% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+% Prelude
+if ~exist('plane')
+ plane = 'axial';
+ planeOption = 3;
+elseif strcmp(plane, 'sagital')
+ planeOption = 2;
+elseif strcmp(plane, 'coronal')
+ planeOption = 1;
+end
+
+if ~exist('sliceOfInt')
+ sliceOfInt = round(ct.cubeDim(planeOption)/2);
+end
+
+
+segmentationVolume = zeros(ct.cubeDim);
+
+for matCounter = 1:size({ct.tissueBin.matIndex},2)
+segmentationVolume(ct.tissueBin(matCounter).linIndVol) = matCounter -1;
+end
+
+% Plot
+
+fig1 = figure;
+fig1.Units = 'centimeters';
+fig1.Position = [0 0 29.7 21];
+ax1 = axes;
+if strcmp(plane, 'axial')
+ ctPlot = imagesc(squeeze(ct.cubeHU{1}(:,:,sliceOfInt)));
+elseif strcmp(plane, 'sagital')
+ ctPlot = imagesc(squeeze(ct.cubeHU{1}(:,sliceOfInt,:)));
+elseif strcmp(plane, 'coronal')
+ ctPlot = imagesc(squeeze(ct.cubeHU{1}(sliceOfInt,:,:)));
+end
+
+title('Segmentation of CT-Scan Using Hounsfield Unit Intervals', 'FontSize', 20)
+
+
+ax2 = axes;
+linkaxes([ax1,ax2])
+if strcmp(plane, 'axial')
+ segmentationPlot = contour(flip(squeeze(segmentationVolume(:,:,sliceOfInt)),1), [1:size({ct.tissueBin.matIndex},2)-1]);
+elseif strcmp(plane, 'sagital')
+ segmentationPlot = contour(flip(squeeze(segmentationVolume(:,sliceOfInt,:)),1), [1:size({ct.tissueBin.matIndex},2)-1]);
+elseif strcmp(plane, 'coronal')
+ segmentationPlot = contour(flip(squeeze(segmentationVolume(sliceOfInt,:,:)),1), [1:size({ct.tissueBin.matIndex},2)-1]);
+end
+
+
+ax1.XTick = [];
+ax1.YTick = [];
+ax1.Units = 'centimeters';
+
+ax2.Visible = 'off';
+ax2.XTick = [];
+ax2.YTick = [];
+ax2.Units = 'centimeters';
+
+
+set([ax1,ax2],'Position',[4 1.5 21.2 17]);
+cb1 = colorbar(ax1);
+cb1.Units = 'centimeters';
+cb1.Position = [3 1.5 .5 17];
+
+cb2 = colorbar(ax2);
+cb2.Units = 'centimeters';
+cb2.Position = [25.7 1.5 .5 17];
+cb2.TickLabels = {ct.tissueBin.name};
+cb2.Ticks = [0:size({ct.tissueBin.matIndex},2)-1];
+
+cb1.Label.String = 'Hounsfield Units';
+
+cb1.FontSize = 18;
+cb2.FontSize = 18;
+
+colormap(ax1, 'gray')
+colormap(ax2, 'autumn')
+
+
+
+end
\ No newline at end of file
diff --git a/MCNP/readme.txt b/MCNP/readme.txt
new file mode 100644
index 000000000..2699dce04
--- /dev/null
+++ b/MCNP/readme.txt
@@ -0,0 +1,2 @@
+- Add comment on how to name basedata machine.
+-
\ No newline at end of file
diff --git a/MCNP/tools/hounsfield2density.m b/MCNP/tools/hounsfield2density.m
new file mode 100644
index 000000000..1e1a1826c
--- /dev/null
+++ b/MCNP/tools/hounsfield2density.m
@@ -0,0 +1,130 @@
+function [density, sound_speed] = hounsfield2density(ct_data, plot_fitting)
+%HOUNSFIELD2DENSITY Convert Hounsfield units to density.
+%
+% DESCRIPTION:
+% hounsfield2density converts Hounsfield units to units of density
+% [kg/m^3] based on the experimental data given by Schneider et al. The
+% conversion is made using a piece-wise linear fit to the data. For
+% soft-tissue, the approximate sound speed can also be returned using
+% the empirical relationship given by Mast.
+%
+% USAGE:
+% density = hounsfield2density(ct_data)
+% density = hounsfield2density(ct_data, plot_fitting)
+% [density, sound_speed] = hounsfield2density(ct_data)
+% [density, sound_speed] = hounsfield2density(ct_data, plot_fitting)
+%
+% INPUTS:
+% ct_data - CT data in Hounsfield units to convert to density
+%
+% OPTIONAL INPUTS:
+% plot_fitting - Boolean controlling whether the original data points
+% and fitting is plotted (default = false)
+%
+% OUTPUTS:
+% density - density in kg/m^3
+% sound_speed - sound speed in m/s
+%
+% ABOUT:
+% author - Bradley Treeby
+% date - 9th January 2012
+% last update - 4th June 2017
+%
+% REFERENCES:
+% Schneider, U., Pedroni, E., and Lomax A., "The calibration of CT
+% Hounsfield units for radiotherapy treatment planning," Phys. Med.
+% Biol., 41, pp. 111-124 (1996).
+%
+% Mast, T. D., "Empirical relationships between acoustic parameters
+% in human soft tissues," Acoust. Res. Lett. Online, 1(2), pp. 37-42
+% (2000).
+%
+% This function is part of the k-Wave Toolbox (http://www.k-wave.org)
+% Copyright (C) 2012-2017 Bradley Treeby
+
+% This file is part of k-Wave. k-Wave is free software: you can
+% redistribute it and/or modify it under the terms of the GNU Lesser
+% General Public License as published by the Free Software Foundation,
+% either version 3 of the License, or (at your option) any later version.
+%
+% k-Wave is distributed in the hope that it will be useful, but WITHOUT ANY
+% WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+% FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for
+% more details.
+%
+% You should have received a copy of the GNU Lesser General Public License
+% along with k-Wave. If not, see .
+
+% create empty density matrix
+density = zeros(size(ct_data), 'like', ct_data);
+
+% apply conversion in several parts using linear fits to the data
+% Part 1: Less than 930 Hounsfield Units
+density(ct_data < 930) = polyval([1.025793065681423, -5.680404011488714], ct_data(ct_data < 930));
+
+% Part 2: Between 930 and 1098 (soft tissue region)
+density(ct_data >= 930 & ct_data <= 1098) = polyval([0.9082709691264, 103.6151457847139], ct_data(ct_data >= 930 & ct_data <= 1098));
+
+% Part 3: Between 1098 and 1260 (between soft tissue and bone)
+density(ct_data > 1098 & ct_data < 1260) = polyval([0.5108369316599, 539.9977189228704], ct_data(ct_data > 1098 & ct_data < 1260));
+
+% Part 4: Greater than 1260 (bone region)
+density(ct_data >= 1260) = polyval([0.6625370912451, 348.8555178455294], ct_data(ct_data >= 1260));
+
+% calculate corresponding sound speed values if required using soft tissue
+% relationship
+if nargout == 2
+ sound_speed = (density + 349) ./ 0.893;
+end
+
+% plot original data and fitted curves if required
+if nargin == 2 && plot_fitting
+
+ % soft tissue values excluding spongiosa
+ density_soft_tissue = [0.95, 1.06, 1.04, 1.02, 1.00, 1.07, 1.03, 1.06, 1.05, 1.06, 1.05, 1.03, 1.05, 1.05, 1.04, 1.10, 1.03, 0.98, 1.09, 1.06, 1.04, 1.05] * 1000;
+ hounsfd_soft_tissue = [ 930, 1055, 1037, 1003, 1003, 1050, 1023, 1055, 1043, 1053, 1044, 1028, 1042, 1045, 1032, 1098, 1014, 958, 1075, 1054, 1032, 1040];
+
+ % bone values
+ density_bone = [1.92, 1.61, 1.33, 1.46, 1.68, 1.41, 1.52, 1.29, 1.18, 1.42, 1.33] * 1000;
+ hounsfd_bone = [2376, 1903, 1499, 1683, 2006, 1595, 1763, 1413, 1260, 1609, 1477];
+
+ % filled lung values
+ density_lung = 0.26 * 1000;
+ hounsfd_lung = 259;
+
+ % find linear fit for soft tissue data points
+ h_axis_soft_tissue = min(hounsfd_soft_tissue(:)):max(hounsfd_soft_tissue(:));
+ p_soft_tissue = polyfit(hounsfd_soft_tissue, density_soft_tissue, 1);
+
+ % find linear fit for bone data points
+ h_axis_bone = min(hounsfd_bone(:)):max(hounsfd_bone(:));
+ p_bone = polyfit(hounsfd_bone, density_bone, 1);
+
+ % find linear fit from soft tissue to bone region
+ h_axis_tissue_to_bone = [h_axis_soft_tissue(end), h_axis_bone(1)];
+ density_tissue_to_bone = [polyval(p_soft_tissue, h_axis_soft_tissue(end)), polyval(p_bone, h_axis_bone(1))];
+ p_tissue_to_bone = polyfit(h_axis_tissue_to_bone, density_tissue_to_bone, 1);
+
+ % find linear fit from filled lung to soft tissue region
+ h_axis_lung_to_tissue = [hounsfd_lung, h_axis_soft_tissue(1)];
+ density_lung_to_tissue = [density_lung, polyval(p_soft_tissue, h_axis_soft_tissue(1))];
+ p_lung_to_tissue = polyfit(h_axis_lung_to_tissue, density_lung_to_tissue, 1);
+
+ % plot original data points
+ figure;
+ hold on;
+ plot(hounsfd_soft_tissue, density_soft_tissue, 'r.');
+ plot(hounsfd_bone , density_bone , 'b.');
+ plot(hounsfd_lung, density_lung, 'g.');
+
+ % plot fitting data
+ plot(h_axis_soft_tissue, polyval(p_soft_tissue, h_axis_soft_tissue), 'r-');
+ plot(h_axis_bone, polyval(p_bone, h_axis_bone), 'b-');
+ plot(h_axis_tissue_to_bone, polyval(p_tissue_to_bone, h_axis_tissue_to_bone), 'k-');
+ plot(h_axis_lung_to_tissue, polyval(p_lung_to_tissue, h_axis_lung_to_tissue), 'k-');
+ xlabel('Hounsfield Units');
+ ylabel('Density [kg/m^3]');
+ legend('Soft Tissue', 'Bone', 'Lung', 'Location', 'NorthWest');
+ box on;
+
+end
\ No newline at end of file
diff --git a/MCNP/tools/matRad_cleanRepFromRUNTPE.m b/MCNP/tools/matRad_cleanRepFromRUNTPE.m
new file mode 100644
index 000000000..ca98f597a
--- /dev/null
+++ b/MCNP/tools/matRad_cleanRepFromRUNTPE.m
@@ -0,0 +1,18 @@
+function matRad_cleanRepFromRUNTPE(inputExtension)
+% matRad_cleanRepFromRUNTPE: function cleans up directory by deleting MCNP
+% files with extension given by input.
+% Delete RUNTPE by default.
+
+if nargin < 1
+ inputExtension = 'r';
+ filelist = dir(strcat('MCNPrunfile_*bixel', inputExtension));
+else
+ filelist = dir(strcat('MCNPrunfile_*bixel', inputExtension));
+end
+
+if isempty(filelist)
+ warning(strcat('No files: ', ' MCNPrunfile_*bixel', inputExtension, ' were found in current directory.'))
+else
+ delete(filelist.name)
+end
+end
\ No newline at end of file
diff --git a/MCNP/tools/matRad_doseCubeFromDij.m b/MCNP/tools/matRad_doseCubeFromDij.m
new file mode 100644
index 000000000..d5b4fbad4
--- /dev/null
+++ b/MCNP/tools/matRad_doseCubeFromDij.m
@@ -0,0 +1,48 @@
+function [doseCube_physicalDose, doseCube_physicalDoseRelError] = matRad_doseCubeFromDij(dij) %, counter)
+
+% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% Function to generate dose cube from dij sparse matrix
+%
+% Call:
+% [doseCube.physicalDose, doseCube.physicalDoseRelError] = matRad_doseCubeFromDij(dij)
+%
+% Outout:
+% doseCube.physicalDose & doseCube.physicalDose_relError
+%
+% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+% Get total physical dose
+doseCube_physicalDose_dummy = zeros(prod(dij.doseGrid.dimensions),1);
+doseCube_physicalDose = zeros(dij.doseGrid.dimensions);
+
+% Comment here to avoid loop over all bixels
+for i = 1:size(dij.physicalDose{1,1},2)
+ doseCube_physicalDose_dummy = doseCube_physicalDose_dummy + ...
+ full(dij.physicalDose{1,1}(:,i));
+ max(doseCube_physicalDose_dummy)
+ disp(i)
+end
+% Uncomment to get specific bixel
+ % doseCube_physicalDose_dummy = doseCube_physicalDose_dummy + ...
+ % full(dij.physicalDose{1,1}(:,counter));
+ % max(doseCube_physicalDose_dummy)
+ % disp(counter)
+
+doseCube_physicalDose(:) = doseCube_physicalDose_dummy;
+
+% Get error of total physical dose
+doseCube_physicalDoseRelError_dummy = zeros(prod(dij.doseGrid.dimensions),1);
+doseCube_physicalDoseRelError = zeros(dij.doseGrid.dimensions);
+
+try
+ for i = 1:size(dij.physicalDose{1,1},2)
+ doseCube_physicalDoseRelError_dummy = doseCube_physicalDoseRelError_dummy + ...
+ full(dij.physicalDose_relError{1,1}(:,i));
+ end
+ doseCube_physicalDoseRelError(:) = doseCube_physicalDoseRelError_dummy;
+
+catch
+ disp('No relative error calculation available. Probably no Monte Carlo simulation run...')
+end
+
+end
\ No newline at end of file
diff --git a/MCNP/tools/matRad_getRMFmodelParameters4neutrons.m b/MCNP/tools/matRad_getRMFmodelParameters4neutrons.m
new file mode 100644
index 000000000..29a911855
--- /dev/null
+++ b/MCNP/tools/matRad_getRMFmodelParameters4neutrons.m
@@ -0,0 +1,397 @@
+function [dij, cst] = matRad_getRMFmodelParameters4neutrons(dij, counterDijColumns, doseMatrixBixel, pln, ct, cst, modificationMode)
+% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% A: Extract data tallied in MCNP simulation when biological optimization
+% for neutrons is switched on.
+%
+% B: Calculate RBE_LD and RBE_HD values for neutron radiation for each
+% bixel.
+%
+% input: dij: structure from matRad
+% counterDijColumns: indicates bixel number
+% doseMatrixBixel: information on data tallied in MCNP
+% calculation (only needed in simulation
+% workflow, set doseMatrixBixel=0 when
+% not needed)
+% pln: structure from matRad
+% ct: structure from matRad
+% cst: structure from matRad (modify
+% alpha/beta ratio here)
+% modificationMode: indicate modification of alpha/beta
+% ratio for RMF model parameter
+% re-calculation
+%
+%
+% output: dij
+% cst: cst with cancelled alpha/beta ratio
+% overlaps
+%
+%
+% Author: Lucas Sommer (Lucas.Sommer@tum.de), 09/2020
+%
+% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+%% Check function usage
+if ~exist('modificationMode')
+ modificationMode = false;
+end
+
+%% A: Data Extraction: Extract particle specific dose, RBE_DSB weighted dose and intra track term for RMF model
+if ~modificationMode
+ %% Proton
+ % Physical dose
+ dij.doseMatrixBixel(counterDijColumns).protonDose{1} = ...
+ sparse(find(doseMatrixBixel.physicalDose_proton),1,doseMatrixBixel.physicalDose_proton(doseMatrixBixel.physicalDose_proton~=0),dij.numOfVoxels,1);
+ dij.doseMatrixBixel(counterDijColumns).protonDose_relError{1} = ...
+ sparse(find(doseMatrixBixel.physicalDose_proton_relError),1,doseMatrixBixel.physicalDose_proton_relError(doseMatrixBixel.physicalDose_proton_relError~=0),dij.numOfVoxels,1);
+ % Aerobic environment
+ dij.doseMatrixBixel(counterDijColumns).protonDosexRBE_aero{1} = ...
+ sparse(find(doseMatrixBixel.RBExDose_proton_aero),1,doseMatrixBixel.RBExDose_proton_aero(doseMatrixBixel.RBExDose_proton_aero~=0),dij.numOfVoxels,1);
+ dij.doseMatrixBixel(counterDijColumns).RBExDose_proton_aero_relError{1} = ...
+ sparse(find(doseMatrixBixel.RBExDose_proton_aero_relError),1,doseMatrixBixel.RBExDose_proton_aero_relError(doseMatrixBixel.RBExDose_proton_aero_relError~=0),dij.numOfVoxels,1);
+
+ dij.doseMatrixBixel(counterDijColumns).intraTrackTerm_aero_proton{1} = ...
+ sparse(find(doseMatrixBixel.intraTrackTerm_aero_proton),1,doseMatrixBixel.intraTrackTerm_aero_proton(doseMatrixBixel.intraTrackTerm_aero_proton~=0),dij.numOfVoxels,1);
+ dij.doseMatrixBixel(counterDijColumns).intraTrackTerm_aero_proton_relError{1} = ...
+ sparse(find(doseMatrixBixel.intraTrackTerm_proton_aero_relError),1,doseMatrixBixel.intraTrackTerm_proton_aero_relError(doseMatrixBixel.intraTrackTerm_proton_aero_relError~=0),dij.numOfVoxels,1);
+% % Anoxic environment
+% dij.doseMatrixBixel(counterDijColumns).protonDosexRBE_anox{1} = ...
+% sparse(find(doseMatrixBixel.RBExDose_proton_anox),1,doseMatrixBixel.RBExDose_proton_anox(doseMatrixBixel.RBExDose_proton_anox~=0),dij.numOfVoxels,1);
+% dij.doseMatrixBixel(counterDijColumns).RBExDose_proton_anox_relError{1} = ...
+% sparse(find(doseMatrixBixel.RBExDose_proton_anox_relError),1,doseMatrixBixel.RBExDose_proton_anox_relError(doseMatrixBixel.RBExDose_proton_anox_relError~=0),dij.numOfVoxels,1);
+%
+% dij.doseMatrixBixel(counterDijColumns).intraTrackTerm_anox_proton{1} = ...
+% sparse(find(doseMatrixBixel.intraTrackTerm_anox_proton),1,doseMatrixBixel.intraTrackTerm_anox_proton(doseMatrixBixel.intraTrackTerm_anox_proton~=0),dij.numOfVoxels,1);
+% dij.doseMatrixBixel(counterDijColumns).intraTrackTerm_anox_proton_relError{1} = ...
+% sparse(find(doseMatrixBixel.intraTrackTerm_proton_anox_relError),1,doseMatrixBixel.intraTrackTerm_proton_anox_relError(doseMatrixBixel.intraTrackTerm_proton_anox_relError~=0),dij.numOfVoxels,1);
+
+
+ %% Deuteron
+ dij.doseMatrixBixel(counterDijColumns).deuteronDose{1} = ...
+ sparse(find(doseMatrixBixel.physicalDose_deuteron),1,doseMatrixBixel.physicalDose_deuteron(doseMatrixBixel.physicalDose_deuteron~=0),dij.numOfVoxels,1);
+ dij.doseMatrixBixel(counterDijColumns).deuteronDose_relError{1} = ...
+ sparse(find(doseMatrixBixel.physicalDose_deuteron_relError),1,doseMatrixBixel.physicalDose_deuteron_relError(doseMatrixBixel.physicalDose_deuteron_relError~=0),dij.numOfVoxels,1);
+ % Aerobic environment
+ dij.doseMatrixBixel(counterDijColumns).deuteronDosexRBE_aero{1} = ...
+ sparse(find(doseMatrixBixel.RBExDose_deuteron_aero),1,doseMatrixBixel.RBExDose_deuteron_aero(doseMatrixBixel.RBExDose_deuteron_aero~=0),dij.numOfVoxels,1);
+ dij.doseMatrixBixel(counterDijColumns).RBExDose_deuteron_aero_relError{1} = ...
+ sparse(find(doseMatrixBixel.RBExDose_deuteron_aero_relError),1,doseMatrixBixel.RBExDose_deuteron_aero_relError(doseMatrixBixel.RBExDose_deuteron_aero_relError~=0),dij.numOfVoxels,1);
+
+ dij.doseMatrixBixel(counterDijColumns).intraTrackTerm_aero_deuteron{1} = ...
+ sparse(find(doseMatrixBixel.intraTrackTerm_aero_deuteron),1,doseMatrixBixel.intraTrackTerm_aero_deuteron(doseMatrixBixel.intraTrackTerm_aero_deuteron~=0),dij.numOfVoxels,1);
+ dij.doseMatrixBixel(counterDijColumns).intraTrackTerm_aero_deuteron_relError{1} = ...
+ sparse(find(doseMatrixBixel.intraTrackTerm_deuteron_aero_relError),1,doseMatrixBixel.intraTrackTerm_deuteron_aero_relError(doseMatrixBixel.intraTrackTerm_deuteron_aero_relError~=0),dij.numOfVoxels,1);
+% % Anoxic environment
+% dij.doseMatrixBixel(counterDijColumns).deuteronDosexRBE_anox{1} = ...
+% sparse(find(doseMatrixBixel.RBExDose_deuteron_anox),1,doseMatrixBixel.RBExDose_deuteron_anox(doseMatrixBixel.RBExDose_deuteron_anox~=0),dij.numOfVoxels,1);
+% dij.doseMatrixBixel(counterDijColumns).RBExDose_deuteron_anox_relError{1} = ...
+% sparse(find(doseMatrixBixel.RBExDose_deuteron_anox_relError),1,doseMatrixBixel.RBExDose_deuteron_anox_relError(doseMatrixBixel.RBExDose_deuteron_anox_relError~=0),dij.numOfVoxels,1);
+%
+% dij.doseMatrixBixel(counterDijColumns).intraTrackTerm_anox_deuteron{1} = ...
+% sparse(find(doseMatrixBixel.intraTrackTerm_anox_deuteron),1,doseMatrixBixel.intraTrackTerm_anox_deuteron(doseMatrixBixel.intraTrackTerm_anox_deuteron~=0),dij.numOfVoxels,1);
+% dij.doseMatrixBixel(counterDijColumns).intraTrackTerm_anox_deuteron_relError{1} = ...
+% sparse(find(doseMatrixBixel.intraTrackTerm_deuteron_anox_relError),1,doseMatrixBixel.intraTrackTerm_deuteron_anox_relError(doseMatrixBixel.intraTrackTerm_deuteron_anox_relError~=0),dij.numOfVoxels,1);
+
+ %% Triton
+ dij.doseMatrixBixel(counterDijColumns).tritonDose{1} = ...
+ sparse(find(doseMatrixBixel.physicalDose_triton),1,doseMatrixBixel.physicalDose_triton(doseMatrixBixel.physicalDose_triton~=0),dij.numOfVoxels,1);
+ dij.doseMatrixBixel(counterDijColumns).tritonDose_relError{1} = ...
+ sparse(find(doseMatrixBixel.physicalDose_triton_relError),1,doseMatrixBixel.physicalDose_triton_relError(doseMatrixBixel.physicalDose_triton_relError~=0),dij.numOfVoxels,1);
+ % Aerobic environment
+ dij.doseMatrixBixel(counterDijColumns).tritonDosexRBE_aero{1} = ...
+ sparse(find(doseMatrixBixel.RBExDose_triton_aero),1,doseMatrixBixel.RBExDose_triton_aero(doseMatrixBixel.RBExDose_triton_aero~=0),dij.numOfVoxels,1);
+ dij.doseMatrixBixel(counterDijColumns).RBExDose_triton_aero_relError{1} = ...
+ sparse(find(doseMatrixBixel.RBExDose_triton_aero_relError),1,doseMatrixBixel.RBExDose_triton_aero_relError(doseMatrixBixel.RBExDose_triton_aero_relError~=0),dij.numOfVoxels,1);
+
+ dij.doseMatrixBixel(counterDijColumns).intraTrackTerm_aero_triton{1} = ...
+ sparse(find(doseMatrixBixel.intraTrackTerm_aero_triton),1,doseMatrixBixel.intraTrackTerm_aero_triton(doseMatrixBixel.intraTrackTerm_aero_triton~=0),dij.numOfVoxels,1);
+ dij.doseMatrixBixel(counterDijColumns).intraTrackTerm_aero_triton_relError{1} = ...
+ sparse(find(doseMatrixBixel.intraTrackTerm_triton_aero_relError),1,doseMatrixBixel.intraTrackTerm_triton_aero_relError(doseMatrixBixel.intraTrackTerm_triton_aero_relError~=0),dij.numOfVoxels,1);
+% % Anoxic environment
+% dij.doseMatrixBixel(counterDijColumns).tritonDosexRBE_anox{1} = ...
+% sparse(find(doseMatrixBixel.RBExDose_triton_anox),1,doseMatrixBixel.RBExDose_triton_anox(doseMatrixBixel.RBExDose_triton_anox~=0),dij.numOfVoxels,1);
+% dij.doseMatrixBixel(counterDijColumns).RBExDose_triton_anox_relError{1} = ...
+% sparse(find(doseMatrixBixel.RBExDose_triton_anox_relError),1,doseMatrixBixel.RBExDose_triton_anox_relError(doseMatrixBixel.RBExDose_triton_anox_relError~=0),dij.numOfVoxels,1);
+%
+% dij.doseMatrixBixel(counterDijColumns).intraTrackTerm_anox_triton{1} = ...
+% sparse(find(doseMatrixBixel.intraTrackTerm_anox_triton),1,doseMatrixBixel.intraTrackTerm_anox_triton(doseMatrixBixel.intraTrackTerm_anox_triton~=0),dij.numOfVoxels,1);
+% dij.doseMatrixBixel(counterDijColumns).intraTrackTerm_anox_triton_relError{1} = ...
+% sparse(find(doseMatrixBixel.intraTrackTerm_triton_anox_relError),1,doseMatrixBixel.intraTrackTerm_triton_anox_relError(doseMatrixBixel.intraTrackTerm_triton_anox_relError~=0),dij.numOfVoxels,1);
+
+ %% He3
+ dij.doseMatrixBixel(counterDijColumns).he3Dose{1} = ...
+ sparse(find(doseMatrixBixel.physicalDose_he3),1,doseMatrixBixel.physicalDose_he3(doseMatrixBixel.physicalDose_he3~=0),dij.numOfVoxels,1);
+ dij.doseMatrixBixel(counterDijColumns).he3Dose_relError{1} = ...
+ sparse(find(doseMatrixBixel.physicalDose_he3_relError),1,doseMatrixBixel.physicalDose_he3_relError(doseMatrixBixel.physicalDose_he3_relError~=0),dij.numOfVoxels,1);
+ % Aerobic environment
+ dij.doseMatrixBixel(counterDijColumns).he3DosexRBE_aero{1} = ...
+ sparse(find(doseMatrixBixel.RBExDose_he3_aero),1,doseMatrixBixel.RBExDose_he3_aero(doseMatrixBixel.RBExDose_he3_aero~=0),dij.numOfVoxels,1);
+ dij.doseMatrixBixel(counterDijColumns).RBExDose_he3_aero_relError{1} = ...
+ sparse(find(doseMatrixBixel.RBExDose_he3_aero_relError),1,doseMatrixBixel.RBExDose_he3_aero_relError(doseMatrixBixel.RBExDose_he3_aero_relError~=0),dij.numOfVoxels,1);
+
+ dij.doseMatrixBixel(counterDijColumns).intraTrackTerm_aero_he3{1} = ...
+ sparse(find(doseMatrixBixel.intraTrackTerm_aero_he3),1,doseMatrixBixel.intraTrackTerm_aero_he3(doseMatrixBixel.intraTrackTerm_aero_he3~=0),dij.numOfVoxels,1);
+ dij.doseMatrixBixel(counterDijColumns).intraTrackTerm_aero_he3_relError{1} = ...
+ sparse(find(doseMatrixBixel.intraTrackTerm_he3_aero_relError),1,doseMatrixBixel.intraTrackTerm_he3_aero_relError(doseMatrixBixel.intraTrackTerm_he3_aero_relError~=0),dij.numOfVoxels,1);
+% % Anoxic environment
+% dij.doseMatrixBixel(counterDijColumns).he3DosexRBE_anox{1} = ...
+% sparse(find(doseMatrixBixel.RBExDose_he3_anox),1,doseMatrixBixel.RBExDose_he3_anox(doseMatrixBixel.RBExDose_he3_anox~=0),dij.numOfVoxels,1);
+% dij.doseMatrixBixel(counterDijColumns).RBExDose_he3_anox_relError{1} = ...
+% sparse(find(doseMatrixBixel.RBExDose_he3_anox_relError),1,doseMatrixBixel.RBExDose_he3_anox_relError(doseMatrixBixel.RBExDose_he3_anox_relError~=0),dij.numOfVoxels,1);
+%
+% dij.doseMatrixBixel(counterDijColumns).intraTrackTerm_anox_he3{1} = ...
+% sparse(find(doseMatrixBixel.intraTrackTerm_anox_he3),1,doseMatrixBixel.intraTrackTerm_anox_he3(doseMatrixBixel.intraTrackTerm_anox_he3~=0),dij.numOfVoxels,1);
+% dij.doseMatrixBixel(counterDijColumns).intraTrackTerm_anox_he3_relError{1} = ...
+% sparse(find(doseMatrixBixel.intraTrackTerm_he3_anox_relError),1,doseMatrixBixel.intraTrackTerm_he3_anox_relError(doseMatrixBixel.intraTrackTerm_he3_anox_relError~=0),dij.numOfVoxels,1);
+
+ %% Alpha
+ dij.doseMatrixBixel(counterDijColumns).alphaDose{1} = ...
+ sparse(find(doseMatrixBixel.physicalDose_alpha),1,doseMatrixBixel.physicalDose_alpha(doseMatrixBixel.physicalDose_alpha~=0),dij.numOfVoxels,1);
+ dij.doseMatrixBixel(counterDijColumns).alphaDose_relError{1} = ...
+ sparse(find(doseMatrixBixel.physicalDose_alpha_relError),1,doseMatrixBixel.physicalDose_alpha_relError(doseMatrixBixel.physicalDose_alpha_relError~=0),dij.numOfVoxels,1);
+ % Aerobic environment
+ dij.doseMatrixBixel(counterDijColumns).alphaDosexRBE_aero{1} = ...
+ sparse(find(doseMatrixBixel.RBExDose_alpha_aero),1,doseMatrixBixel.RBExDose_alpha_aero(doseMatrixBixel.RBExDose_alpha_aero~=0),dij.numOfVoxels,1);
+ dij.doseMatrixBixel(counterDijColumns).RBExDose_alpha_aero_relError{1} = ...
+ sparse(find(doseMatrixBixel.RBExDose_alpha_aero_relError),1,doseMatrixBixel.RBExDose_alpha_aero_relError(doseMatrixBixel.RBExDose_alpha_aero_relError~=0),dij.numOfVoxels,1);
+
+ dij.doseMatrixBixel(counterDijColumns).intraTrackTerm_aero_alpha{1} = ...
+ sparse(find(doseMatrixBixel.intraTrackTerm_aero_alpha),1,doseMatrixBixel.intraTrackTerm_aero_alpha(doseMatrixBixel.intraTrackTerm_aero_alpha~=0),dij.numOfVoxels,1);
+ dij.doseMatrixBixel(counterDijColumns).intraTrackTerm_aero_alpha_relError{1} = ...
+ sparse(find(doseMatrixBixel.intraTrackTerm_alpha_aero_relError),1,doseMatrixBixel.intraTrackTerm_alpha_aero_relError(doseMatrixBixel.intraTrackTerm_alpha_aero_relError~=0),dij.numOfVoxels,1);
+% % Anoxic environment
+% dij.doseMatrixBixel(counterDijColumns).alphaDosexRBE_anox{1} = ...
+% sparse(find(doseMatrixBixel.RBExDose_alpha_anox),1,doseMatrixBixel.RBExDose_alpha_anox(doseMatrixBixel.RBExDose_alpha_anox~=0),dij.numOfVoxels,1);
+% dij.doseMatrixBixel(counterDijColumns).RBExDose_alpha_anox_relError{1} = ...
+% sparse(find(doseMatrixBixel.RBExDose_alpha_anox_relError),1,doseMatrixBixel.RBExDose_alpha_anox_relError(doseMatrixBixel.RBExDose_alpha_anox_relError~=0),dij.numOfVoxels,1);
+%
+% dij.doseMatrixBixel(counterDijColumns).intraTrackTerm_anox_alpha{1} = ...
+% sparse(find(doseMatrixBixel.intraTrackTerm_anox_alpha),1,doseMatrixBixel.intraTrackTerm_anox_alpha(doseMatrixBixel.intraTrackTerm_anox_alpha~=0),dij.numOfVoxels,1);
+% dij.doseMatrixBixel(counterDijColumns).intraTrackTerm_anox_alpha_relError{1} = ...
+% sparse(find(doseMatrixBixel.intraTrackTerm_alpha_anox_relError),1,doseMatrixBixel.intraTrackTerm_alpha_anox_relError(doseMatrixBixel.intraTrackTerm_alpha_anox_relError~=0),dij.numOfVoxels,1);
+
+ %% Electron
+ dij.doseMatrixBixel(counterDijColumns).electronDose{1} = ...
+ sparse(find(doseMatrixBixel.physicalDose_electron),1,doseMatrixBixel.physicalDose_electron(doseMatrixBixel.physicalDose_electron~=0),dij.numOfVoxels,1);
+ dij.doseMatrixBixel(counterDijColumns).electronDose_relError{1} = ...
+ sparse(find(doseMatrixBixel.physicalDose_electron_relError),1,doseMatrixBixel.physicalDose_electron_relError(doseMatrixBixel.physicalDose_electron_relError~=0),dij.numOfVoxels,1);
+ % Aerobic environment
+ dij.doseMatrixBixel(counterDijColumns).electronDosexRBE_aero{1} = ...
+ sparse(find(doseMatrixBixel.RBExDose_electron_aero),1,doseMatrixBixel.RBExDose_electron_aero(doseMatrixBixel.RBExDose_electron_aero~=0),dij.numOfVoxels,1);
+ dij.doseMatrixBixel(counterDijColumns).RBExDose_electron_aero_relError{1} = ...
+ sparse(find(doseMatrixBixel.RBExDose_electron_aero_relError),1,doseMatrixBixel.RBExDose_electron_aero_relError(doseMatrixBixel.RBExDose_electron_aero_relError~=0),dij.numOfVoxels,1);
+
+ dij.doseMatrixBixel(counterDijColumns).intraTrackTerm_aero_electron{1} = ...
+ sparse(find(doseMatrixBixel.intraTrackTerm_aero_electron),1,doseMatrixBixel.intraTrackTerm_aero_electron(doseMatrixBixel.intraTrackTerm_aero_electron~=0),dij.numOfVoxels,1);
+ dij.doseMatrixBixel(counterDijColumns).intraTrackTerm_aero_electron_relError{1} = ...
+ sparse(find(doseMatrixBixel.intraTrackTerm_electron_aero_relError),1,doseMatrixBixel.intraTrackTerm_electron_aero_relError(doseMatrixBixel.intraTrackTerm_electron_aero_relError~=0),dij.numOfVoxels,1);
+% % Anoxic environment
+% dij.doseMatrixBixel(counterDijColumns).electronDosexRBE_anox{1} = ...
+% sparse(find(doseMatrixBixel.RBExDose_electron_anox),1,doseMatrixBixel.RBExDose_electron_anox(doseMatrixBixel.RBExDose_electron_anox~=0),dij.numOfVoxels,1);
+% dij.doseMatrixBixel(counterDijColumns).RBExDose_electron_anox_relError{1} = ...
+% sparse(find(doseMatrixBixel.RBExDose_electron_anox_relError),1,doseMatrixBixel.RBExDose_electron_anox_relError(doseMatrixBixel.RBExDose_electron_anox_relError~=0),dij.numOfVoxels,1);
+%
+% dij.doseMatrixBixel(counterDijColumns).intraTrackTerm_anox_electron{1} = ...
+% sparse(find(doseMatrixBixel.intraTrackTerm_anox_electron),1,doseMatrixBixel.intraTrackTerm_anox_electron(doseMatrixBixel.intraTrackTerm_anox_electron~=0),dij.numOfVoxels,1);
+% dij.doseMatrixBixel(counterDijColumns).intraTrackTerm_anox_electron_relError{1} = ...
+% sparse(find(doseMatrixBixel.intraTrackTerm_electron_anox_relError),1,doseMatrixBixel.intraTrackTerm_electron_anox_relError(doseMatrixBixel.intraTrackTerm_electron_anox_relError~=0),dij.numOfVoxels,1);
+
+ %% Heavy ion
+ dij.doseMatrixBixel(counterDijColumns).heavyIonDose{1} = ...
+ sparse(find(doseMatrixBixel.physicalDose_heavyIon),1,doseMatrixBixel.physicalDose_heavyIon(doseMatrixBixel.physicalDose_heavyIon~=0),dij.numOfVoxels,1);
+ dij.doseMatrixBixel(counterDijColumns).heavyIonDose_relError{1} = ...
+ sparse(find(doseMatrixBixel.physicalDose_heavyIon_relError),1,doseMatrixBixel.physicalDose_heavyIon_relError(doseMatrixBixel.physicalDose_heavyIon_relError~=0),dij.numOfVoxels,1);
+ % Check heavy ion RBE values
+ if strcmp(pln.propOpt.bioOptimization,'RBExSecPartDose_MCDS_RMFmodel')
+ if isfield(pln.propOpt, 'heavyIonRBEval_aero')
+ RBEvalue_heavyIon_aero = pln.propOpt.heavyIonRBEval_aero;
+ else
+ RBEvalue_heavyIon_aero = 3.41;
+ end
+% if isfield(pln.propOpt, 'heavyIonRBEval_anox')
+% RBEvalue_heavyIon_anox = pln.propOpt.heavyIonRBEval_anox;
+% else
+% RBEvalue_heavyIon_anox = 9.93;
+% end
+ end
+ % Aerobic environment
+ dij.doseMatrixBixel(counterDijColumns).heavyIonDosexRBE_aero{1} = ...
+ dij.doseMatrixBixel(counterDijColumns).heavyIonDose{1}*RBEvalue_heavyIon_aero;
+ dij.doseMatrixBixel(counterDijColumns).RBExDose_heavyIon_aero_relError{1} = ...
+ dij.doseMatrixBixel(counterDijColumns).heavyIonDose_relError{1};
+
+ dij.doseMatrixBixel(counterDijColumns).intraTrackTerm_aero_heavyIon{1} = ...
+ sparse(find(doseMatrixBixel.intraTrackTerm_aero_heavyIon),1,doseMatrixBixel.intraTrackTerm_aero_heavyIon(doseMatrixBixel.intraTrackTerm_aero_heavyIon~=0),dij.numOfVoxels,1);
+ dij.doseMatrixBixel(counterDijColumns).intraTrackTerm_aero_heavyIon_relError{1} = ...
+ sparse(find(doseMatrixBixel.intraTrackTerm_heavyIon_aero_relError),1,doseMatrixBixel.intraTrackTerm_heavyIon_aero_relError(doseMatrixBixel.intraTrackTerm_heavyIon_aero_relError~=0),dij.numOfVoxels,1);
+% % Anoxic environment
+% dij.doseMatrixBixel(counterDijColumns).heavyIonDosexRBE_anox{1} = ...
+% dij.doseMatrixBixel(counterDijColumns).heavyIonDose{1}*RBEvalue_heavyIon_anox;
+% dij.doseMatrixBixel(counterDijColumns).RBExDose_heavyIon_anox_relError{1} = ...
+% dij.doseMatrixBixel(counterDijColumns).heavyIonDose_relError{1};
+%
+% dij.doseMatrixBixel(counterDijColumns).intraTrackTerm_anox_heavyIon{1} = ...
+% sparse(find(doseMatrixBixel.intraTrackTerm_anox_heavyIon),1,doseMatrixBixel.intraTrackTerm_anox_heavyIon(doseMatrixBixel.intraTrackTerm_anox_heavyIon~=0),dij.numOfVoxels,1);
+% dij.doseMatrixBixel(counterDijColumns).intraTrackTerm_anox_heavyIon_relError{1} = ...
+% sparse(find(doseMatrixBixel.intraTrackTerm_heavyIon_anox_relError),1,doseMatrixBixel.intraTrackTerm_heavyIon_anox_relError(doseMatrixBixel.intraTrackTerm_heavyIon_anox_relError~=0),dij.numOfVoxels,1);
+
+% %% Photon dose
+% dij.doseMatrixBixel(counterDijColumns).photonDose{1} = ...
+% sparse(find(doseMatrixBixel.physicalDose_photonHeating),1,doseMatrixBixel.physicalDose_photonHeating(doseMatrixBixel.physicalDose_photonHeating~=0),dij.numOfVoxels,1);
+% dij.doseMatrixBixel(counterDijColumns).photonDose_relError{1} = ...
+% sparse(find(doseMatrixBixel.physicalDose_photonHeating_relError),1,doseMatrixBixel.physicalDose_photonHeating_relError(doseMatrixBixel.physicalDose_photonHeating_relError~=0),dij.numOfVoxels,1);
+% %% Neutron dose
+% dij.doseMatrixBixel(counterDijColumns).neutronDose{1} = ...
+% sparse(find(doseMatrixBixel.physicalDose_neutronHeating),1,doseMatrixBixel.physicalDose_neutronHeating(doseMatrixBixel.physicalDose_neutronHeating~=0),dij.numOfVoxels,1);
+% dij.doseMatrixBixel(counterDijColumns).neutronDose_relError{1} = ...
+% sparse(find(doseMatrixBixel.physicalDose_neutronHeating_relError),1,doseMatrixBixel.physicalDose_neutronHeating_relError(doseMatrixBixel.physicalDose_neutronHeating_relError~=0),dij.numOfVoxels,1);
+end
+
+%% B: Calculate alpha and beta values for neutron radiation using RMF model
+
+% Calculate total dose
+disp('*****')
+disp('Total dose for calculation of RMF model parameters: sum of secondary charged particles only.')
+disp('*****')
+containerSummedDose = dij.doseMatrixBixel(counterDijColumns).protonDose{1} + ...
+ dij.doseMatrixBixel(counterDijColumns).deuteronDose{1} + dij.doseMatrixBixel(counterDijColumns).tritonDose{1} + dij.doseMatrixBixel(counterDijColumns).alphaDose{1} + dij.doseMatrixBixel(counterDijColumns).he3Dose{1} + ...
+ dij.doseMatrixBixel(counterDijColumns).heavyIonDose{1} + dij.doseMatrixBixel(counterDijColumns).electronDose{1};
+
+
+%% B.1: Calculate dose weighted RBE for DSB induction
+disp('*****')
+disp('RBE weighted dose for calculation of RMF model parameters: sum of secondary charged particle dose x RBE(aero).')
+disp('*****')
+containerRBExDose_aero = dij.doseMatrixBixel(counterDijColumns).protonDosexRBE_aero{1} + ...
+ dij.doseMatrixBixel(counterDijColumns).deuteronDosexRBE_aero{1} + dij.doseMatrixBixel(counterDijColumns).tritonDosexRBE_aero{1} + dij.doseMatrixBixel(counterDijColumns).alphaDosexRBE_aero{1} + dij.doseMatrixBixel(counterDijColumns).he3DosexRBE_aero{1} + ...
+ dij.doseMatrixBixel(counterDijColumns).heavyIonDosexRBE_aero{1} + dij.doseMatrixBixel(counterDijColumns).electronDosexRBE_aero{1};
+
+disp('*****')
+disp('Dose weighted RBE values: ratio of RBExDose/Dose for each voxel (aerobic environment).')
+disp('Secondary charged particles only.')
+disp('*****')
+containerDoseWeightedRBEvalues_aero = containerRBExDose_aero(containerSummedDose~=0)./containerSummedDose(containerSummedDose~=0);
+
+% disp('*****')
+% disp('RBE weighted dose for calculation of RMF model parameters: sum of secondary charged particle dose x RBE(anox).')
+% disp('*****')
+% containerRBExDose_anox = dij.doseMatrixBixel(counterDijColumns).protonDosexRBE_anox{1} + ...
+% dij.doseMatrixBixel(counterDijColumns).deuteronDosexRBE_anox{1} + dij.doseMatrixBixel(counterDijColumns).tritonDosexRBE_anox{1} + dij.doseMatrixBixel(counterDijColumns).alphaDosexRBE_anox{1} + dij.doseMatrixBixel(counterDijColumns).he3DosexRBE_anox{1} + ...
+% dij.doseMatrixBixel(counterDijColumns).heavyIonDosexRBE_anox{1} + dij.doseMatrixBixel(counterDijColumns).electronDosexRBE_anox{1};
+
+% disp('*****')
+% disp('Dose weighted RBE values: ratio of RBExDose/Dose for each voxel (anoxic environment).')
+% disp('Secondary charged particles only.')
+% disp('*****')
+% containerDoseWeightedRBEvalues_anox = containerRBExDose_anox(containerSummedDose~=0)./containerSummedDose(containerSummedDose~=0);
+
+%% B.2: Calculate dose weighted intra track term for RMF model
+disp('*****')
+disp('Dose weighted RBE values: ratio of zFxRBExRBExDose/Dose for each voxel.')
+disp('Secondary charged particles only.')
+disp('*****')
+
+% Calculation of intra track term for all particles
+containerIntraTrackTerm_aero = dij.doseMatrixBixel(counterDijColumns).intraTrackTerm_aero_proton{1} + ...
+ dij.doseMatrixBixel(counterDijColumns).intraTrackTerm_aero_deuteron{1} + dij.doseMatrixBixel(counterDijColumns).intraTrackTerm_aero_triton{1} + dij.doseMatrixBixel(counterDijColumns).intraTrackTerm_aero_alpha{1} + dij.doseMatrixBixel(counterDijColumns).intraTrackTerm_aero_he3{1} + ...
+ dij.doseMatrixBixel(counterDijColumns).intraTrackTerm_aero_heavyIon{1} ...
+ + dij.doseMatrixBixel(counterDijColumns).intraTrackTerm_aero_electron{1};
+% Calculation of intra track term for all particles
+% containerIntraTrackTerm_anox = dij.doseMatrixBixel(counterDijColumns).intraTrackTerm_anox_proton{1} + ...
+% dij.doseMatrixBixel(counterDijColumns).intraTrackTerm_anox_deuteron{1} + dij.doseMatrixBixel(counterDijColumns).intraTrackTerm_anox_triton{1} + dij.doseMatrixBixel(counterDijColumns).intraTrackTerm_anox_alpha{1} + dij.doseMatrixBixel(counterDijColumns).intraTrackTerm_anox_he3{1} + ...
+% dij.doseMatrixBixel(counterDijColumns).intraTrackTerm_anox_heavyIon{1} ...
+% + dij.doseMatrixBixel(counterDijColumns).intraTrackTerm_anox_electron{1};
+
+
+% Rescaling of zF intra track term according to zF rescaling factor
+if isfield(pln, 'propMCDS')
+ if isfield(pln.propMCDS, 'zFrescaleFactor')
+ zFrescaleFactor = pln.propMCDS.zFrescaleFactor;
+ end
+else
+ zFrescaleFactor = 1;
+end
+
+containerIntraTrackTerm_aero = containerIntraTrackTerm_aero * zFrescaleFactor;
+% containerIntraTrackTerm_anox = containerIntraTrackTerm_anox * zFrescaleFactor;
+
+containerDoseWeightedintraTrackTerm_aero = spalloc(prod(ct.cubeDim), 1, prod(ct.cubeDim));
+% containerDoseWeightedintraTrackTerm_anox = spalloc(prod(ct.cubeDim), 1, prod(ct.cubeDim));
+containerDoseWeightedintraTrackTerm_aero(containerSummedDose~=0) = containerIntraTrackTerm_aero(containerSummedDose~=0)./containerSummedDose(containerSummedDose~=0);
+% containerDoseWeightedintraTrackTerm_anox(containerSummedDose~=0) = containerIntraTrackTerm_anox(containerSummedDose~=0)./containerSummedDose(containerSummedDose~=0);
+
+% Check indices
+if ~isempty(find(find(containerSummedDose) - find(containerDoseWeightedintraTrackTerm_aero)))
+ error('Voxel indices of non-zero voxel elements of summed dose and intra track terms are not the same!')
+% elseif ~isempty(find(find(containerSummedDose) - find(containerDoseWeightedintraTrackTerm_anox)))
+% error('Voxel indices of non-zero voxel elements of summed dose and intra track terms are not the same!')
+elseif ~isempty(find(find(containerSummedDose) - find(containerRBExDose_aero)))
+ error('Voxel indices of non-zero voxel elements of summed dose and RBE weighted dose are not the same!')
+% elseif ~isempty(find(find(containerSummedDose) - find(containerRBExDose_anox)))
+% error('Voxel indices of non-zero voxel elements of summed dose and RBE weighted dose are not the same!')
+end
+
+%% B.3: Get alpha over beta ratio map for reference radiation
+alphaBetaRatioMap = zeros(ct.cubeDim);
+
+for counterRTstructures = 1:size(cst,1)
+ % Check for predefined values
+ if ~isfield(cst{counterRTstructures,5},'alphaBetaRatioX')
+ cst{counterRTstructures,5}.alphaBetaRatioX = pln.propOpt.defaultLQmodel.ratioAlphaBeta;
+ end
+ if ~isfield(cst{counterRTstructures,5},'LQmodelPriority')
+ if strcmpi(cst{counterRTstructures,2}, pln.propMCNP.bodyStructureName)
+ cst{counterRTstructures,5}.LQmodelPriority = 0;
+ elseif strcmp(cst{counterRTstructures,3}, 'OAR') && ~strcmpi(cst{counterRTstructures,2}, pln.propMCNP.bodyStructureName)
+ cst{counterRTstructures,5}.LQmodelPriority = 1;
+ elseif strcmp(cst{counterRTstructures,3}, 'TARGET')
+ cst{counterRTstructures,5}.LQmodelPriority = 2;
+ end
+ end
+end
+
+for counterRTstructures = 1:size(cst,1)
+ % Set values in alpha over beta ratio map for each voxel
+ for counterOtherStruct = 1:size(cst,1)
+ if size(unique([cst{counterRTstructures,4}{1}' cst{counterOtherStruct,4}{1}']),2)~= size(cst{counterRTstructures,4}{1},1)+size(cst{counterOtherStruct,4}{1},1) && counterOtherStruct~=counterRTstructures
+ if cst{counterRTstructures,5}.LQmodelPriority > cst{counterOtherStruct,5}.LQmodelPriority
+ alphaBetaRatioMap(cst{counterRTstructures,4}{1}) = cst{counterRTstructures,5}.alphaBetaRatioX;
+ elseif cst{counterRTstructures,5}.LQmodelPriority < cst{counterOtherStruct,5}.LQmodelPriority
+ alphaBetaRatioMap(cst{counterOtherStruct,4}{1}) = cst{counterOtherStruct,5}.alphaBetaRatioX;
+ elseif cst{counterRTstructures,5}.LQmodelPriority == cst{counterOtherStruct,5}.LQmodelPriority
+ if cst{counterRTstructures,5}.alphaBetaRatioX ~= cst{counterOtherStruct,5}.alphaBetaRatioX
+ warning('Tissue with identical LQ parameter priority but different alpha over beta values detected. Better re-define.')
+ alphaBetaRatioMap(cst{counterRTstructures,4}{1}) = cst{counterRTstructures,5}.alphaBetaRatioX;
+ else
+ alphaBetaRatioMap(cst{counterRTstructures,4}{1}) = cst{counterRTstructures,5}.alphaBetaRatioX;
+ end
+ end
+ else
+ alphaBetaRatioMap(cst{counterRTstructures,4}{1}) = cst{counterRTstructures,5}.alphaBetaRatioX;
+ end
+ end
+end
+
+% Remember alpha/beta ratio map
+dij.alphaBetaRatioMap{counterDijColumns} = alphaBetaRatioMap;
+
+%% B.4: Calculate RBE_LD and RBE_HD values for neutron ray according to RMF model
+dij.RBE_LD_aero{1}(:,counterDijColumns) = sparse(size(dij.physicalDose{1}(:,counterDijColumns),1),1);
+dij.RBE_HD_aero{1}(:,counterDijColumns) = sparse(size(dij.physicalDose{1}(:,counterDijColumns),1),1);
+% dij.RBE_LD_anox{1}(:,counterDijColumns) = sparse(size(dij.physicalDose{1}(:,counterDijColumns),1),1);
+% dij.RBE_HD_anox{1}(:,counterDijColumns) = sparse(size(dij.physicalDose{1}(:,counterDijColumns),1),1);
+
+% RBE_LD values
+dij.RBE_LD_aero{1}(containerSummedDose~=0,counterDijColumns) = (containerDoseWeightedRBEvalues_aero+...
+ (2./alphaBetaRatioMap(containerSummedDose~=0)).*containerDoseWeightedintraTrackTerm_aero(containerSummedDose~=0));
+
+% RBE_HD values
+dij.RBE_HD_aero{1}(containerSummedDose~=0,counterDijColumns) = containerDoseWeightedRBEvalues_aero;
+
+% % RBE_LD values
+% dij.RBE_LD_anox{1}(containerSummedDose~=0,counterDijColumns) = (containerDoseWeightedRBEvalues_anox+...
+% (2./alphaBetaRatioMap(containerSummedDose~=0)).*containerDoseWeightedintraTrackTerm_anox(containerSummedDose~=0));
+%
+% % RBE_HD values
+% dij.RBE_HD_anox{1}(containerSummedDose~=0,counterDijColumns) = containerDoseWeightedRBEvalues_anox;
+
+end
\ No newline at end of file
diff --git a/MCNP/tools/matRad_getTime4log.m b/MCNP/tools/matRad_getTime4log.m
new file mode 100644
index 000000000..92afe8b15
--- /dev/null
+++ b/MCNP/tools/matRad_getTime4log.m
@@ -0,0 +1,14 @@
+% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% Decription: Generate time array formatted for log file creation
+%
+% Author: Lucas Sommer (Lucas.Sommer@tum.de), 10/2018
+%
+% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+function timeArray = matRad_getTime4log
+uhrzeit = datestr(now,'HH:MM:SS');
+datum = datestr(now,'yyyy-mm-dd');
+
+timeArray = strcat(datum(1:4), datum(6:7), datum(9:10), 'd', uhrzeit(1:2), ...
+ uhrzeit(4:5), uhrzeit(7:8), 'h');
\ No newline at end of file
diff --git a/MCNP/tools/matRad_readDataFromText.m b/MCNP/tools/matRad_readDataFromText.m
new file mode 100644
index 000000000..1e5e88bea
--- /dev/null
+++ b/MCNP/tools/matRad_readDataFromText.m
@@ -0,0 +1,96 @@
+function valueResult = matRad_readDataFromText(fileName, textBeforeData_1,textBeforeData_2, textBehindData, numberOfColumns)
+
+%% Function to read data between two known lines of text
+% Input: fileName
+% textBeforeData_1 - last line or text fragment before data
+% textBeforeData_2 - specific line/fragment before data (if
+% not applicable set to char(''))
+% textBehindData - first line behind data
+% numberOfColumns - optional reordering into given # of
+% colums
+%
+% Author: Lucas Sommer, 10.05.2020 (lucas.sommer@tum.de)
+
+%% Open text file
+fid_read = fopen(fileName, 'rt');
+
+%% Find last line before data
+lineDummy = fgetl(fid_read);
+while(~strcmp(lineDummy(1,1:min(length(lineDummy),length(textBeforeData_1))), textBeforeData_1(1,:)))
+ clear lineDummy
+ lineDummy = fgetl(fid_read);
+end
+
+if ~isempty(textBeforeData_2)
+ while(~strcmp(lineDummy(1,1:min(length(lineDummy),length(textBeforeData_2))), textBeforeData_2(1,:)))
+ clear lineDummy
+ lineDummy = fgetl(fid_read);
+ end
+end
+
+%% Read data
+% valueResult = char(''); %fgetl(fid_read);
+% dummyTestEndData = fgetl(fid_read); %valueResult;
+% while(~strcmp(dummyTestEndData(1,1:min(length(dummyTestEndData), length(textBehindData))), textBehindData(1,:)))
+% if ~feof(fid_read)
+% valueResult = [valueResult ' ' dummyTestEndData];
+% dummyTestEndData = fgetl(fid_read);
+% elseif feof(fid_read)
+% valueResult = [valueResult ' ' dummyTestEndData];
+% break
+% end
+% end
+%
+% valueResult = sscanf(valueResult, '%f');
+
+valueResult_char = char('');
+valueResult_sparse = spalloc(512^3,1,1);
+sparceCounter = 1;
+
+dummyTestEndData = fgetl(fid_read);
+while(~strcmp(dummyTestEndData(1,1:min(length(dummyTestEndData), length(textBehindData))), textBehindData(1,:)))
+ if ~feof(fid_read)
+ valueResult_char = dummyTestEndData;
+ valueDummy = sscanf(valueResult_char, '%f');
+ valueResult_sparse(sparceCounter:sparceCounter+length(valueDummy)-1,1) = valueDummy(:);
+ sparceCounter = sparceCounter+length(valueDummy);
+ dummyTestEndData = fgetl(fid_read);
+ elseif feof(fid_read)
+ valueResult_char = dummyTestEndData;
+ valueDummy = sscanf(valueResult_char, '%f');
+ valueResult_sparse(sparceCounter:sparceCounter+length(valueDummy)-1,1) = valueDummy(:);
+ sparceCounter = sparceCounter+length(valueDummy);
+ break
+ end
+end
+
+valueResult = valueResult_sparse(1:sparceCounter-1,1);
+
+%% Close text file
+fclose(fid_read);
+
+%% Reorder (optional)
+if (nargin > 4) && (numberOfColumns <= 3)
+ switch numberOfColumns
+ case 1
+ disp('Data output given in one column.')
+ case 2
+ if ~mod(length(valueResult_sparse),2)
+ valueResult_sparse = reshape(valueResult_sparse, 2, length(valueResult_sparse)/2);
+ disp('Data output given in two columns.')
+ elseif mod(length(valueResult_sparse),2)
+ disp('Number of values does not match wished number of columns, reordering not possible!')
+ end
+ case 3
+ if ~mod(length(valueResult_sparse),3)
+ valueResult_sparse = reshape(valueResult_sparse, 3, length(valueResult_sparse)/3);
+ disp('Data output given in three column.')
+ elseif mod(length(valueResult_sparse),3)
+ disp('Number of values does not match wished number of columns, reordering not possible!')
+ end
+ end
+elseif(nargin > 4) && (numberOfColumns > 3)
+ disp('Too many columns were selected, reordering not possible!')
+end
+
+end
\ No newline at end of file
diff --git a/MCNP/tools/matRad_readDataFromText_TMESHvBioOpti.m b/MCNP/tools/matRad_readDataFromText_TMESHvBioOpti.m
new file mode 100644
index 000000000..9b5a81440
--- /dev/null
+++ b/MCNP/tools/matRad_readDataFromText_TMESHvBioOpti.m
@@ -0,0 +1,107 @@
+function tallyData = matRad_readDataFromText_TMESHvBioOpti(fileName, tallyIdentifier, numberOfColumns)
+
+if strcmpi(tallyIdentifier, 'TMESH3')
+ content = fileread(fileName) ;
+
+ % Find data for TMESH typ 3 tally
+ dataBegin_tally = strfind( content, 'tally 3' );
+ dataBegin = strfind( content, 'vals' )+8;
+ dataEnd = strfind(content, 'tfc' )-1;
+
+ if ~isempty(dataEnd)
+ if ~(dataBegin(end-1)dataBegin_tally)
+ error('TMESH data location does not match expected location at end of tally file.')
+ end
+ elseif isempty(dataEnd)
+ disp('No MCNP tally for RBE calculation.')
+ end
+
+ tallyData = sscanf(content(dataBegin(end):end), '%f');
+
+ %% Reorder (optional)
+ if exist('numberOfColumns')
+ switch numberOfColumns
+ case 1
+ disp('Data output given in one column.')
+ case 2
+ if ~mod(length(tallyData),2)
+ tallyData = reshape(tallyData, 2, length(tallyData)/2);
+ disp('Data output given in two columns.')
+ elseif mod(length(tallyData),2)
+ disp('Number of values does not match wished number of columns, reordering not possible!')
+ end
+ case 3
+ if ~mod(length(tallyData),3)
+ tallyData = reshape(tallyData, 3, length(tallyData)/3);
+ disp('Data output given in three column.')
+ elseif mod(length(tallyData),3)
+ disp('Number of values does not match wished number of columns, reordering not possible!')
+ end
+ end
+ end
+
+
+elseif strcmpi(tallyIdentifier, 'F6heating4RBEcalc')
+ content = fileread(fileName) ;
+
+ dataBegin = strfind( content, 'vals' )+8;
+ dataBegin = dataBegin(1:end-1); % Attention: last entry in dataBegin belongs to TMESH tally for total dose tallying
+ dataEnd = strfind(content, 'tfc' )-1;
+
+% f6TallyList = [1016, 1026, 1036, 1046, 1056, ...
+% 2016, 2026 2036, 2046, 2056, ...
+% 3016, 3026 3036, 3046, 3056, ...
+% 4016, 4026 4036, 4046, 4056, ...
+% 5016, 5026 5036, 5046, 5056, ...
+% 6016, 6026 6036, 6046, 6056, ...
+% 7016, 7026 7036, 7046, 7056, ...
+% 8016 8036, 8056, ...
+% 9016, 1116];
+
+% List w/o anoxic tallies
+ f6TallyList = [1016, 1026, 1036, ...
+ 2016, 2026 2036, ...
+ 3016, 3026 3036, ...
+ 4016, 4026 4036, ...
+ 5016, 5026 5036, ...
+ 6016, 6026 6036, ...
+ 8016 8036];
+
+ for counter=1:size(dataEnd,2)
+ dataBegin_tally(counter) = strfind( content, ['tally ', int2str(f6TallyList(counter))] );
+ end
+
+
+ [~, indexTallyData] = sort(dataBegin_tally);
+
+ for counter =1:size(dataEnd,2)
+ tallyData.(['tally', int2str(f6TallyList(indexTallyData((counter))))]) = sscanf(content(dataBegin(counter):dataEnd(counter)), '%f');
+
+ %% Reorder (optional)
+ if exist('numberOfColumns')
+ switch numberOfColumns
+ case 1
+ disp('Data output given in one column.')
+ case 2
+ if ~mod(length(tallyData.(['tally', int2str(f6TallyList(indexTallyData((counter))))])),2)
+ tallyData.(['tally', int2str(f6TallyList(indexTallyData((counter))))]) = reshape(tallyData.(['tally', int2str(f6TallyList(indexTallyData((counter))))]), 2, length(tallyData.(['tally', int2str(f6TallyList(indexTallyData((counter))))]))/2);
+ disp('Data output given in two columns.')
+ elseif mod(length(tallyData.(['tally', int2str(f6TallyList(indexTallyData((counter))))])),2)
+ disp('Number of values does not match wished number of columns, reordering not possible!')
+ end
+ case 3
+ if ~mod(length(tallyData.(['tally', int2str(f6TallyList(indexTallyData((counter))))])),3)
+ tallyData.(['tally', int2str(f6TallyList(indexTallyData((counter))))]) = reshape(tallyData.(['tally', int2str(f6TallyList(indexTallyData((counter))))]), 3, length(tallyData.(['tally', int2str(f6TallyList(indexTallyData((counter))))]))/3);
+ disp('Data output given in three column.')
+ elseif mod(length(tallyData.(['tally', int2str(f6TallyList(indexTallyData((counter))))])),3)
+ disp('Number of values does not match wished number of columns, reordering not possible!')
+ end
+ end
+ end
+
+ end
+
+
+end
+
+end
\ No newline at end of file
diff --git a/MCNP/tools/matRad_segmentationCTscan.m b/MCNP/tools/matRad_segmentationCTscan.m
new file mode 100644
index 000000000..f0f44ce23
--- /dev/null
+++ b/MCNP/tools/matRad_segmentationCTscan.m
@@ -0,0 +1,645 @@
+function [cst, tissueBin]=matRad_segmentationCTscan(CTdata, CTresolution, binIntervals, cst, cstBodyIndex, cstTargetIndex, useLungQuestionDialog)
+% DESCRIPTION:
+% 1) Read scaled Hounsfield units and bin voxels into predefined tissue
+% bins characterized by HU intervals in binIntervals,
+% 2) In case no lung has been pre-segmented define lung and reassign false
+% lung tissue to other tissue types. Furthermore, use body contour to
+% define skin layer around patient (body structure has to exist in cst).
+%
+% USAGE:
+% [cst, tissueBin] = segmentationCTscan(CTdata, CTresolution, binIntervals, cst, cstBodyIndex)
+%
+% INPUTS:
+% CTdata - CT values given in scaled HU
+% CTresolution - CT scan resolution
+% binIntervals - intervals for material segementation
+% cst - radiotherapy structures coherent with matRad
+% structure handling
+% cstBodyIndex - index of body structure in cst
+%
+% OUTPUTS:
+% tissueBin - structure containing all information obtained
+% from segmentation
+% tissueBin.indices - indices of each material specified in the bin
+% intervals, output has the same ordering as
+% given in binIntervals.name
+% cst - radiotherapy structures with additional lung
+% and/or skin structure (depends on problem)
+%
+% Author: Lucas Sommer (Lucas.Sommer@tum.de), 06/2018
+
+%% Extract information
+
+HUbin = {binIntervals.HUbin};
+tissueName = {binIntervals.name};
+
+% Find indices in volume for each material
+%% A) Segmentation by HU intervals given in variable binIntervals
+
+dummy_indexCounter = 0; % Make sure all voxels are detected
+
+% Important: some materials cannot be segmented using HU bin intervals
+% s.th. the corresponding HUbin in the variable binIntervals is empty,
+% their properties have to be defined in the last entries of binIntervals.
+% For example, soft tissue with additional B-10 is defined there.
+maxHUbin_nonEmpty = 1; % Find last non-empty entry
+while ~isempty(binIntervals(maxHUbin_nonEmpty+1).HUbin) && (maxHUbin_nonEmpty <= size(binIntervals,2))
+ maxHUbin_nonEmpty = maxHUbin_nonEmpty +1;
+end
+
+% Segmentation using predefined HU bin intervals goes here
+for i=1:maxHUbin_nonEmpty
+ % Names of tissue associated to HU
+ tissueBin(i).name = tissueName{i};
+
+ % Tissue Indices
+ tissueBin(i).matIndex = i;
+
+ % Linear and matrix indices
+ tissueBin(i).linIndVol = find((CTdata >= HUbin{i}(1)) & CTdata < HUbin{i}(2)); % indexing according to input
+ [dum1, dum2, dum3] = ind2sub(size(CTdata), tissueBin(i).linIndVol);
+ tissueBin(i).matIndVol = [dum1, dum2, dum3];
+ clear dum1; clear dum2; clear dum3;
+
+ % Add bone to cst structure
+ if strcmpi(tissueBin(i).name, 'bone')
+ boneIndex = i;
+ end
+
+ dummy_indexCounter = dummy_indexCounter +numel(tissueBin(i).linIndVol);
+end
+
+if (dummy_indexCounter~=numel(CTdata))
+ error('Some voxels were lost in the segmentation process!')
+end
+
+%% B) Post-processing of CT data
+% 1) Eliminate small regions that have been falsely segmented as lung
+% 2) Define pre-segmented lung or perform segmentation
+% 3) Find body surface
+% 4) Enlarge body hull for skin segmentation
+% 5) Find small cavities in body and process surrounding tissue
+% 6) Find BNCT PTV if present in contours
+
+%% 1) Eliminate small regions that have been falsely segmented as lung
+% Predefinitions
+nnOfInterest = 1; % Set size of region
+minDist = sqrt(3); % Set minimum distance to n.n. before elemination
+
+airHUlimit = 300; % Set limit for HU air value
+
+lungIndex = 1; % Find material index for lung tissue from HU interval segmentation
+while ~strcmpi( tissueBin(lungIndex).name, 'lung') && (lungIndex<=size(tissueBin, 2))
+ lungIndex = lungIndex +1;
+end
+
+if ~strcmpi( tissueBin(lungIndex).name, 'lung') % Check if lung tissue exists in segmented material
+ disp('No lung tissue from HU segmentation process.')
+ lungIndex = false;
+end
+
+if ~isempty(tissueBin(lungIndex).linIndVol)
+ lungMask_HUsegmentation = zeros(size(CTdata));
+ lungMask_HUsegmentation(tissueBin(lungIndex).linIndVol) = 1;
+ falseLungIdx = [];
+else
+ disp('Segmentation via HU intervals led to zero voxels with lung tissue.')
+ lungIndex = false;
+end
+
+
+dummyCube_smoothed = imboxfilt3(CTdata,3, 'padding', 'replicate'); % Calculate local mean CT values by using cubic 3x3x3 box filter
+
+% Only process lung material in case it has been pre-segmented
+if lungIndex
+ % Find k nearest neighbors
+ [a1, a2, a3] = ind2sub(size(lungMask_HUsegmentation), find(lungMask_HUsegmentation>0));
+ a_ind = [a1 a2 a3];
+ b_ind = a_ind;
+ [~, dist] = knnsearch(a_ind,b_ind,'K',27);
+
+
+ % Generate mask from tissue within lung HU interval
+ lungMask_processed = zeros(size(CTdata));
+ lungMask_processed(tissueBin(lungIndex).linIndVol) = 1;
+
+ % Eleminate small pseudo-lung regions by assigning them to neighboring
+ % tissue intervals
+ eraseInd = a_ind((dist(:,nnOfInterest+1)>minDist),:); % Number of n.n. of interest should not include voxel itself
+
+ lungMask_processed(sub2ind(size(lungMask_processed), eraseInd(:,1), eraseInd(:,2), eraseInd(:,3))) = 0 ;
+
+ % Reassign pseudo-lung regions to tissue from surrounding HU intervals
+ for counterAdditional = 1:length(eraseInd)
+ if dummyCube_smoothed(sub2ind(size(lungMask_processed), ...
+ eraseInd(counterAdditional,1), eraseInd(counterAdditional,2), ...
+ eraseInd(counterAdditional,3))) > airHUlimit
+
+ tissueBin(lungIndex+1).linIndVol(end+1) = sub2ind(size(lungMask_processed), ...
+ eraseInd(counterAdditional,1), ...
+ eraseInd(counterAdditional,2), ...
+ eraseInd(counterAdditional,3));
+ elseif dummyCube_smoothed(sub2ind(size(lungMask_processed), ...
+ eraseInd(counterAdditional,1), ...
+ eraseInd(counterAdditional,2), eraseInd(counterAdditional,3))) <= airHUlimit
+
+ tissueBin(lungIndex-1).linIndVol(end+1) = sub2ind(size(lungMask_processed), ...
+ eraseInd(counterAdditional,1), ...
+ eraseInd(counterAdditional,2), ...
+ eraseInd(counterAdditional,3));
+ end
+ end
+
+ tissueBin(lungIndex-1).linIndVol = sort(tissueBin(lungIndex-1).linIndVol,1);
+ tissueBin(lungIndex+1).linIndVol = sort(tissueBin(lungIndex+1).linIndVol,1);
+ tissueBin(lungIndex).linIndVol = sort(find(lungMask_processed));
+
+ tissueBin(lungIndex-1).matIndVol = [];
+ [tissueBin(lungIndex-1).matIndVol(:,1), tissueBin(lungIndex-1).matIndVol(:,2), tissueBin(lungIndex-1).matIndVol(:,3)] = ind2sub(size(CTdata), tissueBin(lungIndex-1).linIndVol);
+ tissueBin(lungIndex+1).matIndVol = [];
+ [tissueBin(lungIndex+1).matIndVol(:,1), tissueBin(lungIndex+1).matIndVol(:,2), tissueBin(lungIndex+1).matIndVol(:,3)] = ind2sub(size(CTdata), tissueBin(lungIndex+1).linIndVol);
+ tissueBin(lungIndex).matIndVol = [];
+ [tissueBin(lungIndex).matIndVol(:,1), tissueBin(lungIndex).matIndVol(:,2), tissueBin(lungIndex).matIndVol(:,3)] = ind2sub(size(CTdata), tissueBin(lungIndex).linIndVol);
+
+
+ disp([num2str(length(find(lungMask_HUsegmentation)) - length(find(lungMask_processed))), ' voxels were redefined to be either air or soft tissue.'])
+
+ % Result: lungMask_processed: Mask smoothed lung tissue from segmentation according to HU
+ % intervals without small regions
+
+ clear lungMask_HUsegmentation
+end
+
+%% 2. Find lung
+% Overwrite lung segmentation by predefined lung structure or segment
+% lung here
+
+if lungIndex && useLungQuestionDialog % Check if lung voxels were generated in pre-segmentation using HU intervals
+ % Check if lung is visible on CT scan
+ answerLungExistance = questdlg('Is the lung visible on the CT scan?', ...
+ 'Lung in ROI', ...
+ 'Yes','No', 'No');
+
+ switch answerLungExistance
+ case 'Yes' % In case lung is visible, find it
+
+ % Check if lung structure is present in structure set
+ cstLungIndex = 1;
+ lungStructureName = {'Lung'}; % Default lung name
+
+ while ~strcmpi(cst{cstLungIndex,2}, lungStructureName{1})
+ cstLungIndex = cstLungIndex +1;
+ if cstLungIndex > size(cst,1)
+ answer = questdlg('Is there a lung structure in your structure set (maybe it was not found)?', ...
+ 'Find Pre-Segmented Lung Structure', ...
+ 'Yes','No', 'No');
+ break
+ end
+ end
+
+
+ % Handle response in case default name is not matched
+ switch answer
+ case 'Yes'
+ prompt = {'Please enter lung structure name:'}; % Ask for the given name
+ dlgtitle = 'Find Lung Structure';
+ lungStructureName = inputdlg(prompt,dlgtitle);
+ cstLungIndex = 1;
+
+ while ~strcmpi(cst{cstLungIndex,2}, lungStructureName{1}) % Find lung structure
+ cstLungIndex = cstLungIndex +1;
+ if cstLungIndex > size(cst,1)
+ disp('Did not find structure. Lung structure will be generated in the following...')
+ % Eleminate small regions before segmenting lung
+ nnOfInterest = 9;
+ minDist = sqrt(3);
+
+ eraseInd = a_ind((dist(:,nnOfInterest+1)>minDist),:); % Number of n.n. of interest should not include voxel itself
+ lungMask_processed(sub2ind(size(lungMask_processed), eraseInd(:,1), eraseInd(:,2), eraseInd(:,3))) = 0;
+
+ % Set largest connected region within body to lung
+ regionConnectivity = 6; % Region connectivity (default value for 3D: 26)
+ CC = bwconncomp(lungMask_processed, regionConnectivity);
+ stats = regionprops3(CC,'Volume', 'VoxelIdxList');
+
+ lungMask_final = zeros(size(CTdata));
+ [~, maxInd] = max(stats.Volume);
+ lungIndRegions = stats.VoxelIdxList{maxInd,1};
+ lungMask_final(lungIndRegions) = 1;
+
+ falseLungIdx = setxor(tissueBin(lungIndex).linIndVol, lungIndRegions);
+ tissueBin(lungIndex).linIndVol = lungIndRegions;
+ tissueBin(lungIndex).matIndVol = [];
+ [tissueBin(lungIndex).matIndVol(:,1), tissueBin(lungIndex).matIndVol(:,2), tissueBin(lungIndex).matIndVol(:,3)] = ind2sub(size(CTdata), tissueBin(lungIndex).linIndVol);
+
+ break
+ else
+ falseLungIdx = setxor(tissueBin(lungIndex).linIndVol, cst{cstLungIndex,4});
+ tissueBin(lungIndex).linIndVol = cst{cstLungIndex,4};
+ tissueBin(lungIndex).matIndVol = [];
+ [tissueBin(lungIndex).matIndVol(:,1), tissueBin(lungIndex).matIndVol(:,2), tissueBin(lungIndex).matIndVol(:,3)] = ind2sub(size(CTdata), tissueBin(lungIndex).linIndVol);
+
+ break
+ end
+ end
+
+ case 'No'
+ disp('Lung structure will be generated...')
+ % Eleminate small regions before segmenting lung
+ nnOfInterest = 9;
+ minDist = sqrt(3);
+
+ eraseInd = a_ind((dist(:,nnOfInterest+1)>minDist),:); % Number of n.n. of interest should not include voxel itself
+ lungMask_processed(sub2ind(size(lungMask_processed), eraseInd(:,1), eraseInd(:,2), eraseInd(:,3))) = 0;
+
+ % Set largest connected region within body to lung
+ regionConnectivity = 6; % Region connectivity (default value for 3D: 26)
+ CC = bwconncomp(lungMask_processed, regionConnectivity);
+ stats = regionprops3(CC,'Volume', 'VoxelIdxList');
+
+ lungMask_final = zeros(size(CTdata));
+ [~, maxInd] = max(stats.Volume);
+ lungIndRegions = stats.VoxelIdxList{maxInd,1};
+ lungMask_final(lungIndRegions) = 1;
+
+ falseLungIdx = setxor(tissueBin(lungIndex).linIndVol, lungIndRegions);
+ tissueBin(lungIndex).linIndVol = lungIndRegions;
+ tissueBin(lungIndex).matIndVol = [];
+ [tissueBin(lungIndex).matIndVol(:,1), tissueBin(lungIndex).matIndVol(:,2), tissueBin(lungIndex).matIndVol(:,3)] = ind2sub(size(CTdata), tissueBin(lungIndex).linIndVol);
+
+
+ % Generate matRad structure in cst variable
+ cstCounter = size(cst,1)+1;
+ cst{cstCounter,1} = cstCounter-1;
+ cst{cstCounter,2} = 'LUNG';
+ cst{cstCounter,3} = 'OAR';
+ cst{cstCounter,4} = {lungIndRegions};
+ cst{cstCounter,5}.Visible = true;
+ cst{cstCounter,5}.Priority = 2;
+
+ end
+
+ case 'No' % In case there is no lung, do not do anything to find it
+ falseLungIdx = tissueBin(lungIndex).linIndVol;
+ tissueBin(lungIndex).linIndVol = [];
+ tissueBin(lungIndex).matIndVol = [];
+ end
+
+elseif lungIndex && ~useLungQuestionDialog
+ % Check if lung structure is present in structure set
+ cstLungIndex = 1;
+ lungStructureName = {'Lung'}; % Default lung name
+
+ while ~strcmpi(cst{cstLungIndex,2}, lungStructureName{1})
+ cstLungIndex = cstLungIndex +1;
+ if cstLungIndex > size(cst,1)
+ disp('No lung contour found. All voxels in HU interval for lung will be redefined as soft tissue. Mandatory name for the contour: Lung.')
+ disp('In order to use autosegmentaiton for lung set dose engine property useLungQuestionDialog to true.')
+ falseLungIdx = tissueBin(lungIndex).linIndVol;
+ tissueBin(lungIndex).linIndVol = [];
+ tissueBin(lungIndex).matIndVol = [];
+ break
+ end
+ end
+end
+
+% Result: lungMask_final: Mask for segmented lung
+
+%% 3. Find body surface
+% Generate body mask
+dummyMask_bodyStruct = zeros(size(CTdata));
+bodyIdx = [cst{sort([cstTargetIndex, cstBodyIndex]),4}];
+bodyIdx = unique(vertcat(bodyIdx{:}));
+
+dummyMask_bodyStruct(bodyIdx) = 1; % cst{cstBodyIndex,4}{1} contains body
+
+% Find minimum and maximum z values of body axis
+[yAxis,~,zAxis] = ind2sub(size(dummyMask_bodyStruct), find(dummyMask_bodyStruct));
+maxZ = max(zAxis);
+minZ = min(zAxis);
+
+maxY = max(yAxis);
+minY = min(yAxis);
+
+% Find body surface
+dummyMask_bodyHull = zeros(size(CTdata));
+
+hullIdx = zeros(length(cst{cstBodyIndex,4}{1}),3);
+hullCounter = 1;
+
+for zCounter=minZ:maxZ
+ stats = regionprops(bwconncomp(squeeze(dummyMask_bodyStruct(:,:,zCounter))),'Centroid', 'PixelIdxList');
+ for objectCounter = 1:size(stats,1)
+ dummyImage = zeros(size(squeeze(dummyMask_bodyStruct(:,:,zCounter))));
+ dummyImage(stats(objectCounter).PixelIdxList)=1;
+ for counter1 = 1:size(dummyImage,1)
+ ind1 = find(dummyImage(counter1,:));
+ if ~isempty(ind1) && numel(ind1) > 2
+ hullIdx(hullCounter,:) = [counter1, min(ind1),zCounter];
+ hullCounter = hullCounter +1;
+ hullIdx(hullCounter,:) = [counter1, max(ind1),zCounter];
+ hullCounter = hullCounter +1;
+ elseif ~isempty(ind1) && numel(ind1) == 2
+ hullIdx(hullCounter,:) = [counter1, min(ind1),zCounter];
+ hullCounter = hullCounter +1;
+ hullIdx(hullCounter,:) = [counter1, max(ind1),zCounter];
+ hullCounter = hullCounter +1;
+ elseif ~isempty(ind1) && numel(ind1) == 1
+ hullIdx(hullCounter,:) = [counter1, min(ind1),zCounter];
+ end
+ end
+ for counter2 = 1:size(dummyImage,2)
+ ind1 = find(dummyImage(:,counter2));
+ if ~isempty(ind1) && numel(ind1) > 2
+ hullIdx(hullCounter,:) = [min(ind1),counter2,zCounter];
+ hullCounter = hullCounter +1;
+ hullIdx(hullCounter,:) = [max(ind1),counter2,zCounter];
+ hullCounter = hullCounter +1;
+ elseif ~isempty(ind1) && numel(ind1) == 2
+ hullIdx(hullCounter,:) = [min(ind1),counter2,zCounter];
+ hullCounter = hullCounter +1;
+ hullIdx(hullCounter,:) = [max(ind1),counter2,zCounter];
+ hullCounter = hullCounter +1;
+ elseif ~isempty(ind1) && numel(ind1) == 1
+ hullIdx(hullCounter,:) = [min(ind1),counter2,zCounter];
+ end
+
+ end
+ end
+end
+
+for yCounter=minY:maxY
+ stats = regionprops(bwconncomp(squeeze(dummyMask_bodyStruct(yCounter,:,:))),'Centroid', 'PixelIdxList');
+ for objectCounter = 1:size(stats,1)
+ dummyImage = zeros(size(squeeze(dummyMask_bodyStruct(yCounter,:,:))));
+ dummyImage(stats(objectCounter).PixelIdxList)=1;
+ for counter1 = 1:size(dummyImage,1)
+ ind1 = find(dummyImage(counter1,:));
+ if ~isempty(ind1) && numel(ind1) > 2
+ hullIdx(hullCounter,:) = [yCounter, counter1, min(ind1)];
+ hullCounter = hullCounter +1;
+ hullIdx(hullCounter,:) = [yCounter, counter1, max(ind1)];
+ hullCounter = hullCounter +1;
+
+ elseif ~isempty(ind1) && numel(ind1) == 2
+ hullIdx(hullCounter,:) = [yCounter, counter1, min(ind1)];
+ hullCounter = hullCounter +1;
+ hullIdx(hullCounter,:) = [yCounter, counter1, max(ind1)];
+ hullCounter = hullCounter +1;
+ elseif ~isempty(ind1) && numel(ind1) == 1
+ hullIdx(hullCounter,:) = [yCounter, counter1, min(ind1)];
+ end
+
+ end
+ for counter2 = 1:size(dummyImage,2)
+ ind1 = find(dummyImage(:,counter2));
+ if ~isempty(ind1) && numel(ind1) > 2
+ hullIdx(hullCounter,:) = [yCounter, min(ind1), counter2];
+ hullCounter = hullCounter +1;
+ hullIdx(hullCounter,:) = [yCounter, max(ind1), counter2];
+ hullCounter = hullCounter +1;
+
+ elseif ~isempty(ind1) && numel(ind1) == 2
+ hullIdx(hullCounter,:) = [yCounter, min(ind1), counter2];
+ hullCounter = hullCounter +1;
+
+ hullIdx(hullCounter,:) = [yCounter, max(ind1), counter2];
+ hullCounter = hullCounter +1;
+
+ elseif ~isempty(ind1) && numel(ind1) == 1
+ hullIdx(hullCounter,:) = [yCounter, min(ind1), counter2];
+
+ end
+
+ end
+ end
+end
+%
+hullIdx_2 = nonzeros(hullIdx);
+hullIdx_2 = reshape(hullIdx_2, [length(hullIdx_2)/3,3]);
+
+linHullIdx = sub2ind(size(dummyMask_bodyHull), hullIdx_2(:,1), hullIdx_2(:,2), hullIdx_2(:,3));
+
+dummyMask_bodyHull(linHullIdx) = 1;
+
+% Result: dummyMask_bodyStruct: Mask of body structure; dummyMask_bodyHull: Mask of hull of
+% body structure
+
+%% 4. Enlarge body hull for skin segmentation
+
+% Set skin thickness
+skinThick = 1; % [mm]
+
+if skinThick > 0
+ disp('*****')
+ disp(['Skin thickness has been set to: ', num2str(skinThick), ' mm.'])
+ disp('*****')
+ % Find k nearest neigbors of hull within body
+ % Define indices of hull
+ [a1, a2, a3] = ind2sub(size(dummyMask_bodyHull), find(dummyMask_bodyHull>0));
+
+ a1 = a1*CTresolution.y - CTresolution.y/2; % Rescale according to CT resolution s.th. origin is in voxel center
+ a2 = a2*CTresolution.x - CTresolution.x/2;
+ a3 = a3*CTresolution.z - CTresolution.z/2;
+ a_ind = [a1 a2 a3];
+
+ % Define body indices
+ [b1, b2, b3] = ind2sub(size(dummyMask_bodyStruct), find(dummyMask_bodyStruct>0));
+
+ b1 = b1*CTresolution.y - CTresolution.y/2; % Rescale according to CT resolution
+ b2 = b2*CTresolution.x - CTresolution.x/2;
+ b3 = b3*CTresolution.z - CTresolution.z/2;
+ b_ind = [b1 b2 b3];
+
+ % Find neighbors and define mask
+ [idx, dist] = knnsearch(b_ind, a_ind,'K',5000);
+ dummyMask_skin = zeros(size(CTdata));
+
+ for counterSkin = 1:size(idx,1)
+ skinInd = idx(counterSkin,dist(counterSkin,:) airHUlimit
+ tissueBin(lungIndex+1).linIndVol(end+1) = falseLungIdx(counterAdditional);
+ elseif dummyCube_smoothed(falseLungIdx(counterAdditional)) <= airHUlimit
+ tissueBin(lungIndex-1).linIndVol(end+1) = falseLungIdx(counterAdditional);
+ end
+ end
+
+ tissueBin(lungIndex-1).linIndVol = sort(tissueBin(lungIndex-1).linIndVol,1);
+ tissueBin(lungIndex-1).matIndVol = [];
+ [tissueBin(lungIndex-1).matIndVol(:,1), tissueBin(lungIndex-1).matIndVol(:,2), tissueBin(lungIndex-1).matIndVol(:,3)] = ind2sub(size(CTdata), tissueBin(lungIndex-1).linIndVol);
+
+
+ tissueBin(lungIndex+1).linIndVol = sort(tissueBin(lungIndex+1).linIndVol,1);
+ tissueBin(lungIndex+1).matIndVol = [];
+ [tissueBin(lungIndex+1).matIndVol(:,1), tissueBin(lungIndex+1).matIndVol(:,2), tissueBin(lungIndex+1).matIndVol(:,3)] = ind2sub(size(CTdata), tissueBin(lungIndex+1).linIndVol);
+
+
+ disp(['Additional ', num2str(length(falseLungIdx)), ' voxels were redefined to be either air or soft tissue.'])
+
+end
+
+%% 6. Find BNCT
+disp('*****')
+disp('In case you wish to simulate BNCT irradiation make sure the PTV is called PTV_BNCT.')
+disp('*****')
+disp('Checking for PTV...')
+
+
+% Find BNCT PTV
+for cstCounter = 1:size(cst,1)
+ if strcmpi(cst{cstCounter,2}, 'PTV_BNCT')
+ disp('*****')
+ disp('PTV for BNCT detected. PTV will be filled with soft tissu and B-10 density specified in segmentation variable.')
+ disp('*****')
+
+ bnct_Control = true;
+ bnct_cstIndex = cstCounter;
+ else
+ continue
+ end
+end
+
+% Process BNCT volume and generate specific material with B-10 for MCNP
+% simulation
+if exist('bnct_Control') && bnct_Control
+ lindInd_PTV_BNCT = cst{bnct_cstIndex,4};
+ for tissueBin_counter = 1:size(tissueBin,2)
+ if ~strcmpi(tissueBin(tissueBin_counter).name, 'softTissue') && ~strcmpi(tissueBin(tissueBin_counter).name, 'skin')
+ dummyIntersect = intersect(lindInd_PTV_BNCT{1}, tissueBin(tissueBin_counter).linIndVol);
+ if ~isempty(dummyIntersect)
+ lindInd_PTV_BNCT{1} = setxor(lindInd_PTV_BNCT{1}, dummyIntersect);
+ disp('*****')
+ disp([num2str(numel(dummyIntersect)), ' from ', tissueBin(tissueBin_counter).name,' voxels were cut from PTV_BNCT.'])
+ disp('*****')
+ end
+ elseif strcmpi(tissueBin(tissueBin_counter).name, 'softTissue') || strcmpi(tissueBin(tissueBin_counter).name, 'skin')
+ dummyIntersect = intersect(lindInd_PTV_BNCT{1}, tissueBin(tissueBin_counter).linIndVol);
+ if ~isempty(dummyIntersect)
+ tissueBin(tissueBin_counter).linIndVol = setxor(tissueBin(tissueBin_counter).linIndVol, dummyIntersect);
+ disp('*****')
+ disp([num2str(numel(dummyIntersect)), ' from ', tissueBin(tissueBin_counter).name, ' voxels were cut from ', tissueBin(tissueBin_counter).name, ' and associated to PTV_BNCT.'])
+ disp('*****')
+ end
+ end
+
+ end
+ tissueBin(size(tissueBin,2)+1).name = 'bnct_material';
+ tissueBin(size(tissueBin,2)).matIndex = size(tissueBin,2);
+ tissueBin(size(tissueBin,2)).linIndVol = lindInd_PTV_BNCT{1};
+ [dumIdx1, dumIdx2, dumIdx3] = ind2sub(size(CTdata), lindInd_PTV_BNCT{1});
+ tissueBin(size(tissueBin,2)).matIndVol = [dumIdx1, dumIdx2, dumIdx3];
+elseif ~exist('bnct_Control')
+ disp('*****')
+ disp('No PTV for BNCT detected.')
+ disp('*****')
+ % Add bnct tissue as tissue type
+ bnctBinIdx = size(tissueBin,2)+1;
+ tissueBin(bnctBinIdx).name = 'bnct_material';
+ tissueBin(bnctBinIdx).matIndex = bnctBinIdx;
+ tissueBin(bnctBinIdx).linIndVol = [];
+ tissueBin(bnctBinIdx).matIndVol = [];
+end
+
+%% Appendix: add bone to cst structure
+% Generate matRad structure in cst variable
+cstCounter = size(cst,1)+1;
+cst{cstCounter,1} = cstCounter-1;
+cst{cstCounter,2} = 'BONE';
+cst{cstCounter,3} = 'OAR';
+cst{cstCounter,4} = {tissueBin(boneIndex).linIndVol};
+cst{cstCounter,5}.Visible = true;
+cst{cstCounter,5}.Priority = 2;
+
+% Make sure linear and sub-indices are the same
+for counterTissueBins = 1:size(tissueBin,2)
+ tissueBin(counterTissueBins).matIndVol = [];
+ if ~isempty(tissueBin(counterTissueBins).linIndVol)
+ [tissueBin(counterTissueBins).matIndVol(:,1), tissueBin(counterTissueBins).matIndVol(:,2), tissueBin(counterTissueBins).matIndVol(:,3)] = ind2sub(size(CTdata), tissueBin(counterTissueBins).linIndVol);
+ end
+end
+
+
+%% Check if all voxels are still assigned to a medium
+dummyVoxelSum = 0;
+for checkerC = 1:size(tissueBin,2)
+ dummyVoxelSum = dummyVoxelSum + length(tissueBin(checkerC).linIndVol);
+end
+
+if dummyVoxelSum > numel(CTdata)
+ error('Something went wrong with the segmentation process. Too many voxels after segmentation.')
+elseif dummyVoxelSum < numel(CTdata)
+ error('Something went wrong with the segmentation process. Voxels were lost in segmentation process.')
+else
+ disp('Segmentation process performed sucessfully.')
+end
diff --git a/examples/matRad_neutronTest1_PBK.m b/examples/matRad_neutronTest1_PBK.m
new file mode 100644
index 000000000..68aa5ebcb
--- /dev/null
+++ b/examples/matRad_neutronTest1_PBK.m
@@ -0,0 +1,231 @@
+%% Test neutron dose calculation using PBKs - modification of example 1
+clear
+%% set matRad runtime configuration
+matRad_rc; %If this throws an error, run it from the parent directory first to set the paths
+
+%% Create a CT image series
+xDim = 200;
+yDim = 200;
+zDim = 100;
+
+ct.cubeDim = [yDim xDim zDim]; % second cube dimension represents the x-coordinate
+ct.resolution.x = 2;
+ct.resolution.y = 2;
+ct.resolution.z = 3;
+ct.numOfCtScen = 1;
+
+% create an ct image series with zeros - it will be filled later
+ct.cubeHU{1} = ones(ct.cubeDim) * -1000;
+
+ct.dicomInfo.RescaleIntercept = 1000;
+ct.dicomInfo.RescaleSlope = 1;
+%% Create the VOI data for the phantom
+% Now we define structures a contour for the phantom and a target
+
+ixOAR = 1;
+ixPTV = 2;
+ixBone = 3;
+ixLung = 4;
+
+% define general VOI properties
+cst{ixOAR,1} = 0;
+cst{ixOAR,2} = 'Body';
+cst{ixOAR,3} = 'OAR';
+
+cst{ixPTV,1} = 1;
+cst{ixPTV,2} = 'PTV';
+cst{ixPTV,3} = 'TARGET';
+
+cst{ixBone,1} = 2;
+cst{ixBone,2} = 'Bone';
+cst{ixBone,3} = 'OAR';
+
+cst{ixLung,1} = 3;
+cst{ixLung,2} = 'Lung';
+cst{ixLung,3} = 'OAR';
+
+% define optimization parameter for both VOIs
+cst{ixOAR,5}.TissueClass = 1;
+cst{ixOAR,5}.alphaX = 0.1000;
+cst{ixOAR,5}.betaX = 0.0500;
+cst{ixOAR,5}.Priority = 2;
+cst{ixOAR,5}.Visible = 1;
+cst{ixOAR,5}.visibleColor = [0 0 0];
+
+cst{ixBone,5}.TissueClass = 1;
+cst{ixBone,5}.alphaX = 0.1000;
+cst{ixBone,5}.betaX = 0.0500;
+cst{ixBone,5}.Priority = 2;
+cst{ixBone,5}.Visible = 1;
+cst{ixBone,5}.visibleColor = [1 0 0];
+
+cst{ixLung,5}.TissueClass = 1;
+cst{ixLung,5}.alphaX = 0.1000;
+cst{ixLung,5}.betaX = 0.0500;
+cst{ixLung,5}.Priority = 2;
+cst{ixLung,5}.Visible = 1;
+cst{ixLung,5}.visibleColor = [0 1 0];
+
+% define objective as struct for compatibility with GNU Octave I/O
+cst{ixOAR,6}{1} = struct(DoseObjectives.matRad_SquaredOverdosing(10,30));
+cst{ixBone,6}{1} = struct(DoseObjectives.matRad_SquaredOverdosing(10,30));
+cst{ixLung,6}{1} = struct(DoseObjectives.matRad_SquaredOverdosing(10,30));
+
+cst{ixPTV,5}.TissueClass = 1;
+cst{ixPTV,5}.alphaX = 0.1000;
+cst{ixPTV,5}.betaX = 0.0500;
+cst{ixPTV,5}.Priority = 1;
+cst{ixPTV,5}.Visible = 1;
+cst{ixPTV,5}.visibleColor = [1 1 1];
+
+% define objective as struct for compatibility with GNU Octave I/O
+cst{ixPTV,6}{1} = struct(DoseObjectives.matRad_SquaredDeviation(800,60));
+
+%% Lets create either a cubic or a spheric phantom
+cubeHelper = zeros(ct.cubeDim);
+
+% Soft tissue OAR
+ xLowOAR = round(xDim/2 - xDim/4);
+ xHighOAR = round(xDim/2 + xDim/4);
+ yLowOAR = round(yDim/2 - yDim/4);
+ yHighOAR = round(yDim/2 + yDim/4);
+ zLowOAR = round(zDim/2 - zDim/4);
+ zHighOAR = round(zDim/2 + zDim/4);
+
+ for x = xLowOAR:1:xHighOAR
+ for y = yLowOAR:1:yHighOAR
+ for z = zLowOAR:1:zHighOAR
+ cubeHelper(y,x,z) = 1;
+ end
+ end
+ end
+
+% radiusOAR = xDim/4;
+%
+% for x = 1:xDim
+% for y = 1:yDim
+% for z = 1:zDim
+% currPost = [y x z] - round([ct.cubeDim./2]);
+% if sqrt(sum(currPost.^2)) < radiusOAR
+% cubeHelper(y,x,z) = 1;
+% end
+% end
+% end
+% end
+clear currPost
+
+% extract the voxel indices and save it in the cst
+cst{ixOAR,4}{1} = find(cubeHelper);
+
+% Bone
+cubeHelper = zeros(ct.cubeDim);
+
+radiusBone = xDim/12;
+
+for x = 1:xDim
+ for y = 1:yDim
+ for z = 1:zDim
+ currPost = [y x z] - round([ct.cubeDim./2]);
+ currPost(2) = currPost(2) + round([ct.cubeDim(2)./8]);
+ if sqrt(sum(currPost.^2)) < radiusBone
+ cubeHelper(y,x,z) = 1;
+ end
+ end
+ end
+end
+clear currPost
+
+% extract the voxel indices and save it in the cst
+cst{ixBone,4}{1} = find(cubeHelper);
+
+% Lung
+cubeHelper = zeros(ct.cubeDim);
+
+radiusLung = xDim/12;
+
+for x = 1:xDim
+ for y = 1:yDim
+ for z = 1:zDim
+ currPost = [y x z] - round([ct.cubeDim./2]);
+ currPost(2) = currPost(2) - round([ct.cubeDim(2)./8]);
+ if sqrt(sum(currPost.^2)) < radiusLung
+ cubeHelper(y,x,z) = 1;
+ end
+ end
+ end
+end
+clear currPost
+% extract the voxel indices and save it in the cst
+cst{ixLung,4}{1} = find(cubeHelper);
+
+% PTV
+cubeHelper = zeros(ct.cubeDim);
+radiusPTV = xDim/24;
+
+for x = 1:xDim
+ for y = 1:yDim
+ for z = 1:zDim
+ currPost = [x y z] - round([ct.cubeDim./2]);
+ currPost(2) = currPost(2) + round([ct.cubeDim(2)./5]);
+ if sqrt(sum(currPost.^2)) < radiusPTV
+ cubeHelper(y,x,z) = 1;
+ end
+ end
+ end
+end
+
+% extract the voxel indices and save it in the cst
+cst{ixPTV,4}{1} = find(cubeHelper);
+
+
+% now we have ct data and cst data for a new phantom
+disp(ct);
+disp(cst);
+
+
+%% Assign relative electron densities
+vIxOAR = cst{ixOAR,4}{1};
+vIxPTV = cst{ixPTV,4}{1};
+vIxBone = cst{ixBone,4}{1};
+vIxLung = cst{ixLung,4}{1};
+
+ct.cubeHU{1}(vIxOAR) = 0; % assign HU of water
+ct.cubeHU{1}(vIxPTV) = 0; % assign HU of water
+ct.cubeHU{1}(vIxBone) = 2000; % assign HU of water
+ct.cubeHU{1}(vIxLung) = -300; % assign HU of water
+
+% Clean up
+clearvars -except ct cst
+
+%% Treatment Plan
+pln.radiationMode = 'neutrons';
+pln.machine = 'Generic';
+pln.propDoseCalc.engine = 'SVDPB';
+
+pln.numOfFractions = 1;
+pln.propStf.gantryAngles = [0 20 340];
+pln.propStf.couchAngles = [0 0 0];
+pln.propStf.bixelWidth = 5;
+
+% Dose calculation settings
+pln.propDoseCalc.doseGrid.resolution.x = 2; % [mm]
+pln.propDoseCalc.doseGrid.resolution.y = 2; % [mm]
+pln.propDoseCalc.doseGrid.resolution.z = 3; % [mm]
+
+% Set add margin to false in order to avoid an oversized margin leading to
+% large number of rays
+pln.propStf.addMargin = false;
+
+%% Generate Beam Geometry STF
+stf = matRad_generateStf(ct,cst,pln);
+% cst{2,6}{1,1}.parameters{1,1} = 1.5;
+
+%% Dose Calculation
+dij = matRad_calcDoseInfluence(ct,cst,stf,pln);
+
+%% Inverse Optimization for intensity-modulated photon therapy
+% The goal of the fluence optimization is to find a set of bixel/spot
+% weights which yield the best possible dose distribution according to the
+% clinical objectives and constraints underlying the radiation treatment.
+resultGUI = matRad_fluenceOptimization(dij,cst,pln);
+matRadGUI
\ No newline at end of file
diff --git a/examples/matRad_neutronTest2_MCNP.m b/examples/matRad_neutronTest2_MCNP.m
new file mode 100644
index 000000000..99d4ecd27
--- /dev/null
+++ b/examples/matRad_neutronTest2_MCNP.m
@@ -0,0 +1,231 @@
+%% Test neutron dose calculation using PBKs - modification of example 1
+clear
+%% set matRad runtime configuration
+matRad_rc; %If this throws an error, run it from the parent directory first to set the paths
+
+%% Create a CT image series
+xDim = 200;
+yDim = 200;
+zDim = 100;
+
+ct.cubeDim = [yDim xDim zDim]; % second cube dimension represents the x-coordinate
+ct.resolution.x = 2;
+ct.resolution.y = 2;
+ct.resolution.z = 3;
+ct.numOfCtScen = 1;
+
+% create an ct image series with zeros - it will be filled later
+ct.cubeHU{1} = ones(ct.cubeDim) * -1000;
+
+ct.dicomInfo.RescaleIntercept = 1000;
+ct.dicomInfo.RescaleSlope = 1;
+%% Create the VOI data for the phantom
+% Now we define structures a contour for the phantom and a target
+
+ixOAR = 1;
+ixPTV = 2;
+ixBone = 3;
+ixLung = 4;
+
+% define general VOI properties
+cst{ixOAR,1} = 0;
+cst{ixOAR,2} = 'Body';
+cst{ixOAR,3} = 'OAR';
+
+cst{ixPTV,1} = 1;
+cst{ixPTV,2} = 'PTV';
+cst{ixPTV,3} = 'TARGET';
+
+cst{ixBone,1} = 2;
+cst{ixBone,2} = 'Bone';
+cst{ixBone,3} = 'OAR';
+
+cst{ixLung,1} = 3;
+cst{ixLung,2} = 'Lung';
+cst{ixLung,3} = 'OAR';
+
+% define optimization parameter for both VOIs
+cst{ixOAR,5}.TissueClass = 1;
+cst{ixOAR,5}.alphaX = 0.1000;
+cst{ixOAR,5}.betaX = 0.0500;
+cst{ixOAR,5}.Priority = 2;
+cst{ixOAR,5}.Visible = 1;
+cst{ixOAR,5}.visibleColor = [0 0 0];
+
+cst{ixBone,5}.TissueClass = 1;
+cst{ixBone,5}.alphaX = 0.1000;
+cst{ixBone,5}.betaX = 0.0500;
+cst{ixBone,5}.Priority = 2;
+cst{ixBone,5}.Visible = 1;
+cst{ixBone,5}.visibleColor = [1 0 0];
+
+cst{ixLung,5}.TissueClass = 1;
+cst{ixLung,5}.alphaX = 0.1000;
+cst{ixLung,5}.betaX = 0.0500;
+cst{ixLung,5}.Priority = 2;
+cst{ixLung,5}.Visible = 1;
+cst{ixLung,5}.visibleColor = [0 1 0];
+
+% define objective as struct for compatibility with GNU Octave I/O
+cst{ixOAR,6}{1} = struct(DoseObjectives.matRad_SquaredOverdosing(10,30));
+cst{ixBone,6}{1} = struct(DoseObjectives.matRad_SquaredOverdosing(10,30));
+cst{ixLung,6}{1} = struct(DoseObjectives.matRad_SquaredOverdosing(10,30));
+
+cst{ixPTV,5}.TissueClass = 1;
+cst{ixPTV,5}.alphaX = 0.1000;
+cst{ixPTV,5}.betaX = 0.0500;
+cst{ixPTV,5}.Priority = 1;
+cst{ixPTV,5}.Visible = 1;
+cst{ixPTV,5}.visibleColor = [1 1 1];
+
+% define objective as struct for compatibility with GNU Octave I/O
+cst{ixPTV,6}{1} = struct(DoseObjectives.matRad_SquaredDeviation(800,60));
+
+%% Lets create either a cubic or a spheric phantom
+cubeHelper = zeros(ct.cubeDim);
+
+% Soft tissue OAR
+ xLowOAR = round(xDim/2 - xDim/4);
+ xHighOAR = round(xDim/2 + xDim/4);
+ yLowOAR = round(yDim/2 - yDim/4);
+ yHighOAR = round(yDim/2 + yDim/4);
+ zLowOAR = round(zDim/2 - zDim/4);
+ zHighOAR = round(zDim/2 + zDim/4);
+
+ for x = xLowOAR:1:xHighOAR
+ for y = yLowOAR:1:yHighOAR
+ for z = zLowOAR:1:zHighOAR
+ cubeHelper(y,x,z) = 1;
+ end
+ end
+ end
+
+% radiusOAR = xDim/4;
+%
+% for x = 1:xDim
+% for y = 1:yDim
+% for z = 1:zDim
+% currPost = [y x z] - round([ct.cubeDim./2]);
+% if sqrt(sum(currPost.^2)) < radiusOAR
+% cubeHelper(y,x,z) = 1;
+% end
+% end
+% end
+% end
+clear currPost
+
+% extract the voxel indices and save it in the cst
+cst{ixOAR,4}{1} = find(cubeHelper);
+
+% Bone
+cubeHelper = zeros(ct.cubeDim);
+
+radiusBone = xDim/12;
+
+for x = 1:xDim
+ for y = 1:yDim
+ for z = 1:zDim
+ currPost = [y x z] - round([ct.cubeDim./2]);
+ currPost(2) = currPost(2) + round([ct.cubeDim(2)./8]);
+ if sqrt(sum(currPost.^2)) < radiusBone
+ cubeHelper(y,x,z) = 1;
+ end
+ end
+ end
+end
+clear currPost
+
+% extract the voxel indices and save it in the cst
+cst{ixBone,4}{1} = find(cubeHelper);
+
+% Lung
+cubeHelper = zeros(ct.cubeDim);
+
+radiusLung = xDim/12;
+
+for x = 1:xDim
+ for y = 1:yDim
+ for z = 1:zDim
+ currPost = [y x z] - round([ct.cubeDim./2]);
+ currPost(2) = currPost(2) - round([ct.cubeDim(2)./8]);
+ if sqrt(sum(currPost.^2)) < radiusLung
+ cubeHelper(y,x,z) = 1;
+ end
+ end
+ end
+end
+clear currPost
+% extract the voxel indices and save it in the cst
+cst{ixLung,4}{1} = find(cubeHelper);
+
+% PTV
+cubeHelper = zeros(ct.cubeDim);
+radiusPTV = xDim/24;
+
+for x = 1:xDim
+ for y = 1:yDim
+ for z = 1:zDim
+ currPost = [x y z] - round([ct.cubeDim./2]);
+ currPost(2) = currPost(2) + round([ct.cubeDim(2)./5]);
+ if sqrt(sum(currPost.^2)) < radiusPTV
+ cubeHelper(y,x,z) = 1;
+ end
+ end
+ end
+end
+
+% extract the voxel indices and save it in the cst
+cst{ixPTV,4}{1} = find(cubeHelper);
+
+
+% now we have ct data and cst data for a new phantom
+disp(ct);
+disp(cst);
+
+
+%% Assign relative electron densities
+vIxOAR = cst{ixOAR,4}{1};
+vIxPTV = cst{ixPTV,4}{1};
+vIxBone = cst{ixBone,4}{1};
+vIxLung = cst{ixLung,4}{1};
+
+ct.cubeHU{1}(vIxOAR) = 0; % assign HU of water
+ct.cubeHU{1}(vIxPTV) = 0; % assign HU of water
+ct.cubeHU{1}(vIxBone) = 2000; % assign HU of water
+ct.cubeHU{1}(vIxLung) = -300; % assign HU of water
+
+% Clean up
+clearvars -except ct cst
+
+%% Treatment Plan
+pln.radiationMode = 'neutrons';
+pln.machine = 'Generic';
+pln.propDoseCalc.engine = 'MCNP';
+
+pln.numOfFractions = 1;
+pln.propStf.gantryAngles = [0 20 340];
+pln.propStf.couchAngles = [0 0 0];
+pln.propStf.bixelWidth = 5;
+
+% Dose calculation settings
+pln.propDoseCalc.doseGrid.resolution.x = 2; % [mm]
+pln.propDoseCalc.doseGrid.resolution.y = 2; % [mm]
+pln.propDoseCalc.doseGrid.resolution.z = 3; % [mm]
+
+% Set add margin to false in order to avoid an oversized margin leading to
+% large number of rays
+pln.propStf.addMargin = false;
+
+%% Generate Beam Geometry STF
+stf = matRad_generateStf(ct,cst,pln);
+% cst{2,6}{1,1}.parameters{1,1} = 1.5;
+
+%% Dose Calculation
+dij = matRad_calcDoseInfluence(ct,cst,stf,pln);
+
+%% Inverse Optimization for intensity-modulated photon therapy
+% The goal of the fluence optimization is to find a set of bixel/spot
+% weights which yield the best possible dose distribution according to the
+% clinical objectives and constraints underlying the radiation treatment.
+resultGUI = matRad_fluenceOptimization(dij,cst,pln);
+matRadGUI
\ No newline at end of file
diff --git a/examples/matRad_neutronTest3_BNCT.m b/examples/matRad_neutronTest3_BNCT.m
new file mode 100644
index 000000000..8e4712654
--- /dev/null
+++ b/examples/matRad_neutronTest3_BNCT.m
@@ -0,0 +1,231 @@
+%% Test neutron dose calculation using PBKs - modification of example 1
+clear
+%% set matRad runtime configuration
+matRad_rc; %If this throws an error, run it from the parent directory first to set the paths
+
+%% Create a CT image series
+xDim = 200;
+yDim = 200;
+zDim = 100;
+
+ct.cubeDim = [yDim xDim zDim]; % second cube dimension represents the x-coordinate
+ct.resolution.x = 2;
+ct.resolution.y = 2;
+ct.resolution.z = 3;
+ct.numOfCtScen = 1;
+
+% create an ct image series with zeros - it will be filled later
+ct.cubeHU{1} = ones(ct.cubeDim) * -1000;
+
+ct.dicomInfo.RescaleIntercept = 1000;
+ct.dicomInfo.RescaleSlope = 1;
+%% Create the VOI data for the phantom
+% Now we define structures a contour for the phantom and a target
+
+ixOAR = 1;
+ixPTV = 2;
+ixBone = 3;
+ixLung = 4;
+
+% define general VOI properties
+cst{ixOAR,1} = 0;
+cst{ixOAR,2} = 'Body';
+cst{ixOAR,3} = 'OAR';
+
+cst{ixPTV,1} = 1;
+cst{ixPTV,2} = 'PTV_BNCT';
+cst{ixPTV,3} = 'TARGET';
+
+cst{ixBone,1} = 2;
+cst{ixBone,2} = 'Bone';
+cst{ixBone,3} = 'OAR';
+
+cst{ixLung,1} = 3;
+cst{ixLung,2} = 'Lung';
+cst{ixLung,3} = 'OAR';
+
+% define optimization parameter for both VOIs
+cst{ixOAR,5}.TissueClass = 1;
+cst{ixOAR,5}.alphaX = 0.1000;
+cst{ixOAR,5}.betaX = 0.0500;
+cst{ixOAR,5}.Priority = 2;
+cst{ixOAR,5}.Visible = 1;
+cst{ixOAR,5}.visibleColor = [0 0 0];
+
+cst{ixBone,5}.TissueClass = 1;
+cst{ixBone,5}.alphaX = 0.1000;
+cst{ixBone,5}.betaX = 0.0500;
+cst{ixBone,5}.Priority = 2;
+cst{ixBone,5}.Visible = 1;
+cst{ixBone,5}.visibleColor = [1 0 0];
+
+cst{ixLung,5}.TissueClass = 1;
+cst{ixLung,5}.alphaX = 0.1000;
+cst{ixLung,5}.betaX = 0.0500;
+cst{ixLung,5}.Priority = 2;
+cst{ixLung,5}.Visible = 1;
+cst{ixLung,5}.visibleColor = [0 1 0];
+
+% define objective as struct for compatibility with GNU Octave I/O
+cst{ixOAR,6}{1} = struct(DoseObjectives.matRad_SquaredOverdosing(10,30));
+cst{ixBone,6}{1} = struct(DoseObjectives.matRad_SquaredOverdosing(10,30));
+cst{ixLung,6}{1} = struct(DoseObjectives.matRad_SquaredOverdosing(10,30));
+
+cst{ixPTV,5}.TissueClass = 1;
+cst{ixPTV,5}.alphaX = 0.1000;
+cst{ixPTV,5}.betaX = 0.0500;
+cst{ixPTV,5}.Priority = 1;
+cst{ixPTV,5}.Visible = 1;
+cst{ixPTV,5}.visibleColor = [1 1 1];
+
+% define objective as struct for compatibility with GNU Octave I/O
+cst{ixPTV,6}{1} = struct(DoseObjectives.matRad_SquaredDeviation(800,60));
+
+%% Lets create either a cubic or a spheric phantom
+cubeHelper = zeros(ct.cubeDim);
+
+% Soft tissue OAR
+ xLowOAR = round(xDim/2 - xDim/4);
+ xHighOAR = round(xDim/2 + xDim/4);
+ yLowOAR = round(yDim/2 - yDim/4);
+ yHighOAR = round(yDim/2 + yDim/4);
+ zLowOAR = round(zDim/2 - zDim/4);
+ zHighOAR = round(zDim/2 + zDim/4);
+
+ for x = xLowOAR:1:xHighOAR
+ for y = yLowOAR:1:yHighOAR
+ for z = zLowOAR:1:zHighOAR
+ cubeHelper(y,x,z) = 1;
+ end
+ end
+ end
+
+% radiusOAR = xDim/4;
+%
+% for x = 1:xDim
+% for y = 1:yDim
+% for z = 1:zDim
+% currPost = [y x z] - round([ct.cubeDim./2]);
+% if sqrt(sum(currPost.^2)) < radiusOAR
+% cubeHelper(y,x,z) = 1;
+% end
+% end
+% end
+% end
+clear currPost
+
+% extract the voxel indices and save it in the cst
+cst{ixOAR,4}{1} = find(cubeHelper);
+
+% Bone
+cubeHelper = zeros(ct.cubeDim);
+
+radiusBone = xDim/12;
+
+for x = 1:xDim
+ for y = 1:yDim
+ for z = 1:zDim
+ currPost = [y x z] - round([ct.cubeDim./2]);
+ currPost(2) = currPost(2) + round([ct.cubeDim(2)./8]);
+ if sqrt(sum(currPost.^2)) < radiusBone
+ cubeHelper(y,x,z) = 1;
+ end
+ end
+ end
+end
+clear currPost
+
+% extract the voxel indices and save it in the cst
+cst{ixBone,4}{1} = find(cubeHelper);
+
+% Lung
+cubeHelper = zeros(ct.cubeDim);
+
+radiusLung = xDim/12;
+
+for x = 1:xDim
+ for y = 1:yDim
+ for z = 1:zDim
+ currPost = [y x z] - round([ct.cubeDim./2]);
+ currPost(2) = currPost(2) - round([ct.cubeDim(2)./8]);
+ if sqrt(sum(currPost.^2)) < radiusLung
+ cubeHelper(y,x,z) = 1;
+ end
+ end
+ end
+end
+clear currPost
+% extract the voxel indices and save it in the cst
+cst{ixLung,4}{1} = find(cubeHelper);
+
+% PTV
+cubeHelper = zeros(ct.cubeDim);
+radiusPTV = xDim/24;
+
+for x = 1:xDim
+ for y = 1:yDim
+ for z = 1:zDim
+ currPost = [x y z] - round([ct.cubeDim./2]);
+ currPost(2) = currPost(2) + round([ct.cubeDim(2)./5]);
+ if sqrt(sum(currPost.^2)) < radiusPTV
+ cubeHelper(y,x,z) = 1;
+ end
+ end
+ end
+end
+
+% extract the voxel indices and save it in the cst
+cst{ixPTV,4}{1} = find(cubeHelper);
+
+
+% now we have ct data and cst data for a new phantom
+disp(ct);
+disp(cst);
+
+
+%% Assign relative electron densities
+vIxOAR = cst{ixOAR,4}{1};
+vIxPTV = cst{ixPTV,4}{1};
+vIxBone = cst{ixBone,4}{1};
+vIxLung = cst{ixLung,4}{1};
+
+ct.cubeHU{1}(vIxOAR) = 0; % assign HU of water
+ct.cubeHU{1}(vIxPTV) = 0; % assign HU of water
+ct.cubeHU{1}(vIxBone) = 2000; % assign HU of water
+ct.cubeHU{1}(vIxLung) = -300; % assign HU of water
+
+% Clean up
+clearvars -except ct cst
+
+%% Treatment Plan
+pln.radiationMode = 'neutrons';
+pln.machine = 'BNCT';
+pln.propDoseCalc.engine = 'MCNP';
+
+pln.numOfFractions = 1;
+pln.propStf.gantryAngles = 0; %[0 20 340];
+pln.propStf.couchAngles = 0; %[0 0 0];
+pln.propStf.bixelWidth = 50;
+
+% Dose calculation settings
+pln.propDoseCalc.doseGrid.resolution.x = 2; % [mm]
+pln.propDoseCalc.doseGrid.resolution.y = 2; % [mm]
+pln.propDoseCalc.doseGrid.resolution.z = 3; % [mm]
+
+% Set add margin to false in order to avoid an oversized margin leading to
+% large number of rays
+pln.propStf.addMargin = false;
+
+%% Generate Beam Geometry STF
+stf = matRad_generateStf(ct,cst,pln);
+% cst{2,6}{1,1}.parameters{1,1} = 1.5;
+
+%% Dose Calculation
+dij = matRad_calcDoseInfluence(ct,cst,stf,pln);
+
+%% Inverse Optimization for intensity-modulated photon therapy
+% The goal of the fluence optimization is to find a set of bixel/spot
+% weights which yield the best possible dose distribution according to the
+% clinical objectives and constraints underlying the radiation treatment.
+resultGUI = matRad_fluenceOptimization(dij,cst,pln);
+matRadGUI
\ No newline at end of file
diff --git a/examples/matRad_test2_neutronMCNPcalc.m b/examples/matRad_test2_neutronMCNPcalc.m
new file mode 100644
index 000000000..c05ce5627
--- /dev/null
+++ b/examples/matRad_test2_neutronMCNPcalc.m
@@ -0,0 +1,114 @@
+
+%% Test neutron dose calculation using MCNP dose engine - modification of example 1
+clear
+%% set matRad runtime configuration
+matRad_rc; %If this throws an error, run it from the parent directory first to set the paths
+load('Patient_FRM2_submGlTumor.mat');
+% now we have ct data and cst data for a new phantom
+display(ct);
+display(cst);
+
+%% Treatment Plan
+% The next step is to define your treatment plan labeled as 'pln'. This
+% structure requires input from the treatment planner and defines the most
+% important cornerstones of your treatment plan.
+
+
+
+%%
+% First of all, we need to define what kind of radiation modality we would
+% like to use. Possible values are photons, protons or carbon. In this
+% example we would like to use photons for treatment planning. Next, we
+% need to define a treatment machine to correctly load the corresponding
+% base data. matRad features generic base data in the file
+% 'photons_Generic.mat'; consequently the machine has to be set to 'Generic'
+pln.radiationMode = 'neutrons';
+pln.machine = 'generic_MCNP';
+
+% MCNP parameter
+pln.propMCNP.normalizationFactor = 1e5;
+% Define properties for MCNP simulationr
+pln.propMCNP.wantWholeZ = true;
+pln.propMCNP.wantToResize = false;
+pln.propMCNP.densityAir = 0.123e-3; % density air in g/cm^3
+pln.propMCNP.numberParticles = 1e3; %5e9;
+% pln.propMCNP.phyMode = 'N P E H'; %'N', 'N P E H D A #';
+
+pln.propMCNP.tallySpecifier = 'TotalDose_TMESH'; % 'KERMA_F4';
+pln.propMCNP.tallyKeyword = 'TOTAL'; %Only needed for TMESH
+% pln.propOpt.bioOptimization = 'RBExSecPartDose_MCDS_RMFmodel';
+pln.propOpt.defaultLQmodel.ratioAlphaBeta = 5;
+
+%%
+% Define the biological optimization model for treatment planning along
+% with the quantity that should be used for optimization. Possible model values
+% are:
+% 'none': physical optimization;
+% 'constRBE': constant RBE of 1.1;
+% 'MCN': McNamara-variable RBE model for protons;
+% 'WED': Wedenberg-variable RBE model for protons
+% 'LEM': Local Effect Model
+% and possible quantityOpt are 'physicalDose', 'effect' or 'RBExD'.
+modelName = 'none'; %'none' 'constRBE'
+quantityOpt = 'physicalDose'; %'RBExD'; %'physicalDose';
+
+%%
+% The remaining plan parameters are set like in the previous example files
+pln.numOfFractions = 1;
+pln.propStf.gantryAngles =270;
+pln.propStf.couchAngles = 0;
+pln.propStf.bixelWidth = 200; %5; %90;
+pln.propStf.numOfBeams = numel(pln.propStf.gantryAngles);
+pln.propStf.isoCenter = ones(pln.propStf.numOfBeams,1) * matRad_getIsoCenter(cst,ct,0);
+pln.propOpt.runDAO = 0;
+pln.propOpt.runSequencing = 0;
+
+% retrieve bio model parameters
+%pln.bioParam.model = 'constRBE';
+pln.bioParam = matRad_bioModel(pln.radiationMode,quantityOpt,modelName);
+
+% retrieve nominal scenario for dose calculation and optimziation
+pln.multScen = matRad_multScen(ct,'nomScen');
+
+% dose calculation settings
+pln.propDoseCalc.doseGrid.resolution.x = ct.resolution.x; % [mm]
+pln.propDoseCalc.doseGrid.resolution.y = ct.resolution.y; % [mm]
+pln.propDoseCalc.doseGrid.resolution.z = ct.resolution.z; % [mm]
+
+
+%% Generate Beam Geometry STF
+stf = matRad_generateStf(ct,cst,pln);
+%cst{2,6}{1,1}.parameters{1,1} = 1.5;
+
+%% Dose Calculation
+[dij,ct,stf,pln,cst] = matRad_calcDoseInfluence(ct,stf,pln,cst);
+
+%% Export dij matrix
+%matRad_exportDij('dij.bin',dij,stf);
+
+%% Inverse Optimization for intensity-modulated photon therapy
+% The goal of the fluence optimization is to find a set of bixel/spot
+% weights which yield the best possible dose distribution according to the
+% clinical objectives and constraints underlying the radiation treatment.
+resultGUI = matRad_fluenceOptimization(dij,cst,pln);
+matRadGUI
+
+% %% Plot the resulting dose slice
+% plane = 3;
+% slice = round(pln.propStf.isoCenter(1,3)./ct.resolution.z);
+% doseWindow = [0 max([resultGUI.physicalDose(:)])];
+%
+% figure,title('phantom plan')
+% matRad_plotSliceWrapper(gca,ct,cst,1,resultGUI.physicalDose,plane,slice,[],[],colorcube,[],doseWindow,[]);
+%
+%
+% %%
+% % We export the the created phantom & dose as dicom. This is handled by the
+% % class matRad_DicomExporter. When no arguments are given, the exporter searches
+% % the workspace itself for matRad-structures. The output directory can be set by
+% % the property dicomDir. While the different DICOM datasets (ct, RTStruct, etc)
+% % can be exported individually, we call the wrapper to do all possible exports.
+% dcmExport = matRad_DicomExporter();
+% dcmExport.dicomDir = [pwd filesep 'dicomExport'];
+% dcmExport.matRad_exportDicom();
+
diff --git a/examples/matRad_test5_MCNPexample_FNT_SmallBixel.m b/examples/matRad_test5_MCNPexample_FNT_SmallBixel.m
new file mode 100644
index 000000000..dd9da4f76
--- /dev/null
+++ b/examples/matRad_test5_MCNPexample_FNT_SmallBixel.m
@@ -0,0 +1,113 @@
+%% Test neutron dose calculation using MCNP dose engine - modification of example 1
+clear
+%% set matRad runtime configuration
+matRad_rc; %If this throws an error, run it from the parent directory first to set the paths
+load('Patient_FRM2_submGlTumor.mat');
+% now we have ct data and cst data for a new phantom
+display(ct);
+display(cst);
+
+%% Treatment Plan
+% The next step is to define your treatment plan labeled as 'pln'. This
+% structure requires input from the treatment planner and defines the most
+% important cornerstones of your treatment plan.
+
+
+
+%%
+% First of all, we need to define what kind of radiation modality we would
+% like to use. Possible values are photons, protons or carbon. In this
+% example we would like to use photons for treatment planning. Next, we
+% need to define a treatment machine to correctly load the corresponding
+% base data. matRad features generic base data in the file
+% 'photons_Generic.mat'; consequently the machine has to be set to 'Generic'
+pln.radiationMode = 'neutrons';
+pln.machine = 'generic_MCNP';
+
+% % MCNP parameter
+% pln.propMCNP.normalizationFactor = 1e5;
+% % Define properties for MCNP simulationr
+% pln.propMCNP.wantWholeZ = true;
+% pln.propMCNP.wantToResize = false;
+% pln.propMCNP.densityAir = 0.123e-3; % density air in g/cm^3
+% pln.propMCNP.numberParticles = 0.25e8; %5e9;
+% % pln.propMCNP.phyMode = 'N P E H'; %'N', 'N P E H D A #';
+%
+% pln.propMCNP.tallySpecifier = 'TotalDose_TMESH'; % 'KERMA_F4';
+% pln.propMCNP.tallyKeyword = 'TOTAL'; %Only needed for TMESH
+% % pln.propOpt.bioOptimization = 'RBExSecPartDose_MCDS_RMFmodel';
+% pln.propOpt.defaultLQmodel.ratioAlphaBeta = 5;
+
+%%
+% Define the biological optimization model for treatment planning along
+% with the quantity that should be used for optimization. Possible model values
+% are:
+% 'none': physical optimization;
+% 'constRBE': constant RBE of 1.1;
+% 'MCN': McNamara-variable RBE model for protons;
+% 'WED': Wedenberg-variable RBE model for protons
+% 'LEM': Local Effect Model
+% and possible quantityOpt are 'physicalDose', 'effect' or 'RBExD'.
+modelName = 'none'; %'none' 'constRBE'
+quantityOpt = 'physicalDose'; %'RBExD'; %'physicalDose';
+
+%%
+% The remaining plan parameters are set like in the previous example files
+pln.numOfFractions = 1;
+pln.propStf.gantryAngles =[270]; %, 230];
+pln.propStf.couchAngles = [0]; %, 0];
+pln.propStf.bixelWidth = 10; %20;
+pln.propStf.numOfBeams = numel(pln.propStf.gantryAngles);
+pln.propStf.isoCenter = ones(pln.propStf.numOfBeams,1) * matRad_getIsoCenter(cst,ct,0);
+pln.propOpt.runDAO = 0;
+pln.propOpt.runSequencing = 0;
+
+% retrieve bio model parameters
+%pln.bioParam.model = 'constRBE';
+pln.bioParam = matRad_bioModel(pln.radiationMode,quantityOpt,modelName);
+
+% retrieve nominal scenario for dose calculation and optimziation
+pln.multScen = matRad_multScen(ct,'nomScen');
+
+% dose calculation settings
+pln.propDoseCalc.doseGrid.resolution.x = ct.resolution.x; % [mm]
+pln.propDoseCalc.doseGrid.resolution.y = ct.resolution.y; % [mm]
+pln.propDoseCalc.doseGrid.resolution.z = ct.resolution.z; % [mm]
+
+
+%% Generate Beam Geometry STF
+stf = matRad_generateStf(ct,cst,pln);
+%cst{2,6}{1,1}.parameters{1,1} = 1.5;
+
+%% Dose Calculation
+[dij,ct,stf,pln,cst] = matRad_calcDoseInfluence(ct,stf,pln,cst);
+
+%% Export dij matrix
+%matRad_exportDij('dij.bin',dij,stf);
+
+%% Inverse Optimization for intensity-modulated photon therapy
+% The goal of the fluence optimization is to find a set of bixel/spot
+% weights which yield the best possible dose distribution according to the
+% clinical objectives and constraints underlying the radiation treatment.
+resultGUI = matRad_fluenceOptimization(dij,cst,pln);
+matRadGUI
+
+% %% Plot the resulting dose slice
+% plane = 3;
+% slice = round(pln.propStf.isoCenter(1,3)./ct.resolution.z);
+% doseWindow = [0 max([resultGUI.physicalDose(:)])];
+%
+% figure,title('phantom plan')
+% matRad_plotSliceWrapper(gca,ct,cst,1,resultGUI.physicalDose,plane,slice,[],[],colorcube,[],doseWindow,[]);
+%
+%
+% %%
+% % We export the the created phantom & dose as dicom. This is handled by the
+% % class matRad_DicomExporter. When no arguments are given, the exporter searches
+% % the workspace itself for matRad-structures. The output directory can be set by
+% % the property dicomDir. While the different DICOM datasets (ct, RTStruct, etc)
+% % can be exported individually, we call the wrapper to do all possible exports.
+% dcmExport = matRad_DicomExporter();
+% dcmExport.dicomDir = [pwd filesep 'dicomExport'];
+% dcmExport.matRad_exportDicom();
+
diff --git a/matRad/MatRad_Config.m b/matRad/MatRad_Config.m
index 06e12316b..030681f36 100644
--- a/matRad/MatRad_Config.m
+++ b/matRad/MatRad_Config.m
@@ -196,6 +196,7 @@ function setDefaultProperties(obj)
%Default machines
obj.defaults.machine.photons = 'Generic';
+ obj.defaults.machine.neutrons = 'Generic';
obj.defaults.machine.protons = 'Generic';
obj.defaults.machine.helium = 'Generic';
obj.defaults.machine.carbon = 'Generic';
@@ -206,6 +207,7 @@ function setDefaultProperties(obj)
%Default Bio Model
obj.defaults.bioModel.photons = 'none';
+ obj.defaults.bioModel.neutrons = 'none';
obj.defaults.bioModel.protons = 'constRBE';
obj.defaults.bioModel.helium = 'HEL';
obj.defaults.bioModel.carbon = 'LEM';
@@ -229,6 +231,7 @@ function setDefaultProperties(obj)
obj.defaults.propDoseCalc.useGivenEqDensityCube = false; %Use the given density cube ct.cube and omit conversion from cubeHU.
obj.defaults.propDoseCalc.ignoreOutsideDensities = true; %Ignore densities outside of cst contours
obj.defaults.propDoseCalc.useCustomPrimaryPhotonFluence = false; %Use a custom primary photon fluence
+ obj.defaults.propDoseCalc.useCustomPrimaryNeutronFluence = false; %Use a custom primary neutron fluence
obj.defaults.propDoseCalc.calcLET = true; %calculate LETs for particles
obj.defaults.propDoseCalc.selectVoxelsInScenarios = 'all';
obj.defaults.propDoseCalc.airOffsetCorrection = true;
@@ -250,8 +253,6 @@ function setDefaultProperties(obj)
%Sequencing Options
obj.defaults.propSeq.sequencer = 'siochi';
-
-
obj.disableGUI = false;
obj.defaults.samplingScenarios = 25;
diff --git a/matRad/basedata/neutrons_BNCT.mat b/matRad/basedata/neutrons_BNCT.mat
new file mode 100644
index 000000000..e584b721f
Binary files /dev/null and b/matRad/basedata/neutrons_BNCT.mat differ
diff --git a/matRad/basedata/neutrons_FNT.mat b/matRad/basedata/neutrons_FNT.mat
new file mode 100644
index 000000000..738628e13
Binary files /dev/null and b/matRad/basedata/neutrons_FNT.mat differ
diff --git a/matRad/basedata/neutrons_Generic.mat b/matRad/basedata/neutrons_Generic.mat
new file mode 100644
index 000000000..74e058b95
Binary files /dev/null and b/matRad/basedata/neutrons_Generic.mat differ
diff --git a/matRad/basedata/neutrons_MEDAPP.mat b/matRad/basedata/neutrons_MEDAPP.mat
new file mode 100644
index 000000000..edf6d0ab6
Binary files /dev/null and b/matRad/basedata/neutrons_MEDAPP.mat differ
diff --git a/matRad/basedata/neutrons_thermalFRM.mat b/matRad/basedata/neutrons_thermalFRM.mat
new file mode 100644
index 000000000..bbca57ef6
Binary files /dev/null and b/matRad/basedata/neutrons_thermalFRM.mat differ
diff --git a/matRad/bioModels/matRad_EmptyBiologicalModel.m b/matRad/bioModels/matRad_EmptyBiologicalModel.m
index daf7e4e27..8291f223f 100644
--- a/matRad/bioModels/matRad_EmptyBiologicalModel.m
+++ b/matRad/bioModels/matRad_EmptyBiologicalModel.m
@@ -16,7 +16,7 @@
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
properties (Constant)
model = 'none';
- possibleRadiationModes = {'photons', 'protons', 'carbon', 'helium', 'brachy','VHEE'};
+ possibleRadiationModes = {'photons', 'protons', 'carbon', 'helium', 'brachy', 'VHEE', 'neutrons'};
requiredQuantities = {};
defaultReportQuantity = 'physicalDose';
end
diff --git a/matRad/doseCalc/+DoseEngines/matRad_NeutronMCNPEngine.m b/matRad/doseCalc/+DoseEngines/matRad_NeutronMCNPEngine.m
new file mode 100644
index 000000000..3e47c7be3
--- /dev/null
+++ b/matRad/doseCalc/+DoseEngines/matRad_NeutronMCNPEngine.m
@@ -0,0 +1,753 @@
+classdef matRad_NeutronMCNPEngine < DoseEngines.matRad_MonteCarloEngineAbstract
+ % Engine for neutron dose calculation using monte carlo calculation
+ % specificly MCNP
+ % for more informations see superclass
+ % DoseEngines.matRad_MonteCarloEngineAbstract
+ %
+ % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+ %
+ % Copyright 2019 the matRad development team.
+ %
+ % This file is part of the matRad project. It is subject to the license
+ % terms in the LICENSE file found in the top-level directory of this
+ % distribution and at https://github.com/e0404/matRad/LICENSES.txt. No part
+ % of the matRad project, including this file, may be copied, modified,
+ % propagated, or distributed except according to the terms contained in the
+ % LICENSE file.
+ %
+ % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+ properties (Constant)
+ possibleRadiationModes = {'neutrons'};
+ name = 'MCNP dose engine';
+ shortName = 'MCNP';
+ end
+
+ properties
+ config; %Holds an instance of all configurable parameters
+
+ %Other Dose Calculation Properties
+ externalCalculation = true;
+
+ % Question dialogs avoided
+ useDICOMinfoRescale = true;
+ useLungQuestionDialog = false;
+
+ calcRMFparameters = false;
+ MCNPinstallationCheck;
+ MCNPFolder;
+ end
+
+ properties (SetAccess = protected, GetAccess = public)
+
+ currFolder = pwd; %folder path when set
+
+ constantRBE = NaN; % constant RBE value
+ end
+
+ methods
+
+ function this = matRad_NeutronMCNPEngine(pln)
+ % Constructor
+ %
+ % call
+ % engine = DoseEngines.matRad_NeutronMCNPEngine(ct,stf,pln,cst)
+ %
+ % input
+ % ct: matRad ct struct
+ % stf: matRad steering information struct
+ % pln: matRad plan meta information struct
+ % cst: matRad cst struct
+
+ if nargin < 1
+ pln = [];
+ end
+
+ % call superclass constructor
+ this = this@DoseEngines.matRad_MonteCarloEngineAbstract(pln);
+
+ this.config = matRad_MCNPConfig();
+
+ % check if bio optimization is needed and set the
+ % coresponding boolean accordingly
+ % TODO:
+ % This should not be handled here as an optimization property
+ % We should rather make optimization dependent on what we have
+ % decided to calculate here.
+ if nargin > 0
+ if (isfield(pln,'propOpt')&& isfield(pln.propOpt,'bioOptimization')&& ...
+ isequal(pln.propOpt.bioOptimization,'RBExSecPartDose_MCDS_RMFmodel'))
+ this.calcBioDose = true;
+ elseif strcmp(pln.radiationMode,'neutrons') && isfield(pln,'propOpt') && isfield(pln.propOpt,'bioOptimization') && isequal(pln.propOpt.bioOptimization,'const_RBExD')
+ this.constantRBE = 4;
+ end
+ end
+ end
+
+ function setDefaults(this)
+ this.setDefaults@DoseEngines.matRad_MonteCarloEngineAbstract();
+
+ % future code for property validation on creation here
+ matRad_cfg = MatRad_Config.instance();
+
+ %Assign default parameters from MatRad_Config
+ %this.doseGrid.resolution = matRad_cfg.propDoseCalc.defaultResolution;
+ %this.multScen = 'nomScen';
+
+ %Set Default MCNP path
+ %Set folder
+ this.MCNPFolder = [matRad_cfg.matRadRoot filesep 'MCNP'];
+ end
+ end
+
+ methods(Access = protected)
+
+ function dij = calcDose(this,ct,cst,stf)
+ % matRad MCNP monte carlo dose calculation wrapper
+ %
+ %
+ % call
+ % dij = this.calcDose(ct,stf,pln,cst)
+ %
+ % input
+ % ct: matRad ct struct
+ % cst: matRad cst struct
+ % stf: atRad steering information struct
+ %
+ % output
+ % dij: matRad dij struct
+ %
+ % References
+ %
+ %
+ % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+ matRad_cfg = MatRad_Config.instance();
+
+ %Now we can run initDoseCalc as usual
+ dij = this.initDoseCalc(ct,cst,stf);
+
+ % For MCNP TMESH calculations the ct grid has to be downsampled to the dose grid
+ for s = 1:dij.numOfScenarios
+ if s>1
+ error('Multiple scenarios not yet implemented for MCNP dose calculations.')
+ end
+ ct.doseGridCT.HUcube{s} = matRad_interp3(dij.ctGrid.x, dij.ctGrid.y', dij.ctGrid.z,ct.cubeHU{s}, ...
+ dij.doseGrid.x,dij.doseGrid.y',dij.doseGrid.z,'linear');
+ cst_doseGrid = matRad_resizeCstToGrid(cst,dij.ctGrid.x,dij.ctGrid.y,dij.ctGrid.z,...
+ dij.doseGrid.x,dij.doseGrid.y,dij.doseGrid.z);
+ end
+
+ % set absolute calibration factor
+ % Convert MeV/g to J/kg, output is now in Gy/source particle
+ absCalibrationFactorMCNP = 1.602177e-19*1e6*1e3;
+
+ %matRad_cfg.matRadRoot
+
+ % Generate log-file
+ pathLog = strcat(this.MCNPFolder, filesep, 'logFile');
+
+ try diary(fullfile(pathLog, strcat(matRad_getTime4log, '_neutronDoseCalculation')))
+ catch
+ mkdir('logFile')
+ diary(fullfile(pathLog, strcat(matRad_getTime4log, '_neutronDoseCalculation')))
+ end
+
+ % Load predefined conversion properties for tissue characterization
+ % according to CT values - elemental composition will be assigned according
+ % to these predefined tissue intervals later
+ matRad_cfg.dispInfo('*****\n')
+ matRad_cfg.dispInfo('Load pre-defined HU conversion properties and MCNP cross sections from conversionCT2tissue.mat.\n')
+ matRad_cfg.dispInfo('Note: Modification of conversionCT2tissue.mat using matRad_genVarCT2tissueConversion.m.\n')
+ load([this.MCNPFolder,filesep,'conversionCT2tissue.mat'])
+ matRad_cfg.dispInfo('*****\n')
+
+ %% Process CT data
+ % Check ct for MCNP Simulation
+ if ct.resolution.x ~= ct.resolution.y
+ error('x- and y-resolution have to be equal for the simulation.')
+ end
+
+ % Set HU outside body to air, i.e. neglect everything outside body for the
+ % simulation
+ % Note: body structure is the only normal tissue structure that
+ % has to be contured
+
+ bodyStructureName = 'Body'; % Default name for body structure is 'Body'
+ try
+ cstBodyIndex = matRad_findBodyStructureCST(cst, bodyStructureName);
+ catch
+ prompt = {'Please enter body structure name:'};
+ dlgtitle = 'Find Body Structure';
+ bodyStructureName = inputdlg(prompt,dlgtitle);
+ cstBodyIndex = matRad_findBodyStructureCST(cst, bodyStructureName);
+ end
+
+ % Process HU values
+ matRad_cfg.dispInfo('*****\n')
+ matRad_cfg.dispInfo(['Properties from (scaled) HU loaded are: Minimum value: ',num2str(min(ct.cubeHU{1}, [], 'all')), ' and \n'])
+ matRad_cfg.dispInfo(['Maximum value: ',num2str(max(ct.cubeHU{1}(cst{cstBodyIndex,4}{1}), [], 'all')), '.\n'])
+ if ~isfield(ct, 'dicomInfo') || ~isfield(ct.dicomInfo, 'RescaleSlope') || ~isfield(ct.dicomInfo, 'RescaleIntercept')
+ matRad_cfg.dispWarning('No information on rescale slope and/or intercept provided in DICOM data. Calculation might crash...\n')
+ else
+ matRad_cfg.dispInfo(['Rescale slope from CT data is read to be: ',num2str(ct.dicomInfo.RescaleSlope), ' and rescale intercept is read to be ',num2str(ct.dicomInfo.RescaleIntercept),'.\n'])
+ end
+
+ % Set values outside body to air
+ try
+ cstTargetIndex = matRad_findTargetStructureCST(cst);
+ catch
+ matRad_cfg.dispError('Target structure has to be set in matRad.\n')
+ end
+
+ maskNonBody = ones(ct.cubeDim);
+ maskNonBody_doseGrid = ones(dij.doseGrid.dimensions);
+ bodyIdx = [cst{sort([cstTargetIndex, cstBodyIndex]),4}];
+ bodyIdx = unique(vertcat(bodyIdx{:}));
+ bodyIdx_doseGrid = [cst_doseGrid{sort([cstTargetIndex, cstBodyIndex]),4}];
+ bodyIdx_doseGrid = unique(vertcat(bodyIdx_doseGrid{:}));
+
+ maskNonBody(bodyIdx) = 0;
+ maskNonBody_doseGrid(bodyIdx_doseGrid) = 0;
+ ct.cube{1}(maskNonBody>0) = 0;
+ ct.cubeHU{1}(maskNonBody>0) = 0;
+ ct.doseGridCT.HUcube{1}(maskNonBody_doseGrid>0) = min(ct.doseGridCT.HUcube{1}, [], 'all'); % Use minimum to ensure compatibility with rescaling below
+
+
+ if ~isprop(this, 'useDICOMinfoRescale')
+ matRad_cfg.dispInfo('Please use question dialog to decide how to convert to scaled HU.\n')
+ matRad_cfg.dispInfo('*****\n')
+ % DICOM rescaling
+ answer = questdlg('Would you like to use DICOM rescale slope and intercept? If not, an offset of 1000 will be added to the HU values to get re-scale HUs.', ...
+ 'Use DICOM Info', ...
+ 'Yes', 'No', 'No');
+
+ switch answer
+ case 'Yes'
+ matRad_cfg.dispInfo('*****\n')
+ matRad_cfg.dispInfo('You decided to use the following parameters to re-scale (scaled) HU data given in ct.cubeHU to HU in ct.cube.\n')
+ matRad_cfg.dispInfo(['Rescale HU: slope=', num2str(ct.dicomInfo.RescaleSlope), ' intercept=', num2str(ct.dicomInfo.RescaleIntercept),'\n'])
+ matRad_cfg.dispInfo('*****\n')
+ ct.doseGridCT.HUcube{1} = ct.doseGridCT.HUcube{1}.*ct.dicomInfo.RescaleSlope + abs(ct.dicomInfo.RescaleIntercept);
+ case 'No'
+ matRad_cfg.dispInfo('*****\n')
+ matRad_cfg.dispInfo('You decided not to use DICOM rescale slope and intercept.\n')
+ matRad_cfg.dispInfo('*****\n')
+ ct.doseGridCT.HUcube{1} = ct.doseGridCT.HUcube{1} + 1000;
+ end
+ clear answer
+ elseif this.useDICOMinfoRescale
+ matRad_cfg.dispInfo('*****\n')
+ matRad_cfg.dispInfo('Re-scaling of (scaled) HU data given in ct.cubeHU to HU in ct.cube selected according to property useDICOMinfoRescale.\n')
+ matRad_cfg.dispInfo('DICOM rescale slope and intercept are used to re-scale.\n')
+ matRad_cfg.dispInfo(['Rescale HU: slope=', num2str(ct.dicomInfo.RescaleSlope), ' intercept=', num2str(ct.dicomInfo.RescaleIntercept),'\n'])
+ matRad_cfg.dispInfo('*****\n')
+ ct.doseGridCT.HUcube{1} = ct.doseGridCT.HUcube{1}.*ct.dicomInfo.RescaleSlope + abs(ct.dicomInfo.RescaleIntercept);
+ elseif ~this.useDICOMinfoRescale
+ matRad_cfg.dispInfo('*****\n')
+ matRad_cfg.dispInfo('Re-scaling of (scaled) HU data given in ct.cubeHU to HU in ct.cube selected according to property useDICOMinfoRescale.\n')
+ matRad_cfg.dispInfo('You decided not to use DICOM rescale slope and intercept. An offset of +1000 is added.\n')
+ matRad_cfg.dispInfo('*****\n')
+ ct.doseGridCT.HUcube{1} = ct.doseGridCT.HUcube{1} + 1000;
+
+ end
+
+ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+ % Additional Information on Conversion %
+ % Re-scale HU from intensity values given in DICOM by using 'rescale intercept' and 'rescale slope' %
+ % Def. HU: HU = 1000*((mu - mu_water)/mu_water) -> HU_water = 0 %
+ % Note: For our purpose, HU values should start at zero. %
+ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+ % Infere tissue characteristics from HU
+ matRad_cfg.dispInfo('*****\n')
+ matRad_cfg.dispInfo(['Properties from rescaled HU are: Minimum value: ',num2str(min(ct.doseGridCT.HUcube{1}, [], 'all')), ' and \n'])
+ matRad_cfg.dispInfo(['Maximum value: ',num2str(max(ct.doseGridCT.HUcube{1}, [], 'all')), '.\n'])
+ matRad_cfg.dispInfo('*****\n')
+ matRad_cfg.dispInfo('Material types are assigned using the following HU intervals:\n')
+ maxHUbin_nonEmpty = 1; % Find last non-empty entry
+ while ~isempty(binIntervals(maxHUbin_nonEmpty+1).HUbin) && (maxHUbin_nonEmpty <= size(binIntervals,2))
+ maxHUbin_nonEmpty = maxHUbin_nonEmpty +1;
+ end
+ for i=1:maxHUbin_nonEmpty
+ matRad_cfg.dispInfo([binIntervals(i).name, ': ', num2str(binIntervals(i).HUbin(1)), ' to ', num2str(binIntervals(i).HUbin(2)),'\n']);
+ end
+ matRad_cfg.dispInfo('*****\n')
+
+ [cst_doseGrid, ct.doseGridCT.tissueBin] = matRad_segmentationCTscan(ct.doseGridCT.HUcube{1}, dij.doseGrid.resolution, binIntervals, cst_doseGrid, cstBodyIndex, cstTargetIndex, this.useLungQuestionDialog);
+ ct.doseGridCT.cubeDim = dij.doseGrid.dimensions;
+
+ % Calculate density for CT voxels and resize afterwards -> caution: step-
+ % wise definition of conversion causes a difference concerning the ordering
+ % of the conversion and resize operation
+ matRad_cfg.dispInfo('*****\n')
+ matRad_cfg.dispInfo('Calculate density from CT data with density given in [g/cm^3]\n')
+ matRad_cfg.dispInfo('*****\n')
+ ct.doseGridCT.density{1} = hounsfield2density(ct.doseGridCT.HUcube{1})*1e-3; % rescale from kg/m^3 to g/cm^3
+ ct.doseGridCT.density{1}(ct.doseGridCT.density{1}<=(hounsfield2density(segVar.upperLimitAir)*1e-3)) = segVar.densityAir;
+
+ %% Rescale ct information to cm for MCNP runfile
+ varHelper.rescaleFactor = 1e-1; % conversion from mm to cm
+ ct.doseGridCT.x_MCNP = dij.doseGrid.resolution.x*varHelper.rescaleFactor;
+ ct.doseGridCT.y_MCNP = dij.doseGrid.resolution.y*varHelper.rescaleFactor;
+ ct.doseGridCT.z_MCNP = dij.doseGrid.resolution.z*varHelper.rescaleFactor;
+
+
+ %% Create MCNP runfile blocks A and B
+ varHelper.simPropMCNP.loopCounter = false; % try to generate MCNP runfile with maximum 99999 elements for reasons of performance
+ varHelper.simPropMCNP.MCNP_limitNumberOfElements = 99999-1; % minus one since we need one integer for the source surface
+
+ [varHelper.simPropMCNP.control_makeTargetMCNP, varHelper.simPropMCNP.fileID_A, varHelper.simPropMCNP.fileID_B, varHelper.simPropMCNP.geometryOption] = ...
+ matRad_makeTargetMCNP(ct, varHelper.simPropMCNP);
+
+ if ~varHelper.simPropMCNP.control_makeTargetMCNP
+ varHelper.simPropMCNP.MCNP_limitNumberOfElements = 99999999-1; % minus one since we need one integer for the source surface
+ varHelper.simPropMCNP.loopCounter = true;
+ [varHelper.simPropMCNP.control_makeTargetMCNP,~ ,~ ,~ ] = ...
+ matRad_makeTargetMCNP(ct, varHelper.simPropMCNP);
+ end
+
+ if ~varHelper.simPropMCNP.control_makeTargetMCNP
+ matRad_cfg.dispError('Number of defined elements for simulation is too high! MCNP6 only allows 99,999,999 cells and surfaces in total.\n')
+ end
+
+ %% Create MCNP runfile block C (source etc.)
+ % Set default number of particles
+ varHelper.simPropMCNP.numberParticles = this.config.Num_Primaries;
+
+ % Get total number of bixels and write source card
+ % Total number of bixel is counter for j in dij matrix
+
+ % C.1 Source
+ varHelper.totalNumberBixels = 0;
+ for counterField =1:size(stf,2)
+ varHelper.simPropMCNP.counterField = counterField;
+ for counterRay=1:stf(counterField).numOfRays
+ varHelper.simPropMCNP.counterRay = counterRay;
+ % Calculate position of MLC field in LPS system
+ stf(counterField).ray(counterRay).rayPosMLC = stf(counterField).isoCenter + stf(counterField).ray(counterRay).rayPos + stf(counterField).sourcePoint;
+ varHelper.totalNumberBixels = varHelper.totalNumberBixels + 1;
+
+ % Generate source card for each bixel - see also description of
+ % matRad^_makeSourceMCNP(...)
+ [control_makeSourceMCNP, varHelper] = matRad_makeSourceMCNP(this, stf, ct, varHelper, counterField, counterRay);
+ end
+ end
+
+ varHelper.simPropMCNP.sourceBlockNames = strings(1,varHelper.totalNumberBixels);
+ for cntList=1:varHelper.totalNumberBixels; varHelper.simPropMCNP.sourceBlockNames(cntList)=['blockC_source', int2str(cntList)]; end
+
+ % Open file to write rest of block C
+ % Source and the rest of block C input are seperated so the source
+ % positioning can be done easily w/o wasting time on redundant writing of
+ % the rest (like MODE and PHYS card) into a text file.
+
+ pathRunfiles = strcat(matRad_cfg.matRadRoot,filesep, 'MCNP', filesep, 'runfiles_tmp', filesep);
+ fileID_C_rest = fopen(strcat(pathRunfiles,'blockC_rest'), 'w');
+
+ % C.2 Physics and problem termination
+ fprintf(fileID_C_rest, 'C ***************************************************************\n');
+ fprintf(fileID_C_rest, 'C C.2: Physics\n');
+ fprintf(fileID_C_rest, 'C ***************************************************************\n');
+
+ matRad_definePhysicsMCNP(fileID_C_rest, this, binIntervals, varHelper.simPropMCNP); % Define PHYS-card
+
+ % C.3 Materials
+ fprintf(fileID_C_rest, 'C ***************************************************************\n');
+ fprintf(fileID_C_rest, 'C C.3: Materials\n');
+ fprintf(fileID_C_rest, 'C ***************************************************************\n');
+
+ matIdentifierTxt = 'M%d $ %s \n';
+ matCompositionTxt = ' %d%s %.9f \n';
+
+ for counterMaterial = 1:size(binIntervals,2)
+ fprintf(fileID_C_rest, matIdentifierTxt, counterMaterial, binIntervals(counterMaterial).name);
+ fprintf(fileID_C_rest,' plib=14p\n');
+ fprintf(fileID_C_rest,' hlib=70h\n');
+ for counterComponent = 1:size(binIntervals(counterMaterial).ZAID,2)
+ fprintf(fileID_C_rest,matCompositionTxt, binIntervals(counterMaterial).ZAID(counterComponent), crossSectionsLibrary(binIntervals(counterMaterial).crossSection(counterComponent),:), binIntervals(counterMaterial).percentageMass(counterComponent));
+ end
+ end
+ clear counterMaterial; clear counterComponent;
+
+ % C.4 Tally
+ matRad_makeTallyMCNP(this, ct, fileID_C_rest, binIntervals)
+
+ fclose(fileID_C_rest);
+
+ %% Concatenate all blocks to one runfile for each ray
+ matRad_concatenateRunfiles(varHelper, pathRunfiles);
+
+ %% Run MCNP calculation
+ matRad_bixelDoseCalculatorMCNP(this);
+
+ %% Evaluate MCNP results
+ dij = matRad_evaluateTallyMCNP(dij, cst, ct);
+
+ %% Switch off diary
+ diary off
+ end
+
+ function setBinaries(this)
+ % setBinaries check if the binaries are available on the current
+ % machine and sets to the mcsquarebinary object property
+ %
+
+ binaryFound = this.checkBinaries();
+ this.MCNPinstallationCheck = binaryFound;
+ end
+
+ function dij = initDoseCalc(this,ct,cst,stf)
+ %% Assingn and check parameters
+ matRad_cfg = MatRad_Config.instance();
+
+ % check if binaries are available
+ % Executables for simulation
+ this.setBinaries();
+
+ % set and change to MCsquare binary folder
+ this.currFolder = pwd;
+
+ %% Call Superclass init function
+ dij = initDoseCalc@DoseEngines.matRad_MonteCarloEngineAbstract(this,ct,cst,stf);
+
+ % Since MCNP setup only allows similar resolution in x&y, we do some
+ % extra checks on that before calling the normal initDoseCalc.
+ if dij.doseGrid.resolution.x ~= dij.doseGrid.resolution.y
+ matRad_cfg.dispError('Voxel size in x and y do not agree.\n');
+ end
+
+ %% Validate and preset some additional dij variables
+ %Issue a warning when we have more than 1 scenario
+ if dij.numOfScenarios ~= 1
+ matRad_cfg.dispWarning('MCNP is only implemented for single scenario use at the moment. Will only use the first Scenario for Monte Carlo calculation!');
+ end
+
+ if ~isnan(this.constantRBE)
+ dij.RBE = this.constantRBE;
+ end
+ end
+
+ function writeInputFiles(obj,filename,stf)
+ % generate input files for MCsquare dose calcualtion from matRad
+ %
+ % call
+ % obj.writeInputFiles(filename,filename,stf)
+ %
+ % input
+ % filename: filename of the Configuration file
+ % stf: matRad steering information struct
+ %
+ % output
+ % -
+ %
+ % References
+ % [1] https://openreggui.org/git/open/REGGUI/blob/master/functions/io/convert_Plan_PBS.m
+ %
+ % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+ %
+ % Copyright 2019 the matRad development team.
+ %
+ % This file is part of the matRad project. It is subject to the license
+ % terms in the LICENSE file found in the top-level directory of this
+ % distribution and at https://github.com/e0404/matRad/LICENSES.txt. No part
+ % of the matRad project, including this file, may be copied, modified,
+ % propagated, or distributed except according to the terms contained in the
+ % LICENSE file.
+ %
+ % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+
+ %% write overall configuration file
+ fileHandle = fopen(filename,'w');
+ obj.config.write(fileHandle);
+ fclose(fileHandle);
+
+ %% prepare steering file writing
+ numOfFields = length(stf);
+ if obj.config.Beamlet_Mode
+ totalMetersetWeightOfAllFields = 1;
+ else
+ totalMetersetWeightOfFields = NaN*ones(numOfFields,1);
+ for i = 1:numOfFields
+ totalMetersetWeightOfFields(i) = sum([stf(i).energyLayer.numOfPrimaries]);
+ end
+ totalMetersetWeightOfAllFields = sum(totalMetersetWeightOfFields);
+ end
+
+ %% write steering file
+
+ fileHandle = fopen(obj.config.BDL_Plan_File,'w');
+
+ fprintf(fileHandle,'#TREATMENT-PLAN-DESCRIPTION\n');
+ fprintf(fileHandle,'#PlanName\n');
+ fprintf(fileHandle,'matRad_bixel\n');
+ fprintf(fileHandle,'#NumberOfFractions\n');
+ fprintf(fileHandle,'1\n');
+ fprintf(fileHandle,'##FractionID\n');
+ fprintf(fileHandle,'1\n');
+ fprintf(fileHandle,'##NumberOfFields\n');
+ fprintf(fileHandle,[num2str(numOfFields) '\n']);
+ for i = 1:numOfFields
+ fprintf(fileHandle,'###FieldsID\n');
+ fprintf(fileHandle,[num2str(i) '\n']);
+ end
+ fprintf(fileHandle,'\n#TotalMetersetWeightOfAllFields\n');
+ fprintf(fileHandle,[num2str(totalMetersetWeightOfAllFields) '\n']);
+
+ for i = 1:numOfFields
+ fprintf(fileHandle,'\n#FIELD-DESCRIPTION\n');
+ fprintf(fileHandle,'###FieldID\n');
+ fprintf(fileHandle,[num2str(i) '\n']);
+ fprintf(fileHandle,'###FinalCumulativeMeterSetWeight\n');
+ if obj.config.Beamlet_Mode
+ finalCumulativeMeterSetWeight = 1/numOfFields;
+ else
+ finalCumulativeMeterSetWeight = totalMetersetWeightOfFields(i);
+ end
+ fprintf(fileHandle,[num2str(finalCumulativeMeterSetWeight) '\n']);
+ fprintf(fileHandle,'###GantryAngle\n');
+ fprintf(fileHandle,[num2str(stf(i).gantryAngle) '\n']);
+ fprintf(fileHandle,'###PatientSupportAngle\n');
+ fprintf(fileHandle,[num2str(stf(i).couchAngle) '\n']);
+ fprintf(fileHandle,'###IsocenterPosition\n');
+ fprintf(fileHandle,[num2str(stf(i).isoCenter) '\n']);
+ fprintf(fileHandle,'###NumberOfControlPoints\n');
+ numOfEnergies = numel(stf(i).energies);
+ fprintf(fileHandle,[num2str(numOfEnergies) '\n']);
+
+ %Range shfiter
+ if stf(i).rangeShifterID ~= 0
+ fprintf(fileHandle,'###RangeShifterID\n%d\n',stf(i).rangeShifterID);
+ fprintf(fileHandle,'###RangeShifterType\n%s\n',stf(i).rangeShifterType);
+ end
+
+ metersetOffset = 0;
+ fprintf(fileHandle,'\n#SPOTS-DESCRIPTION\n');
+ for j = 1:numOfEnergies
+ fprintf(fileHandle,'####ControlPointIndex\n');
+ fprintf(fileHandle,[num2str(j) '\n']);
+ fprintf(fileHandle,'####SpotTunnedID\n');
+ fprintf(fileHandle,['1\n']);
+ fprintf(fileHandle,'####CumulativeMetersetWeight\n');
+ if obj.config.Beamlet_Mode
+ cumulativeMetersetWeight = j/numOfEnergies * 1/numOfFields;
+ else
+ cumulativeMetersetWeight = metersetOffset + sum([stf(i).energyLayer(j).numOfPrimaries]);
+ metersetOffset = cumulativeMetersetWeight;
+ end
+ fprintf(fileHandle,[num2str(cumulativeMetersetWeight) '\n']);
+ fprintf(fileHandle,'####Energy (MeV)\n');
+ fprintf(fileHandle,[num2str(stf(i).energies(j)) '\n']);
+
+ %Range shfiter
+ if stf(i).rangeShifterID ~= 0
+ rangeShifter = stf(i).energyLayer(j).rangeShifter;
+ if rangeShifter.ID ~= 0
+ fprintf(fileHandle,'####RangeShifterSetting\n%s\n','IN');
+ pmma_rsp = 1.165; %TODO: hardcoded for now
+ rsWidth = rangeShifter.eqThickness / pmma_rsp;
+ isoToRaShi = stf(i).SAD - rangeShifter.sourceRashiDistance + rsWidth;
+ fprintf(fileHandle,'####IsocenterToRangeShifterDistance\n%f\n',-isoToRaShi/10); %in cm
+ fprintf(fileHandle,'####RangeShifterWaterEquivalentThickness\n%f\n',rangeShifter.eqThickness);
+ else
+ fprintf(fileHandle,'####RangeShifterSetting\n%s\n','OUT');
+ end
+ end
+
+ fprintf(fileHandle,'####NbOfScannedSpots\n');
+ numOfSpots = size(stf(i).energyLayer(j).targetPoints,1);
+ fprintf(fileHandle,[num2str(numOfSpots) '\n']);
+ fprintf(fileHandle,'####X Y Weight\n');
+ for k = 1:numOfSpots
+ %{
+ if obj.config.Beamlet_Mode
+ n = stf(i).energyLayer(j).numOfPrimaries(k);
+ else
+ n = stf(i).energyLayer(j).numOfPrimaries(k) / obj.mcSquare_magicFudge(stf(i).energies(j));
+ end
+ %}
+ n = stf(i).energyLayer(j).numOfPrimaries(k);
+ fprintf(fileHandle,[num2str(stf(i).energyLayer(j).targetPoints(k,:)) ' ' num2str(n) '\n']);
+ end
+ end
+ end
+
+ fclose(fileHandle);
+
+ end
+
+ function cube = readMhd(obj,filename)
+ % TODO: This should become a binary export function in matRads
+ % IO folde
+ % matRad mhd file reader
+ %
+ % call
+ % cube = matRad_readMhd(folder,filename)
+ %
+ % input
+ % folder: folder where the *raw and *mhd file are located
+ % filename: filename
+ %
+ % output
+ % cube: 3D array
+ %
+ % References
+ %
+ % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+ %
+ % Copyright 2019 the matRad development team.
+ %
+ % This file is part of the matRad project. It is subject to the license
+ % terms in the LICENSE file found in the top-level directory of this
+ % distribution and at https://github.com/e0404/matRad/LICENSES.txt. No part
+ % of the matRad project, including this file, may be copied, modified,
+ % propagated, or distributed except according to the terms contained in the
+ % LICENSE file.
+ %
+ % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+
+ %% read header
+ headerFileHandle = fopen([obj.config.Output_Directory, filesep filename],'r');
+
+ s = textscan(headerFileHandle, '%s', 'delimiter', '\n');
+
+ % read dimensions
+ idx = find(~cellfun(@isempty,strfind(s{1}, 'DimSize')),1,'first');
+ dimensions = cell2mat(textscan(s{1}{idx},'DimSize = %f %f %f'));
+
+ % read filename of data
+ idx = find(~cellfun(@isempty,strfind(s{1}, 'ElementDataFile')),1,'first');
+ tmp = textscan(s{1}{idx},'ElementDataFile = %s');
+ dataFilename = cell2mat(tmp{1});
+
+ % get data type
+ idx = find(~cellfun(@isempty,strfind(s{1}, 'ElementType')),1,'first');
+ tmp = textscan(s{1}{idx},'ElementType = MET_%s');
+ type = lower(cell2mat(tmp{1}));
+
+ fclose(headerFileHandle);
+
+ %% read data
+ dataFileHandle = fopen([obj.config.Output_Directory filesep dataFilename],'r');
+ cube = reshape(fread(dataFileHandle,inf,type),dimensions);
+ cube = permute(cube,[2 1 3]);
+ cube = flip(cube,2);
+ fclose(dataFileHandle);
+ end
+
+ function writeMhd(obj,cube,resolution)
+ % TODO: This should become a binary export function in matRads
+ % IO folder
+ % References
+ % -
+ %
+ % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+ %
+ % Copyright 2020 the matRad development team.
+ %
+ % This file is part of the matRad project. It is subject to the license
+ % terms in the LICENSE file found in the top-level directory of this
+ % distribution and at https://github.com/e0404/matRad/LICENSES.txt. No part
+ % of the matRad project, including this file, may be copied, modified,
+ % propagated, or distributed except according to the terms contained in the
+ % LICENSE file.
+ %
+ % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+ %% write header file
+ fileHandle = fopen(obj.config.CT_File,'w');
+
+ fprintf(fileHandle,'ObjectType = Image\n');
+ fprintf(fileHandle,'NDims = 3\n');
+ fprintf(fileHandle,'BinaryData = True\n');
+ fprintf(fileHandle,'BinaryDataByteOrderMSB = False\n');
+ fprintf(fileHandle,'CompressedData = False\n');
+ fprintf(fileHandle,'TransformMatrix = 1 0 0 0 1 0 0 0 1\n');
+ fprintf(fileHandle,'Offset = 0 0 0\n');
+ fprintf(fileHandle,'CenterOfRotation = 0 0 0\n');
+ fprintf(fileHandle,'AnatomicalOrientation = RAI\n');
+ fprintf(fileHandle,'ElementSpacing = %f %f %f\n',resolution);
+ fprintf(fileHandle,'DimSize = %d %d %d\n',size(cube,2),size(cube,1),size(cube,3));
+ fprintf(fileHandle,'ElementType = MET_DOUBLE\n');
+ filenameRaw = [obj.config.CT_File(1:end-4) '.raw'];
+ fprintf(fileHandle,'ElementDataFile = %s\n',filenameRaw);
+
+ fclose(fileHandle);
+
+ %% write data file
+ dataFileHandle = fopen(filenameRaw,'w');
+
+ cube = flip(cube,2);
+ cube = permute(cube,[2 1 3]);
+
+ fwrite(dataFileHandle,cube(:),'double');
+ fclose(dataFileHandle);
+ end
+
+ end
+
+ methods (Access = private)
+ end
+
+
+ methods (Static)
+ function binaryFound = checkBinaries()
+ % checkBinaries check if MCNP is installed on the machine and
+ % path variables are properly set to run MCNP in matRad
+ matRad_cfg = MatRad_Config.instance();
+
+ if ispc
+ [~,cmdout] = system('mcnp6');
+ if strcmp(cmdout(2:5), 'mcnp')
+ binaryFound = true;
+ else
+ matRad_cfg.dispWarning('Could not test MCNP. Please check installation and path variables.\n');
+ end
+ elseif ismac
+ matRad_cfg.dispWarning('Check for MCNP installation not yet implemented. Check set to false.\n');
+ binaryFound = false;
+ elseif isunix
+ matRad_cfg.dispWarning('Check for MCNP installation not yet implemented. Check set to false.\n');
+ binaryFound = false;
+
+ else
+ binaryFound = false;
+ end
+
+ end
+
+ function [available,msg] = isAvailable(pln,machine)
+ % see superclass for information
+
+ msg = [];
+ available = false;
+
+ if nargin < 2
+ machine = matRad_loadMachine(pln);
+ end
+
+ %checkBasic
+ try
+ checkBasic = any(strcmp(machine.meta.calculationMode, 'MonteCarlo'));
+
+ %check modality
+ checkModality = any(strcmp(DoseEngines.matRad_NeutronMCNPEngine.possibleRadiationModes, machine.meta.radiationMode));
+
+ preCheck = checkBasic && checkModality;
+
+ if ~preCheck
+ return;
+ end
+ available = true;
+ catch
+ msg = 'Your machine file is invalid and does not contain the basic field (meta/data/radiationMode)!';
+ return;
+ end
+
+ end
+
+ end
+end
+
diff --git a/matRad/doseCalc/+DoseEngines/matRad_NeutronPencilBeamSVDEngine.m b/matRad/doseCalc/+DoseEngines/matRad_NeutronPencilBeamSVDEngine.m
new file mode 100644
index 000000000..28d8dd581
--- /dev/null
+++ b/matRad/doseCalc/+DoseEngines/matRad_NeutronPencilBeamSVDEngine.m
@@ -0,0 +1,617 @@
+classdef matRad_NeutronPencilBeamSVDEngine < DoseEngines.matRad_PencilBeamEngineAbstract
+ % matRad_NeutronPencilBeamSVDEngine: Pencil-beam dose calculation with
+ % singular value decomposed kernels
+ %
+ %
+ % References
+ % [1] http://www.ncbi.nlm.nih.gov/pubmed/8497215
+ % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+ %
+ % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+ %
+ % Copyright 2022 the matRad development team.
+ %
+ % This file is part of the matRad project. It is subject to the license
+ % terms in the LICENSE file found in the top-level directory of this
+ % distribution and at https://github.com/e0404/matRad/LICENSE.md. No part
+ % of the matRad project, including this file, may be copied, modified,
+ % propagated, or distributed except according to the terms contained in the
+ % LICENSE file.
+ %
+ % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+ properties (Constant)
+ possibleRadiationModes = {'neutrons'}; %constant which represent available radiation modes
+ name = 'SVD Pencil Beam';
+ shortName = 'SVDPB';
+
+ %supportedQuantities = {'physicalDose'};
+
+ % Define function_Di for beamlet calculation. Constant for use in
+ % static computations
+ %func_Di = @(x,m,beta) beta/(beta-m) * (exp(-m*x) - exp(-beta*x));
+ %func_DiVec = @(x,m,betas) betas./(betas-m) .* (exp(-m*x) - exp(-betas.*x));
+ end
+
+ properties (SetAccess = public, GetAccess = public)
+ useCustomPrimaryNeutronFluence; %boolean to control usage of the primary fluence during dose (influence matrix) computation
+ kernelCutOff; %cut off in [mm] of kernel values
+ randomSeed = 0; %for bixel sampling
+ intConvResolution = 0.5; %resolution for kernel convolution [mm]
+
+ enableDijSampling = true;
+ dijSampling; %struct with lateral dij sampling parameters
+ end
+
+ %Calculation variables
+ properties (SetAccess = protected,GetAccess = public)
+ isFieldBasedDoseCalc; %Will be set
+ penumbraFWHM; %will be obtained from machine
+ fieldWidth; %Will be obtained during calculation
+
+ %Kernel Grid for convolution
+ kernelConvSize; %size of the convolution kernel
+ kernelX; %meshgrid in X
+ kernelZ; %meshgrid in Z
+ kernelMxs; %cell array of kernel matrices
+
+ gaussFilter; %two-dimensional gaussian filter to model penumbra
+ gaussConvSize; %size of the gaussian convolution kernel
+
+ convMx_X; %convolution meshgrid in X
+ convMx_Z; %convolution meshgrid in Z
+
+ F_X; %fluence meshgrid in X
+ F_Z; %fluence meshgrid in Z
+
+ Fpre; %precomputed fluence if uniform fluence used for calculation
+ interpKernelCache; %Kernel interpolators (cached if precomputation per beam possible)
+
+ collimation; %collimation structure from dicom import
+
+ cubeKERMAcorr; %neutron KERMA correction factors relative to water on CT grid
+ end
+
+
+ methods
+
+ function this = matRad_NeutronPencilBeamSVDEngine(pln)
+ % Constructor
+ %
+ % call
+ % engine = DoseEngines.matRad_NeutronPencilBeamSVDEngine(pln)
+ %
+ % input
+ % ct: matRad ct struct
+ % stf: matRad steering information struct
+ % pln: matRad plan meta information struct
+ % cst: matRad cst struct
+
+ if nargin < 1
+ pln = [];
+ end
+
+ % create this from superclass
+ this = this@DoseEngines.matRad_PencilBeamEngineAbstract(pln);
+
+ if nargin > 0
+ % 0 if field calc is bixel based, 1 if dose calc is field based
+ % num2str is only used to prevent failure of strcmp when bixelWidth
+ % contains a number and not a string
+ this.isFieldBasedDoseCalc = strcmp(num2str(pln.propStf.bixelWidth),'field');
+ end
+ end
+
+ function setDefaults(this)
+ setDefaults@DoseEngines.matRad_PencilBeamEngineAbstract(this);
+
+ %Assign defaults from Config
+ matRad_cfg = MatRad_Config.instance();
+ this.useCustomPrimaryNeutronFluence = matRad_cfg.propDoseCalc.defaultUseCustomPrimaryNeutronFluence;
+ this.kernelCutOff = matRad_cfg.propDoseCalc.defaultKernelCutOff;
+
+ %dij sampling defaults
+ this.dijSampling.relDoseThreshold = 0.01;
+ this.dijSampling.latCutOff = 20;
+ this.dijSampling.type = 'radius';
+ this.dijSampling.deltaRadDepth = 5;
+ end
+ end
+
+ methods (Access = protected)
+
+ function dij = initDoseCalc(this,ct,cst,stf)
+ %% Assign parameters
+ matRad_cfg = MatRad_Config.instance();
+
+ % 0 if field calc is bixel based, 1 if dose calc is field based
+ % num2str is only used to prevent failure of strcmp when bixelWidth
+ % contains a number and not a string
+ this.isFieldBasedDoseCalc = any(arrayfun(@(s) strcmp(num2str(s.bixelWidth),'field'),stf));
+
+ %% Call Superclass init
+ dij = initDoseCalc@DoseEngines.matRad_PencilBeamEngineAbstract(this,ct,cst,stf);
+
+ %% Validate some properties
+ % gaussian filter to model penumbra from (measured) machine output / see
+ % diploma thesis siggel 4.1.2 -> https://github.com/e0404/matRad/wiki/Dose-influence-matrix-calculation
+ if isfield(this.machine.data,'penumbraFWHMatIso')
+ this.penumbraFWHM = this.machine.data.penumbraFWHMatIso;
+ else
+ matRad_cfg.dispWarning('Neutron machine file does not contain measured penumbra width in machine.data.penumbraFWHMatIso. Convolution with Gaussian to model penumbra from machine is switched off.');
+ end
+
+ %Correct kernel cut off to base data limits if needed
+ if this.kernelCutOff > this.machine.data.kernelPos(end)
+ matRad_cfg.dispWarning('Kernel Cut-Off ''%f mm'' larger than machine data range of ''%f mm''. Using ''%f mm''!',this.kernelCutOff,this.machine.data.kernelPos(end),this.machine.data.kernelPos(end));
+ this.kernelCutOff = this.machine.data.kernelPos(end);
+ end
+
+ if this.kernelCutOff < this.geometricLateralCutOff
+ matRad_cfg.dispWarning('Kernel Cut-Off ''%f mm'' cannot be smaller than geometric lateral cutoff ''%f mm''. Using ''%f mm''!',this.kernelCutOff,this.geometricLateralCutOff,this.geometricLateralCutOff);
+ this.kernelCutOff = this.geometricLateralCutOff;
+ end
+
+ %% Initiate KERMA correction for neutron dose calculation
+ if ct.numOfCtScen==1
+ if isfield(this.machine.data,'neutronKERMAcorr')
+ for counterCorrInt = 1:size(this.machine.data.neutronKERMAcorr,2)-1
+ this.cubeKERMAcorr{1}((ct.cubeHU{1}>=this.machine.data.neutronKERMAcorr(1,counterCorrInt))&(ct.cubeHU{1} 1
+ matRad_cfg.dispError('Different bixelWidths pear beam are not supported!');
+ end
+
+ this.fieldWidth = unique([stf.bixelWidth]);
+ end
+
+ % calculate field size and distances
+ fieldLimit = ceil(this.fieldWidth/(2*this.intConvResolution));
+ [this.F_X,this.F_Z] = meshgrid(-fieldLimit*this.intConvResolution: ...
+ this.intConvResolution: ...
+ (fieldLimit-1)*this.intConvResolution);
+
+
+ if isfield(this.machine.data,'penumbraFWHMatIso')
+ sigmaGauss = this.penumbraFWHM / sqrt(8*log(2)); % [mm]
+ % use 5 times sigma as the limits for the gaussian convolution
+ gaussLimit = ceil(5*sigmaGauss/this.intConvResolution);
+ [gaussFilterX,gaussFilterZ] = meshgrid(-gaussLimit*this.intConvResolution: ...
+ this.intConvResolution: ...
+ (gaussLimit-1)*this.intConvResolution);
+ this.gaussFilter = 1/(2*pi*sigmaGauss^2/this.intConvResolution^2) * exp(-(gaussFilterX.^2+gaussFilterZ.^2)/(2*sigmaGauss^2) );
+ this.gaussConvSize = 2*(fieldLimit + gaussLimit);
+ end
+
+ % get kernel size and distances
+
+ kernelLimit = ceil(this.kernelCutOff/this.intConvResolution);
+ [this.kernelX, this.kernelZ] = meshgrid(-kernelLimit*this.intConvResolution: ...
+ this.intConvResolution: ...
+ (kernelLimit-1)*this.intConvResolution);
+
+ % precalculate convolved kernel size and distances
+ if isfield(this.machine.data,'penumbraFWHMatIso')
+ kernelConvLimit = fieldLimit + gaussLimit + kernelLimit;
+ else
+ kernelConvLimit = fieldLimit + kernelLimit;
+ end
+
+ [this.convMx_X, this.convMx_Z] = meshgrid(-kernelConvLimit*this.intConvResolution: ...
+ this.intConvResolution: ...
+ (kernelConvLimit-1)*this.intConvResolution);
+ % calculate also the total size and distance as we need this during convolution extensively
+ this.kernelConvSize = 2*kernelConvLimit;
+
+ % define an effective lateral cutoff where dose will be calculated. note
+ % that storage within the influence matrix may be subject to sampling
+ this.effectiveLateralCutOff = this.geometricLateralCutOff + this.fieldWidth/sqrt(2);
+
+
+ % Check if we can precompute fluence and precompute kernel
+ % convolution if we use a uniform fluence
+ if ~this.isFieldBasedDoseCalc
+ % Create fluence matrix
+ this.Fpre = ones(floor(this.fieldWidth/this.intConvResolution));
+
+ if ~this.useCustomPrimaryNeutronFluence && isfield(this.machine.data,'penumbraFWHMatIso')
+ % gaussian convolution of field to model penumbra
+ this.Fpre = real(ifft2(fft2(this.Fpre,this.gaussConvSize,this.gaussConvSize).*fft2(this.gaussFilter,this.gaussConvSize,this.gaussConvSize)));
+ end
+ end
+
+ %% Initialize randomization
+ [env, ~] = matRad_getEnvironment();
+
+ switch env
+ case 'MATLAB'
+ rng(this.randomSeed); %Initializes Mersenne Twister with seed 0
+ case 'OCTAVE'
+ rand('state',this.randomSeed); %Initializes Mersenne Twister with state 0 (does not give similar random numbers as in Matlab)
+ otherwise
+ rand('seed',this.randomSeed); %Fallback
+ matRad_cfg.dispWarning('Environment %s not recognized!',env);
+ end
+
+ end
+
+ function currBeam = initBeam(this,currBeam,ct,cst,stf,i)
+ % Method for initializing the beams for analytical pencil beam
+ % dose calculation
+ %
+ % call
+ % this.initBeam(ct,stf,dij,i)
+ %
+ % input
+ % ct: matRad ct struct
+ % stf: matRad steering information struct
+ % dij: matRad dij struct
+ % i: index of beam
+ %
+ % output
+ % dij: updated dij struct
+
+ currBeam = initBeam@DoseEngines.matRad_PencilBeamEngineAbstract(this,currBeam,ct,cst,stf,i);
+
+ matRad_cfg = MatRad_Config.instance();
+
+ % get index of central ray or closest to the central ray
+ [~,center] = min(sum(reshape([currBeam.ray.rayPos_bev],3,[]).^2));
+
+ % get correct kernel for given SSD at central ray (nearest neighbor approximation)
+ [~,currSSDix] = min(abs([this.machine.data.kernel.SSD]-currBeam.ray(center).SSD));
+ % Display console message.
+ matRad_cfg.dispInfo('\tSSD = %g mm ...\n',this.machine.data.kernel(currSSDix).SSD);
+
+ %Hardcoded for now
+ useKernels = {'kernel1','kernel2','kernel3'};
+
+ kernelPos = this.machine.data.kernelPos;
+
+ for k = 1:length(useKernels)
+ kernel = this.machine.data.kernel(currSSDix).(useKernels{k});
+ this.kernelMxs{k} = interp1(kernelPos,kernel,sqrt(this.kernelX.^2+this.kernelZ.^2),'linear',0);
+ end
+
+ % convolution here if no custom primary fluence and no field based dose calc
+ if ~isempty(this.Fpre) && ~this.useCustomPrimaryNeutronFluence && ~this.isFieldBasedDoseCalc
+
+ % Display console message.
+ matRad_cfg.dispInfo('\tUniform primary neutron fluence -> pre-compute kernel convolution...\n');
+
+ % Get kernel interpolators
+ this.interpKernelCache = this.getKernelInterpolators(this.Fpre);
+ end
+ end
+
+ function [bixel] = computeBixel(this,currRay,k)
+ % matRad neutron dose calculation for an individual bixel
+ %
+ % call
+ % bixel = this.computeBixel(currRay,k)
+
+ bixel = struct();
+
+ if isfield(this.tmpMatrixContainers,'physicalDose')
+ bixel.physicalDose = this.calcSingleBixel(currRay.SAD,...
+ this.machine.data.m,...
+ this.machine.data.betas,...
+ currRay.interpKernels,...
+ currRay.radDepths,...
+ currRay.geoDepths,...
+ currRay.isoLatDists(:,1),...
+ currRay.isoLatDists(:,2));
+
+ % sample dose only for bixel based dose calculation
+ if this.enableDijSampling && ~this.isFieldBasedDoseCalc
+ [bixel.ix,bixel.physicalDose] = this.sampleDij(currRay.ix,bixel.physicalDose,currRay.radDepths,currRay.radialDist_sq,currRay.bixelWidth);
+ if this.multScen.numOfCtScen==1
+ bixel.physicalDose = bixel.physicalDose.*this.cubeKERMAcorr{1}(bixel.ix)';
+ else
+ matRad_cfg.dispError('Neutron dose calculation implemented only for 1 CT scenario!')
+ end
+ else
+ bixel.ix = currRay.ix;
+ end
+ else
+ bixel.ix = [];
+ end
+ end
+
+ function interpKernels = getKernelInterpolators(this,Fx)
+
+ matRad_cfg = MatRad_Config.instance();
+
+ nKernels = length(this.kernelMxs);
+ interpKernels = cell(1,nKernels);
+
+ for ik = 1:nKernels
+ % 2D convolution of Fluence and Kernels in fourier domain
+ convMx = real( ifft2(fft2(Fx,this.kernelConvSize,this.kernelConvSize).* fft2(this.kernelMxs{ik},this.kernelConvSize,this.kernelConvSize)));
+
+ % Creates an interpolant for kernes from vectors position X and Z
+ if matRad_cfg.isMatlab
+ interpKernels{ik} = griddedInterpolant(this.convMx_X',this.convMx_Z',convMx','linear','none');
+ elseif matRad_cfg.isOctave
+ %For some reason the use of interpn here is much faster
+ %than using interp2 in Octave
+ interpKernels{ik} = @(x,y) interpn(this.convMx_X(1,:),this.convMx_Z(:,1),convMx',x,y,'linear',NaN);
+ end
+ end
+ end
+
+ function [ixNew,bixelDoseNew] = sampleDij(this,ix,bixelDose,radDepthV,rad_distancesSq,bixelWidth)
+ % matRad dij sampling function
+ % This function samples.
+ %
+ % call
+ % [ixNew,bixelDoseNew] =
+ % this.sampleDij(ix,bixelDose,radDepthV,rad_distancesSq,sType,Param)
+ %
+ % input
+ % ix: indices of voxels where we want to compute dose influence data
+ % bixelDose: dose at specified locations as linear vector
+ % radDepthV: radiological depth vector
+ % rad_distancesSq: squared radial distance to the central ray
+ % bixelWidth: bixelWidth as set in pln (optional)
+ %
+ % output
+ % ixNew: reduced indices of voxels where we want to compute dose influence data
+ % bixelDoseNew reduced dose at specified locations as linear vector
+ %
+ % References
+ % [1] http://dx.doi.org/10.1118/1.1469633
+ %
+ % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+ %
+ % Copyright 2016 the matRad development team.
+ %
+ % This file is part of the matRad project. It is subject to the license
+ % terms in the LICENSE file found in the top-level directory of this
+ % distribution and at https://github.com/e0404/matRad/LICENSES.txt. No part
+ % of the matRad project, including this file, may be copied, modified,
+ % propagated, or distributed except according to the terms contained in the
+ % LICENSE file.
+ %
+ % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+ relDoseThreshold = this.dijSampling.relDoseThreshold;
+ LatCutOff = this.dijSampling.latCutOff;
+ Type = this.dijSampling.type;
+ deltaRadDepth = this.dijSampling.deltaRadDepth;
+
+ % if the input index vector is of type logical convert it to linear indices
+ if islogical(ix)
+ ix = find(ix);
+ end
+
+ %Increase sample cut-off by bixel width if given
+ if nargin == 6 && ~isempty(bixelWidth)
+ LatCutOff = LatCutOff + bixelWidth/sqrt(2); %use half of the bixel width diagonal as max. field size radius for sampling
+ end
+
+ %% remember dose values inside the inner core
+ switch Type
+ case 'radius'
+ ixCore = rad_distancesSq < LatCutOff^2; % get voxels indices having a smaller radial distance than r0
+ case 'dose'
+ ixCore = bixelDose > relDoseThreshold * max(bixelDose); % get voxels indices having a greater dose than the thresholdDose
+ otherwise
+ matRad_cfg = MatRad_Config.instance();
+ matRad_cfg.dispError('Dij Sampling mode ''%s'' not known!',Type);
+ end
+
+ bixelDoseCore = bixelDose(ixCore); % save dose values that are not affected by sampling
+
+ if all(ixCore)
+ %% all bixels are in the core
+ %exit function with core dose only
+ ixNew = ix;
+ bixelDoseNew = bixelDoseCore;
+ else
+ logIxTail = ~ixCore; % get voxels indices beyond r0
+ linIxTail = find(logIxTail); % convert logical index to linear index
+ numTail = numel(linIxTail);
+ bixelDoseTail = bixelDose(linIxTail); % dose values that are going to be reduced by sampling
+ ixTail = ix(linIxTail); % indices that are going to be reduced by sampling
+
+ %% sample for each radiological depth the lateral halo dose
+ radDepthTail = (radDepthV(linIxTail)); % get radiological depth in the tail
+
+ % cluster radiological dephts to reduce computations
+ B_r = int32(ceil(radDepthTail)); % cluster radiological depths;
+ maxRadDepth = double(max(B_r));
+ C = int32(linspace(0,maxRadDepth,round(maxRadDepth)/deltaRadDepth)); % coarse clustering of rad depths
+
+ ixNew = zeros(numTail,1); % inizialize new index vector
+ bixelDoseNew = zeros(numTail,1); % inizialize new dose vector
+ linIx = int32(1:1:numTail)';
+ IxCnt = 1;
+
+ %% loop over clustered radiological depths
+ for i = 1:numel(C)-1
+ ixTmp = linIx(B_r >= C(i) & B_r < C(i+1)); % extracting sub indices
+ if isempty(ixTmp)
+ continue
+ end
+ subDose = bixelDoseTail(ixTmp); % get tail dose in current cluster
+ subIx = ixTail(ixTmp); % get indices in current cluster
+ thresholdDose = max(subDose);
+ r = rand(numel(subDose),1); % get random samples
+ ixSamp = r<=(subDose/thresholdDose);
+ NumSamples = sum(ixSamp);
+
+ ixNew(IxCnt:IxCnt+NumSamples-1,1) = subIx(ixSamp); % save new indices
+ bixelDoseNew(IxCnt:IxCnt+NumSamples-1,1) = thresholdDose; % set the dose
+ IxCnt = IxCnt + NumSamples;
+ end
+
+
+ % cut new vectors and add inner core values
+ ixNew = [ix(ixCore); ixNew(1:IxCnt-1)];
+ bixelDoseNew = [bixelDoseCore; bixelDoseNew(1:IxCnt-1)];
+ end
+
+ end
+
+ function [ray] = initRay(this,currBeam,j)
+
+ ray = initRay@DoseEngines.matRad_PencilBeamEngineAbstract(this,currBeam,j);
+
+ % convolution here if custom primary fluence OR field based dose calc
+ if this.useCustomPrimaryNeutronFluence || this.isFieldBasedDoseCalc
+
+ % overwrite field opening if necessary
+ if this.isFieldBasedDoseCalc
+ F = ray.shape;
+ else
+ F = this.Fpre;
+ end
+
+ % prepare primary fluence array
+ primaryFluence = this.machine.data.primaryFluence;
+ r = sqrt( (this.F_X-ray.rayPos(1)).^2 + (this.F_Z-ray.rayPos(3)).^2 );
+ Psi = interp1(primaryFluence(:,1)',primaryFluence(:,2)',r,'linear',0);
+
+ % apply the primary fluence to the field
+ Fx = F .* Psi;
+
+ % convolve with the gaussian
+ Fx = real( ifft2(fft2(Fx,this.gaussConvSize,this.gaussConvSize).* fft2(this.gaussFilter,this.gaussConvSize,this.gaussConvSize)) );
+
+ % Get kernel interpolators
+ ray.interpKernels = this.getKernelInterpolators(Fx);
+
+ else
+ ray.interpKernels = this.interpKernelCache;
+ end
+
+
+ end
+ end
+
+ methods (Static)
+
+ function [available,msg] = isAvailable(pln,machine)
+ % see superclass for information
+
+ msg = [];
+ available = false;
+
+ if nargin < 2
+ machine = matRad_loadMachine(pln);
+ end
+
+ %checkBasic
+ try
+ checkBasic = isfield(machine,'meta') && isfield(machine,'data');
+
+ %check modality
+ checkModality = any(strcmp(DoseEngines.matRad_NeutronPencilBeamSVDEngine.possibleRadiationModes, machine.meta.radiationMode));
+
+ preCheck = checkBasic && checkModality;
+
+ if ~preCheck
+ return;
+ end
+ catch
+ msg = 'Your machine file is invalid and does not contain the basic field (meta/data/radiationMode)!';
+ return;
+ end
+
+
+ %Basic check for information (does not check data integrity & subfields etc.)
+ checkData = all(isfield(machine.data,{'betas','energy','m','primaryFluence','kernel','kernelPos'}));
+ checkMeta = all(isfield(machine.meta,{'SAD'})); %,'SCD'}));
+
+ if checkData && checkMeta
+ available = true;
+ else
+ available = false;
+ return;
+ end
+
+ %Now check for optional fields that would be guessed otherwise
+ checkOptional = isfield(machine.data,'penumbraFWHMatIso');
+ if checkOptional
+ msg = 'No penumbra given, generic value will be used!';
+ end
+ end
+
+ function bixelDose = calcSingleBixel(SAD,m,betas,interpKernels,...
+ radDepths,geoDists,isoLatDistsX,isoLatDistsZ)
+ % matRad neutron dose calculation for an individual bixel
+ % This is defined as a static function so it can also be
+ % called individually for certain applications without having
+ % a fully defined dose engine
+ %
+ % call
+ % bixelDose = calcSingleBixel(SAD,m,betas,interpKernels,...
+ % radDepths,geoDists,isoLatDistsX,isoLatDistsZ)
+ %
+ % input
+ % SAD: source to axis distance
+ % m: absorption in water (part of the dose calc base
+ % data)
+ % betas: beta parameters for the parameterization of the
+ % three depth dose components
+ % interpKernels: kernel interpolators for dose calculation
+ % radDepths: radiological depths
+ % geoDists: geometrical distance from virtual photon source
+ % isoLatDistsX: lateral distance in X direction in BEV from central
+ % ray at iso center plane
+ % isoLatDistsZ: lateral distance in Z direction in BEV from central
+ % ray at iso center plane
+ %
+ % output
+ % dose: neutron dose at specified locations as linear vector
+ %
+ % References
+ % [1] https://pubmed.ncbi.nlm.nih.gov/38241727/
+ %
+
+ % Compute depth dose components according to [1, eq. 2]
+ func_Di = @(beta,x) beta(1)/(beta(2) - m) * (exp(-m*x) - exp(-beta(2)*x)) + ...
+ beta(3)/(beta(4) - m) * (exp(-m*x) - exp(-beta(4)*x));
+
+ doseComponent = zeros(size(radDepths,1),length(interpKernels));
+ % Multiply with lateral 2D-convolved kernels using
+ % grid interpolation at lateral distances
+ for ik = 1:length(interpKernels)
+ doseComponent(:,ik) = func_Di(betas(ik,:),radDepths) .* interpKernels{ik}(isoLatDistsX,isoLatDistsZ);
+ end
+
+ % now add everything together (eq 19 w/o inv sq corr -> see below)
+ bixelDose = sum(doseComponent,2);
+
+ % inverse square correction
+ bixelDose = bixelDose .* ((SAD)./geoDists(:)).^2;
+
+ % check if we have valid dose values and adjust numerical instabilities
+ % from fft convolution
+ minLimit = -1; % default limit = -1e-14
+ bixelDose(bixelDose < 0 & bixelDose > minLimit) = 0;
+ if any(isnan(bixelDose)) || any(bixelDose<0)
+ matRad_cfg.dispError('Invalid numerical values in neutron dose calculation. PBK-based dose calculation for neutrons appeares to be less stable than for photons.');
+ end
+ end
+
+ end
+
+end
+
diff --git a/matRad/doseCalc/+DoseEngines/matRad_NeutronPlusGammaPencilBeamSVDEngine.m b/matRad/doseCalc/+DoseEngines/matRad_NeutronPlusGammaPencilBeamSVDEngine.m
new file mode 100644
index 000000000..12a09a083
--- /dev/null
+++ b/matRad/doseCalc/+DoseEngines/matRad_NeutronPlusGammaPencilBeamSVDEngine.m
@@ -0,0 +1,616 @@
+classdef matRad_NeutronPlusGammaPencilBeamSVDEngine < DoseEngines.matRad_PencilBeamEngineAbstract
+ % matRad_NeutronGammaPencilBeamSVDEngine: Pencil-beam dose calculation with
+ % singular value decomposed kernels
+ %
+ %
+ % References
+ % [1] http://www.ncbi.nlm.nih.gov/pubmed/8497215
+ % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+ %
+ % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+ %
+ % Copyright 2022 the matRad development team.
+ %
+ % This file is part of the matRad project. It is subject to the license
+ % terms in the LICENSE file found in the top-level directory of this
+ % distribution and at https://github.com/e0404/matRad/LICENSE.md. No part
+ % of the matRad project, including this file, may be copied, modified,
+ % propagated, or distributed except according to the terms contained in the
+ % LICENSE file.
+ %
+ % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+ properties (Constant)
+ possibleRadiationModes = {'neutronsPLUSgammas'}; %constant which represent available radiation modes
+ name = 'SVD Pencil Beam';
+ shortName = 'SVDPB';
+
+ %supportedQuantities = {'physicalDose'};
+ end
+
+ properties (SetAccess = public, GetAccess = public)
+ useCustomPrimaryNeutronFluence; %boolean to control usage of the primary fluence during dose (influence matrix) computation
+ kernelCutOff; %cut off in [mm] of kernel values
+ randomSeed = 0; %for bixel sampling
+ intConvResolution = 0.5; %resolution for kernel convolution [mm]
+
+ enableDijSampling = true;
+ dijSampling; %struct with lateral dij sampling parameters
+ end
+
+ %Calculation variables
+ properties (SetAccess = protected,GetAccess = public)
+ isFieldBasedDoseCalc; %Will be set
+ penumbraFWHM; %will be obtained from machine
+ fieldWidth; %Will be obtained during calculation
+
+ %Kernel Grid for convolution
+ kernelConvSize; %size of the convolution kernel
+ kernelX; %meshgrid in X
+ kernelZ; %meshgrid in Z
+ kernelMxs; %cell array of kernel matrices
+
+ gaussFilter; %two-dimensional gaussian filter to model penumbra
+ gaussConvSize; %size of the gaussian convolution kernel
+
+ convMx_X; %convolution meshgrid in X
+ convMx_Z; %convolution meshgrid in Z
+
+ F_X; %fluence meshgrid in X
+ F_Z; %fluence meshgrid in Z
+
+ Fpre; %precomputed fluence if uniform fluence used for calculation
+ interpKernelCache; %Kernel interpolators (cached if precomputation per beam possible)
+
+ collimation; %collimation structure from dicom import
+
+ cubeKERMAcorr; %neutron KERMA correction factors relative to water on CT grid
+ end
+
+
+ methods
+
+ function this = matRad_NeutronPlusGammaPencilBeamSVDEngine(pln)
+ % Constructor
+ %
+ % call
+ % engine = DoseEngines.matRad_NeutronPencilBeamSVDEngine(pln)
+ %
+ % input
+ % ct: matRad ct struct
+ % stf: matRad steering information struct
+ % pln: matRad plan meta information struct
+ % cst: matRad cst struct
+
+ if nargin < 1
+ pln = [];
+ end
+
+ % create this from superclass
+ this = this@DoseEngines.matRad_PencilBeamEngineAbstract(pln);
+
+ if nargin > 0
+ % 0 if field calc is bixel based, 1 if dose calc is field based
+ % num2str is only used to prevent failure of strcmp when bixelWidth
+ % contains a number and not a string
+ this.isFieldBasedDoseCalc = strcmp(num2str(pln.propStf.bixelWidth),'field');
+ end
+ end
+
+ function setDefaults(this)
+ setDefaults@DoseEngines.matRad_PencilBeamEngineAbstract(this);
+
+ %Assign defaults from Config
+ matRad_cfg = MatRad_Config.instance();
+ this.useCustomPrimaryNeutronFluence = matRad_cfg.propDoseCalc.defaultUseCustomPrimaryNeutronFluence;
+ this.kernelCutOff = matRad_cfg.propDoseCalc.defaultKernelCutOff;
+
+ %dij sampling defaults
+ this.dijSampling.relDoseThreshold = 0.01;
+ this.dijSampling.latCutOff = 20;
+ this.dijSampling.type = 'radius';
+ this.dijSampling.deltaRadDepth = 5;
+ end
+ end
+
+ methods (Access = protected)
+
+ function dij = initDoseCalc(this,ct,cst,stf)
+ %% Assign parameters
+ matRad_cfg = MatRad_Config.instance();
+
+ % 0 if field calc is bixel based, 1 if dose calc is field based
+ % num2str is only used to prevent failure of strcmp when bixelWidth
+ % contains a number and not a string
+ this.isFieldBasedDoseCalc = any(arrayfun(@(s) strcmp(num2str(s.bixelWidth),'field'),stf));
+
+ %% Call Superclass init
+ dij = initDoseCalc@DoseEngines.matRad_PencilBeamEngineAbstract(this,ct,cst,stf);
+
+ % Add dij dose components here:
+ dij.neutronDose = dij.physicalDose;
+ dij.photonDose = dij.physicalDose;
+
+ %% Validate some properties
+ % gaussian filter to model penumbra from (measured) machine output / see
+ % diploma thesis siggel 4.1.2 -> https://github.com/e0404/matRad/wiki/Dose-influence-matrix-calculation
+ if isfield(this.machine.data,'penumbraFWHMatIso')
+ this.penumbraFWHM = this.machine.data.penumbraFWHMatIso;
+ else
+ matRad_cfg.dispWarning('Neutron machine file does not contain measured penumbra width in machine.data.penumbraFWHMatIso. Convolution with Gaussian to model penumbra from machine is switched off.');
+ end
+
+ %Correct kernel cut off to base data limits if needed
+ if this.kernelCutOff > this.machine.data.kernelPos(end)
+ matRad_cfg.dispWarning('Kernel Cut-Off ''%f mm'' larger than machine data range of ''%f mm''. Using ''%f mm''!',this.kernelCutOff,this.machine.data.kernelPos(end),this.machine.data.kernelPos(end));
+ this.kernelCutOff = this.machine.data.kernelPos(end);
+ end
+
+ if this.kernelCutOff < this.geometricLateralCutOff
+ matRad_cfg.dispWarning('Kernel Cut-Off ''%f mm'' cannot be smaller than geometric lateral cutoff ''%f mm''. Using ''%f mm''!',this.kernelCutOff,this.geometricLateralCutOff,this.geometricLateralCutOff);
+ this.kernelCutOff = this.geometricLateralCutOff;
+ end
+
+ %% Initiate KERMA correction for neutron dose calculation
+ if ct.numOfCtScen==1
+ if isfield(this.machine.data,'neutronKERMAcorr')
+ for counterCorrInt = 1:size(this.machine.data.neutronKERMAcorr,2)-1
+ this.cubeKERMAcorr{1}((ct.cubeHU{1}>=this.machine.data.neutronKERMAcorr(1,counterCorrInt))&(ct.cubeHU{1} 1
+ matRad_cfg.dispError('Different bixelWidths pear beam are not supported!');
+ end
+
+ this.fieldWidth = unique([stf.bixelWidth]);
+ end
+
+ % calculate field size and distances
+ fieldLimit = ceil(this.fieldWidth/(2*this.intConvResolution));
+ [this.F_X,this.F_Z] = meshgrid(-fieldLimit*this.intConvResolution: ...
+ this.intConvResolution: ...
+ (fieldLimit-1)*this.intConvResolution);
+
+
+ if isfield(this.machine.data,'penumbraFWHMatIso')
+ sigmaGauss = this.penumbraFWHM / sqrt(8*log(2)); % [mm]
+ % use 5 times sigma as the limits for the gaussian convolution
+ gaussLimit = ceil(5*sigmaGauss/this.intConvResolution);
+ [gaussFilterX,gaussFilterZ] = meshgrid(-gaussLimit*this.intConvResolution: ...
+ this.intConvResolution: ...
+ (gaussLimit-1)*this.intConvResolution);
+ this.gaussFilter = 1/(2*pi*sigmaGauss^2/this.intConvResolution^2) * exp(-(gaussFilterX.^2+gaussFilterZ.^2)/(2*sigmaGauss^2) );
+ this.gaussConvSize = 2*(fieldLimit + gaussLimit);
+ end
+
+ % get kernel size and distances
+
+ kernelLimit = ceil(this.kernelCutOff/this.intConvResolution);
+ [this.kernelX, this.kernelZ] = meshgrid(-kernelLimit*this.intConvResolution: ...
+ this.intConvResolution: ...
+ (kernelLimit-1)*this.intConvResolution);
+
+ % precalculate convolved kernel size and distances
+ if isfield(this.machine.data,'penumbraFWHMatIso')
+ kernelConvLimit = fieldLimit + gaussLimit + kernelLimit;
+ else
+ kernelConvLimit = fieldLimit + kernelLimit;
+ end
+
+ [this.convMx_X, this.convMx_Z] = meshgrid(-kernelConvLimit*this.intConvResolution: ...
+ this.intConvResolution: ...
+ (kernelConvLimit-1)*this.intConvResolution);
+ % calculate also the total size and distance as we need this during convolution extensively
+ this.kernelConvSize = 2*kernelConvLimit;
+
+ % define an effective lateral cutoff where dose will be calculated. note
+ % that storage within the influence matrix may be subject to sampling
+ this.effectiveLateralCutOff = this.geometricLateralCutOff + this.fieldWidth/sqrt(2);
+
+
+ % Check if we can precompute fluence and precompute kernel
+ % convolution if we use a uniform fluence
+ if ~this.isFieldBasedDoseCalc
+ % Create fluence matrix
+ this.Fpre = ones(floor(this.fieldWidth/this.intConvResolution));
+
+ if ~this.useCustomPrimaryNeutronFluence && isfield(this.machine.data,'penumbraFWHMatIso')
+ % gaussian convolution of field to model penumbra
+ this.Fpre = real(ifft2(fft2(this.Fpre,this.gaussConvSize,this.gaussConvSize).*fft2(this.gaussFilter,this.gaussConvSize,this.gaussConvSize)));
+ end
+ end
+
+ %% Initialize randomization
+ [env, ~] = matRad_getEnvironment();
+
+ switch env
+ case 'MATLAB'
+ rng(this.randomSeed); %Initializes Mersenne Twister with seed 0
+ case 'OCTAVE'
+ rand('state',this.randomSeed); %Initializes Mersenne Twister with state 0 (does not give similar random numbers as in Matlab)
+ otherwise
+ rand('seed',this.randomSeed); %Fallback
+ matRad_cfg.dispWarning('Environment %s not recognized!',env);
+ end
+
+ end
+
+ function currBeam = initBeam(this,currBeam,ct,cst,stf,i)
+ % Method for initializing the beams for analytical pencil beam
+ % dose calculation
+ %
+ % call
+ % this.initBeam(ct,stf,dij,i)
+ %
+ % input
+ % ct: matRad ct struct
+ % stf: matRad steering information struct
+ % dij: matRad dij struct
+ % i: index of beam
+ %
+ % output
+ % dij: updated dij struct
+
+ currBeam = initBeam@DoseEngines.matRad_PencilBeamEngineAbstract(this,currBeam,ct,cst,stf,i);
+
+ matRad_cfg = MatRad_Config.instance();
+
+ % get index of central ray or closest to the central ray
+ [~,center] = min(sum(reshape([currBeam.ray.rayPos_bev],3,[]).^2));
+
+ % get correct kernel for given SSD at central ray (nearest neighbor approximation)
+ [~,currSSDix] = min(abs([this.machine.data.kernel.SSD]-currBeam.ray(center).SSD));
+ % Display console message.
+ matRad_cfg.dispInfo('\tSSD = %g mm ...\n',this.machine.data.kernel(currSSDix).SSD);
+
+ %Hardcoded for now
+ useKernels = {'kernel1','kernel2','kernel3'};
+
+ kernelPos = this.machine.data.kernelPos;
+
+ for k = 1:length(useKernels)
+ kernel = this.machine.data.kernel(currSSDix).(useKernels{k});
+ this.kernelMxs{k} = interp1(kernelPos,kernel,sqrt(this.kernelX.^2+this.kernelZ.^2),'linear',0);
+ end
+
+ % convolution here if no custom primary fluence and no field based dose calc
+ if ~isempty(this.Fpre) && ~this.useCustomPrimaryNeutronFluence && ~this.isFieldBasedDoseCalc
+
+ % Display console message.
+ matRad_cfg.dispInfo('\tUniform primary neutron fluence -> pre-compute kernel convolution...\n');
+
+ % Get kernel interpolators
+ this.interpKernelCache = this.getKernelInterpolators(this.Fpre);
+ end
+ end
+
+ function [bixel] = computeBixel(this,currRay,k)
+ % matRad neutron dose calculation for an individual bixel
+ %
+ % call
+ % bixel = this.computeBixel(currRay,k)
+
+ bixel = struct();
+
+ if isfield(this.tmpMatrixContainers,'physicalDose')
+ bixel.physicalDose = this.calcSingleBixel(currRay.SAD,...
+ this.machine.data.m,...
+ this.machine.data.betas,...
+ currRay.interpKernels,...
+ currRay.radDepths,...
+ currRay.geoDepths,...
+ currRay.isoLatDists(:,1),...
+ currRay.isoLatDists(:,2));
+
+ % sample dose only for bixel based dose calculation
+ if this.enableDijSampling && ~this.isFieldBasedDoseCalc
+ [bixel.ix,bixel.physicalDose] = this.sampleDij(currRay.ix,bixel.physicalDose,currRay.radDepths,currRay.radialDist_sq,currRay.bixelWidth);
+ if this.multScen.numOfCtScen==1
+ bixel.physicalDose = bixel.physicalDose.*this.cubeKERMAcorr{1}(bixel.ix)';
+ else
+ matRad_cfg.dispError('Neutron dose calculation implemented only for 1 CT scenario!')
+ end
+ else
+ bixel.ix = currRay.ix;
+ end
+ else
+ bixel.ix = [];
+ end
+ end
+
+ function interpKernels = getKernelInterpolators(this,Fx)
+
+ matRad_cfg = MatRad_Config.instance();
+
+ nKernels = length(this.kernelMxs);
+ interpKernels = cell(1,nKernels);
+
+ for ik = 1:nKernels
+ % 2D convolution of Fluence and Kernels in fourier domain
+ convMx = real( ifft2(fft2(Fx,this.kernelConvSize,this.kernelConvSize).* fft2(this.kernelMxs{ik},this.kernelConvSize,this.kernelConvSize)));
+
+ % Creates an interpolant for kernes from vectors position X and Z
+ if matRad_cfg.isMatlab
+ interpKernels{ik} = griddedInterpolant(this.convMx_X',this.convMx_Z',convMx','linear','none');
+ elseif matRad_cfg.isOctave
+ %For some reason the use of interpn here is much faster
+ %than using interp2 in Octave
+ interpKernels{ik} = @(x,y) interpn(this.convMx_X(1,:),this.convMx_Z(:,1),convMx',x,y,'linear',NaN);
+ end
+ end
+ end
+
+ function [ixNew,bixelDoseNew] = sampleDij(this,ix,bixelDose,radDepthV,rad_distancesSq,bixelWidth)
+ % matRad dij sampling function
+ % This function samples.
+ %
+ % call
+ % [ixNew,bixelDoseNew] =
+ % this.sampleDij(ix,bixelDose,radDepthV,rad_distancesSq,sType,Param)
+ %
+ % input
+ % ix: indices of voxels where we want to compute dose influence data
+ % bixelDose: dose at specified locations as linear vector
+ % radDepthV: radiological depth vector
+ % rad_distancesSq: squared radial distance to the central ray
+ % bixelWidth: bixelWidth as set in pln (optional)
+ %
+ % output
+ % ixNew: reduced indices of voxels where we want to compute dose influence data
+ % bixelDoseNew reduced dose at specified locations as linear vector
+ %
+ % References
+ % [1] http://dx.doi.org/10.1118/1.1469633
+ %
+ % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+ %
+ % Copyright 2016 the matRad development team.
+ %
+ % This file is part of the matRad project. It is subject to the license
+ % terms in the LICENSE file found in the top-level directory of this
+ % distribution and at https://github.com/e0404/matRad/LICENSES.txt. No part
+ % of the matRad project, including this file, may be copied, modified,
+ % propagated, or distributed except according to the terms contained in the
+ % LICENSE file.
+ %
+ % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+ relDoseThreshold = this.dijSampling.relDoseThreshold;
+ LatCutOff = this.dijSampling.latCutOff;
+ Type = this.dijSampling.type;
+ deltaRadDepth = this.dijSampling.deltaRadDepth;
+
+ % if the input index vector is of type logical convert it to linear indices
+ if islogical(ix)
+ ix = find(ix);
+ end
+
+ %Increase sample cut-off by bixel width if given
+ if nargin == 6 && ~isempty(bixelWidth)
+ LatCutOff = LatCutOff + bixelWidth/sqrt(2); %use half of the bixel width diagonal as max. field size radius for sampling
+ end
+
+ %% remember dose values inside the inner core
+ switch Type
+ case 'radius'
+ ixCore = rad_distancesSq < LatCutOff^2; % get voxels indices having a smaller radial distance than r0
+ case 'dose'
+ ixCore = bixelDose > relDoseThreshold * max(bixelDose); % get voxels indices having a greater dose than the thresholdDose
+ otherwise
+ matRad_cfg = MatRad_Config.instance();
+ matRad_cfg.dispError('Dij Sampling mode ''%s'' not known!',Type);
+ end
+
+ bixelDoseCore = bixelDose(ixCore); % save dose values that are not affected by sampling
+
+ if all(ixCore)
+ %% all bixels are in the core
+ %exit function with core dose only
+ ixNew = ix;
+ bixelDoseNew = bixelDoseCore;
+ else
+ logIxTail = ~ixCore; % get voxels indices beyond r0
+ linIxTail = find(logIxTail); % convert logical index to linear index
+ numTail = numel(linIxTail);
+ bixelDoseTail = bixelDose(linIxTail); % dose values that are going to be reduced by sampling
+ ixTail = ix(linIxTail); % indices that are going to be reduced by sampling
+
+ %% sample for each radiological depth the lateral halo dose
+ radDepthTail = (radDepthV(linIxTail)); % get radiological depth in the tail
+
+ % cluster radiological dephts to reduce computations
+ B_r = int32(ceil(radDepthTail)); % cluster radiological depths;
+ maxRadDepth = double(max(B_r));
+ C = int32(linspace(0,maxRadDepth,round(maxRadDepth)/deltaRadDepth)); % coarse clustering of rad depths
+
+ ixNew = zeros(numTail,1); % inizialize new index vector
+ bixelDoseNew = zeros(numTail,1); % inizialize new dose vector
+ linIx = int32(1:1:numTail)';
+ IxCnt = 1;
+
+ %% loop over clustered radiological depths
+ for i = 1:numel(C)-1
+ ixTmp = linIx(B_r >= C(i) & B_r < C(i+1)); % extracting sub indices
+ if isempty(ixTmp)
+ continue
+ end
+ subDose = bixelDoseTail(ixTmp); % get tail dose in current cluster
+ subIx = ixTail(ixTmp); % get indices in current cluster
+ thresholdDose = max(subDose);
+ r = rand(numel(subDose),1); % get random samples
+ ixSamp = r<=(subDose/thresholdDose);
+ NumSamples = sum(ixSamp);
+
+ ixNew(IxCnt:IxCnt+NumSamples-1,1) = subIx(ixSamp); % save new indices
+ bixelDoseNew(IxCnt:IxCnt+NumSamples-1,1) = thresholdDose; % set the dose
+ IxCnt = IxCnt + NumSamples;
+ end
+
+
+ % cut new vectors and add inner core values
+ ixNew = [ix(ixCore); ixNew(1:IxCnt-1)];
+ bixelDoseNew = [bixelDoseCore; bixelDoseNew(1:IxCnt-1)];
+ end
+
+ end
+
+ function [ray] = initRay(this,currBeam,j)
+
+ ray = initRay@DoseEngines.matRad_PencilBeamEngineAbstract(this,currBeam,j);
+
+ % convolution here if custom primary fluence OR field based dose calc
+ if this.useCustomPrimaryNeutronFluence || this.isFieldBasedDoseCalc
+
+ % overwrite field opening if necessary
+ if this.isFieldBasedDoseCalc
+ F = ray.shape;
+ else
+ F = this.Fpre;
+ end
+
+ % prepare primary fluence array
+ primaryFluence = this.machine.data.primaryFluence;
+ r = sqrt( (this.F_X-ray.rayPos(1)).^2 + (this.F_Z-ray.rayPos(3)).^2 );
+ Psi = interp1(primaryFluence(:,1)',primaryFluence(:,2)',r,'linear',0);
+
+ % apply the primary fluence to the field
+ Fx = F .* Psi;
+
+ % convolve with the gaussian
+ Fx = real( ifft2(fft2(Fx,this.gaussConvSize,this.gaussConvSize).* fft2(this.gaussFilter,this.gaussConvSize,this.gaussConvSize)) );
+
+ % Get kernel interpolators
+ ray.interpKernels = this.getKernelInterpolators(Fx);
+
+ else
+ ray.interpKernels = this.interpKernelCache;
+ end
+
+
+ end
+ end
+
+ methods (Static)
+
+ function [available,msg] = isAvailable(pln,machine)
+ % see superclass for information
+
+ msg = [];
+ available = false;
+
+ if nargin < 2
+ machine = matRad_loadMachine(pln);
+ end
+
+ %checkBasic
+ try
+ checkBasic = isfield(machine,'meta') && isfield(machine,'data');
+
+ %check modality
+ checkModality = any(strcmp(DoseEngines.matRad_NeutronPencilBeamSVDEngine.possibleRadiationModes, machine.meta.radiationMode));
+
+ preCheck = checkBasic && checkModality;
+
+ if ~preCheck
+ return;
+ end
+ catch
+ msg = 'Your machine file is invalid and does not contain the basic field (meta/data/radiationMode)!';
+ return;
+ end
+
+
+ %Basic check for information (does not check data integrity & subfields etc.)
+ checkData = all(isfield(machine.data,{'betas','energy','m','primaryFluence','kernel','kernelPos'}));
+ checkMeta = all(isfield(machine.meta,{'SAD'})); %,'SCD'}));
+
+ if checkData && checkMeta
+ available = true;
+ else
+ available = false;
+ return;
+ end
+
+ %Now check for optional fields that would be guessed otherwise
+ checkOptional = isfield(machine.data,'penumbraFWHMatIso');
+ if checkOptional
+ msg = 'No penumbra given, generic value will be used!';
+ end
+ end
+
+ function bixelDose = calcSingleBixel(SAD,m,betas,interpKernels,...
+ radDepths,geoDists,isoLatDistsX,isoLatDistsZ)
+ % matRad neutron dose calculation for an individual bixel
+ % This is defined as a static function so it can also be
+ % called individually for certain applications without having
+ % a fully defined dose engine
+ %
+ % call
+ % bixelDose = calcSingleBixel(SAD,m,betas,interpKernels,...
+ % radDepths,geoDists,isoLatDistsX,isoLatDistsZ)
+ %
+ % input
+ % SAD: source to axis distance
+ % m: absorption in water (part of the dose calc base
+ % data)
+ % betas: beta parameters for the parameterization of the
+ % three depth dose components
+ % interpKernels: kernel interpolators for dose calculation
+ % radDepths: radiological depths
+ % geoDists: geometrical distance from virtual photon source
+ % isoLatDistsX: lateral distance in X direction in BEV from central
+ % ray at iso center plane
+ % isoLatDistsZ: lateral distance in Z direction in BEV from central
+ % ray at iso center plane
+ %
+ % output
+ % dose: neutron dose at specified locations as linear vector
+ %
+ % References
+ % [1] https://pubmed.ncbi.nlm.nih.gov/38241727/
+ %
+
+ % Compute depth dose components according to [1, eq. 2]
+ func_Di = @(beta,x) beta(1)/(beta(2) - m) * (exp(-m*x) - exp(-beta(2)*x)) + ...
+ beta(3)/(beta(4) - m) * (exp(-m*x) - exp(-beta(4)*x));
+
+ doseComponent = zeros(size(radDepths,1),length(interpKernels));
+ % Multiply with lateral 2D-convolved kernels using
+ % grid interpolation at lateral distances
+ for ik = 1:length(interpKernels)
+ doseComponent(:,ik) = func_Di(betas(ik,:),radDepths) .* interpKernels{ik}(isoLatDistsX,isoLatDistsZ);
+ end
+
+ % now add everything together (eq 19 w/o inv sq corr -> see below)
+ bixelDose = sum(doseComponent,2);
+
+ % inverse square correction
+ bixelDose = bixelDose .* ((SAD)./geoDists(:)).^2;
+
+ % check if we have valid dose values and adjust numerical instabilities
+ % from fft convolution
+ minLimit = -1; % default limit = -1e-14
+ bixelDose(bixelDose < 0 & bixelDose > minLimit) = 0;
+ if any(isnan(bixelDose)) || any(bixelDose<0)
+ matRad_cfg.dispError('Invalid numerical values in neutron dose calculation. PBK-based dose calculation for neutrons appeares to be less stable than for photons.');
+ end
+ end
+
+ end
+
+end
+
diff --git a/matRad/gui/widgets/matRad_PlanWidget.m b/matRad/gui/widgets/matRad_PlanWidget.m
index e0b3a2a20..31f555171 100644
--- a/matRad/gui/widgets/matRad_PlanWidget.m
+++ b/matRad/gui/widgets/matRad_PlanWidget.m
@@ -32,10 +32,8 @@
end
properties (Constant)
-
- modalities = {'photons','protons','carbon', 'helium','brachy', 'VHEE'};
+ modalities = {'photons','protons','carbon','helium','brachy','VHEE','neutrons'};
availableProjections = { 'physicalDose'; 'RBExDose'; 'effect'; 'BED'; }
-
end
methods
@@ -1116,8 +1114,7 @@ function switchEnables(this)
contentPopUpQuantityOpt = get(handles.popMenuQuantityOpt,'String');
contentPopUpBioModel = get(handles.popMenuBioModel,'String');
switch RadIdentifier
- case 'photons'
-
+ case {'photons', 'neutrons'}
set(handles.popMenuQuantityOpt,'Enable','on');
% ix = find(strcmp(contentPopUpQuantityOpt,'physicalDose'));
% set(handles.popMenuQuantityOpt,'Value',ix);
@@ -1305,7 +1302,7 @@ function popupRadMode_Callback(this, hObject, eventdata)
if ismember('resultGUI',AllVarNames)
resultGUI = evalin('base','resultGUI');
radMode = allRadiationModes(get(hObject,'Value'));
- if any(strcmp(radMode,{'photons','brachy','VHEE'}))
+ if any(strcmp(radMode,{'photons','brachy','VHEE','neutrons'}))
if isfield(resultGUI,'alpha'); resultGUI = rmfield(resultGUI,'alpha'); end
if isfield(resultGUI,'beta'); resultGUI = rmfield(resultGUI,'beta'); end
if isfield(resultGUI,'RBExDose'); resultGUI = rmfield(resultGUI,'RBExDose');end
diff --git a/matRad/hluts/MEDAPP-allWater-ConvolutionKernel-neutronField_neutrons.hlut b/matRad/hluts/MEDAPP-allWater-ConvolutionKernel-neutronField_neutrons.hlut
new file mode 100644
index 000000000..67eb92f4d
--- /dev/null
+++ b/matRad/hluts/MEDAPP-allWater-ConvolutionKernel-neutronField_neutrons.hlut
@@ -0,0 +1,11 @@
+# matRad all water HU lookup table
+#
+# First column: Hounsfield values (typically -1000...+3000)
+# Second column: Relative electron density (typically 1.0 for water)
+-1024.0 0.00324
+-999 .99
+200.0 .999
+449.0 .9999
+2000.0 .99999
+2048 .999999
+3071 1
\ No newline at end of file
diff --git a/matRad/hluts/MEDAPP-neutronXScorrMEDAPPspec-ConvolutionKernel-neutronField_neutrons.hlut b/matRad/hluts/MEDAPP-neutronXScorrMEDAPPspec-ConvolutionKernel-neutronField_neutrons.hlut
new file mode 100644
index 000000000..4d578d3da
--- /dev/null
+++ b/matRad/hluts/MEDAPP-neutronXScorrMEDAPPspec-ConvolutionKernel-neutronField_neutrons.hlut
@@ -0,0 +1,12 @@
+# matRad default HU lookup table
+#
+# First column: Hounsfield values (typically -1000...+3000)
+# Second column: Cross section corr. for neutrons rel. to water
+-1024.0 0.003239
+-950.1 0.00324
+-950 0.249
+-170 0.25
+-169.99 0.949
+279.99 0.95
+280 0.909
+4000 0.91
\ No newline at end of file
diff --git a/matRad/steering/matRad_StfGeneratorNeutronIMRT.m b/matRad/steering/matRad_StfGeneratorNeutronIMRT.m
new file mode 100644
index 000000000..3cf3992bf
--- /dev/null
+++ b/matRad/steering/matRad_StfGeneratorNeutronIMRT.m
@@ -0,0 +1,77 @@
+classdef matRad_StfGeneratorNeutronIMRT < matRad_StfGeneratorNeutronRayBixelAbstract
+
+ properties (Constant)
+ name = 'Neutron IMRT stf Generator';
+ shortName = 'NeutronIMRT';
+ possibleRadiationModes = {'neutrons'};
+ end
+
+
+
+ methods
+ function this = matRad_StfGeneratorNeutronIMRT(pln)
+ if nargin < 1
+ pln = [];
+ end
+ this@matRad_StfGeneratorNeutronRayBixelAbstract(pln);
+
+ if (isfield(pln, 'propDoseCalc') && isfield(pln.propDoseCalc, 'addMargin') && ~pln.propDoseCalc.addMargin)
+ this.addMargin = false;
+ end
+
+ if isempty(this.radiationMode)
+ this.radiationMode = 'neutrons';
+ end
+ end
+ end
+
+ methods (Access = protected)
+ function pbMargin = getPbMargin(this)
+ pbMargin = this.bixelWidth;
+ end
+ end
+
+ methods (Static)
+ function [available,msg] = isAvailable(pln,machine)
+ % see superclass for information
+
+ if nargin < 2
+ machine = matRad_loadMachine(pln);
+ end
+
+ % Check superclass availability
+ [available,msg] = matRad_StfGeneratorNeutronRayBixelAbstract.isAvailable(pln,machine);
+
+ if ~available
+ return;
+ else
+ available = false;
+ msg = [];
+ end
+
+ %checkBasic
+ try
+ checkBasic = isfield(machine,'meta') && isfield(machine,'data');
+
+ %check modality
+ checkModality = any(strcmp(matRad_StfGeneratorNeutronIMRT.possibleRadiationModes, machine.meta.radiationMode)) && any(strcmp(matRad_StfGeneratorNeutronIMRT.possibleRadiationModes, pln.radiationMode));
+
+ %Sanity check compatibility
+ if checkModality
+ checkModality = strcmp(machine.meta.radiationMode,pln.radiationMode);
+ end
+
+ preCheck = checkBasic && checkModality;
+
+ if ~preCheck
+ return;
+ end
+ catch
+ msg = 'Your machine file is invalid and does not contain the basic field (meta/data/radiationMode)!';
+ return;
+ end
+
+ available = preCheck;
+ end
+ end
+end
diff --git a/matRad/steering/matRad_StfGeneratorNeutronRayBixelAbstract.m b/matRad/steering/matRad_StfGeneratorNeutronRayBixelAbstract.m
new file mode 100644
index 000000000..8353a6d2a
--- /dev/null
+++ b/matRad/steering/matRad_StfGeneratorNeutronRayBixelAbstract.m
@@ -0,0 +1,102 @@
+classdef (Abstract) matRad_StfGeneratorNeutronRayBixelAbstract < matRad_StfGeneratorExternalRayBixelAbstract
+% matRad_StfGeneratorNeutronRayBixelAbstract: Abstract Superclass for
+% neutron
+% Stf Generators using the ray-bixel mechanism
+%
+% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% Copyright 2024 the matRad development team.
+%
+% This file is part of the matRad project. It is subject to the license
+% terms in the LICENSE file found in the top-level directory of this
+% distribution and at https://github.com/e0404/matRad/LICENSE.md. No part
+% of the matRad project, including this file, may be copied, modified,
+% propagated, or distributed except according to the terms contained in the
+% LICENSE file.
+%
+% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+ methods
+ function this = matRad_StfGeneratorNeutronRayBixelAbstract(pln)
+ % Constructs ExternalStfGenerator with or without pln
+ if nargin < 1
+ pln = [];
+ end
+ this@matRad_StfGeneratorExternalRayBixelAbstract(pln);
+ end
+
+ function setDefaults(this)
+ % Set default values for ExternalStfGenerator
+ this.setDefaults@matRad_StfGeneratorExternalRayBixelAbstract();
+ end
+ end
+
+ methods (Access = protected)
+
+ function beam = initBeamData(this,beam)
+ beam = this.initBeamData@matRad_StfGeneratorExternalRayBixelAbstract(beam);
+ % beam.SCD = this.machine.meta.SCD;
+ end
+
+ function beam = setBeamletEnergies(this,beam)
+ %Assigns the max photon machine energy to all rays
+ numOfRays = numel(beam.ray);
+
+ for j = numOfRays:-1:1
+ beam.ray(j).energy = this.machine.data.energy;
+ end
+ end
+
+ function beam = initRays(this,beam)
+ %Initializes the geometrical beamlet information for photon bixels (ray corners at isocenter and collimator plane)
+
+ beam = this.initRays@matRad_StfGeneratorExternalRayBixelAbstract(beam);
+
+ rotMat_vectors_T = transpose(matRad_getRotationMatrix(beam.gantryAngle,beam.couchAngle));
+
+ numOfRays = numel(beam.ray);
+
+ %photon ray-target position
+ for j = 1:numOfRays
+ beam.ray(j).beamletCornersAtIso = [beam.ray(j).rayPos_bev + [+beam.bixelWidth/2,0,+beam.bixelWidth/2];...
+ beam.ray(j).rayPos_bev + [-beam.bixelWidth/2,0,+beam.bixelWidth/2];...
+ beam.ray(j).rayPos_bev + [-beam.bixelWidth/2,0,-beam.bixelWidth/2];...
+ beam.ray(j).rayPos_bev + [+beam.bixelWidth/2,0,-beam.bixelWidth/2]]*rotMat_vectors_T;
+ % beam.ray(j).rayCorners_SCD = (repmat([0, beam.SCD - beam.SAD, 0],4,1)+ (beam.SCD/beam.SAD) * ...
+ % [beam.ray(j).rayPos_bev + [+beam.bixelWidth/2,0,+beam.bixelWidth/2];...
+ % beam.ray(j).rayPos_bev + [-beam.bixelWidth/2,0,+beam.bixelWidth/2];...
+ % beam.ray(j).rayPos_bev + [-beam.bixelWidth/2,0,-beam.bixelWidth/2];...
+ % beam.ray(j).rayPos_bev + [+beam.bixelWidth/2,0,-beam.bixelWidth/2]])*rotMat_vectors_T;
+ end
+ end
+ end
+
+ methods (Static)
+ function [available,msg] = isAvailable(pln,machine)
+ % see superclass for information
+
+ if nargin < 2
+ machine = matRad_loadMachine(pln);
+ end
+
+ % Check superclass availability
+ [available,msg] = matRad_StfGeneratorExternalRayBixelAbstract.isAvailable(pln,machine);
+
+ if ~available
+ return;
+ end
+
+ %available = available && isfield(machine.data,'energy') && isscalar(machine.data.energy);
+
+ %available = available && isfield(machine.meta,'SCD') && isscalar(machine.meta.SCD);
+
+
+ if ~available
+ msg = 'Your machine file is invalid and does not contain the basic fields required for photon machines!';
+ else
+ msg = [];
+ end
+ end
+ end
+end
+
diff --git a/matRad/steering/matRad_StfGeneratorNeutronSingleBeamlet.m b/matRad/steering/matRad_StfGeneratorNeutronSingleBeamlet.m
new file mode 100644
index 000000000..8b9f4c3b5
--- /dev/null
+++ b/matRad/steering/matRad_StfGeneratorNeutronSingleBeamlet.m
@@ -0,0 +1,91 @@
+classdef matRad_StfGeneratorNeutronSingleBeamlet < matRad_StfGeneratorNeutronRayBixelAbstract
+% matRad_StfGeneratorNeutronSingleBeamlet:
+% Creates a single beamlet for neutrons
+%
+% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% Copyright 2024 the matRad development team.
+%
+% This file is part of the matRad project. It is subject to the license
+% terms in the LICENSE file found in the top-level directory of this
+% distribution and at https://github.com/e0404/matRad/LICENSE.md. No part
+% of the matRad project, including this file, may be copied, modified,
+% propagated, or distributed except according to the terms contained in the
+% LICENSE file.
+%
+% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+ properties (Constant)
+ name = 'Neutron Single Bixel';
+ shortName = 'NeutronSingleBixel';
+ possibleRadiationModes = {'neutrons'};
+ end
+
+ methods
+ function this = matRad_StfGeneratorNeutronSingleBeamlet(pln)
+ if nargin < 1
+ pln = [];
+ end
+ this@matRad_StfGeneratorNeutronRayBixelAbstract(pln);
+
+ if isempty(this.radiationMode)
+ this.radiationMode = 'neutrons';
+ end
+ end
+ end
+
+ methods (Access = protected)
+ function pbMargin = getPbMargin(this)
+ pbMargin = 0;
+ end
+
+ function rayPos = getRayPositionMatrix(this,beam)
+ % see superclass for information
+ rayPos = [0 0 0];
+ end
+ end
+
+ methods (Static)
+ function [available,msg] = isAvailable(pln,machine)
+ % see superclass for information
+
+ if nargin < 2
+ machine = matRad_loadMachine(pln);
+ end
+
+ % Check superclass availability
+ [available,msg] = matRad_StfGeneratorNeutronRayBixelAbstract.isAvailable(pln,machine);
+
+ if ~available
+ return;
+ else
+ available = false;
+ msg = [];
+ end
+
+ %checkBasic
+ try
+ checkBasic = isfield(machine,'meta') && isfield(machine,'data');
+
+ %check modality
+ checkModality = any(strcmp(matRad_StfGeneratorNeutronSingleBeamlet.possibleRadiationModes, machine.meta.radiationMode)) && any(strcmp(matRad_StfGeneratorNeutronSingleBeamlet.possibleRadiationModes, pln.radiationMode));
+
+ %Sanity check compatibility
+ if checkModality
+ checkModality = strcmp(machine.meta.radiationMode,pln.radiationMode);
+ end
+
+ preCheck = checkBasic && checkModality;
+
+ if ~preCheck
+ return;
+ end
+ catch
+ msg = 'Your machine file is invalid and does not contain the basic field (meta/data/radiationMode)!';
+ return;
+ end
+
+ available = preCheck;
+ end
+ end
+end