<div>Hello All</div>
<div> </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> </div>
<div> </div>
<div>my OS : Windows XP</div>
<div>my compiler: MSVC 6.0</div>
<div>Cmake is 2.4 patch 7</div>
<div> </div>
<div>what i did are</div>
<div> </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> </div>
<div>3) in the Cmake</div>
<div> source : C:\InsightToolkit-3.2.0</div>
<div> binary: C:\ITK </div>
<div> 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> </div>
<div>here is a snapshot of the error messages</div>
<div> </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 "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "cmTryCompileExec_EXPORTS" /D "_WINDOWS" /D "NOMINMAX" /D "VCL_HAS_EXPORT" /D "_MBCS" /D CMAKE_INTDIR=\"Debug\" /Fo"Debug/" /Fd"Debug/" /FD /GZ /Zm1000 /GZ /TP /c
</p>
<p> "C:\InsightToolkit-3.2.0\Utilities\vxl\config\cmake\config\vxl_platform_tests.cxx"</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 ';' before ''template<''</p>
<p>C:\InsightToolkit-3.2.0\Utilities\vxl\config\cmake\config\vxl_platform_tests.cxx(25) : error C2501: 'export' : missing storage-class or type specifiers</p>
<p>Error executing cl.exe.</p>
<p> </p>
<p>cmTryCompileExec.exe - 2 error(s), 0 warning(s)</p></div>
<div>============</div>
<div> </div>
<div> </div>
<div> </div>
<div>4) in the Cmake there are only 4 cache variables:</div>
<div> BUILD_EXAMPLES OFF</div>
<div> BUILD_SHARE_LIBRARIES OFF</div>
<div> BUILD_TESTING OFF</div>
<div> CMAKE_INSTAL_PREFIX C:\program files\ITK</div>
<div> </div>
<div>i OFFed those variables , b'coz someone in his/her tutorial said it will speed up the building process. well so be it...</div>
<div> </div>
<div>i did check the checkbox to see advance values, but just for observation. i did not find anything like ITK_USE_VTK, since my primary objective is to use ITK with VTK. since i am not quite sure all these variables then i just leave it as default.
</div>
<div> </div>
<div> </div>
<div>5)press OK, then wait serveral second......</div>
<div> </div>
<div>6) find the ITK.dsw in the C:\ITK folder and open it with MS studio 6.0.</div>
<div> </div>
<div>7) in the MSVC 6.0 tool tar i clicked "Build" then "Set Active Configuration" i chose Win32 Release for ALL_BUILD classes</div>
<div> </div>
<div>8) then press F7 start to build ITK. 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> </div>
<div> </div>
<div>9)wait and wait.... then it finished. </div>
<div> </div>
<div>10) to test whether ITK itself can work properly. copy the C:\InsightToolkit-3.2.0\Examples\Installation out and run CMake again</div>
<div> source C:\somewhere\Installation </div>
<div> binary C:\somewhere\Hellobin</div>
<div> </div>
<div>everything leave as default. but i wonder what "EXECUTABLE_OUTPUT_PATH" for ??? anyway i leave it blank as it is...</div>
<div> configure and then ok.</div>
<div> </div>
<div>11) go to the C:\somewhere\Hellobin and find the HelloWorld.dsw. load it in MSVC and build in release and then in C:\somewhere\Hellobin\release i found HelloWorld.exe so i run it .."ITK Hello World !".BINGO!!... so far so good. it worked fine for this testing program. therefore i assume my ITK was compiled successfully.
</div>
<div> </div>
<div> </div>
<div> </div>
<div>then how to make ITK work with VTK</div>
<div> </div>
<div>i take the example from well-known GettingStarted-II.pdf</div>
<div> </div>
<div>code</div>
<div>===========</div>
<div>
<p>#include "itkImage.h"<br>#include "itkImageFileReader.h"<br>#include "C:\Documents and Settings\panz\Desktop\vitkbin\itkImageToVTKImageFilter.h"<br>#include "vtkImageViewer.h"<br>
#include "vtkRenderWindowInteractor.h"<br>int main( int argc, char **argv) {<br>typedef itk::Image<unsigned short,2> ImageType;<br>typedef itk::ImageFileReader<ImageType> ReaderType;<br>typedef itk::ImageToVTKImageFilter<ImageType> ConnectorType;
</p>
<p>ReaderType::Pointer reader= ReaderType::New();<br>ConnectorType::Pointer connector= ConnectorType::New();</p>
<p>reader->SetFileName(argv[1]);<br>connector->SetInput(reader->GetOutput());<br>vtkImageViewer* viewer= vtkImageViewer::New();<br>vtkRenderWindowInteractor* renderWindowInteractor=vtkRenderWindowInteractor::New();
<br>viewer->SetupInteractor( renderWindowInteractor);<br>viewer->SetInput( connector->GetOutput() );<br>viewer->Render();<br>viewer->SetColorWindow( 255);<br>viewer->SetColorLevel( 128);<br>renderWindowInteractor->Start();
<br>return 0;<br>}</p></div>
<div>===========</div>
<div> </div>
<div>can not make it work since it can not find itkImageToVTKImageFilter.h</div>
<div>as refer</div>
<div>
<div>" Where to find itkImageToVTKImageFilter.h"</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> </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> </div>
<div>how can i fix this ?</div>
<div> </div>
<div> </div></div>
<div>i did refer some material like</div>
<div> </div>
<div>"Howto build itk with vtk4.0 and cmake ? "<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> </div>
<div>but i just find it too much out-dated.</div>
<div> </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> </div>
<div> </div>
<div> during this process i did meet project such as </div>
<div> fatal error LNK1181 "ITKBasicFilters.lib" can not be found... then in the VC6.0 tooltar tools/options/directory there, you need to set the included libraries.</div>
<div> </div>
<div>i believe this would help some beginner to start to use latest ITK and VTK.</div>
<div> </div>
<div>and ITK guru again, please give me some explanation to the questions i asked during the process....</div>
<div> </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> </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> </div>
<div> </div>
<div>sorry for this long email.</div>
<div> </div>
<div>thank you
<div> </div>
<div>Yours</div>
<div>Ocean</div></div>