From 1e33700a6eed93a32168abb934fbc8d8f368d86c Mon Sep 17 00:00:00 2001 From: Marc-Andre Renaud Date: Tue, 16 Jan 2018 18:14:21 -0500 Subject: [PATCH] Add a .bindos output option to the DOSXYZnrc gui Add an option to select the dose output format in the gui. Just emulating what was done for the howfarless option. --- .../omega/progs/gui/dosxyznrc/create_file_nrc.tcl | 13 +++++++++---- .../omega/progs/gui/dosxyznrc/load_input2_nrc.tcl | 9 +++++++++ .../progs/gui/dosxyznrc/reset_parameters_nrc.tcl | 4 +++- .../progs/gui/dosxyznrc/set_main_inputs_egsnrc.tcl | 3 ++- .../omega/progs/gui/dosxyznrc/xyznrc_parameters.tcl | 13 +++++++++++++ 5 files changed, 36 insertions(+), 6 deletions(-) diff --git a/HEN_HOUSE/omega/progs/gui/dosxyznrc/create_file_nrc.tcl b/HEN_HOUSE/omega/progs/gui/dosxyznrc/create_file_nrc.tcl index 06eb6e2ee..753db9e83 100644 --- a/HEN_HOUSE/omega/progs/gui/dosxyznrc/create_file_nrc.tcl +++ b/HEN_HOUSE/omega/progs/gui/dosxyznrc/create_file_nrc.tcl @@ -27,6 +27,7 @@ # Iwan Kawrakow # Ernesto Mainegra-Hing # Frederic Tessier +# Marc-Andre Renaud # ############################################################################### # @@ -68,7 +69,7 @@ proc create_file { file } { global grouping nrow izrow enflag numsrcopts izopts ncpu dflag parnum global numthphi angfixed ang1 ang2 nang pang ivary thphidef global numsets iso1 iso2 iso3 ang1 ang2 ang3 dsource muI - global iphant iphspout imuphspout calflag + global iphant iphspout imuphspout calflag ibindos global level ibcmp_min ibcmp_max iphter_min iphter_max global iraylr_min iraylr_max iedgfl_min iedgfl_max global i_dbs r_dbs ssd_dbs z_dbs the_beam_code the_input_file the_pegs_file @@ -446,7 +447,13 @@ set str "$ivary($i), $angfixed($i), $ang1($i), $ang2($i), $nang($i), $pang($i)" } else { set val 0 } - set str "$str$val, $iphspout" + set str "$str$val, $iphspout, " + if { [string compare $values(ibindos) $options(ibindos,1)]==0 } { + set val 1 + } else { + set val 0 + } + set str "$str$val" puts $file $str @@ -700,5 +707,3 @@ proc error_flag { text } { tk_dialog .edit "Bad inputs" "You haven't defined $text. Please\ fill in all options required before saving." warning 0 OK } - - diff --git a/HEN_HOUSE/omega/progs/gui/dosxyznrc/load_input2_nrc.tcl b/HEN_HOUSE/omega/progs/gui/dosxyznrc/load_input2_nrc.tcl index 0d9cf3bd2..d5556922c 100644 --- a/HEN_HOUSE/omega/progs/gui/dosxyznrc/load_input2_nrc.tcl +++ b/HEN_HOUSE/omega/progs/gui/dosxyznrc/load_input2_nrc.tcl @@ -27,6 +27,7 @@ # Iwan Kawrakow # Ernesto Mainegra-Hing # Frederic Tessier +# Marc-Andre Renaud # ############################################################################### # @@ -768,6 +769,14 @@ proc read_input {} { set iphspout 0 if {$arr(0)<=2} { set iphspout $arr(0) } + # bindos output option + set data [get_val $data arr 0] + if {$arr(0)==1} { + set values(ibindos) $options(ibindos,1) + } else { + set values(ibindos) $options(ibindos,0) + } + # now get the EGSnrc inputs foreach i {ecut pcut smaxir estepe ximax bca_algorithm skindepth_for_bca \ transport_algorithm spin_effects ibrdst ibr_nist ibcmp iprdst\ diff --git a/HEN_HOUSE/omega/progs/gui/dosxyznrc/reset_parameters_nrc.tcl b/HEN_HOUSE/omega/progs/gui/dosxyznrc/reset_parameters_nrc.tcl index ae35ffd9e..653536682 100644 --- a/HEN_HOUSE/omega/progs/gui/dosxyznrc/reset_parameters_nrc.tcl +++ b/HEN_HOUSE/omega/progs/gui/dosxyznrc/reset_parameters_nrc.tcl @@ -26,6 +26,7 @@ # Contributors: Blake Walters # Iwan Kawrakow # Frederic Tessier +# Marc-Andre Renaud # ############################################################################### # @@ -65,7 +66,7 @@ proc reset_parameters { } { global spec_file ecutin pcutin estepm smax imax ivox gvox dsurround global inc exc names mvox izvox PhantFileName latbit nbit1 nbit2 global grouping nrow izrow enflag numsrcopts izopts maxvals - global dflag dflagopt iphspout imuphspout calflag + global dflag dflagopt iphspout imuphspout calflag ibindos global numthphi angfixed ang1 ang2 nang pang ivary thphidef global numsets iso1 iso2 iso3 ang1 ang2 ang3 dsource muI global iphant level the_beam_code the_input_file the_pegs_file @@ -172,6 +173,7 @@ proc reset_parameters { } { set iphspout 0 set imuphspout 0 set calflag 0 + set ibindos 0 set Ein {} set spec_file {} diff --git a/HEN_HOUSE/omega/progs/gui/dosxyznrc/set_main_inputs_egsnrc.tcl b/HEN_HOUSE/omega/progs/gui/dosxyznrc/set_main_inputs_egsnrc.tcl index 581b1ef49..836265db2 100644 --- a/HEN_HOUSE/omega/progs/gui/dosxyznrc/set_main_inputs_egsnrc.tcl +++ b/HEN_HOUSE/omega/progs/gui/dosxyznrc/set_main_inputs_egsnrc.tcl @@ -26,6 +26,7 @@ # Contributors: Blake Walters # Iwan Kawrakow # Frederic Tessier +# Marc-Andre Renaud # ############################################################################### # @@ -256,7 +257,7 @@ proc edit_parameters {} { frame $w frame $w1 frame $w2 - foreach j { 5 6 7 8 9 10 12 ihowfarless } { + foreach j { 5 6 7 8 9 10 12 ihowfarless ibindos } { frame $w1.inp$j -bd 4 button $w1.inp$j.help -text "?" -command "help $j" label $w1.inp$j.label -text $names($j) -anchor w diff --git a/HEN_HOUSE/omega/progs/gui/dosxyznrc/xyznrc_parameters.tcl b/HEN_HOUSE/omega/progs/gui/dosxyznrc/xyznrc_parameters.tcl index eaf2a5ab6..ac8d4d433 100644 --- a/HEN_HOUSE/omega/progs/gui/dosxyznrc/xyznrc_parameters.tcl +++ b/HEN_HOUSE/omega/progs/gui/dosxyznrc/xyznrc_parameters.tcl @@ -27,6 +27,7 @@ # Iwan Kawrakow # Ernesto Mainegra-Hing # Frederic Tessier +# Marc-Andre Renaud # ############################################################################### # @@ -739,6 +740,18 @@ monoenergetic electron beams. Recommended for all homogeneous phantom calculations. } +set ibindos {} +set names(ibindos) "Dose output" +set numopts(ibindos) 2 +set options(ibindos,0) "3ddose" +set options(ibindos,1) "bindos (sparse binary format)" +set values(ibindos) $options(ibindos,0) +set help_text(ibindos) { +Set to "3ddose output" to output a voxel doses in a dense ASCII file. +Set to "sparse binary output" for a sparse binary dose file. +See the DOSXYZnrc manual section titled "Format of Dose Outputs" for a\ +description of the file formats. +} #################The following are the EGSnrc parameters############# set ecut {}