[Insight-users] Problem in running MyProject.cxx in getting started II?
Nora Nora
nora_droit at yahoo.fr
Tue Dec 30 06:55:15 EST 2008
Thanks Andinet for response,
I copied these four files in the source directory with MyProject.cxx, here is the new error message I got :
2>..\Myproject-source\myProject.cxx(10) : error C2065: 'Imagetype' : identificateur non déclaré
2>..\Myproject-source\myProject.cxx(13) : error C2955: 'itk::ImageFileReader' : l'utilisation d'une classe modèle requiert une liste d'arguments modèle
2> c:\program files\insighttoolkit-3.10.0\code\io\itkImageFileReader.h(93) : voir la déclaration de 'itk::ImageFileReader'
2>..\Myproject-source\myProject.cxx(13) : error C2653: 'readertype' : n'est pas un nom de classe ni d'espace de noms
2>..\Myproject-source\myProject.cxx(13) : error C3861: 'New' : identificateur introuvable
2>..\Myproject-source\myProject.cxx(13) : error C2514: 'itk::SmartPointer<itk::ImageFileReader<TOutputImage,ConvertPixelTraits>>' : la classe n'a aucun constructeur
2>..\Myproject-source\myProject.cxx(16) : error C2678: '->' binaire : aucun opérateur trouvé qui accepte un opérande de partie gauche de type 'itk::SmartPointer<itk::ImageFileReader<TOutputImage,ConvertPixelTraits>>' (ou il n'existe pas de conversion acceptable)
2> c:\program files\insighttoolkit-3.10.0\code\common\itkSmartPointer.h(69): peut être 'TObjectType *itk::SmartPointer<TObjectType>::operator ->(void) const'
2> lors de la tentative de mise en correspondance de la liste des arguments '(itk::SmartPointer<itk::ImageFileReader<TOutputImage,ConvertPixelTraits>>)'
2>..\Myproject-source\myProject.cxx(16) : error C2039: 'setFilename' : n'est pas membre de 'itk::SmartPointer<itk::ImageFileReader<TOutputImage,ConvertPixelTraits>>'
2>..\Myproject-source\myProject.cxx(17) : error C2678: '->' binaire : aucun opérateur trouvé qui accepte un opérande de partie gauche de type 'itk::SmartPointer<itk::ImageFileReader<TOutputImage,ConvertPixelTraits>>' (ou il n'existe pas de conversion acceptable)
2> c:\program files\insighttoolkit-3.10.0\code\common\itkSmartPointer.h(69): peut être 'TObjectType *itk::SmartPointer<TObjectType>::operator ->(void) const'
2> lors de la tentative de mise en correspondance de la liste des arguments '(itk::SmartPointer<itk::ImageFileReader<TOutputImage,ConvertPixelTraits>>)'
2>..\Myproject-source\myProject.cxx(17) : error C2039: 'GetOutput' : n'est pas membre de 'itk::SmartPointer<itk::ImageFileReader<TOutputImage,ConvertPixelTraits>>'
2>Le journal de génération a été enregistré à l'emplacement "file://c:\Documents and Settings\PC.WORK-PC\Bureau\ITK-VTK\MyProject\MyProject-Bin\myProject.dir\Debug\BuildLog.htm"
2>myProject - 9 erreur(s), 0 avertissement(s)
Is the problem in including Lib or in adding namespace?
I will appreciate you help,
Nora
--- En date de : Lun 29.12.08, Andinet Enquobahrie <andinet.enqu at kitware.com> a écrit :
De: Andinet Enquobahrie <andinet.enqu at kitware.com>
Objet: Re: [Insight-users] Problem in running MyProject.cxx in getting started II?
À: nora_droit at yahoo.fr
Date: Lundi 29 Décembre 2008, 22h14
Nora-
Copy those files into your Project source directory ( where you have MyProject.cxx ) NOT to your binary directory.
On Mon, Dec 29, 2008 at 5:04 PM, Nora Nora <nora_droit at yahoo.fr> wrote:
Hi all ITK users,
I tried to run MyProject.cxx following instructions in getting started II. Here are MyProjct.cxx and CmakeLists.txt files :
PROJECT( myProject )
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 )
INCLUDE_DIRECTORIES( ${myProject_SOURCE_DIR})
ADD_EXECUTABLE( myProject myProject.cxx )
TARGET_LINK_LIBRARIES ( myProject
ITKBasicFilters ITKCommon ITKIO
vtkRendering vtkGraphics vtkHybrid
vtkImaging vtkIO vtkFiltering vtkCommon
)
#include "itkImage.h"
#include "itkImageFileReader.h"
#include "itkImageToVTKImageFilter.h"
#include "vtkImageViewer.h"
#include "vtkRenderWindowInteractor.h"
int main( int argc, char **argv) {
typedef itk::Image<unsigned short,2> ImageType;
typedef itk::ImageFileReader<Imagetype> ReaderType;
typedef itk::ImageToVTKImageFilter<ImageType> ConnectorType;
ReaderType::Pointer reader = readertype::New();
ConnectorType::Pointer connector = ConnectorType::New();
reader->setFilename( argv[1] );
connector->SetInput( reader->GetOutput() );
vtkImageViewer * viewer = vtkImageViewer::New();
vtkRenderWindowInteractor * renderWindowInteractor =
vtkRenderWindowInteractor::New();
viewer->SetupInteractor( renderWindowInteractor );
viewer->SetInput( connector->GetOutput() );
viewer->Render();
viewer->SetColorWindow( 255 );
viewer->SetColorLevel( 128 );
renderWindowInteractor->Start();
return 0;
}
I have successively built it, but in running this error message is chown :
Myproject-source\myProject.cxx(3) : fatal error C1083: Impossible d'ouvrir le fichier include : 'itkImageToVTKImageFilter.h' : No such file or directory
I have red the response of Luis in OSdir forum to such problem that is as followed :
The files that you need are in InsightApplications/Auxiliary/vtk :
itkImageToVTKImageFilter.h
itkImageToVTKImageFilter.txx
itkVTKImageToImageFilter.h
itkVTKImageToImageFilter.txx
Copy these files into the directory where you are putting the code of your example.
So I copied these files in the generated binary directory with myProject.dsw.
But I stiil have the same error message??
Can someone help me??
Are there other examples on how connect ITK to VTK?
Thanks,
Nora
_______________________________________________
Insight-users mailing list
Insight-users at itk.org
http://www.itk.org/mailman/listinfo/insight-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20081230/c6b5d14a/attachment.htm>
More information about the Insight-users
mailing list