calculate the volume of tumor in logical image
Version 1.0.0 (1,44 ko) par
mohd akmal masud
To Compute the no. of voxel (==1) in logical/binary .mat file
%load your binary/logical image
load(logical.mat)%just example
Voxels = sum(labels(:)==1)
VoxelVol = sum((labels==1).*dV,'all');
%If you have varying size of the voxels, for example if the voxels in the first and last slices are larger than the ones in the centre, then you have to take that into account. For example if the size varies as:
[x,y,z] = meshgrid(1:130,1:130,1:36);
dV = 1 + 4/36^2*(z-18.5).^2;
% To just extract the tumor-flagged voxels from your imstack3-variable you can do just this:
Tumor_vals = imstack3(labels(:));
%If you need to find the location/indices of the tumors you can do:
[idx1] = find(labels(:));
[i1,i2,i3] = ind2sub(size(labels),idx1);
slice(double(imstack3),63,60,7),shading flat
hold on
plot3(i2,i1,i3,'r.')
Citation pour cette source
mohd akmal masud (2024). calculate the volume of tumor in logical image (https://www.mathworks.com/matlabcentral/fileexchange/119443-calculate-the-volume-of-tumor-in-logical-image), MATLAB Central File Exchange. Extrait(e) le .
Compatibilité avec les versions de MATLAB
Créé avec
R2022a
Compatible avec toutes les versions
Plateformes compatibles
Windows macOS LinuxTags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Découvrir Live Editor
Créez des scripts avec du code, des résultats et du texte formaté dans un même document exécutable.
Version | Publié le | Notes de version | |
---|---|---|---|
1.0.0 |