help with 3D image processing (conversion from alphashape to binary image)

9 ビュー (過去 30 日間)
simone poli
simone poli 2018 年 3 月 19 日
コメント済み: Ce xiao 2020 年 1 月 8 日
Hello everyone, since some days I'm try to solve a problem about image processing that is blocking my project.
I'm working with 3D binary images of a micro CTscan (these images are very fragmented and full of noise). I need do interpolate the external boundaries of my 3D binary image in order to avoid all the holes and cavities (made by trabeculas) that are inside my volume. I didn't use any smooth,smooth3 function because I don't want my images to get worst. What I've done is: I used alphaShape() function to create a bounding volume that envelops the set of my 3-D points and it worked well. The problem is that the image obtained is an 'AlphaShape' type and I don't know how to convert it back to a binary image, in order to make more operations on it. I tried using plot but again, the the image obtained is a 'Patch' type and I don't know how to go back to binary image. Here attached you can find the code: BWbm is the initial binary image. I also attached the image of the AlphaShape interpolation.
%With these 3 vectors I can applay alpha-shape that creates a bounding
%volume that envelops a set of 2-D or 3-D points.
%PROBLEM: how can I go back from tha alphaShape image to the binary image?
[x,y,z] = ind2sub(size(BWbm),find(BWbm == 1)); % trasform the 3D matrix in 3 vectors
z = double(z);
shp = alphaShape(x,y,z,5);
figure(4); patchimage=plot(shp); %'Patch type' image
Thanks in advance!

回答 (2 件)

Jyotish Robin
Jyotish Robin 2018 年 3 月 23 日
Hi Simone!
You can create a binary 3D image by querying coordinates of the alphaShape for every voxel representing the 3D image.
The attached MATLAB script can be helpful.
Thanks,
Jyotish
  1 件のコメント
simone poli
simone poli 2018 年 3 月 27 日
Thanks for the answer! The problem is that the volume is not rebuilt omogenously but slice by slice and the image that I obtain is not the continuous volume I was wandering. Here attached you find the image that I obtained. As you can see is the dimension of the matrix are Ok (574x525x181)but the volume is disconnected. Suggestion on how should I do? This is the code I used:
I = alphaShape2im_fast(shp,[574/2 525/2 181/2],[size(BW,1),size(BW,2),size(BW,3)]);

サインインしてコメントする。


Ce xiao
Ce xiao 2020 年 1 月 8 日
I find the same problem with simone.
@ simone , Have you found a solution?
For me ,when I plot(shp),it's looks good. But when I use alphaSahpe to output volum.
The volume is disconnected.
  1 件のコメント
Ce xiao
Ce xiao 2020 年 1 月 8 日
Ok I find the solution
Just change the value of r in alphaShape2im-fast

サインインしてコメントする。

Community Treasure Hunt

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

Start Hunting!

Translated by