matRad function to resize the ct to a given resolution call cst = matRad_resizeCstToGrid(cst,vXgridOld,vYgridOld,vZgridOld,vXgridNew,vYgridNew,vZgridNew) input cst: matRad cst struct vXgridOld: vector containing old spatial grid points in x [mm] vYgridOld: vector containing old spatial grid points in y [mm] vZgridOld: vector containing old spatial grid points in z [mm] vXgridNew: vector containing new spatial grid points in x [mm] vYgridNew: vector containing new spatial grid points in y [mm] vZgridNew: vector containing new spatial grid points in z [mm] output cst: updated matRad cst struct containing new linear voxel indices References - %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Copyright 2018 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_resizeCstToGrid(cst,vXgridOld,vYgridOld,vZgridOld,vXgridNew,vYgridNew,vZgridNew) 0002 % matRad function to resize the ct to a given resolution 0003 % 0004 % call 0005 % cst = matRad_resizeCstToGrid(cst,vXgridOld,vYgridOld,vZgridOld,vXgridNew,vYgridNew,vZgridNew) 0006 % 0007 % input 0008 % cst: matRad cst struct 0009 % vXgridOld: vector containing old spatial grid points in x [mm] 0010 % vYgridOld: vector containing old spatial grid points in y [mm] 0011 % vZgridOld: vector containing old spatial grid points in z [mm] 0012 % vXgridNew: vector containing new spatial grid points in x [mm] 0013 % vYgridNew: vector containing new spatial grid points in y [mm] 0014 % vZgridNew: vector containing new spatial grid points in z [mm] 0015 % 0016 % output 0017 % cst: updated matRad cst struct containing new linear voxel indices 0018 % 0019 % References 0020 % - 0021 % 0022 % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0023 % 0024 % Copyright 2018 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 0036 for i = 1:size(cst,1) 0037 for j = 1:numel(cst{i,4}) 0038 tmpCube = zeros([numel(vYgridOld) numel(vXgridOld) numel(vZgridOld)]); 0039 tmpCube(cst{i,4}{j}) = 1; 0040 cst{i,4}{j} = find(matRad_interp3(vXgridOld,vYgridOld,vZgridOld, ... 0041 tmpCube, ... 0042 vXgridNew,vYgridNew',vZgridNew,'nearest')); 0043 end 0044 end