<table cellspacing="0" cellpadding="0" border="0" ><tr><td valign="top" style="font: inherit;"><PRE>Thanks Arnaud</PRE><PRE>Can we get also the curvature mean, min and max with Itk? </PRE><PRE>Martine</PRE>
<DIV><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, 15h27<BR><BR><PRE>Hi Martine,

vtkCurvatures processes vtkPolyData. Thus, if you want to compute Gaussian
curvature, you have to extract one surface from your image (e.g. by using a
Marching Cubes).

Note that you can now directly compute the Gaussian curvature of a given
surface in itk by using itk::QuadEdgeMeshDiscreteGaussianCurvatureEstimator.. The
way to estimate the Gaussian curvature is less sensitive to the connectivity
than the vtk version.

http://www.itk.org/Doxygen/html/classitk_1_1QuadEdgeMeshDiscreteGaussianCurvatureEstimator.html

Arnaud

Martine Lefevre wrote:
&gt; Hi
&gt; I try to estimate the curvature information of an object but I failed. In
run time I get vtkOutpouWindow saying there is an error in the file
vtkDemandDrivenPipeline.cxx.
&gt; My input volume is an itk image that I convert to vtk image in order to
estimate the curvature.
&gt; I paste my code here. Any help is appreciated.
&gt; Thank you.
&gt;  Regards
&gt; Martine
&gt; 
&gt;  
&gt;  
&gt; #include "itkImage.h"
&gt; #include "itkImageFileReader.h"
&gt; #include "itkImageFileWriter.h"
&gt; #include "itkVTKImageExport.h"
&gt; #include "itkVTKImageImport.h"
&gt; #include "vtkImageData.h"
&gt; #include "vtkImageImport.h"
&gt; #include "vtkImageExport.h"
&gt; #include "vtkCurvatures.h"
&gt;  // This function will connect the given itk::VTKImageExport filter to the
given vtkImageImport filter.
&gt; template &lt;typename ITK_Exporter, typename VTK_Importer&gt;
&gt; void ConnectPipelines(ITK_Exporter exporter, VTK_Importer* importer)
&gt; {
&gt;
importer-&gt;SetUpdateInformationCallback(exporter-&gt;GetUpdateInformationCallback());
&gt;
importer-&gt;SetPipelineModifiedCallback(exporter-&gt;GetPipelineModifiedCallback());
&gt;
importer-&gt;SetWholeExtentCallback(exporter-&gt;GetWholeExtentCallback());
&gt; importer-&gt;SetSpacingCallback(exporter-&gt;GetSpacingCallback());
&gt; importer-&gt;SetOriginCallback(exporter-&gt;GetOriginCallback());
&gt; importer-&gt;SetScalarTypeCallback(exporter-&gt;GetScalarTypeCallback());
&gt;
importer-&gt;SetNumberOfComponentsCallback(exporter-&gt;GetNumberOfComponentsCallback());
&gt;
importer-&gt;SetPropagateUpdateExtentCallback(exporter-&gt;GetPropagateUpdateExtentCallback());
&gt; importer-&gt;SetUpdateDataCallback(exporter-&gt;GetUpdateDataCallback());
&gt; importer-&gt;SetDataExtentCallback(exporter-&gt;GetDataExtentCallback());
&gt;
importer-&gt;SetBufferPointerCallback(exporter-&gt;GetBufferPointerCallback());
&gt; importer-&gt;SetCallbackUserData(exporter-&gt;GetCallbackUserData());
&gt; }
&gt; int main()
&gt; {
&gt; typedef float PixelType;
&gt; const unsigned int Dimension = 3;
&gt; typedef itk::Image&lt; PixelType, Dimension &gt; ImageType;
&gt; typedef itk::ImageFileReader&lt; ImageType &gt; ReaderType;
&gt; typedef itk::ImageFileWriter &lt;ImageType&gt; WriterType;
&gt; ReaderType::Pointer reader = ReaderType::New();
&gt; WriterType::Pointer writer = WriterType::New();
&gt; reader-&gt;SetFileName("C:/work/MyImages/MyObject.hdr");
&gt; // convert itk to vtk image type
&gt; typedef itk::VTKImageExport&lt; ImageType &gt; ExportFilterType;
&gt; ExportFilterType::Pointer itkExporter = ExportFilterType::New();
&gt; itkExporter-&gt;SetInput( reader-&gt;GetOutput() );
&gt; // Create the vtkImageImport and connect it to the itk::VTKImageExport
instance.
&gt; vtkImageImport* vtkImporter = vtkImageImport::New();
&gt; ConnectPipelines(itkExporter, vtkImporter);
&gt; // estimate the curvature mean
&gt; vtkCurvatures* myCurvatures= vtkCurvatures::New();
&gt; myCurvatures-&gt;SetCurvatureTypeToGaussian();
&gt; myCurvatures-&gt;SetInput(vtkImporter-&gt;GetOutput());
&gt; myCurvatures-&gt;Update();
&gt; std::cout &lt;&lt; "end of the code !" &lt;&lt; std::endl;
&gt; std::cin.get();
&gt; return 0;
&gt; }
&gt; 
&gt; 

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