[vtkusers] Mean Curvature

Gorman, Gerard g.gorman at imperial.ac.uk
Tue Jul 5 12:11:39 EDT 2005


It is a bug in VTK. It always gives you a determinant of zero when you extract tensor components. On inspection of file

./VTK/Graphics/vtkExtractTensorComponents.cxx

you see:
  else //VTK_EXTRACT_EFFECTIVE_DETERMINANT
        {
        }

ie. the determinant is simply not evaluated.

The fix is

 else //VTK_EXTRACT_EFFECTIVE_DETERMINANT
        {
         s = tensor[0]*(tensor[4]*tensor[8]-tensor[5]*tensor[7]) -
             tensor[1]*(tensor[3]*tensor[8]-tensor[5]*tensor[6]) +
             tensor[2]*(tensor[3]*tensor[7]-tensor[4]*tensor[6]);
        }

Cheers
Gerard.

-----Original Message-----
From: vtkusers-bounces+g.gorman=imperial.ac.uk at vtk.org on behalf of Philip Batchelor
Sent: Tue 7/5/2005 4:23 PM
To: Prathap Nair
Cc: vtkusers at vtk.org
Subject: Re: [vtkusers] Mean Curvature
 
Hi

I am not sure why you get this, would need to see the data I guess. 
There are some 'constant mean curvature' surfaces, but if you found one 
by luck, you'll make
 many researchers in maths very jealous...

NB: the curvatures class are meant to be upgraded to have a more general 
structure, and include tensor computations, which would give access to 
principal curvatures directly.
In the meantime, you are welcome to try this temporary class (with 
proviso that it is rather untested).

Ph


Prathap Nair wrote:

> Hello,
>  
> I am using VTK 4.2 on Windows XP with VC++ 6.0 and am relatively new 
> to VTK. I am doing a project where I have to register two 2.5 D scans 
> (two surfaces) which are in wavefront obj format. I have had no 
> problems so far in terms of rendering or implementation of the 
> Iterative Closest Point Transform.
>  
> Now i need to implement a landmark detection algorithm that needs the 
> values of Gaussian and Mean curvatures at each point of the surface. I 
> have written the code using the VTK class vtkCurvatures and it 
> compiles and runs error free. I am able to get values for Gaussian 
> curvature, but for mean curvature i get the value zero at all points 
> of the scan. Snippet of my code is provided below, if anyone has faced 
> this problem before or knows what I am doing wrong, please please let 
> me know.
>  
> Thanks in advance.
>  
> Regards,
>  
> Prathap Nair
> Dept of Electronic Engineering,
> Queen Mary, University of London,
> Mile End Road, London E1 4NS (UK).
>  
> /************************Code Snippet***************/
>  
> //face 3 is a polydata object containing the surface
> this->face3->DeepCopy(face2->GetOutput());
>  
> //Get the Mean curvature and store in vtkDoubleArray "mvals"
> this->curvm->SetInput(this->face3);                   //curvm is an 
> object of vtkCurvatures
> this->curvm->SetCurvatureTypeToMean();
> this->curvm->Update();
> this->mvals->DeepCopy(curvm->GetOutput()->GetPointData()->GetScalars());
> //Get the Gaussian curvature and store in vtkDoubleArray "gvals"
> this->curvg->SetInput(this->face3);                    //curvg is an 
> object of vtkCurvatures
> this->curvg->SetCurvatureTypeToGaussian();
> this->curvg->Update();
> this->gvals->DeepCopy(curvg->GetOutput()->GetPointData()->GetScalars());
>
>------------------------------------------------------------------------
>
>_______________________________________________
>This is the private VTK discussion list. 
>Please keep messages on-topic. Check the FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
>Follow this link to subscribe/unsubscribe:
>http://www.vtk.org/mailman/listinfo/vtkusers
>  
>


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20050705/9d42677e/attachment.htm>


More information about the vtkusers mailing list