<table cellspacing="0" cellpadding="0" border="0" ><tr><td valign="top" style="font: inherit;"><DIV>Thanks a lot Mr. Cemal Cagatay Bilgin, the example has perfectly executed exactly after correcting these 3 bugs!I appreciated yoyr help.</DIV>
<DIV>&nbsp;</DIV>
<DIV>Nora<BR><BR>--- En date de&nbsp;: <B>Mar 30.12.08, Cemal Cagatay Bilgin <I>&lt;bilgic@cs.rpi.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: Cemal Cagatay Bilgin &lt;bilgic@cs.rpi.edu&gt;<BR>Objet: Re: [Insight-users] Problem in running MyProject.cxx in getting started II?<BR>À: nora_droit@yahoo.fr<BR>Cc: insight-users@itk.org<BR>Date: Mardi 30 Décembre 2008, 22h20<BR><BR>
<DIV id=yiv1008440283>Nora,&nbsp;
<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>&gt;         typedef itk::ImageFileReader&lt;Imagetype&gt; ReaderType;</PRE></SPAN></BLOCKQUOTE>should be&nbsp;</DIV>
<DIV>typedef itk::ImageFileReader&lt;ImageType&gt; ReaderType;&nbsp;</DIV>
<DIV>Node the &nbsp;ImageType &nbsp;with the capital letters.&nbsp;</DIV>
<DIV><BR></DIV>
<DIV>the others are&nbsp;</DIV>
<DIV>
<DIV>ReaderType::Pointer reader = ReaderType::New(); //</DIV>
<DIV>and reader-&gt;SetFileName.&nbsp;</DIV>
<DIV><BR></DIV>
<DIV>Your code should compile after you take care of these.&nbsp;</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>
<TBODY>
<TR>
<TD vAlign=top>
<DIV><BR>Dear Andinet,</DIV>
<DIV>&nbsp;</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&nbsp;wich &nbsp;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!!&nbsp;</FONT></DIV><FONT size=2></FONT>
<DIV>&nbsp;Are threre any other way or other examples to connect ITK to VTK??</DIV>
<DIV>&nbsp;</DIV>
<DIV>Thanks, </DIV>
<DIV>Nora<BR>--- En date de&nbsp;: <B>Mar 30.12.08, Andinet Enquobahrie <I>&lt;<A href="mailto:andinet.enqu@kitware.com" target=_blank rel=nofollow>andinet.enqu@kitware.com</A>&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: Andinet Enquobahrie &lt;<A href="mailto:andinet..enqu@kitware.com" target=_blank rel=nofollow>andinet.enqu@kitware.com</A>&gt;<BR>Objet: Re: [Insight-users] Problem in running MyProject.cxx in getting started II?<BR>À: <A href="mailto:nora_droit@yahoo.fr" target=_blank rel=nofollow>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...
&gt; Thanks Andinet for response,
&gt; I copied these four files in the source directory with MyProject.cxx, here
is the new error message I got :
&gt;   2&gt;..\Myproject-source\myProject.cxx(10) : error C2065:
'Imagetype' : identificateur non déclaré
&gt; 2&gt;..\Myproject-source\myProject.cxx(13) : error C2955:
'itk::ImageFileReader' : l'utilisation d'une classe modèle
requiert une liste d'arguments modèle
&gt; 2&gt; c:\program
files\insighttoolkit-3.10.0\code\io\itkImageFileReader.h(93) :
voir la déclaration de 'itk::ImageFileReader'
&gt; 2&gt;..\Myproject-source\myProject.cxx(13) : error C2653:
'readertype' : n'est pas un nom de classe ni d'espace de noms
&gt; 2&gt;..\Myproject-source\myProject.cxx(13) : error C3861:
'New' : identificateur introuvable
&gt; 2&gt;..\Myproject-source\myProject.cxx(13) : error C2514:
'itk::SmartPointer&lt;itk::ImageFileReader&lt;TOutputImage,ConvertPixelTraits&gt;&gt;'
: la classe n'a aucun constructeur
&gt; 2&gt;..\Myproject-source\myProject.cxx(16) : error C2678:
'-&gt;' binaire : aucun opérateur trouvé qui accepte un opérande de
partie gauche de type
'itk::SmartPointer&lt;itk::ImageFileReader&lt;TOutputImage,ConvertPixelTraits&gt;&gt;'
(ou il n'existe pas de conversion acceptable)
&gt; 2&gt; c:\program
files\insighttoolkit-3.10.0\code\common\itkSmartPointer.h(69):
peut être 'TObjectType *itk::SmartPointer&lt;TObjectType&gt;::operator
-&gt;(void) const'
&gt; 2&gt; lors de la tentative de mise en correspondance de la liste des
arguments
'(itk::SmartPointer&lt;itk::ImageFileReader&lt;TOutputImage,ConvertPixelTraits&gt;&gt;)'
&gt; 2&gt;..\Myproject-source\myProject.cxx(16) : error C2039:
'setFilename' : n'est pas membre de
'itk::SmartPointer&lt;itk::ImageFileReader&lt;TOutputImage,ConvertPixelTraits&gt;&gt;'
&gt; 2&gt;..\Myproject-source\myProject.cxx(17) : error C2678:
'-&gt;' binaire : aucun opérateur trouvé qui accepte un opérande de
partie gauche de type
'itk::SmartPointer&lt;itk::ImageFileReader&lt;TOutputImage,ConvertPixelTraits&gt;&gt;'
(ou il n'existe pas de conversion acceptable)
&gt; 2&gt; c:\program
files\insighttoolkit-3.10.0\code\common\itkSmartPointer.h(69):
peut être 'TObjectType *itk::SmartPointer&lt;TObjectType&gt;::operator
-&gt;(void) const'
&gt; 2&gt; lors de la tentative de mise en correspondance de la liste des
arguments
'(itk::SmartPointer&lt;itk::ImageFileReader&lt;TOutputImage,ConvertPixelTraits&gt;&gt;)'
&gt; 2&gt;..\Myproject-source\myProject.cxx(17) : error C2039:
'GetOutput' : n'est pas membre de
'itk::SmartPointer&lt;itk::ImageFileReader&lt;TOutputImage,ConvertPixelTraits&gt;&gt;'
&gt; 2&gt;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"
&gt; 2&gt;myProject - 9 erreur(s), 0 avertissement(s)
&gt; 
&gt; Is the problem in including Lib or in adding namespace?
&gt;  I will appreciate you help,
&gt;  Nora
&gt; 
&gt; --- En date de : *Lun 29.12.08, Andinet Enquobahrie
/&lt;<A href="mailto:andinet.enqu@kitware.com" target=_blank rel=nofollow>andinet.enqu@kitware.com</A>&gt;/* a écrit :
&gt; 
&gt;     De: Andinet Enquobahrie &lt;<A href="mailto:andinet.enqu@kitware..com" target=_blank rel=nofollow>andinet.enqu@kitware.com</A>&gt;
&gt;     Objet: Re: [Insight-users] Problem in running MyProject.cxx in
&gt;     getting started II?
&gt;     À: <A href="mailto:nora_droit@yahoo.fr" target=_blank rel=nofollow>nora_droit@yahoo.fr</A>
&gt;     Date: Lundi 29 Décembre 2008, 22h14
&gt; 
&gt;     Nora-
&gt; 
&gt;     Copy those files into your Project source directory ( where you
&gt;     have MyProject.cxx ) NOT to your binary directory.
&gt; 
&gt; 
&gt;     On Mon, Dec 29, 2008 at 5:04 PM, Nora Nora &lt;<A href="mailto:nora_droit@yahoo.fr" target=_blank rel=nofollow>nora_droit@yahoo.fr</A>
&gt;     &lt;<A href="mailto:nora_droit@yahoo.fr" target=_blank rel=nofollow>mailto:nora_droit@yahoo.fr</A>&gt;&gt; wrote:
&gt; 
&gt;                  Hi all ITK users,
&gt;                  I tried to run MyProject.cxx  following instructions in
&gt;         getting started II. Here are MyProjct.cxx and CmakeLists.txt
&gt;         files :
&gt;                  PROJECT( myProject )
&gt;          FIND_PACKAGE ( ITK )
&gt;           IF ( ITK_FOUND )
&gt;              INCLUDE( ${USE_ITK_FILE} )
&gt;         ENDIF( ITK_FOUND )
&gt;          FIND_PACKAGE ( VTK )
&gt;           IF ( VTK_FOUND )
&gt;             INCLUDE( ${USE_VTK_FILE} )
&gt;          ENDIF( VTK_FOUND )
&gt;          INCLUDE_DIRECTORIES( ${myProject_SOURCE_DIR})
&gt;          ADD_EXECUTABLE( myProject myProject.cxx )
&gt;          TARGET_LINK_LIBRARIES ( myProject
&gt;          ITKBasicFilters ITKCommon ITKIO
&gt;          vtkRendering vtkGraphics vtkHybrid
&gt;          vtkImaging vtkIO vtkFiltering vtkCommon
&gt;         )
&gt;         #include "itkImage.h"
&gt;         #include "itkImageFileReader.h"
&gt;         #include "itkImageToVTKImageFilter.h"
&gt; 
&gt;         #include "vtkImageViewer.h"
&gt;         #include "vtkRenderWindowInteractor.h"
&gt; 
&gt;         int main( int argc, char **argv) {
&gt; 
&gt;         typedef itk::Image&lt;unsigned short,2&gt; ImageType;
&gt;         typedef itk::ImageFileReader&lt;Imagetype&gt; ReaderType;
&gt;         typedef itk::ImageToVTKImageFilter&lt;ImageType&gt; ConnectorType;
&gt; 
&gt;         ReaderType::Pointer reader = readertype::New();
&gt;         ConnectorType::Pointer connector = ConnectorType::New();
&gt; 
&gt;         reader-&gt;setFilename( argv[1] );
&gt;         connector-&gt;SetInput( reader-&gt;GetOutput() );
&gt; 
&gt;         vtkImageViewer * viewer = vtkImageViewer::New();
&gt;         vtkRenderWindowInteractor * renderWindowInteractor =
&gt;         vtkRenderWindowInteractor::New();
&gt; 
&gt;         viewer-&gt;SetupInteractor( renderWindowInteractor );
&gt;         viewer-&gt;SetInput( connector-&gt;GetOutput() );
&gt; 
&gt;         viewer-&gt;Render();
&gt;         viewer-&gt;SetColorWindow( 255 );
&gt;         viewer-&gt;SetColorLevel( 128 );
&gt;         renderWindowInteractor-&gt;Start();
&gt; 
&gt;         return 0;
&gt;         }
&gt; 
&gt;         I have successively built it, but in running this error
&gt;         message is chown :
&gt;                  Myproject-source\myProject.cxx(3) : fatal error
C1083:
&gt;         Impossible d'ouvrir le fichier include :
&gt;         'itkImageToVTKImageFilter.h' : No such file or directory
&gt;          I have red the response of Luis in OSdir forum to such
&gt;         problem that is as followed :
&gt;                  The files that you need are in
InsightApplications/Auxiliary/vtk :
&gt; 
&gt;         itkImageToVTKImageFilter.h
&gt;         itkImageToVTKImageFilter.txx
&gt;         itkVTKImageToImageFilter.h
&gt;         itkVTKImageToImageFilter.txx
&gt; 
&gt;         Copy these files into the directory where you are putting the
&gt;         code of your example.
&gt;                  So I copied these files in the generated binary directory
with
&gt;         myProject.dsw.
&gt;                  But I stiil have the same error message??
&gt;                  Can someone help me??
&gt;                  Are there other examples on how connect ITK to VTK?
&gt;                  Thanks,
&gt;         Nora 
&gt; 
&gt; 
&gt;         _______________________________________________
&gt;         Insight-users mailing list
&gt;         Insight-users@itk.org &lt;<A href="mailto:Insight-users@itk...org" target=_blank rel=nofollow>mailto:Insight-users@itk..org</A>&gt;
&gt;         <A href="http://www.itk.org/mailman/listinfo/insight-users" target=_blank rel=nofollow>http://www.itk.org/mailman/listinfo/insight-users</A>
&gt; 
&gt; 
&gt; 


-- ==========================================================
Andinet A. Enquobahrie, PhD
R&amp;D Engineer
Kitware Inc.

28 Corporate Drive
Clifton Park, NY 12065-8662
Phone: 518-371-3971 x124
<A href="http://www.kitware.com/" target=_blank rel=nofollow>www.kitware.com</A>


</PRE></BLOCKQUOTE></TD></TR></TBODY></TABLE><BR>_______________________________________________<BR>Insight-users mailing list<BR><A href="mailto:Insight-users@itk.org" target=_blank rel=nofollow>Insight-users@itk.org</A><BR>http://www.itk.org/mailman/listinfo/insight-users<BR></BLOCKQUOTE></DIV><BR></DIV></DIV></BLOCKQUOTE></td></tr></table><br>