0001 classdef MatRad_MCsquareConfig 0002 % MatRad_MCsquareConfig class definition 0003 % 0004 % 0005 % References 0006 % 0007 % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0008 % 0009 % Copyright 2019 the matRad development team. 0010 % 0011 % This file is part of the matRad project. It is subject to the license 0012 % terms in the LICENSE file found in the top-level directory of this 0013 % distribution and at https://github.com/e0404/matRad/LICENSES.txt. No part 0014 % of the matRad project, including this file, may be copied, modified, 0015 % propagated, or distributed except according to the terms contained in the 0016 % LICENSE file. 0017 % 0018 % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0019 0020 0021 0022 properties 0023 0024 %%% Simulation parameters: 0025 Num_Threads = 0; % Number of parallel calculation threads. Default: 0 = max available threads 0026 RNG_Seed = 0; % Seed for the random number generator (deterministic result only with single thread). Default: 0 = seed based on the time 0027 Num_Primaries = 1e6; % Number of primary protons to simulate. Default: 1e7 0028 E_Cut_Pro = 0.5; % Energy cut (in MeV) below which heavy charged particles are locally absorbed. Default: 0.5 0029 D_Max = 0.2; % Maximum distance between two step (cm). Default: 0.2 0030 Epsilon_Max = 0.25; % Fractional energy loss (dE/T) per step. Default: 0.25 0031 Te_Min = 0.05; % Threshold energy (MeV) for the production of secondary electrons (currently locally absorbed). Default: 0.05 0032 % As a reference: 200 MeV protons can transfer a maximum energy of 0.5 MeV to ?-electrons which correspond to a range of 7 mm in lung tissues. 0033 0034 %%% Input files 0035 CT_File = 'Patient.mhd'; % Name of the CT file. Default: CT.mhd 0036 HU_Density_Conversion_File = 'Scanners/matRad_water/HU_Density_Conversion.txt'; % Name of the file containing HU to density conversion data. Default: HU_Density_Conversion.txt 0037 HU_Material_Conversion_File = 'Scanners/matRad_water/HU_Material_Conversion.txt'; % Name of the file containing HU to material conversion data. Default: HU_Material_Conversion.txt 0038 BDL_Machine_Parameter_File = 'BDL/BDL_matrad.txt'; % Name of the machine parameter file for the beam data library. Default: BDL.txt 0039 BDL_Plan_File = 'PlanPencil.txt'; % Name of the plan file for the beam data library. Default: Plan.txt 0040 0041 %%% Physical parameters 0042 Simulate_Nuclear_Interactions = true; % Enable/Disable the simulation of nuclear interactions. Default: True 0043 Simulate_Secondary_Protons = true; % Enable/Disable the simulation of secondary protons (emitted during nuclear interactions). Default: True 0044 Simulate_Secondary_Deuterons = true; % Enable/Disable the simulation of secondary deuterons (emitted during nuclear interactions). Default: True 0045 Simulate_Secondary_Alphas = true; % Enable/Disable the simulation of secondary alphas (emitted during nuclear interactions). Default: True 0046 0047 0048 %%% 4D simulation 0049 fourD_Mode = false; % Enable/Disable the 4D simulation mode. Default: False 0050 fourD_Dose_Accumulation = false; % Enable/Disable the dose accumulation for all 4D-CT phases. Default: False 0051 Field_type = 'Velocity'; % Field type: Displacement or Velocity. Default: Velocity 0052 Create_Ref_from_4DCT = false; % Create the reference phase image from 4D CT images (True), or import the reference image (False). Default: False 0053 Create_4DCT_from_Ref = false; % Create 4D CT images by deforming the reference phase image (True), or import 4D CT images (False). Default: False 0054 Dynamic_delivery = false; % Enable/Disable simulation of dynamic delivery (interplay simulation). Default: False 0055 Breathing_period = 7.0; % Period (in seconds) of the breathing motion. Default: 7.0 0056 0057 0058 %%% Robustness simulation 0059 Robustness_Mode = false; % Enable/Disable the robustness verification mode. Default: False 0060 %Scenario_selection = 'All' % Method for scenario selection: All (simulate all combinations), Random (randomly sample scenarios). Default: All 0061 Simulate_nominal_plan = true; % Simulate the nominal plan (without any systematic or random uncertainty). Default: True 0062 %Systematic_Setup_Error = [0.25 0.25 0.25]; % Systematic error for the patient setup along the XYZ axes (cm). Default: 0.25 0.25 0.25 0063 %Random_Setup_Error = [0.1 0.1 0.1]; % Standard deviation of the patient random setup error along the XYZ axes (cm). Default: 0.1 0.1 0.1 0064 %Systematic_Range_Error = 3.0; % Systematic error in percent of the proton range (%). Default: 3.0 0065 %Systematic_Amplitude_Error = 5.0; % Systematic error in percent of the breathing motion amplitude for 4D simulations. Default: 5.0 0066 %Random_Amplitude_Error = 5.0; % Random error in percent of the breathing motion amplitude for 4D simulations. Default: 5.0 0067 %Systematic_Period_Error = 5.0; % Systematic error in percent of the breathing motion period for simulations of interplay with dynamic delivery. Default: 5.0 0068 %Random_Period_Error = 5.0; % Random error in percent of the breathing motion period for simulations of interplay with dynamic delivery. Default: 5.0 0069 0070 0071 %%% Beamlet simulation 0072 Beamlet_Mode = false; % Enable/Disable the beamlet computation mode. Default: False 0073 Beamlet_Parallelization = false; % Parallelization on beamlet level is sometimes faster for beamlet simulation. This requires more memory. Default: False 0074 0075 0076 %%% Output parameters 0077 Output_Directory = 'MCsquareOutput'; % Name of the output directory. Default: Outputs 0078 0079 Energy_ASCII_Output = false; % Enable/Disable the output of Energy in ASCII format. Default: False 0080 Energy_MHD_Output = false; % Enable/Disable the output of Energy in MHD format. Default: False 0081 Energy_Sparse_Output = false; % Enable/Disable the output of Energy in Sparse matrix format. Default: False 0082 Dose_ASCII_Output = false; % Enable/Disable the output of Dose in ASCII format. Default: False 0083 Dose_MHD_Output = true; % Enable/Disable the output of Dose in MHD format. Default: True 0084 Dose_Sparse_Output = true; % Enable/Disable the output of Dose in Sparse matrix format. Default: False 0085 LET_ASCII_Output = false; % Enable/Disable the output of LET in ASCII format. Default: False 0086 LET_MHD_Output = false; % Enable/Disable the output of LET in MHD format. Default: False 0087 LET_Sparse_Output = false; % Enable/Disable the output of LET in Sparse matrix format. Default: False 0088 0089 Densities_Output = false; % Enable/Disable the export of the density map (converted from the CT image). Default: False 0090 Materials_Output = false; % Enable/Disable the export of the map of materials (converted from the CT image). Default: False 0091 0092 Compute_DVH = false; % Enable/Disable the computation and export of DVH based on RT-Struct binary masks. Default: False 0093 0094 Dose_Sparse_Threshold = 0; % The dose values above the threshold will be stored in the sparse matrix file. Default: 0 0095 Energy_Sparse_Threshold = 0; % The energy values above the threshold will be stored in the sparse matrix file. Default: 0 0096 LET_Sparse_Threshold = 0; % The LET values above the threshold will be stored in the sparse matrix file. Default: 0 0097 0098 Score_PromptGammas = false; % Enable/Disable the scoring of Prompt Gammas (emitted during nuclear interactions). Default: False 0099 PG_LowEnergyCut = 0.0; % Disable the scoring of Prompt Gammas with energy below this value (MeV). Default: 0.0 0100 PG_HighEnergyCut = 50.0; % Disable the scoring of Prompt Gammas with energy above this value (MeV). Default: 50.0 0101 % Typical gamma camera would be sensitive between 3.0 and 6.0 MeV 0102 PG_Spectrum_NumBin = 150; % Number of bins to score the Prompt Gamma energy spectrum. Default: 150 0103 PG_Spectrum_Binning = 0.1; % Bin width (MeV) for the scoring of Prompt Gamma spectrum. Default: 0.1 0104 0105 LET_Calculation_Method = 'StopPow'; % Select the method employed for the calculation of LET (DepositedEnergy, StopPow). Default: StopPow 0106 0107 %Export_Beam_dose = 'Disabled' % Export dose distribution for each beam (Enable) or entire plan (Disable). Default: Disable 0108 Dose_to_Water_conversion = 'Disabled'; % Select the method employed to convert simulation results (dose to medium) to dose to water (Disabled, PostProcessing, OnlineSPR). Default: Disabled 0109 0110 Dose_Segmentation = false; % Enable/Disable a segmentation of the dose map based on a density thresholding (remove dose artifacts in the air). Default: False 0111 Density_Threshold_for_Segmentation = 0.01; % Density threshold employed for the segmentation (in g/cm3). Default: 0.01 0112 end 0113 0114 methods 0115 function obj = MatRad_MCsquareConfig() 0116 %UNTITLED Construct an instance of this class 0117 % Detailed explanation goes here 0118 %obj.Property1 = inputArg1 + inputArg2; 0119 end 0120 0121 function write(obj,fid) 0122 0123 MCsquareProperties = fieldnames(obj); 0124 0125 logicalString = {'False', 'True'}; 0126 0127 for i = 1:numel(MCsquareProperties) 0128 0129 % modify fieldnames beginning with "4D" 0130 if strncmp(MCsquareProperties{i},'fourD',5) 0131 writeString = ['4D' MCsquareProperties{i}(6:end)]; 0132 else 0133 writeString = MCsquareProperties{i}; 0134 end 0135 0136 if isa(obj.(MCsquareProperties{i}),'logical') 0137 fprintf(fid,[writeString ' ' logicalString{obj.(MCsquareProperties{i})+1} '\n']); 0138 elseif isa(obj.(MCsquareProperties{i}),'double') 0139 fprintf(fid,[writeString ' ' num2str(obj.(MCsquareProperties{i})) '\n']); 0140 elseif isa(obj.(MCsquareProperties{i}),'char') 0141 fprintf(fid,[writeString ' ' obj.(MCsquareProperties{i}) '\n']); 0142 else 0143 error('export not defined'); 0144 end 0145 0146 end 0147 0148 end 0149 0150 end 0151 end 0152