<div>Hello All</div>
<div>&nbsp;</div>
<div>i just download ITK and want to compile and do some programs with it. i refer all kinds of starting-up tutorials,</div>
<div>but all those are not up-to-date. i have problems occurred duiring my compilation process. below i describe what i did and please someone kindly diagnose my steps.</div>
<div>&nbsp;</div>
<div>&nbsp;</div>
<div>my OS : Windows XP</div>
<div>my compiler: MSVC 6.0</div>
<div>Cmake is 2.4 patch 7</div>
<div>&nbsp;</div>
<div>what i did are</div>
<div>&nbsp;</div>
<div>1) unpack the InsightToolkit-3.2.0.zip to my C: drive with folder name C:\InsightToolkit-3.2.0</div>
<div>2) create a C:\ITK for keep the output files</div>
<div>&nbsp;</div>
<div>3)&nbsp;in the Cmake</div>
<div>&nbsp;&nbsp;&nbsp; source : C:\InsightToolkit-3.2.0</div>
<div>&nbsp;&nbsp;&nbsp; binary:&nbsp;&nbsp; C:\ITK </div>
<div>&nbsp;&nbsp; press configure, it took quite a while, then i noticed in my C:\ITK has a CMakeError.log, i opened and i saw loads of error messages.</div>
<div>&nbsp;</div>
<div>here is a snapshot of the error messages</div>
<div>&nbsp;</div>
<div>============</div>
<div>
<p>Performing Test VCL_HAS_EXPORT failed with the following output:<br>--------------------Configuration: cmTryCompileExec - Win32 Debug--------------------</p>
<p>Compiling...</p>
<p>Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 12.00.8168 for 80x86</p>
<p>Copyright (C) Microsoft Corp 1984-1998. All rights reserved.</p>
<p>cl /MDd /W3 /GR /GX /Zi /Od /D &quot;WIN32&quot; /D &quot;_DEBUG&quot; /D &quot;_CONSOLE&quot; /D &quot;cmTryCompileExec_EXPORTS&quot; /D &quot;_WINDOWS&quot; /D &quot;NOMINMAX&quot; /D &quot;VCL_HAS_EXPORT&quot; /D &quot;_MBCS&quot; /D CMAKE_INTDIR=\&quot;Debug\&quot; /Fo&quot;Debug/&quot; /Fd&quot;Debug/&quot; /FD /GZ&nbsp;&nbsp; /Zm1000&nbsp; /GZ&nbsp; /TP /c 
</p>
<p>&nbsp;&nbsp; &quot;C:\InsightToolkit-3.2.0\Utilities\vxl\config\cmake\config\vxl_platform_tests.cxx&quot;</p>
<p>vxl_platform_tests.cxx</p>
<p>C:\InsightToolkit-3.2.0\Utilities\vxl\config\cmake\config\vxl_platform_tests.cxx(25) : error C2143: syntax error : missing &#39;;&#39; before &#39;&#39;template&lt;&#39;&#39;</p>
<p>C:\InsightToolkit-3.2.0\Utilities\vxl\config\cmake\config\vxl_platform_tests.cxx(25) : error C2501: &#39;export&#39; : missing storage-class or type specifiers</p>
<p>Error executing cl.exe.</p>
<p>&nbsp;</p>
<p>cmTryCompileExec.exe - 2 error(s), 0 warning(s)</p></div>
<div>============</div>
<div>&nbsp;</div>
<div>&nbsp;</div>
<div>&nbsp;</div>
<div>4) in the Cmake there are only 4 cache variables:</div>
<div>&nbsp;&nbsp;&nbsp; BUILD_EXAMPLES&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; OFF</div>
<div>&nbsp;&nbsp;&nbsp; BUILD_SHARE_LIBRARIES&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; OFF</div>
<div>&nbsp;&nbsp;&nbsp; BUILD_TESTING&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; OFF</div>
<div>&nbsp;&nbsp;&nbsp; CMAKE_INSTAL_PREFIX&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; C:\program files\ITK</div>
<div>&nbsp;</div>
<div>i OFFed those variables , b&#39;coz someone in his/her tutorial said it will speed up the building process. well so be it...</div>
<div>&nbsp;</div>
<div>i did check the checkbox to see advance values, but&nbsp;just for observation. i did not find anything like ITK_USE_VTK, since my primary objective is to use ITK with VTK.&nbsp; since i am not quite sure all these variables then i just leave it as default. 
</div>
<div>&nbsp;</div>
<div>&nbsp;</div>
<div>5)press OK, then wait serveral second......</div>
<div>&nbsp;</div>
<div>6) find the ITK.dsw in the C:\ITK folder and open it with MS studio 6.0.</div>
<div>&nbsp;</div>
<div>7) in the MSVC 6.0 tool tar i clicked &quot;Build&quot; then &quot;Set Active Configuration&quot; i chose Win32 Release for ALL_BUILD classes</div>
<div>&nbsp;</div>
<div>8) then press F7 start to build ITK.&nbsp; the compilation process took 100% of my CPU, and it does not seem like what others said just 15 minutes. it took more than that on my pc(Centrino 1.6Ghz 533FSB)</div>
<div>&nbsp;</div>
<div>&nbsp;</div>
<div>9)wait and wait.... then it finished. </div>
<div>&nbsp;</div>
<div>10) to test whether ITK itself can work properly. copy the C:\InsightToolkit-3.2.0\Examples\Installation out&nbsp; and run CMake again</div>
<div>&nbsp;&nbsp;&nbsp;&nbsp; source C:\somewhere\Installation </div>
<div>&nbsp;&nbsp;&nbsp;&nbsp; binary&nbsp; C:\somewhere\Hellobin</div>
<div>&nbsp;&nbsp; </div>
<div>everything leave as default. but i wonder what &quot;EXECUTABLE_OUTPUT_PATH&quot; for ??? anyway i leave&nbsp;it blank as it is...</div>
<div>&nbsp;configure and then ok.</div>
<div>&nbsp;</div>
<div>11) go to the C:\somewhere\Hellobin&nbsp; and find the HelloWorld.dsw. load it in MSVC and build in release and then in C:\somewhere\Hellobin\release&nbsp; i found&nbsp;HelloWorld.exe so i run it ..&quot;ITK Hello World !&quot;.BINGO!!... so far so good. it worked fine for this testing program. therefore i assume my ITK&nbsp;was&nbsp;compiled successfully. 
</div>
<div>&nbsp;</div>
<div>&nbsp;</div>
<div>&nbsp;</div>
<div>then how to make ITK work with VTK</div>
<div>&nbsp;</div>
<div>i take the example from well-known GettingStarted-II.pdf</div>
<div>&nbsp;</div>
<div>code</div>
<div>===========</div>
<div>
<p>#include &quot;itkImage.h&quot;<br>#include &quot;itkImageFileReader.h&quot;<br>#include &quot;C:\Documents and Settings\panz\Desktop\vitkbin\itkImageToVTKImageFilter.h&quot;<br>#include &quot;vtkImageViewer.h&quot;<br>
#include &quot;vtkRenderWindowInteractor.h&quot;<br>int main( int argc, char **argv) {<br>typedef itk::Image&lt;unsigned short,2&gt; ImageType;<br>typedef itk::ImageFileReader&lt;ImageType&gt; ReaderType;<br>typedef itk::ImageToVTKImageFilter&lt;ImageType&gt; ConnectorType; 
</p>
<p>ReaderType::Pointer reader= ReaderType::New();<br>ConnectorType::Pointer connector= ConnectorType::New();</p>
<p>reader-&gt;SetFileName(argv[1]);<br>connector-&gt;SetInput(reader-&gt;GetOutput());<br>vtkImageViewer* viewer= vtkImageViewer::New();<br>vtkRenderWindowInteractor* renderWindowInteractor=vtkRenderWindowInteractor::New(); 
<br>viewer-&gt;SetupInteractor( renderWindowInteractor);<br>viewer-&gt;SetInput( connector-&gt;GetOutput() );<br>viewer-&gt;Render();<br>viewer-&gt;SetColorWindow( 255);<br>viewer-&gt;SetColorLevel( 128);<br>renderWindowInteractor-&gt;Start(); 
<br>return 0;<br>}</p></div>
<div>===========</div>
<div>&nbsp;</div>
<div>can not make it work since it can not find itkImageToVTKImageFilter.h</div>
<div>as refer</div>
<div>
<div>&quot;&nbsp;Where to find itkImageToVTKImageFilter.h&quot;</div>
<div><a onclick="return top.js.OpenExtLink(window,event,this)" href="http://public.kitware.com/pipermail/insight-users/2004-July/009669.html" target="_blank">http://public.kitware.com/pipermail/insight-users/2004-July/009669.html
</a></div>
<div>&nbsp;</div>
<div>i copied all necessary to project source code folder but still can not i have to specify the absolute path to itkImageToVTKImageFilter.h.</div>
<div>&nbsp;</div>
<div>how can i fix this ?</div>
<div>&nbsp;</div>
<div>&nbsp;</div></div>
<div>i did refer some material like</div>
<div>&nbsp;</div>
<div>&quot;Howto build itk with vtk4.0 and cmake ? &quot;<br><a onclick="return top.js.OpenExtLink(window,event,this)" href="http://public.kitware.com/pipermail/insight-users/2002-May/000438.html" target="_blank">http://public.kitware.com/pipermail/insight-users/2002-May/000438.html 
</a>&nbsp;</div>
<div>but i just find it too much out-dated.</div>
<div>&nbsp;</div>
<div><a onclick="return top.js.OpenExtLink(window,event,this)" href="http://public.kitware.com/pipermail/insight-users/2004-July/009669.html" target="_blank"></a>&nbsp;</div>
<div>&nbsp;</div>
<div>&nbsp;during this process i did meet project such as </div>
<div>&nbsp;fatal error LNK1181 &quot;ITKBasicFilters.lib&quot; can not be found... then in the VC6.0 tooltar&nbsp; &nbsp;tools/options/directory&nbsp;there, you&nbsp;need to set the included libraries.</div>
<div>&nbsp;</div>
<div>i believe this would help some beginner to start to use latest ITK and VTK.</div>
<div>&nbsp;</div>
<div>and ITK guru again, please give me some explanation to the questions i asked during the process....</div>
<div>&nbsp;</div>
<div>and i also want to know...</div>
<div>1)to do some VTK+ITK programming in C++ , to make thing convenient, is CMake a must?</div>
<div>&nbsp;</div>
<div>2) is there any tcl/tk examples in ITK. since i learn VTK by tcl, now i want to continue exploring ITK with tcl, please give me some suggestions on this.</div>
<div>&nbsp;</div>
<div>&nbsp;</div>
<div>sorry for this long email.</div>
<div>&nbsp; </div>
<div>thank you
<div>&nbsp;</div>
<div>Yours</div>
<div>Ocean</div></div>