<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Nora, <div><br></div><div>there are 3 bugs in your code:</div><div><blockquote type="cite"><span class="Apple-style-span" style="color: rgb(0, 0, 0); "><pre>> typedef itk::ImageFileReader<Imagetype> ReaderType;</pre></span></blockquote>should be </div><div>typedef itk::ImageFileReader<ImageType> ReaderType; </div><div>Node the ImageType with the capital letters. </div><div><br></div><div>the others are </div><div><div>ReaderType::Pointer reader = ReaderType::New(); //</div><div>and reader->SetFileName. </div><div><br></div><div>Your code should compile after you take care of these. </div><div><br></div><div>Cagatay Bilgin</div><div><br></div><div><br></div></div><div><br></div><div><div><div>On Dec 30, 2008, at 8:58 AM, Nora Nora wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><table cellspacing="0" cellpadding="0" border="0" style="position: static; z-index: auto; "><tbody><tr><td valign="top" style="font: inherit;"><div><br>Dear Andinet,</div> <div> </div> <div>I got the error message posted in the last email when trying to run a new build. I have just repeated the building processus after deleting the first binary directory and copying the four files in source directory. Here is the error message wich is the same :</div> <div>I can't advance in my registration project without resolving this problem. May be the problem is in visual C++ version?As <font size="2">itkImageToVTKImageFilter.h is a part of itk applications and most applications are done in old vs versions??I'm using visual express 2008!! </font></div><font size="2"></font> <div> Are threre any other way or other examples to connect ITK to VTK??</div> <div> </div> <div>Thanks, </div> <div>Nora<br>--- En date de : <b>Mar 30.12.08, Andinet Enquobahrie <i><<a href="mailto:andinet.enqu@kitware.com">andinet.enqu@kitware.com</a>></i></b> a écrit :<br></div> <blockquote style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: rgb(16,16,255) 2px solid">De: Andinet Enquobahrie <<a href="mailto:andinet.enqu@kitware.com">andinet.enqu@kitware.com</a>><br>Objet: Re: [Insight-users] Problem in running MyProject.cxx in getting started II?<br>À: <a href="mailto:nora_droit@yahoo.fr">nora_droit@yahoo.fr</a><br>Date: Mardi 30 Décembre 2008, 13h01<br><br><pre>Nora-
Start from a clean build tree and try again...
> 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
/<<a href="mailto:andinet.enqu@kitware.com">andinet.enqu@kitware.com</a>>/* a écrit :
>
> De: Andinet Enquobahrie <<a href="mailto:andinet.enqu@kitware.com">andinet.enqu@kitware.com</a>>
> Objet: Re: [Insight-users] Problem in running MyProject.cxx in
> getting started II?
> À: <a href="mailto:nora_droit@yahoo.fr">nora_droit@yahoo.fr</a>
> 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 <<a href="mailto:nora_droit@yahoo.fr">nora_droit@yahoo.fr</a>
> <<a href="mailto:nora_droit@yahoo.fr">mailto:nora_droit@yahoo.fr</a>>> 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@itk.org <<a href="mailto:Insight-users@itk..org">mailto:Insight-users@itk..org</a>>
> <a href="http://www.itk.org/mailman/listinfo/insight-users">http://www.itk.org/mailman/listinfo/insight-users</a>
>
>
>
-- ==========================================================
Andinet A. Enquobahrie, PhD
R&D Engineer
Kitware Inc.
28 Corporate Drive
Clifton Park, NY 12065-8662
Phone: 518-371-3971 x124
<a href="http://www.kitware.com">www.kitware.com</a>
</pre></blockquote></td></tr></tbody></table><br> _______________________________________________<br>Insight-users mailing list<br><a href="mailto:Insight-users@itk.org">Insight-users@itk.org</a><br>http://www.itk.org/mailman/listinfo/insight-users<br></blockquote></div><br></div></body></html>