matRad function that computes all VOI surfaces call cst = matRad_computeAllVoiSurfaces(ct,cst) input ct matRad ct struct cst matRad cst struct output cst the new cst with the column containing the precomputed surface 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. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0001 function cst = matRad_computeAllVoiSurfaces(ct,cst) 0002 % matRad function that computes all VOI surfaces 0003 % 0004 % call 0005 % cst = matRad_computeAllVoiSurfaces(ct,cst) 0006 % 0007 % input 0008 % ct matRad ct struct 0009 % cst matRad cst struct 0010 % 0011 % output 0012 % cst the new cst with the column containing the precomputed surface 0013 % 0014 % References 0015 % - 0016 % 0017 % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0018 % 0019 % Copyright 2015 the matRad development team. 0020 % 0021 % This file is part of the matRad project. It is subject to the license 0022 % terms in the LICENSE file found in the top-level directory of this 0023 % distribution and at https://github.com/e0404/matRad/LICENSES.txt. No part 0024 % of the matRad project, including this file, may be copied, modified, 0025 % propagated, or distributed except according to the terms contained in the 0026 % LICENSE file. 0027 % 0028 % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0029 0030 disp('Computing 3D Surfaces...'); 0031 0032 % initialize waitbar 0033 figureWait = waitbar(0,'Computing 3D Surfaces...'); 0034 % prevent closure of waitbar and show busy state 0035 set(figureWait,'pointer','watch'); 0036 0037 xCoord = ct.resolution.x * double(1:ct.cubeDim(2)); 0038 yCoord = ct.resolution.y * double(1:ct.cubeDim(1)); 0039 zCoord = ct.resolution.z * double(1:ct.cubeDim(3)); 0040 0041 [xMesh,yMesh,zMesh] = meshgrid(xCoord,yCoord,zCoord); 0042 0043 numVois = size(cst,1); 0044 0045 0046 0047 for s = 1:numVois 0048 mask = zeros(ct.cubeDim); % create zero cube with same dimeonsions like dose cube 0049 mask(cst{s,4}{1}) = 1; 0050 0051 %Smooth the VOI 0052 v = smooth3(mask,'gaussian',[5 5 5],2); 0053 isoSurface = isosurface(xMesh,yMesh,zMesh,v,0.5); 0054 0055 %reduce the complexity 0056 isoSurface = reducepatch(isoSurface,0.05); 0057 0058 %compute isonormals 0059 isoNormals = isonormals(xMesh,yMesh,zMesh,v,isoSurface.vertices); 0060 0061 cst{s,8}{1} = isoSurface; 0062 cst{s,8}{2} = isoNormals; 0063 matRad_progress(s,numVois); 0064 waitbar(s/numVois,figureWait); 0065 end 0066 try 0067 % wait 0.1s for closing all waitbars 0068 allWaitBarFigures = findall(0,'type','figure','tag','TMWWaitbar'); 0069 delete(allWaitBarFigures); 0070 pause(0.1); 0071 catch 0072 0073 end 0074 end 0075