I am trying to do a 3D gamma comparison between two dose dicom files that I have exported from Eclipse. They have the same resolution. I use the dicomread function to store them as arrays in matlab and then try to run gamma 3D with the strMask3M variable setup to the same dimensions as the dose arrays. I end up getting an error message as it is having issues when it updates the tmpGammaV variable using doseDiffMethod = 2. I am wondering if it is having issues since it looks like my two dose matrices are not the same size. I am scratching my head a little, both dose arrays are the same size when I load them into matlab but when I run the Gamma3D function, it changes the resolution of doseArray2 matrix so it no longer matches dimensions of doseArray1 somewhere along the way. I am wondering if this is what is causing the issue. I have put a copy of the script I am trying to run below along with the associated error message. Any help would be greatly appreciated!
doseA2M = dicomread('RD.zTBLtCW.dcm');
doseB2M = dicomread('RD.zClinacLtCW.dcm');
doseA2M = permute(doseA2M,[1,2,4,3]); % this is done to change dimensions of matrix
doseB2M = permute(doseB2M,[1,2,4,3]);
% binary mask defining the region of interest
strMask3M = doseA2M.^0;
% voxel size
deltaXYZv = [0.25,0.25,0.3]; %cm
% absolute dose agreement in Gy
doseAgreement = 2; % Gy
% distance agreement in cm
distAgreement = 0.2; %cm
% maximum search distance
maxDistance = 1; %cm
% threshold to ignore values less than this
thresholdAbsolute = 0.1; % Gy
doseDiffMethod = 2;
% calculate gamma
gammaM = gammaDose3d(doseA2M, doseB2M, strMask3M, deltaXYZv, ...
doseAgreement, distAgreement, maxDistance, thresholdAbsolute, doseDiffMethod);
% plot
figure, imagesc(doseA2M-doseB2M), title('Difference')
figure, imagesc(gammaM), title('Gamma index')
Error using bsxfun
Mixed integer class inputs are not supported.
Error in gammaDose3d (line 141)
tmpGammaV = bsxfun(@plus,(tmpGammaV), (xysq +
zV(slcCount)^2) / distAgreement^2);
Error in testGamma (line 52)
gammaM = gammaDose3d(doseA2M, doseB2M, strMask3M,
deltaXYZv, ...