File Exchange

image thumbnail

Surface Curvature

version 1.0 (1.77 KB) by

Vectorized surface curvature computation

4.78261
24 Ratings

52 Downloads

Updated

No License

[K,H,P1,P2] = surfature(X,Y,Z) returns the gaussian curvature of a surface (K), mean curvature (H), and principal curvatures (P1,P2). The inputs (X,Y,Z) are 2D arrays corresponding to the surface being analyzed.

Example
[X,Y,Z] = peaks;
[K,H,P1,P2] = surfature(X,Y,Z);
surf(X,Y,Z,H,'facecolor','interp');
set(gca,'clim',[-1,1])

Comments and Ratings (33)

Ahmad Faraz

masyrezaei

hi, what is 2d array, X, Y , Z are 1d array corresponding to coordinates. what is 2d array for them?
thanks

hassan obeid

jiang

jiang (view profile)

it works very well, thanks!

I will be very grateful if you inform me about the reference to this implementatiion.

Hi Andres,

Thank you very much for implementing these curvatures measures, it has been really helpful.
Is there any reference specific to this implementation?

Kind regards,
Catarina

Nadal

Nadal (view profile)

Hi Andres,

Getting following error:
Error in ==> gradient at 49
[msg,f,ndim,loc,rflag] = parse_inputs(f,varargin);
Too many outputs

Can you just share a sample example showing how to pass parameters to run the code.

Andres Cruz

it works quite well aparently, will test more surfaces

Liam Morrow

Perfect!

Hongli Yang

Hongli Yang

try to contact author, but email expired
do someone knows what the sign here means, for each point, the curvature could be positive or negative. If we want to have a mean curvature of the whole surface, should we consider the sign or not?

Othmani

I am trying to run the code with 3D data but I gets this problem :
Error in ==> gradient at 49
[msg,f,ndim,loc,rflag] = parse_inputs(f,varargin);

??? Output argument "varargout{2}" (and maybe others) not assigned during call to "C:\Program
Files\MATLAB\R2010a\toolbox\matlab\datafun\gradient.m>gradient".

Error in ==> surfature at 11
[Xu,Xv] = gradient(X);

abuzer

abuzer (view profile)

thank you for code however it does not run for 3D data and the error occured.

Error in gradient (line 49)
[err,f,ndim,loc,rflag] = parse_inputs(f,varargin);

dong

dong (view profile)

Ahmad

Ahmad (view profile)

this is that I want i.e. all types of curvature.
BUT(!) I have a point cloud that every point have x,y&z(3D coordinate).
Can I calculate curvature of each point?
If yes then how?
thank U

Daniel

Daniel (view profile)

Caitlin

I am also wondering what the 2D input arrays corresponding to the surface are?

soudeh

soudeh (view profile)

Thank you for your code,
I am trying to obtain the principal curvatures (K1,K2) for each voxels(x,y,z) of a 3d image that has an intensity value. These values are calculated based on Gaussian and mean curvatures . How can I use your code in order to get my results.

bnu

bnu (view profile)

very good,thanks a lot!!

vinu arasu

Could you please explain what is 2D arrays corresponding to the surface being analyzed??

Lucas Lorensi

Excellent! Is there a way to compute principal directions?

Ted Teng

By definition, H>0 for convex surface, so it seems negative Z corresponding to convex?

Jason Zhang

Cool, see how it works!

krog babuz'

Hi, could you please specify what the 2D arrays for X,Y,Z actually are?

Su Ping

cool, I'm looking for this

ewe wewe

Giancanio Sileo

Very good tool for curvature computation.

Michael Girard

COOL

mustafa yagci

Tao Ye

i've been trying to find code to perform some computational geometry tasks, this one is very much helpful. Thank you.

MATLAB Release
MATLAB 7 (R14)

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video