matRad_MinDVH

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_MinDVH < DoseObjectives.matRad_DoseObjective
0002 % matRad_MinDVH Implements a penalized MinDVH 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 = 'Min DVH';
0023         parameterNames = {'d', 'V^{min}'};
0024         parameterTypes = {'dose','numeric'};
0025     end
0026     
0027     properties
0028         parameters = {60,95};
0029         penalty = 1;
0030     end
0031     
0032     methods
0033         function obj = matRad_MinDVH(penalty,dRef,vMinPercent)
0034             
0035             % if we have a struct in first argument
0036             if nargin == 1 && isstruct(penalty)
0037                 inputStruct = penalty;
0038                 initFromStruct = true;
0039             else
0040                 initFromStruct = false;
0041                 inputStruct = [];
0042             end
0043             
0044             %Call Superclass Constructor (for struct initialization)
0045             obj@DoseObjectives.matRad_DoseObjective(inputStruct);
0046             
0047             %now handle initialization from other parameters
0048             if ~initFromStruct
0049                 if nargin >= 3 && isscalar(vMinPercent)
0050                     obj.parameters{2} = vMinPercent;
0051                 end
0052                 
0053                 if nargin >= 2 && isscalar(dRef)
0054                     obj.parameters{1} = dRef;
0055                 end
0056                 
0057                 if nargin >= 1 && isscalar(penalty)
0058                     obj.penalty = penalty;
0059                 end
0060             end
0061             
0062         end        
0063         %% Calculates the Objective Function value
0064         function fDose = computeDoseObjectiveFunction(obj,dose)                       
0065             % get reference Volume
0066             refVol = obj.parameters{2}/100;
0067             
0068             % calc deviation
0069             deviation = dose - obj.parameters{1};
0070 
0071             % calc d_ref2: V(d_ref2) = refVol
0072             d_ref2 = matRad_calcInversDVH(refVol,dose);
0073 
0074             
0075             deviation(dose > obj.parameters{1} | dose < d_ref2) = 0;
0076    
0077             % claculate objective function
0078             fDose = (obj.penalty/numel(dose))*(deviation'*deviation);
0079         end
0080         
0081         %% Calculates the Objective Function gradient
0082         function fDoseGrad   = computeDoseObjectiveGradient(obj,dose)
0083             % get reference Volume
0084             refVol = obj.parameters{2}/100;
0085             
0086             % calc deviation
0087             deviation = dose - obj.parameters{1};
0088             
0089             % calc d_ref2: V(d_ref2) = refVol
0090             d_ref2 = matRad_calcInversDVH(refVol,dose);
0091             
0092             deviation(dose > obj.parameters{1} | dose < d_ref2) = 0;
0093 
0094             % calculate delta
0095             fDoseGrad = 2 * (obj.penalty/numel(dose))*deviation;
0096         end
0097     end
0098     
0099 end

| Generated by m2html © 2005