<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2900.2769" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2>
<DIV><FONT face=Arial size=2>Hi!</FONT></DIV>
<DIV><FONT face=Arial size=2>&nbsp;&nbsp;&nbsp; I'm&nbsp;starting to work with 
integration between ITK and VTK, and I wrote a basic program, as 
follows:</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>#include "itkImageFileReader.h"<BR>#include 
"itkRawImageIO.h"<BR>#include "itkVTKImageExport.h"<BR>#include 
"itkImage.h"</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>#include "vtkImageImport.h"<BR>#include 
"vtkImageViewer.h"</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV><FONT face=Arial size=2>
<DIV><BR>int main( )<BR>{<BR>&nbsp; <BR>&nbsp; <BR>&nbsp; typedef unsigned 
short&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; PixelType;<BR>&nbsp; const&nbsp;&nbsp; 
unsigned int&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Dimension = 2;<BR></DIV>
<DIV>&nbsp; typedef itk::Image&lt; PixelType, Dimension &gt;&nbsp;&nbsp;&nbsp; 
ImageType;<BR></DIV>
<DIV>&nbsp; typedef itk::RawImageIO&lt;PixelType, Dimension&gt; IOType;</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp; typedef itk::ImageFileReader&lt; ImageType &gt;&nbsp; 
ReaderType;<BR>&nbsp; typedef itk::VTKImageExport&lt; ImageType &gt;&nbsp; 
ExporterType;<BR>&nbsp; <BR>&nbsp; <BR>&nbsp; ReaderType::Pointer reader = 
ReaderType::New();<BR>&nbsp; ExporterType::Pointer exporter = 
ExporterType::New();<BR>&nbsp; IOType::Pointer io = IOType::New();</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp; io-&gt;SetDimensions(0,64);<BR>&nbsp; 
io-&gt;SetDimensions(1,64);</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp; reader-&gt;SetImageIO( io );<BR>&nbsp; </DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp; reader-&gt;SetFileName( "D:\\VTK\\VTKData\\Data\\headsq\\quarter.30" 
);<BR>&nbsp; <BR>&nbsp; exporter-&gt;SetInput( reader-&gt;GetOutput() 
);<BR>&nbsp; <BR>&nbsp; vtkImageImport *importer = 
vtkImageImport::New();<BR>&nbsp; vtkImageViewer *viewer = 
vtkImageViewer::New();</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp; importer-&gt;SetImportVoidPointer( exporter );<BR>&nbsp; 
viewer-&gt;SetInput(importer-&gt;GetOutput() );</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp; try <BR>&nbsp;&nbsp;&nbsp; { <BR>&nbsp;&nbsp;&nbsp; 
viewer-&gt;Render(); <BR>&nbsp;&nbsp;&nbsp; } <BR>&nbsp; catch( 
itk::ExceptionObject &amp; err ) <BR>&nbsp;&nbsp;&nbsp; { <BR>&nbsp;&nbsp;&nbsp; 
std::cerr &lt;&lt; "ExceptionObject caught !" &lt;&lt; std::endl; 
<BR>&nbsp;&nbsp;&nbsp; std::cerr &lt;&lt; err &lt;&lt; std::endl; 
<BR>&nbsp;&nbsp;&nbsp; return EXIT_FAILURE;<BR>&nbsp;&nbsp;&nbsp; } <BR>&nbsp; 
<BR>&nbsp; return EXIT_SUCCESS;<BR>}</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV>which just reads a raw image with ITK and passes it to VTK for 
visualisation. I get an unresolved external symbol error during compilation (VS 
.NET 2005) concerning the callback fuctions in VTKImageExportBase:</DIV>
<DIV>&nbsp;</DIV>
<DIV>ITKtoVTK error LNK2001: unresolved external symbol "protected: virtual int 
__thiscall itk::VTKImageExportBase::PipelineModifiedCallback(void)" (<A 
href="mailto:?PipelineModifiedCallback@VTKImageExportBase@itk@@MAEHXZ">?PipelineModifiedCallback@VTKImageExportBase@itk@@MAEHXZ</A>)<BR>ITKtoVTK 
error LNK2001: unresolved external symbol "protected: virtual void __thiscall 
itk::VTKImageExportBase::PrintSelf(class std::basic_ostream&lt;char,struct 
std::char_traits&lt;char&gt; &gt; &amp;,class itk::Indent)const " (<A 
href="mailto:?PrintSelf@VTKImageExportBase@itk@@MBEXAAV?$basic_ostream@DU?$char_traits@D@std@@@std@@VIndent@2@@Z">?PrintSelf@VTKImageExportBase@itk@@MBEXAAV?$basic_ostream@DU?$char_traits@D@std@@@std@@VIndent@2@@Z</A>)<BR>ITKtoVTK 
error LNK2001: unresolved external symbol "protected: virtual void __thiscall 
itk::VTKImageExportBase::UpdateDataCallback(void)" (<A 
href="mailto:?UpdateDataCallback@VTKImageExportBase@itk@@MAEXXZ">?UpdateDataCallback@VTKImageExportBase@itk@@MAEXXZ</A>)<BR>ITKtoVTK 
error LNK2001: unresolved external symbol "protected: virtual void __thiscall 
itk::VTKImageExportBase::UpdateInformationCallback(void)" (<A 
href="mailto:?UpdateInformationCallback@VTKImageExportBase@itk@@MAEXXZ">?UpdateInformationCallback@VTKImageExportBase@itk@@MAEXXZ</A>)<BR>ITKtoVTK 
error LNK2019: unresolved external symbol "protected: __thiscall 
itk::VTKImageExportBase::VTKImageExportBase(void)" (<A 
href="mailto:??0VTKImageExportBase@itk@@IAE@XZ">??0VTKImageExportBase@itk@@IAE@XZ</A>) 
referenced in function "protected: __thiscall itk::VTKImageExport&lt;class 
itk::Image&lt;unsigned short,2&gt; &gt;::VTKImageExport&lt;class 
itk::Image&lt;unsigned short,2&gt; &gt;(void)" (<A 
href="mailto:??0?$VTKImageExport@V?$Image@G$01@itk@@@itk@@IAE@XZ">??0?$VTKImageExport@V?$Image@G$01@itk@@@itk@@IAE@XZ</A>)<BR></DIV>
<DIV>&nbsp;&nbsp;&nbsp; Do I have to create those functions? From what I read in 
the docs, I think that these are passed to VTKImageImport, that sets them as its 
callbacks. Also,&nbsp;it seemed like&nbsp;an "include" error, but ITK's 
VTKImageExport header&nbsp;includes the VTKImageExportBase header file. </DIV>
<DIV>&nbsp;</DIV>
<DIV>CMakeLists.txt looks like this:</DIV>
<DIV>&nbsp;</DIV>
<DIV>PROJECT(ITKtoVTK)</DIV>
<DIV>&nbsp;</DIV>
<DIV>FIND_PACKAGE ( ITK)<BR>IF ( ITK_FOUND)<BR>INCLUDE( ${USE_ITK_FILE} 
)<BR>ENDIF( ITK_FOUND)</DIV>
<DIV>&nbsp;</DIV>
<DIV>FIND_PACKAGE ( VTK)<BR>IF ( VTK_FOUND)<BR>INCLUDE( ${USE_VTK_FILE} 
)<BR>ENDIF( VTK_FOUND)</DIV>
<DIV>&nbsp;</DIV>
<DIV>INCLUDE_DIRECTORIES(${C:\[CORRECT_PATH]\ITKtoVTK})</DIV>
<DIV>&nbsp;</DIV>
<DIV>ADD_EXECUTABLE( ITKtoVTK ITKtoVTK.cxx)</DIV>
<DIV>&nbsp;</DIV>
<DIV>TARGET_LINK_LIBRARIES (ITKtoVTK ITKCommon ITKIO vtkRendering vtkGraphics 
vtkHybrid vtkImaging vtkIO vtkCommon)</DIV>
<DIV>&nbsp;</DIV>
<DIV>Am I missing some libraries?</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;&nbsp;&nbsp; Thanks a lot for any help, 
Diego</DIV></FONT></FONT></DIV></BODY></HTML>