Issue with Gamma3D function

106 views
Skip to first unread message

P Mcg

unread,
Feb 28, 2021, 9:28:43 PM2/28/21
to CERR FORUM
Hello,

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!

Thanks 

P






##################################################
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')

#######################

resulting error message when script is run in matlab:

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, ... 




Aditya Apte

unread,
Mar 2, 2021, 10:16:09 AM3/2/21
to cerr-...@googlegroups.com
Hi P,

I see a couple of issues:
1> dicomeread(doseFile) will not produce dose in Gy. GoseGridScaling needs to be applied to the results of dicomread.
e.g. doseV = dicomread(DOSE.file); doseV = single(doseV) * dGS;
2> The error might be due to mismatched data types. gammaDose3d.m expects doseArray1 and doseArray2 to be of data type "single".

Can you try importing the DICOM dataset to planC format and running the computation form Dose --> Gamma 3D.

-Aditya


--
You received this message because you are subscribed to the Google Groups "CERR FORUM" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cerr-forum+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/cerr-forum/31067262-fd56-4a1c-baee-0f4b6c9abd9dn%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages