matRad_MaxDVH

Purpose ^

Synopsis ^

This is a script file.

Description ^

Cross-reference information ^

This function calls: This function is called by:

Subfunctions ^

Source code ^

0001 classdef matRad_MaxDVH < DoseObjectives.matRad_DoseObjective
0002 % matRad_MaxDVH Implements a penalized maximum DVH objective
0003 %   See matRad_DoseObjective for interface description
0004 %
0005 % References
0006 %   -
0007 %
0008 % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0009 %
0010 % Copyright 2020 the matRad development team.
0011 %
0012 % This file is part of the matRad project. It is subject to the license
0013 % terms in the LICENSE file found in the top-level directory of this
0014 % distribution and at https://github.com/e0404/matRad/LICENSES.txt. No part
0015 % of the matRad project, including this file, may be copied, modified,
0016 % propagated, or distributed except according to the terms contained in the
0017 % LICENSE file.
0018 %
0019 % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0020     
0021     properties (Constant)
0022         name = 'Max DVH';
0023         parameterNames = {'d', 'V^{max}'};
0024         parameterTypes = {'dose','numeric'};
0025     end
0026     
0027     properties
0028         parameters = {30,95};
0029         penalty = 1;
0030     end
0031     
0032     methods 
0033         function obj = matRad_MaxDVH(penalty,dRef,vMaxPercent)
0034             %If we have a struct in first argument
0035             if nargin == 1 && isstruct(penalty)
0036                 inputStruct = penalty;
0037                 initFromStruct = true;
0038             else
0039                 initFromStruct = false;
0040                 inputStruct = [];
0041             end
0042             
0043             %Call Superclass Constructor (for struct initialization)
0044             obj@DoseObjectives.matRad_DoseObjective(inputStruct);
0045             
0046             %now handle initialization from other parameters
0047             if ~initFromStruct
0048                 if nargin >= 3 && isscalar(vMaxPercent)
0049                     obj.parameters{2} = vMaxPercent;
0050                 end
0051                 
0052                 if nargin >= 2 && isscalar(dRef)
0053                     obj.parameters{1} = dRef;
0054                 end
0055                 
0056                 if nargin >= 1 && isscalar(penalty)
0057                     obj.penalty = penalty;
0058                 end
0059             end
0060         end        
0061         
0062         %% Calculates the Objective Function value
0063         function fDose = computeDoseObjectiveFunction(obj,dose)                       
0064             % get reference Volume
0065             refVol = obj.parameters{2}/100;
0066             
0067             % calc deviation
0068             deviation = dose - obj.parameters{1};
0069 
0070             % calc d_ref2: V(d_ref2) = refVol
0071             d_ref2 = matRad_calcInversDVH(refVol,dose);
0072 
0073             
0074             deviation(dose < obj.parameters{1} | dose > d_ref2) = 0;
0075    
0076             % claculate objective function
0077             fDose = (obj.penalty/numel(dose))*(deviation'*deviation);
0078         end
0079         
0080         %% Calculates the Objective Function gradient
0081         function fDoseGrad   = computeDoseObjectiveGradient(obj,dose)
0082             % get reference Volume
0083             refVol = obj.parameters{2}/100;
0084             
0085             % calc deviation
0086             deviation = dose - obj.parameters{1};
0087             
0088             % calc d_ref2: V(d_ref2) = refVol
0089             d_ref2 = matRad_calcInversDVH(refVol,dose);
0090             
0091             deviation(dose < obj.parameters{1} | dose > d_ref2) = 0;
0092 
0093             % calculate delta
0094             fDoseGrad = 2 * (obj.penalty/numel(dose))*deviation;
0095         end
0096     end
0097     
0098 end

| Generated by m2html © 2005