- Compute the volume of the masked region in each image slice by multiplying the number of non-zero pixels with the thickness of the slice (assumed 1px).
- Sum up the volumes of each individual image slice to obtain the overall volume.
How to calculate the volume image segmentation.
17 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Dear All,
I have set Images as attached (matlab.mat)
. Then I upload in Volume Viewer Apps. Anyone know how to calculate the volume it self as picture?
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1019290/image.jpeg)
0 comentarios
Respuestas (1)
VINAYAK LUHA
el 28 de Sept. de 2023
Editada: VINAYAK LUHA
el 28 de Sept. de 2023
Hi Mohd,
I understand that you want to determine the total volume created by a series of masked images.
You can achieve this in the following manner:
The code snippet of the steps mentioned above can be seen below:
data = load("vol.mat");
stackedImages = data.I131256;
sliceThickness=1;
volume =0;
for i=1:24
volume=volume + nnz(stackedImages(:,:,12))*sliceThickness;
end
disp("Volume of the object:"+num2str(volume)+" cubic pixels");
Hope this helps.
Regards,
Vinayak Luha
0 comentarios
Ver también
Categorías
Más información sobre Image Processing Toolbox en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!