<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="Generator" CONTENT="MS Exchange Server version 6.5.7226.0">
<TITLE>RE: [vtkusers] Mean Curvature</TITLE>
</HEAD>
<BODY>
<!-- Converted from text/plain format -->
<P><FONT SIZE=2>It is a bug in VTK. It always gives you a determinant of zero when you extract tensor components. On inspection of file<BR>
<BR>
./VTK/Graphics/vtkExtractTensorComponents.cxx<BR>
<BR>
you see:<BR>
else //VTK_EXTRACT_EFFECTIVE_DETERMINANT<BR>
{<BR>
}<BR>
<BR>
ie. the determinant is simply not evaluated.<BR>
<BR>
The fix is<BR>
<BR>
else //VTK_EXTRACT_EFFECTIVE_DETERMINANT<BR>
{<BR>
s = tensor[0]*(tensor[4]*tensor[8]-tensor[5]*tensor[7]) -<BR>
tensor[1]*(tensor[3]*tensor[8]-tensor[5]*tensor[6]) +<BR>
tensor[2]*(tensor[3]*tensor[7]-tensor[4]*tensor[6]);<BR>
}<BR>
<BR>
Cheers<BR>
Gerard.<BR>
<BR>
-----Original Message-----<BR>
From: vtkusers-bounces+g.gorman=imperial.ac.uk@vtk.org on behalf of Philip Batchelor<BR>
Sent: Tue 7/5/2005 4:23 PM<BR>
To: Prathap Nair<BR>
Cc: vtkusers@vtk.org<BR>
Subject: Re: [vtkusers] Mean Curvature<BR>
<BR>
Hi<BR>
<BR>
I am not sure why you get this, would need to see the data I guess.<BR>
There are some 'constant mean curvature' surfaces, but if you found one<BR>
by luck, you'll make<BR>
many researchers in maths very jealous...<BR>
<BR>
NB: the curvatures class are meant to be upgraded to have a more general<BR>
structure, and include tensor computations, which would give access to<BR>
principal curvatures directly.<BR>
In the meantime, you are welcome to try this temporary class (with<BR>
proviso that it is rather untested).<BR>
<BR>
Ph<BR>
<BR>
<BR>
Prathap Nair wrote:<BR>
<BR>
> Hello,<BR>
> <BR>
> I am using VTK 4.2 on Windows XP with VC++ 6.0 and am relatively new<BR>
> to VTK. I am doing a project where I have to register two 2.5 D scans<BR>
> (two surfaces) which are in wavefront obj format. I have had no<BR>
> problems so far in terms of rendering or implementation of the<BR>
> Iterative Closest Point Transform.<BR>
> <BR>
> Now i need to implement a landmark detection algorithm that needs the<BR>
> values of Gaussian and Mean curvatures at each point of the surface. I<BR>
> have written the code using the VTK class vtkCurvatures and it<BR>
> compiles and runs error free. I am able to get values for Gaussian<BR>
> curvature, but for mean curvature i get the value zero at all points<BR>
> of the scan. Snippet of my code is provided below, if anyone has faced<BR>
> this problem before or knows what I am doing wrong, please please let<BR>
> me know.<BR>
> <BR>
> Thanks in advance.<BR>
> <BR>
> Regards,<BR>
> <BR>
> Prathap Nair<BR>
> Dept of Electronic Engineering,<BR>
> Queen Mary, University of London,<BR>
> Mile End Road, London E1 4NS (UK).<BR>
> <BR>
> /************************Code Snippet***************/<BR>
> <BR>
> //face 3 is a polydata object containing the surface<BR>
> this->face3->DeepCopy(face2->GetOutput());<BR>
> <BR>
> //Get the Mean curvature and store in vtkDoubleArray "mvals"<BR>
> this->curvm->SetInput(this->face3); //curvm is an<BR>
> object of vtkCurvatures<BR>
> this->curvm->SetCurvatureTypeToMean();<BR>
> this->curvm->Update();<BR>
> this->mvals->DeepCopy(curvm->GetOutput()->GetPointData()->GetScalars());<BR>
> //Get the Gaussian curvature and store in vtkDoubleArray "gvals"<BR>
> this->curvg->SetInput(this->face3); //curvg is an<BR>
> object of vtkCurvatures<BR>
> this->curvg->SetCurvatureTypeToGaussian();<BR>
> this->curvg->Update();<BR>
> this->gvals->DeepCopy(curvg->GetOutput()->GetPointData()->GetScalars());<BR>
><BR>
>------------------------------------------------------------------------<BR>
><BR>
>_______________________________________________<BR>
>This is the private VTK discussion list.<BR>
>Please keep messages on-topic. Check the FAQ at: <A HREF="http://www.vtk.org/Wiki/VTK_FAQ">http://www.vtk.org/Wiki/VTK_FAQ</A><BR>
>Follow this link to subscribe/unsubscribe:<BR>
><A HREF="http://www.vtk.org/mailman/listinfo/vtkusers">http://www.vtk.org/mailman/listinfo/vtkusers</A><BR>
> <BR>
><BR>
<BR>
<BR>
</FONT>
</P>
</BODY>
</HTML>