matRad_setOverlapPriorities

Purpose ^

function to handle overlap priorities

Synopsis ^

function [cst,overlapPriorityCube] = matRad_setOverlapPriorities(cst,ctDim)

Description ^

 function to handle overlap priorities 
 during fluence optimization and dose calculation. If you have overlapping 
 volumes of interest you need to inform matRad to which volume(s) the 
 intersection voxels belong.
 
 call
   cst = matRad_considerOverlap(cst)
   [cst, overlapPriorityCube] = matRad_setOverlapPriorities(cst,ctDim)

 input
   cst:        cst file
   ctDim:      (optional) dimension of the ct for overlap cube claculation 

 output
   cst:                updated cst file considering overlap priorities
   overlapPriorityCube:(optional) cube visualizing the overlap priority 

 References
   -

 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

 Copyright 2015 the matRad development team. 
 
 This file is part of the matRad project. It is subject to the license 
 terms in the LICENSE file found in the top-level directory of this 
 distribution and at https://github.com/e0404/matRad/LICENSES.txt. No part 
 of the matRad project, including this file, may be copied, modified, 
 propagated, or distributed except according to the terms contained in the 
 LICENSE file.

 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

Cross-reference information ^

This function calls: This function is called by:

Source code ^

0001 function [cst,overlapPriorityCube] = matRad_setOverlapPriorities(cst,ctDim)
0002 % function to handle overlap priorities
0003 % during fluence optimization and dose calculation. If you have overlapping
0004 % volumes of interest you need to inform matRad to which volume(s) the
0005 % intersection voxels belong.
0006 %
0007 % call
0008 %   cst = matRad_considerOverlap(cst)
0009 %   [cst, overlapPriorityCube] = matRad_setOverlapPriorities(cst,ctDim)
0010 %
0011 % input
0012 %   cst:        cst file
0013 %   ctDim:      (optional) dimension of the ct for overlap cube claculation
0014 %
0015 % output
0016 %   cst:                updated cst file considering overlap priorities
0017 %   overlapPriorityCube:(optional) cube visualizing the overlap priority
0018 %
0019 % References
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 numOfCtScenarios = unique(cellfun(@(x)numel(x),cst(:,4)));
0036 
0037 if numel(numOfCtScenarios) > 1
0038     error('Inconsistent number of segmentations in cst struct.');
0039 end  
0040 
0041 for i = 1:numOfCtScenarios
0042     
0043     % consider VOI priorities
0044     for j = 1:size(cst,1)
0045          
0046         idx = cst{j,4}{i};          
0047         
0048         for k = 1:size(cst,1)
0049             if cst{k,5}.Priority < cst{j,5}.Priority && ~(j==k) && ~isempty(cst{k,6})
0050                 % remove indices from VOI with higher priority from current VOI
0051                 % if an objective has been defined
0052                 idx = setdiff(idx,cst{k,4}{i});
0053             end
0054         end
0055         
0056         cst{j,4}{i} = idx;
0057         
0058         if isempty(cst{j,4}{i}) && ~isempty(cst{j,6})
0059             error([cst{j,2} ': Objective(s) and/or constraints for inverse planning defined ' ...
0060                  'but structure overlapped by structure with higher overlap priority.' ...
0061                  'Objective(s) will not be considered during optimization']); 
0062         end
0063          
0064     end
0065 end
0066 
0067 %Calculate the overlap cube if requested
0068 if nargout == 2 && nargin == 2
0069    overlapPriorityCube = zeros(ctDim);
0070     for i = 1:size(cst,1)
0071         overlapPriorityCube(cst{i,4}{1}) = cst{i,5}.Priority;
0072     end
0073 end
0074     
0075 
0076 end
0077

| Generated by m2html © 2005