Calculating Volume of Tumor

7 views (last 30 days)
Sayali Lopez
Sayali Lopez on 28 Nov 2014
Commented: Sayali Lopez on 28 Nov 2014
Hie, i am a PG student working on a project detection of tumor from a sequence of MRI slices. After detecting the tumor from the slices, i calculate the volume of tumor. can any one help me out with the code for calculating the volume. i have this code for calculating the volume could u help me understand this code. i didnt understand what does "level" mean. Please helpme understand the code. i am new to MATLAB.
function [tumorvolume,flag] = volumetumor(handles)
% % % handles % % % pause
delxx = handles.delxx;
delyy = handles.delyy;
delzz = handles.delzz;
imagedata = handles.onlytumor;
[nx,ny,nz] = size(imagedata);
level = 3;
tumorvolume = 0.0;
%%imagedata(:,:,1)
for k=1:nz
BW =(imagedata(:,:,k)>level);
total = bwarea(BW);
tumorvolume =tumorvolume+total*delxx*delyy*delzz;
end
tumorvolume; flag =1;

Accepted Answer

Guillaume
Guillaume on 28 Nov 2014
Looks like level is simply threshold for binarisation. Any pixel whose intensity is smaller or equal to level is considered background (set to 0) any pixel above is the tumor (set to 1).
Once each slice has been binarised, its area is calculated with bwarea (read its help to understand how that works, the algorithm is described). It's converted to a volume by multiplying it by delxx*delyy*delzz which I presume is the scale/distance of your images in the x,y,z directions.

More Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!