<table cellspacing="0" cellpadding="0" border="0" ><tr><td valign="top" style="font: inherit;"><DIV>Thanks a lot, I will extract a surface from my object and then apply the different curvature filters on it.&nbsp;</DIV>
<DIV>Best regards </DIV>
<DIV>Martine<BR><BR>--- En date de&nbsp;: <B>Lun 26.1.09, Arnaud Gelas <I>&lt;arnaud_gelas@hms.harvard.edu&gt;</I></B> a écrit&nbsp;:<BR></DIV>
<BLOCKQUOTE style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: rgb(16,16,255) 2px solid">De: Arnaud Gelas &lt;arnaud_gelas@hms.harvard.edu&gt;<BR>Objet: Re: [vtkusers] problem in estimating the curvature<BR>À: "martine_lef@yahoo.fr" &lt;martine_lef@yahoo.fr&gt;<BR>Cc: "vtk" &lt;vtkusers@vtk.org&gt;<BR>Date: Lundi 26 Janvier 2009, 15h40<BR><BR><PRE>Right, you can!
mean curvature:
http://www.itk.org/Doxygen/html/classitk_1_1QuadEdgeMeshDiscreteMeanCurvatureEstimator.html
max curvature:
http://www.itk.org/Doxygen/html/classitk_1_1QuadEdgeMeshDiscreteMaxCurvatureEstimator.html
min curvature:
http://www.itk.org/Doxygen/html/classitk_1_1QuadEdgeMeshDiscreteMinCurvatureEstimator.html

You can also refer to this paper for more information:
http://www.insight-journal.org/browse/publication/302
(The code is now part of itk)

Keep in mind that you should first extract one surface, before estimating
curvatures.

Arnaud

Martine Lefevre wrote:
&gt; Thanks Arnaud
&gt; Can we get also the curvature mean, min and max with Itk? Martine
&gt; 
&gt; --- En date de : *Lun 26.1.09, Arnaud Gelas
/&lt;arnaud_gelas@hms.harvard.edu&gt;/* a écrit :
&gt; 
&gt;     De: Arnaud Gelas &lt;arnaud_gelas@hms.harvard.edu&gt;
&gt;     Objet: Re: [vtkusers] problem in estimating the curvature
&gt;     À: "martine_lef@yahoo.fr" &lt;martine_lef@yahoo.fr&gt;
&gt;     Cc: "vtk" &lt;vtkusers@vtk.org&gt;
&gt;     Date: Lundi 26 Janvier 2009, 15h27
&gt; 
&gt;     Hi Martine,
&gt; 
&gt;     vtkCurvatures processes vtkPolyData. Thus, if you want to compute
Gaussian
&gt;     curvature, you have to extract one surface from your image (e.g. by
using a
&gt;     Marching Cubes).
&gt; 
&gt;     Note that you can now directly compute the Gaussian curvature of a
given
&gt;     surface in itk by using
itk::QuadEdgeMeshDiscreteGaussianCurvatureEstimator.. The
&gt;     way to estimate the Gaussian curvature is less sensitive to the
connectivity
&gt;     than the vtk version.
&gt; 
&gt;    
http://www.itk.org/Doxygen/html/classitk_1_1QuadEdgeMeshDiscreteGaussianCurvatureEstimator.html
&gt; 
&gt;     Arnaud
&gt; 
&gt;     Martine Lefevre wrote:
&gt;     &gt; Hi
&gt;     &gt; I try to estimate the curvature information of an object but I
failed. In
&gt;     run time I get vtkOutpouWindow saying there is an error in the file
&gt;     vtkDemandDrivenPipeline.cxx.
&gt;     &gt; My input volume is an itk image that I convert to vtk image in
order to
&gt;     estimate the curvature.
&gt;     &gt; I paste my code here. Any help is appreciated.
&gt;     &gt; Thank you.
&gt;     &gt;  Regards
&gt;     &gt; Martine
&gt;     &gt;     &gt;      &gt;      &gt; #include "itkImage.h"
&gt;     &gt; #include "itkImageFileReader.h"
&gt;     &gt; #include "itkImageFileWriter.h"
&gt;     &gt; #include "itkVTKImageExport.h"
&gt;     &gt; #include "itkVTKImageImport.h"
&gt;     &gt; #include "vtkImageData.h"
&gt;     &gt; #include "vtkImageImport.h"
&gt;     &gt; #include "vtkImageExport.h"
&gt;     &gt; #include "vtkCurvatures.h"
&gt;     &gt;  // This function will connect the given itk::VTKImageExport
filter to the
&gt;     given vtkImageImport filter.
&gt;     &gt; template &lt;typename ITK_Exporter, typename VTK_Importer&gt;
&gt;     &gt; void ConnectPipelines(ITK_Exporter exporter, VTK_Importer*
importer)
&gt;     &gt; {
&gt;     &gt;
&gt;    
importer-&gt;SetUpdateInformationCallback(exporter-&gt;GetUpdateInformationCallback());
&gt;     &gt;
&gt;    
importer-&gt;SetPipelineModifiedCallback(exporter-&gt;GetPipelineModifiedCallback());
&gt;     &gt;
&gt;    
importer-&gt;SetWholeExtentCallback(exporter-&gt;GetWholeExtentCallback());
&gt;     &gt;
importer-&gt;SetSpacingCallback(exporter-&gt;GetSpacingCallback());
&gt;     &gt; importer-&gt;SetOriginCallback(exporter-&gt;GetOriginCallback());
&gt;     &gt;
importer-&gt;SetScalarTypeCallback(exporter-&gt;GetScalarTypeCallback());
&gt;     &gt;
&gt;    
importer-&gt;SetNumberOfComponentsCallback(exporter-&gt;GetNumberOfComponentsCallback());
&gt;     &gt;
&gt;    
importer-&gt;SetPropagateUpdateExtentCallback(exporter-&gt;GetPropagateUpdateExtentCallback());
&gt;     &gt;
importer-&gt;SetUpdateDataCallback(exporter-&gt;GetUpdateDataCallback());
&gt;     &gt;
importer-&gt;SetDataExtentCallback(exporter-&gt;GetDataExtentCallback());
&gt;     &gt;
&gt;    
importer-&gt;SetBufferPointerCallback(exporter-&gt;GetBufferPointerCallback());
&gt;     &gt;
importer-&gt;SetCallbackUserData(exporter-&gt;GetCallbackUserData());
&gt;     &gt; }
&gt;     &gt; int main()
&gt;     &gt; {
&gt;     &gt; typedef float PixelType;
&gt;     &gt; const unsigned int Dimension = 3;
&gt;     &gt; typedef itk::Image&lt; PixelType, Dimension &gt; ImageType;
&gt;     &gt; typedef itk::ImageFileReader&lt; ImageType &gt; ReaderType;
&gt;     &gt; typedef itk::ImageFileWriter &lt;ImageType&gt; WriterType;
&gt;     &gt; ReaderType::Pointer reader = ReaderType::New();
&gt;     &gt; WriterType::Pointer writer = WriterType::New();
&gt;     &gt;
reader-&gt;SetFileName("C:/work/MyImages/MyObject.hdr");
&gt;     &gt; // convert itk to vtk image type
&gt;     &gt; typedef itk::VTKImageExport&lt; ImageType &gt; ExportFilterType;
&gt;     &gt; ExportFilterType::Pointer itkExporter = ExportFilterType::New();
&gt;     &gt; itkExporter-&gt;SetInput( reader-&gt;GetOutput() );
&gt;     &gt; // Create the vtkImageImport and connect it to the
itk::VTKImageExport
&gt;     instance.
&gt;     &gt; vtkImageImport* vtkImporter = vtkImageImport::New();
&gt;     &gt; ConnectPipelines(itkExporter, vtkImporter);
&gt;     &gt; // estimate the curvature mean
&gt;     &gt; vtkCurvatures* myCurvatures= vtkCurvatures::New();
&gt;     &gt; myCurvatures-&gt;SetCurvatureTypeToGaussian();
&gt;     &gt; myCurvatures-&gt;SetInput(vtkImporter-&gt;GetOutput());
&gt;     &gt; myCurvatures-&gt;Update();
&gt;     &gt; std::cout &lt;&lt; "end of the code !" &lt;&lt;
std::endl;
&gt;     &gt; std::cin.get();
&gt;     &gt; return 0;
&gt;     &gt; }
&gt;     &gt;     &gt; 
&gt;               
&gt; 

</PRE></BLOCKQUOTE></td></tr></table><br>