matRad_MinMaxMeanDose

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_MinMaxMeanDose < DoseConstraints.matRad_DoseConstraint
0002     % matRad_MinMaxMeanDose Implements a MinMaxMeanDose constraint
0003     %   See matRad_DoseConstraint 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 = 'mean dose constraint';
0023         parameterNames = {'\mu_d^{min}', '\mu_d^{max}'};
0024         %parameterIsDose = logical([1 1]);
0025         parameterTypes = {'dose','dose'};
0026     end
0027     
0028     properties
0029         parameters = {0,30};
0030     end
0031     
0032     methods
0033         function obj = matRad_MinMaxMeanDose(minMeanDose,maxMeanDose)
0034             
0035             %If we have a struct in first argument
0036             if nargin == 1 && isstruct(minMeanDose)
0037                 initFromStruct = true;
0038                 inputStruct = minMeanDose;
0039             else
0040                 initFromStruct = false;
0041                 inputStruct = [];
0042             end
0043             
0044             % Call Superclass Constructor (for struct initialization)
0045             obj@DoseConstraints.matRad_DoseConstraint(inputStruct);
0046             
0047             % now handle initialization from other parameters
0048             if ~initFromStruct
0049                 
0050                 if nargin == 2 && isscalar(maxMeanDose)
0051                     obj.parameters{2} = maxMeanDose;
0052                 end
0053                 
0054                 if nargin >= 1 && isscalar(minMeanDose)
0055                     obj.parameters{1} = minMeanDose;
0056                 end
0057                 
0058             end
0059         end
0060         
0061         function cu = upperBounds(obj,n)
0062             cu = obj.parameters{2};
0063         end
0064         function cl = lowerBounds(obj,n)
0065             cl = obj.parameters{1};
0066         end
0067         
0068         %Overloads the struct function to add constraint specific
0069         %parameters
0070         function s = struct(obj)
0071             s = struct@DoseConstraints.matRad_DoseConstraint(obj);
0072             %Nothing to do here...
0073         end
0074         
0075         
0076         %% Calculates the Constraint Function value
0077         function cDose = computeDoseConstraintFunction(obj,dose)
0078             cDose = mean(dose);
0079         end
0080         
0081         %% Calculates the Constraint jacobian
0082         function cDoseJacob  = computeDoseConstraintJacobian(obj,dose)
0083             cDoseJacob = ones(numel(dose),1)./numel(dose);
0084         end
0085     end
0086     
0087 end
0088 
0089

| Generated by m2html © 2005