Draw a bounding box for a 3D plot

조회 수: 5 (최근 30일)
Mahesh Ganesan
Mahesh Ganesan 2020년 7월 21일
편집: Mahesh Ganesan 2020년 10월 31일
Hi,
I am working on a skeletonization problem and have managed to extract the skeleton of a 3D image volume. The skeleton is a 3D logical matrix. I now want to plot the skeleton as a 3D plot and do so within a bounding box. An example of what I want to achieve is shown below. It is the table of contents image for this journal article. I request the MATLAB community to please advice on how to get a plot like this. Thank you,
Mahesh
  댓글 수: 3
Tim
Tim 2020년 10월 30일
See my answer to: https://www.mathworks.com/matlabcentral/answers/631624-3d-image-production?s_tid=srchtitle , that shows 2 methods. If you are using volshow there probably isn't an easy way using line objects other than editing the values of the voxel edges. Alternatively, if your volume is small or sparse enough (looks like yours is pretty sparse) you can use something like VOXview and set 'bounding_box' to true.
Mahesh Ganesan
Mahesh Ganesan 2020년 10월 31일
편집: Mahesh Ganesan 2020년 10월 31일
Thanks for the suggestion, Tim. I will aim to give VOXview a try. Regardless, it seems to be a very useful function that might come handy. The inbuilt volshow does not offer as much control as VOXview provides.
My data are 3D arrays of the form M x N x P where M and N are 512 x 512 (mostly) and P varies anywhere from 200 - 500. The array is sparse as Tim identified. I couldn't get the final result that I wanted using any of the default 3D plotting methods in MATLAB. Instead, I followed the method of projections. I basically followed the example provided here : https://www.mathworks.com/help/matlab/ref/viewmtx.html
The perspective projection transform works great where I project both my skeleton points and the bounding box points onto a 2D plane. Adjusting the viewing angle then gets me to the final result, similar to the image I included in my original question above.

댓글을 달려면 로그인하십시오.

답변 (0개)

Community Treasure Hunt

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

Start Hunting!

Translated by