matRad_calcDoseInitBeam

Purpose ^

Synopsis ^

This is a script file.

Description ^

Cross-reference information ^

This function calls: This function is called by:

Source code ^

0001 matRad_cfg.dispInfo('Beam %d of %d:\n',i,dij.numOfBeams);
0002 
0003 % remember beam and bixel number
0004 if calcDoseDirect
0005     dij.beamNum(i)    = i;
0006     dij.rayNum(i)     = i;
0007     dij.bixelNum(i)   = i;
0008 end
0009 
0010 bixelsPerBeam = 0;
0011 
0012 % convert voxel indices to real coordinates using iso center of beam i
0013 xCoordsV       = xCoordsV_vox(:)*ct.resolution.x-stf(i).isoCenter(1);
0014 yCoordsV       = yCoordsV_vox(:)*ct.resolution.y-stf(i).isoCenter(2);
0015 zCoordsV       = zCoordsV_vox(:)*ct.resolution.z-stf(i).isoCenter(3);
0016 coordsV        = [xCoordsV yCoordsV zCoordsV];
0017 
0018 xCoordsVdoseGrid = xCoordsV_voxDoseGrid(:)*dij.doseGrid.resolution.x-stf(i).isoCenter(1);
0019 yCoordsVdoseGrid = yCoordsV_voxDoseGrid(:)*dij.doseGrid.resolution.y-stf(i).isoCenter(2);
0020 zCoordsVdoseGrid = zCoordsV_voxDoseGrid(:)*dij.doseGrid.resolution.z-stf(i).isoCenter(3);
0021 coordsVdoseGrid  = [xCoordsVdoseGrid yCoordsVdoseGrid zCoordsVdoseGrid];
0022 
0023 % Get Rotation Matrix
0024 % Do not transpose matrix since we usage of row vectors &
0025 % transformation of the coordinate system need double transpose
0026 
0027 rotMat_system_T = matRad_getRotationMatrix(stf(i).gantryAngle,stf(i).couchAngle);
0028 
0029 % Rotate coordinates (1st couch around Y axis, 2nd gantry movement)
0030 rot_coordsV         = coordsV*rotMat_system_T;
0031 rot_coordsVdoseGrid = coordsVdoseGrid*rotMat_system_T;
0032 
0033 rot_coordsV(:,1) = rot_coordsV(:,1)-stf(i).sourcePoint_bev(1);
0034 rot_coordsV(:,2) = rot_coordsV(:,2)-stf(i).sourcePoint_bev(2);
0035 rot_coordsV(:,3) = rot_coordsV(:,3)-stf(i).sourcePoint_bev(3);
0036 
0037 rot_coordsVdoseGrid(:,1) = rot_coordsVdoseGrid(:,1)-stf(i).sourcePoint_bev(1);
0038 rot_coordsVdoseGrid(:,2) = rot_coordsVdoseGrid(:,2)-stf(i).sourcePoint_bev(2);
0039 rot_coordsVdoseGrid(:,3) = rot_coordsVdoseGrid(:,3)-stf(i).sourcePoint_bev(3);
0040 
0041 % calculate geometric distances
0042 geoDistVdoseGrid{1}= sqrt(sum(rot_coordsVdoseGrid.^2,2));
0043 
0044 % Calculate radiological depth cube
0045 matRad_cfg.dispInfo('matRad: calculate radiological depth cube... ');
0046 radDepthVctGrid = matRad_rayTracing(stf(i),ct,VctGrid,rot_coordsV,effectiveLateralCutoff);
0047 matRad_cfg.dispInfo('done.\n');
0048 
0049 % interpolate radiological depth cube to dose grid resolution
0050 radDepthVdoseGrid = matRad_interpRadDepth...
0051     (ct,1,VctGrid,VdoseGrid,dij.doseGrid.x,dij.doseGrid.y,dij.doseGrid.z,radDepthVctGrid);
0052  
0053 % limit rotated coordinates to positions where ray tracing is availabe
0054 rot_coordsVdoseGrid = rot_coordsVdoseGrid(~isnan(radDepthVdoseGrid{1}),:);
0055

| Generated by m2html © 2005