.mat file w/ vertices of 3D image inputted into axes in GUI

3 views (last 30 days)
I have a GUI with an axes box, and I have a file V.mat which contains the vertices of a 3D image. How do I make this 3D image show up in the axes?
  3 Comments
Golnar
Golnar on 27 Mar 2014
"a point cloud" [x, y, z] of a pressure ulcer, obtained by projecting Structured Light patterns on a wound and capturing via webcam the distortions in the pattern

Sign in to comment.

Accepted Answer

Walter Roberson
Walter Roberson on 27 Mar 2014
pointsize = 20; %adjust as needed
scatter3(V.mat(:,1), V.mat(:,2), V.mat(:,3), pointsize)
However I am confused now about whether it is [x, y, z] coordinates, or if it is "0's and 1's": if it is 0's and 1's then it is not clear what the x y or z values would be.
  6 Comments
Joseph Cheng
Joseph Cheng on 28 Mar 2014
size represents the size of the point in the scatter plot
Walter Roberson
Walter Roberson on 28 Mar 2014
Edited: Walter Roberson on 28 Mar 2014
You had posted "V.mat is a 49358 x 3 matrix of 0's and 1's" so yes, I did mean V.mat
Perhaps what you meant was that the file V.mat contains a variable that has that structure. If so then we would need to know the name of the variable in order to code appropriately. You can use
whos -file V.mat
in order to see the list of variables in the file.
With regards to loading the data in one place and plotting it in another:
I still don't understand how your (x,y,z) and color are to relate together to be plotted.

Sign in to comment.

More Answers (1)

Joseph Cheng
Joseph Cheng on 28 Mar 2014
From your screenshot you will not be able to do it there. Are you trying to plot this when it opens? Push of a button?
Where ever you are trying to do this you need to do something like this
handles.axes1; %handles. (tag of the axes)
pointsize=20;
scatter3(V(:,1),V(:,2),V(:,3),pointsize);
now depending on where you want to do this you'll need to do it when V is defined.
When/where do you want to plot the scatter? and when/where/how is V.mat loaded?
  8 Comments
Golnar
Golnar on 28 Mar 2014
Edited: Walter Roberson on 28 Mar 2014
Joseph, I'm waiting on some more files before attempting to run it through the GUI. For now I'm going to just manually try and get the plot.
pointsize=20;
scatter3(V(:,1),V(:,2),V(:,3),pointsize);
returns this:
I have a COLOR.mat and an index.mat file as well that I'm now thinking relate to making this work. This is COLOR:
This is index.mat (just 1-49358):
Joseph Cheng
Joseph Cheng on 28 Mar 2014
oh ok, check back when you get more stuff. i just wasn't sure what type of 3d plot with that much data and i see you only had 3 unique points.

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!