MATLAB: Volume Fraction for 2D image

areafractionconvert 2d to 3dvolume fraction 2d

Hello Folks,
Im newbie in matlab.
Im working on image processing of bubble. I have questions :
  1. How to calculate the volume fraction for 2D image?
  2. WHats the difference between bwarea, and just 'Area' using regionprops?
  3. Is areaFraction in 2D represent volume fraction?
  4. How to convert my 2D image to 3D?
Thank you so much
:: Vira ::

Best Answer

1) and 3):
"volume fraction" does not apply to 2D images, just like "volume" does not apply to circles or squares.
Not unless you are using "volume" as the short form of "hypervolume" as "hypervolume" is a term that is applicable to the N-dimensional integral of containment for an N-dimensional figure. "hypervolume" includes "one dimensional content" == "length" for a one dimensional object == "line", "two dimensional content" == "area" for a two dimensional object, "three dimensional content" == "volume" for a three-dimensional object, and so on. If you then relax "hypervolume" to "volume" then "volume" of a 2D object would be the same as "area" of the object.
2) The area calculation for bwarea is described at http://www.mathworks.com/help/images/ref/bwarea.html#f1-71878. The Area returned by regionprops is the number of non-zero pixels in the region.
4) How do you make a piece of paper into a book? Answer: you stack it with a number of other pieces of paper. What you stack might be copies of the original or they might be different. There are different ways you can implement depending on your intent:
%copies
Image_3D = repmat(Image_2D, 1, 1, NumberOfLayers);
or
%layer distinct existing images
Image_3D = cat(3, Image_2D_A, Image_2D_B, Image_2D_C, Image_2D_D, ...);
or
%by computation
rows = size(Image_2D,1);
cols = size(Image_2D,2);
Image_3D = zeros(rows, cols, NumberOfLayers);
Image_3D(:,:,1) = Image_2D; %put original in the first layer
for K = 2 : NumberOfLayers
%e.g., Additive Noise
Noise = rand(rows,cols) < 0.05;
Image_3D(:,:,K) = Image_2D + Noise;
end