Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Meshgrid for 3D shapes #16

Open
samomin46 opened this issue Apr 15, 2020 · 1 comment
Open

Meshgrid for 3D shapes #16

samomin46 opened this issue Apr 15, 2020 · 1 comment

Comments

@samomin46
Copy link

Hi there,

I am trying to plot the .mat file using meshgrid but output is blank. I would like to visualize the 3D shapes. You did it in the paper. Would you mind sharing code? if not could you please share anything which can help. Thnx.

@Yang7879
Copy link
Owner

Hi @samomin46 , in the paper, I use matlab to visualize the 3D voxel. Here's the code. Hope it's helpful for your research.

function mesh(vol)
    threshold=0.5;
    [d1,d2,d3]=size(vol);
    figure;
    [x,y,z]=meshgrid(1:1:d1,1:1:d2,1:1:d3);
    p1=patch(isosurface(x,y,z,vol,threshold,'noshare'));
    isonormals(x,y,z,vol,p1);
    p1.FaceColor = 'red';
    p1.EdgeColor = 'none';
    camlight;
    view(3);
    lighting gouraud;
    axis equal; 
    axis off;
end

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants