[Insight-users] link error: cannot open file 'ITKReview.lib'

Arnaud Gelas arnaud_gelas at hms.harvard.edu
Mon Feb 23 09:51:52 EST 2009


Dear Martine,

There is no library for ITKReview (Note that you can see all generated 
libraries your BUILD_DIRECTORY/bin/ ), you should link instead with 
ITKQuadEdgeMesh since you want to use the QuadEdgeMeshDataStructure.
Then, in your main you should use itk::QuadEdgeMesh instead of 
itk::Mesh, if you want to estimate curvatures...

You can find examples/tests in Testing/Code/Review directory:

    * itkQuadEdgeMeshGaussianCurvatureTest.cxx
    * itkQuadEdgeMeshMeanCurvatureTest.cxx
    * itkQuadEdgeMeshMaxCurvatureTest.cxx
    * itkQuadEdgeMeshMinCurvatureTest.cxx

Have a good day,
Arnaud

Martine Lefevre wrote:
> Dear Luis and itk users,
>
> I try to do some curvature estimation using the filter proposed by 
> Gelas Arnauld which is based on a surface mesh data structure 
> itk::QuadEdgeMesh. For this reason I include the ITKReview in my 
> CMakeLists file. 
>
>  
> In building the project I get the following link error:
>
> 1>Linking...
>
> 1>     LINK : fatal error LNK1104: cannot open file 'ITKReview.lib'
>
>  
> Do you know the cause of this error?
> Thank you in advance
> Martine
> I paste the code here and the CMakeLists file.
>
>  
>
>  
>
>  
>
> # This project is designed to be built outside the Insight source tree.
>
>  
>
> PROJECT(Curvature)
>
>  
>
>  
>
> FIND_PACKAGE ( ITK)
>
> IF ( ITK_FOUND)
>
> INCLUDE( ${USE_ITK_FILE} )
>
> ENDIF( ITK_FOUND)
>
>  
>
> FIND_PACKAGE ( VTK)
>
> IF ( VTK_FOUND)
>
> INCLUDE( ${USE_VTK_FILE} )
>
> ENDIF( VTK_FOUND)
>
>  
>
> ADD_EXECUTABLE(Curvature Curvature.cxx)
>
> TARGET_LINK_LIBRARIES(Curvature ITKBasicFilters ITKReview 
> ITKSpatialObject ITKNumerics ITKIO ITKCommon ITKAlgorithms 
> vtkRendering vtkVolumeRendering vtkIO vtkWidgets vtkGraphics 
> vtkImaging vtkFiltering vtkCommon)
>
>  
>
>  
>
>  
>
>  
>
> // surface extraction with itk: itkBinaryMask3DMeshSource
>
> // SurfaceExtraction.cxx
>
>  
>
> #include "itkImageFileReader.h"
>
> #include "itkBinaryMask3DMeshSource.h"
>
> #include "itkImage.h"
>
> #include "itkMesh.h"
>
>  
>
> //#include "itkQuadEdgeMesh.h"
>
>  
>
> int main(void )
>
> {
>
>   const unsigned int Dimension = 3;
>
>   //typedef unsigned char  PixelType;
>
>   typedef float  PixelType;
>
>  
>
>   typedef itk::Image< PixelType, Dimension >   ImageType;
>
>   typedef itk::ImageFileReader< ImageType >    ReaderType;
>
>   ReaderType::Pointer reader = ReaderType::New();
>
>   reader->SetFileName("C:/Images/Volume.hdr"); 
>
>  
>
>  
>
>   try
>
>     {
>
>     reader->Update();
>
>     }
>
>   catch( itk::ExceptionObject & exp )
>
>     {
>
>     std::cerr << "Exception thrown while reading the input file " << 
> std::endl;
>
>     std::cerr << exp << std::endl;
>
>     return EXIT_FAILURE;
>
>     }
>
>  
>
>  
>
>   typedef itk::Mesh<double>                         MeshType;
>
>   typedef itk::BinaryMask3DMeshSource< ImageType, MeshType >   
> MeshSourceType;
>
>   MeshSourceType::Pointer meshSource = MeshSourceType::New();
>
>  
>
>   const PixelType objectValue = static_cast<PixelType>( 255.0);
>
>  
>
>   meshSource->SetObjectValue( objectValue );
>
>   meshSource->SetInput( reader->GetOutput() );
>
>  
>
>   try
>
>     {
>
>     meshSource->Update();
>
>     }
>
>   catch( itk::ExceptionObject & exp )
>
>     {
>
>     std::cerr << "Exception thrown during Update() " << std::endl;
>
>     std::cerr << exp << std::endl;
>
>     return EXIT_FAILURE;
>
>     }
>
>  
>
>   std::cout << "Nodes = " << meshSource->GetNumberOfNodes() << std::endl;
>
>   std::cout << "Cells = " << meshSource->GetNumberOfCells() << std::endl;
>
>   std::cout << "Code end !" << std::endl;
>
>   std::cin.get();
>
>   return EXIT_SUCCESS;
>
> }
>
>  
>
>  
>
>



More information about the Insight-users mailing list