matRad IPOPT callback: constraint function for direct aperture optimization call c = matRad_constraintFunctions(optiProb,apertureInfoVec,dij,cst) input optiProb: option struct defining the type of optimization apertueInfoVec: aperture info vector dij: dose influence matrix cst: matRad cst struct output c: value of constraints Reference [1] http://www.sciencedirect.com/science/article/pii/S0958394701000577 [2] http://www.sciencedirect.com/science/article/pii/S0360301601025858 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0001 function c = matRad_constraintFunctions(optiProb,apertureInfoVec,dij,cst) 0002 % matRad IPOPT callback: constraint function for direct aperture optimization 0003 % 0004 % call 0005 % c = matRad_constraintFunctions(optiProb,apertureInfoVec,dij,cst) 0006 % 0007 % input 0008 % optiProb: option struct defining the type of optimization 0009 % apertueInfoVec: aperture info vector 0010 % dij: dose influence matrix 0011 % cst: matRad cst struct 0012 % 0013 % output 0014 % c: value of constraints 0015 % 0016 % Reference 0017 % [1] http://www.sciencedirect.com/science/article/pii/S0958394701000577 0018 % [2] http://www.sciencedirect.com/science/article/pii/S0360301601025858 0019 % 0020 % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0021 0022 % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0023 % 0024 % Copyright 2015 the matRad development team. 0025 % 0026 % This file is part of the matRad project. It is subject to the license 0027 % terms in the LICENSE file found in the top-level directory of this 0028 % distribution and at https://github.com/e0404/matRad/LICENSES.txt. No part 0029 % of the matRad project, including this file, may be copied, modified, 0030 % propagated, or distributed except according to the terms contained in the 0031 % LICENSE file. 0032 % 0033 % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0034 0035 apertureInfo = optiProb.apertureInfo; 0036 0037 % value of constraints for leaves 0038 leftLeafPos = apertureInfoVec([1:apertureInfo.totalNumOfLeafPairs]+apertureInfo.totalNumOfShapes); 0039 rightLeafPos = apertureInfoVec(1+apertureInfo.totalNumOfLeafPairs+apertureInfo.totalNumOfShapes:end); 0040 c_dao = rightLeafPos - leftLeafPos; 0041 0042 % bixel based objective function calculation 0043 c_dos = matRad_constraintFunctions@matRad_OptimizationProblem(optiProb,apertureInfo.bixelWeights,dij,cst); 0044 0045 % concatenate 0046 c = [c_dao; c_dos];