<table cellspacing="0" cellpadding="0" border="0" ><tr><td valign="top" style="font: inherit;"><FONT size=2>
<DIV></FONT><FONT color=#008000 size=2><FONT color=#008000 size=2></FONT></FONT>&nbsp;</DIV>
<DIV><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Yes I have built itk with itk_use_Review on<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p></SPAN></DIV>
<DIV><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">the previous problem was due to the use of&nbsp;class QEMeshScalarDataVTKPolyDataWriter. I replaced it by QuadEdgeMeshScalarDataVTKPolyDataWriter and the problem was resolved.<o:p></o:p></SPAN></DIV>
<DIV><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"><o:p>&nbsp;</o:p></SPAN></DIV>
<DIV><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Another question regarding the sphere data in the folder data, this data is a surface which can be use as input for curvature estimation. Am I right? <o:p></o:p></SPAN></DIV>
<DIV><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Thank you<o:p></o:p></SPAN></DIV>
<DIV>
<DIV><FONT size=2></FONT>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV><BR><BR>--- En date de&nbsp;: <B>Mar 24.2.09, Arnaud Gelas <I>&lt;arnaud_gelas@hms.harvard.edu&gt;</I></B> a écrit&nbsp;:<BR></DIV></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: compilation error in DiscreteCurvatureEstimator<BR>À: "martine_lef@yahoo.fr" &lt;martine_lef@yahoo.fr&gt;<BR>Cc: "insight itk" &lt;insight-users@itk.org&gt;, "Luis Ibanez" &lt;luis.ibanez@kitware.com&gt;<BR>Date: Mardi 24 Février 2009, 15h00<BR><BR><PRE>Hi Martine,

DiscreteCurvatureEstimators are now in Insight/Code/Review directory. To be
able to use it, you need to build itk with ITK_USE_REVIEW ON.
Could you try to copy the code from
Insight/Testing/Code/Review/itkQuadEdgeMeshGaussianCurvatureTest.cxx into your
project, please?
You would only need to change itkQuadEdgeMeshGaussianCurvatureTest by main,
then it should normally work.
If you face any problem, just let me know.

Arnaud



Martine Lefevre wrote:
&gt; Hi Arnauld and thank you for your suggestions.
&gt; I have followed what you have suggested, now I have no link problem but I
got a compilation error. I use your c++ code DiscreteCurvatureEstimator Which I
have download from the Insight journal link.
&gt; A/s soon as I instantiate an object of the class
/QEMeshScalarDataVTKPolyDataWriter(the line: WriterType::Pointer writer =
WriterType::New();)/ I get the following error:/
&gt; / /
&gt; 
&gt; Compiling...
&gt; 
&gt; 1&gt;3Dfeatures.cxx
&gt; 
&gt;
1&gt;c:\mycodes\3dfeatures\itkQEMeshScalarDataVTKPolyDataWriter.h(115)
: error C2440: 'initializing' : cannot convert from 'const
itk::MapContainer&lt;TElementIdentifier,TElement&gt; *' to
'itk::SmartPointer&lt;TObjectType&gt;'
&gt; 
&gt; 1&gt;        with
&gt; 
&gt; 1&gt;        [
&gt; 
&gt; 1&gt;           
TElementIdentifier=itk::QuadEdgeMeshExtendedTraits&lt;CoordType,3,2,CoordType,CoordType,CoordType,bool,bool&gt;::PointIdentifier,

&gt; 
&gt; 1&gt;            TElement=double
&gt; 
&gt; 1&gt;        ]
&gt; 
&gt; 1&gt;        and
&gt; 
&gt; 1&gt;        [
&gt; 
&gt; 1&gt;           
TObjectType=itk::MapContainer&lt;itk::QuadEdgeMeshExtendedTraits&lt;CoordType,3,2,CoordType,CoordType,CoordType,bool,bool&gt;::PointIdentifier,double&gt;

&gt; 
&gt; 1&gt;        ]
&gt; 
&gt; 1&gt;        No constructor could take the source type, or constructor
overload resolution was ambiguous
&gt; 
&gt; 1&gt;       
c:\mycodes\3dfeatures\itkQEMeshScalarDataVTKPolyDataWriter.h(114) :
while compiling class template member function 'void
itk::QEMeshScalarDataVTKPolyDataWriter&lt;TMesh&gt;::WritePointData(void)'
&gt; 
&gt; 1&gt;        with
&gt; 
&gt; 1&gt;        [
&gt; 
&gt; 1&gt;            TMesh=MeshType
&gt; 
&gt; 1&gt;        ]
&gt; 
&gt; 1&gt;        ..\3Dfeatures.cxx(106) : see reference to class template
instantiation 'itk::QEMeshScalarDataVTKPolyDataWriter&lt;TMesh&gt;'
being compiled
&gt; 
&gt; 1&gt;        with
&gt; 
&gt; 1&gt;        [
&gt; 
&gt; 1&gt;            TMesh=MeshType
&gt; 
&gt; 1&gt;        ]
&gt; 
&gt; 1&gt;Build log was saved at
"file://c:\mycodes\3DFeatures\Bin\3Dfeatures.dir\Debug\BuildLog.htm"
&gt; 
&gt; 1&gt;3Dfeatures - 1 error(s), 0 warning(s)
&gt; 
&gt; ========== Build: 0 succeeded, 1 failed, 1 up-to-date, 0 skipped
==========
&gt; 
&gt;   Thank you for your time
&gt;  Martine.
&gt; I paste my code here
&gt; 
&gt;  
&gt; //curvature estimation using tkQEMeshDiscreteGaussianCurvatureEstimator
&gt; 
&gt;  
&gt; #include "itkQuadEdgeMesh.h"
&gt; 
&gt; #include "itkVTKPolyDataReader.h"
&gt; 
&gt;  
&gt; #include "itkQuadEdgeMeshExtendedTraits.h"
&gt; 
&gt; #include "itkQEMeshDiscreteGaussianCurvatureEstimator.h"
&gt; 
&gt; #include "itkQEMeshDiscreteMeanCurvatureEstimator.h"
&gt; 
&gt; #include "itkQEMeshDiscreteMinCurvatureEstimator.h"
&gt; 
&gt; #include "itkQEMeshDiscreteMaxCurvatureEstimator.h"
&gt; 
&gt; #include "itkQEMeshScalarDataVTKPolyDataWriter.h"
&gt; 
&gt;  
&gt; int main( )
&gt; 
&gt; {
&gt; 
&gt;  
&gt;       int Curv_choice=0;
&gt; 
&gt;       /*  std::cout &lt;&lt;"   * 0: Gaussian"
&lt;&lt;std::endl;
&gt; 
&gt;         std::cout &lt;&lt;"   * 1: mean" &lt;&lt;std::endl;
&gt; 
&gt;         std::cout &lt;&lt;"   * 2: min" &lt;&lt;std::endl;
&gt; 
&gt;         std::cout &lt;&lt;"   * 3: max" &lt;&lt;std::endl; */
&gt; 
&gt;  
&gt;   const unsigned int Dimension = 3;
&gt; 
&gt;   typedef double CoordType;
&gt; 
&gt;  
&gt;   typedef itk::QuadEdgeMeshExtendedTraits &lt;CoordType, Dimension, 2, 
CoordType,  CoordType,  CoordType,  bool, bool &gt; Traits;
&gt; 
&gt;  
&gt;   typedef itk::QuadEdgeMesh&lt; CoordType, Dimension, Traits &gt;
MeshType;
&gt; 
&gt;   typedef
itk::QEMeshDiscreteGaussianCurvatureEstimator&lt;MeshType,MeshType&gt;
GaussianCurvatureFilterType;
&gt; 
&gt;   typedef
itk::QEMeshDiscreteMeanCurvatureEstimator&lt;MeshType,MeshType&gt; 
MeanCurvatureFilterType;
&gt; 
&gt;   typedef
itk::QEMeshDiscreteMinCurvatureEstimator&lt;MeshType,MeshType&gt; 
MinCurvatureFilterType;
&gt; 
&gt;   typedef
itk::QEMeshDiscreteMaxCurvatureEstimator&lt;MeshType,MeshType&gt;
MaxCurvatureFilterType;
&gt; 
&gt;  
&gt;   typedef itk::VTKPolyDataReader&lt; MeshType &gt; ReaderType;   
ReaderType::Pointer reader = ReaderType::New( );
&gt; 
&gt;  
&gt;  
&gt;   reader-&gt;SetFileName( "C:/Images/sphere.vtk");
&gt; 
&gt;   try
&gt; 
&gt;     {
&gt; 
&gt;     reader-&gt;Update( );
&gt; 
&gt;     }
&gt; 
&gt;   catch( itk::ExceptionObject &amp; exp )
&gt; 
&gt;     {
&gt; 
&gt;     std::cerr &lt;&lt; "Exception thrown while reading the input file
" &lt;&lt; std::endl;
&gt; 
&gt;     std::cerr &lt;&lt; exp &lt;&lt; std::endl;
&gt; 
&gt;     return EXIT_FAILURE;
&gt; 
&gt;     }
&gt; 
&gt;  
&gt;  
&gt;  
&gt;  
&gt;   MeshType::Pointer mesh = reader-&gt;GetOutput();
&gt; 
&gt;  
&gt;   GaussianCurvatureFilterType::Pointer gaussian_curvature =
GaussianCurvatureFilterType::New();
&gt; 
&gt;   MeanCurvatureFilterType::Pointer mean_curvature =
MeanCurvatureFilterType::New();
&gt; 
&gt;   MinCurvatureFilterType::Pointer  min_curvature =
MinCurvatureFilterType::New();
&gt; 
&gt;   MaxCurvatureFilterType::Pointer max_curvature =
MaxCurvatureFilterType::New();
&gt; 
&gt;  
&gt;  
&gt;   MeshType::Pointer output;
&gt; 
&gt;   std::string output_filename;
&gt; 
&gt;  
&gt;   switch(Curv_choice)
&gt; 
&gt;   {
&gt; 
&gt;     case 0:
&gt; 
&gt;       gaussian_curvature-&gt;SetInput( mesh );
&gt; 
&gt;       gaussian_curvature-&gt;Update();
&gt; 
&gt;  
&gt;       output = gaussian_curvature-&gt;GetOutput();
&gt; 
&gt;       output_filename = "gaussian_curvature..vtk";
&gt; 
&gt;       break;
&gt; 
&gt;     case 1:
&gt; 
&gt;       mean_curvature-&gt;SetInput( mesh );
&gt; 
&gt;       mean_curvature-&gt;Update();
&gt; 
&gt;  
&gt;       output = mean_curvature-&gt;GetOutput();
&gt; 
&gt;       output_filename = "mean_curvature.vtk";
&gt; 
&gt;       break;
&gt; 
&gt;     case 2:
&gt; 
&gt;       min_curvature-&gt;SetInput( mesh );
&gt; 
&gt;       min_curvature-&gt;Update();
&gt; 
&gt;  
&gt;       output = min_curvature-&gt;GetOutput();
&gt; 
&gt;       output_filename = "min_curvature.vtk";
&gt; 
&gt;       break;
&gt; 
&gt;     case 3:
&gt; 
&gt;       max_curvature-&gt;SetInput( mesh );
&gt; 
&gt;       max_curvature-&gt;Update();
&gt; 
&gt;  
&gt;       output = max_curvature-&gt;GetOutput();
&gt; 
&gt;       output_filename = "max_curvature.vtk";
&gt; 
&gt;       break;
&gt; 
&gt;     default:
&gt; 
&gt;       std::cout &lt;&lt;"The second parameter should be in between 0
and 3"
&gt; 
&gt;         &lt;&lt;std::endl;
&gt; 
&gt;       return EXIT_FAILURE;
&gt; 
&gt;   }
&gt; 
&gt;  
&gt;   typedef itk::QEMeshScalarDataVTKPolyDataWriter&lt; MeshType &gt;
WriterType;
&gt; 
&gt;   WriterType::Pointer writer = WriterType::New();
&gt; 
&gt;   writer-&gt;SetInput( output );
&gt; 
&gt;   writer-&gt;SetFileName( output_filename );
&gt; 
&gt;   writer-&gt;Update();
&gt; 
&gt;  
&gt;   return EXIT_SUCCESS;
&gt; 
&gt; }
&gt; 
&gt;  
&gt; 
&gt; --- En date de : *Lun 23.2.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: [Insight-users] link error: cannot open file
&gt;     'ITKReview.lib'
&gt;     À: "martine_lef@yahoo.fr" &lt;martine_lef@yahoo.fr&gt;
&gt;     Cc: "insight itk" &lt;insight-users@itk.org&gt;, "Luis
Ibanez"
&gt;     &lt;luis.ibanez@kitware.com&gt;
&gt;     Date: Lundi 23 Février 2009, 14h51
&gt; 
&gt;     Dear Martine,
&gt; 
&gt;     There is no library for ITKReview (Note that you can see all generated
&gt;     libraries your BUILD_DIRECTORY/bin/ ), you should link instead with
&gt;     ITKQuadEdgeMesh since you want to use the QuadEdgeMeshDataStructure.
&gt;     Then, in your main you should use itk::QuadEdgeMesh instead of
itk::Mesh, if
&gt;     you want to estimate curvatures...
&gt; 
&gt;     You can find examples/tests in Testing/Code/Review directory:
&gt; 
&gt;        * itkQuadEdgeMeshGaussianCurvatureTest.cxx
&gt;        * itkQuadEdgeMeshMeanCurvatureTest.cxx
&gt;        * itkQuadEdgeMeshMaxCurvatureTest.cxx
&gt;        * itkQuadEdgeMeshMinCurvatureTest.cxx
&gt; 
&gt;     Have a good day,
&gt;     Arnaud
&gt; 
&gt;     Martine Lefevre wrote:
&gt;     &gt; Dear Luis and itk users,
&gt;     &gt;     &gt; I try to do some curvature estimation using the filter
proposed by Gelas
&gt;     Arnauld which is based on a surface mesh data structure
itk::QuadEdgeMesh. For
&gt;     this reason I include the ITKReview in my CMakeLists file.     &gt; 
In building the project I get the following link error:
&gt;     &gt;     &gt; 1&gt;Linking...
&gt;     &gt;     &gt; 1&gt;     LINK : fatal error LNK1104: cannot open file
&gt;     'ITKReview.lib'
&gt;     &gt;     &gt;  Do you know the cause of this error?
&gt;     &gt; Thank you in advance
&gt;     &gt; Martine
&gt;     &gt; I paste the code here and the CMakeLists file.
&gt;     &gt;     &gt;      &gt;      &gt;      &gt; # This project is designed
to be built outside the Insight source tree..
&gt;     &gt;     &gt;      &gt; PROJECT(Curvature)
&gt;     &gt;     &gt;      &gt;      &gt; FIND_PACKAGE ( ITK)
&gt;     &gt;     &gt; IF ( ITK_FOUND)
&gt;     &gt;     &gt; INCLUDE( ${USE_ITK_FILE} )
&gt;     &gt;     &gt; ENDIF( ITK_FOUND)
&gt;     &gt;     &gt;      &gt; FIND_PACKAGE ( VTK)
&gt;     &gt;     &gt; IF ( VTK_FOUND)
&gt;     &gt;     &gt; INCLUDE( ${USE_VTK_FILE} )
&gt;     &gt;     &gt; ENDIF( VTK_FOUND)
&gt;     &gt;     &gt;      &gt; ADD_EXECUTABLE(Curvature Curvature.cxx)
&gt;     &gt;     &gt; TARGET_LINK_LIBRARIES(Curvature ITKBasicFilters
ITKReview ITKSpatialObject
&gt;     ITKNumerics ITKIO ITKCommon ITKAlgorithms vtkRendering
vtkVolumeRendering vtkIO
&gt;     vtkWidgets vtkGraphics vtkImaging vtkFiltering vtkCommon)
&gt;     &gt;     &gt;      &gt;      &gt;      &gt;      &gt; // surface
extraction with itk: itkBinaryMask3DMeshSource
&gt;     &gt;     &gt; // SurfaceExtraction.cxx
&gt;     &gt;     &gt;      &gt; #include "itkImageFileReader.h"
&gt;     &gt;     &gt; #include "itkBinaryMask3DMeshSource.h"
&gt;     &gt;     &gt; #include "itkImage.h"
&gt;     &gt;     &gt; #include "itkMesh.h"
&gt;     &gt;     &gt;      &gt; //#include "itkQuadEdgeMesh.h"
&gt;     &gt;     &gt;      &gt; int main(void )
&gt;     &gt;     &gt; {
&gt;     &gt;     &gt;   const unsigned int Dimension = 3;
&gt;     &gt;     &gt;   //typedef unsigned char  PixelType;
&gt;     &gt;     &gt;   typedef float  PixelType;
&gt;     &gt;     &gt;      &gt;   typedef itk::Image&lt; PixelType, Dimension
&gt;   ImageType;
&gt;     &gt;     &gt;   typedef itk::ImageFileReader&lt; ImageType &gt;   
ReaderType;
&gt;     &gt;     &gt;   ReaderType::Pointer reader = ReaderType::New();
&gt;     &gt;     &gt;  
reader-&gt;SetFileName("C:/Images/Volume.hdr");     &gt;      &gt;    
 &gt;   try
&gt;     &gt;     &gt;     {
&gt;     &gt;     &gt;     reader-&gt;Update();
&gt;     &gt;     &gt;     }
&gt;     &gt;     &gt;   catch( itk::ExceptionObject &amp; exp )
&gt;     &gt;     &gt;     {
&gt;     &gt;     &gt;     std::cerr &lt;&lt; "Exception thrown while
reading the input file
&gt;     " &lt;&lt; std::endl;
&gt;     &gt;     &gt;     std::cerr &lt;&lt; exp &lt;&lt; std::endl;
&gt;     &gt;     &gt;     return EXIT_FAILURE;
&gt;     &gt;     &gt;     }
&gt;     &gt;     &gt;      &gt;      &gt;   typedef itk::Mesh&lt;double&gt;   
                     MeshType;
&gt;     &gt;     &gt;   typedef itk::BinaryMask3DMeshSource&lt; ImageType,
MeshType &gt;      MeshSourceType;
&gt;     &gt;     &gt;   MeshSourceType::Pointer meshSource =
MeshSourceType::New();
&gt;     &gt;     &gt;      &gt;   const PixelType objectValue =
static_cast&lt;PixelType&gt;( 255.0);
&gt;     &gt;     &gt;      &gt;   meshSource-&gt;SetObjectValue( objectValue
);
&gt;     &gt;     &gt;   meshSource-&gt;SetInput( reader-&gt;GetOutput() );
&gt;     &gt;     &gt;      &gt;   try
&gt;     &gt;     &gt;     {
&gt;     &gt;     &gt;     meshSource-&gt;Update();
&gt;     &gt;     &gt;     }
&gt;     &gt;     &gt;   catch( itk::ExceptionObject &amp; exp )
&gt;     &gt;     &gt;     {
&gt;     &gt;     &gt;     std::cerr &lt;&lt; "Exception thrown during
Update() "
&gt;     &lt;&lt; std::endl;
&gt;     &gt;     &gt;     std::cerr &lt;&lt; exp &lt;&lt; std::endl;
&gt;     &gt;     &gt;     return EXIT_FAILURE;
&gt;     &gt;     &gt;     }
&gt;     &gt;     &gt;      &gt;   std::cout &lt;&lt; "Nodes = "
&lt;&lt;
&gt;     meshSource-&gt;GetNumberOfNodes() &lt;&lt; std::endl;
&gt;     &gt;     &gt;   std::cout &lt;&lt; "Cells = " &lt;&lt;
&gt;     meshSource-&gt;GetNumberOfCells() &lt;&lt; std::endl;
&gt;     &gt;     &gt;   std::cout &lt;&lt; "Code end !" &lt;&lt;
std::endl;
&gt;     &gt;     &gt;   std::cin.get();
&gt;     &gt;     &gt;   return EXIT_SUCCESS;
&gt;     &gt;     &gt; }
&gt;     &gt;     &gt;      &gt;      &gt; 
&gt;               
&gt; 

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