It is not easy to use ITKv4 without cmake. There are many examples on the wiki that include sample cmake files. See for example see:<div><a href="http://itk.org/Wiki/ITK/Examples/QuickView">http://itk.org/Wiki/ITK/Examples/QuickView</a></div>
<div><br><div><br><div class="gmail_quote">On Thu, Jul 5, 2012 at 10:49 AM, 吴鹏飞 <span dir="ltr"><<a href="mailto:wpfnihao@gmail.com" target="_blank">wpfnihao@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div lang="ZH-CN" link="blue" vlink="purple"><div><p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:"Calibri","sans-serif";color:#1f497d">Hi Bill,<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:"Calibri","sans-serif";color:#1f497d"> Thanks for your reply. But I use VS 2010 to compile the code, I’m not familiar with the CMake grammar. <u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p><p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:"Calibri","sans-serif";color:#1f497d">Here’s some information of my project (the vtk related info. is omitted).<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p><p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:"Calibri","sans-serif"">The include directory:<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:"Calibri","sans-serif";color:#1f497d">C:\Program Files (x86)\ITK\include\ITK-4.1<u></u><u></u></span></p><p class="MsoNormal">
<span lang="EN-US" style="font-size:10.5pt;font-family:"Calibri","sans-serif";color:#1f497d">C:\Program Files (x86)\ITK\include<u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:"Calibri","sans-serif"">The library directory: <u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:"Calibri","sans-serif";color:#1f497d">C:\Program Files (x86)\ITK\lib<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p><p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:"Calibri","sans-serif"">Additional dependence (I include all the lib files in the ./ITK/lib directory):<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:"Calibri","sans-serif";color:#1f497d">itksys-4.1.lib<u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:"Calibri","sans-serif";color:#1f497d">itkvnl_algo-4.1.lib<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:"Calibri","sans-serif";color:#1f497d">itkvnl-4.1.lib<u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:"Calibri","sans-serif";color:#1f497d">itkv3p_netlib-4.1.lib<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:"Calibri","sans-serif";color:#1f497d">ITKCommon-4.1.lib<u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:"Calibri","sans-serif";color:#1f497d">itkNetlibSlatec-4.1.lib<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:"Calibri","sans-serif";color:#1f497d">ITKStatistics-4.1.lib<u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:"Calibri","sans-serif";color:#1f497d">ITKIOImageBase-4.1.lib<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:"Calibri","sans-serif";color:#1f497d">ITKIOBMP-4.1.lib<u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:"Calibri","sans-serif";color:#1f497d">ITKIOBioRad-4.1.lib<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:"Calibri","sans-serif";color:#1f497d">ITKEXPAT-4.1.lib<u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:"Calibri","sans-serif";color:#1f497d">itkopenjpeg-4.1.lib<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:"Calibri","sans-serif";color:#1f497d">itkzlib-4.1.lib<u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:"Calibri","sans-serif";color:#1f497d">itkgdcmDICT-4.1.lib<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:"Calibri","sans-serif";color:#1f497d">itkgdcmMSFF-4.1.lib<u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:"Calibri","sans-serif";color:#1f497d">ITKIOGDCM-4.1.lib<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:"Calibri","sans-serif";color:#1f497d">ITKIOGIPL-4.1.lib<u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:"Calibri","sans-serif";color:#1f497d">itkjpeg-4.1.lib<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:"Calibri","sans-serif";color:#1f497d">ITKIOJPEG-4.1.lib<u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:"Calibri","sans-serif";color:#1f497d">itktiff-4.1.lib<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:"Calibri","sans-serif";color:#1f497d">ITKIOTIFF-4.1.lib<u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:"Calibri","sans-serif";color:#1f497d">ITKIOLSM-4.1.lib<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:"Calibri","sans-serif";color:#1f497d">ITKMetaIO-4.1.lib<u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:"Calibri","sans-serif";color:#1f497d">ITKIOMeta-4.1.lib<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:"Calibri","sans-serif";color:#1f497d">ITKznz-4.1.lib<u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:"Calibri","sans-serif";color:#1f497d">ITKniftiio-4.1.lib<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:"Calibri","sans-serif";color:#1f497d">ITKIONIFTI-4.1.lib<u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:"Calibri","sans-serif";color:#1f497d">ITKNrrdIO-4.1.lib<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:"Calibri","sans-serif";color:#1f497d">ITKIONRRD-4.1.lib<u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:"Calibri","sans-serif";color:#1f497d">itkpng-4.1.lib<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:"Calibri","sans-serif";color:#1f497d">ITKIOPNG-4.1.lib<u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:"Calibri","sans-serif";color:#1f497d">ITKIOStimulate-4.1.lib<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:"Calibri","sans-serif";color:#1f497d">ITKIOVTK-4.1.lib<u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:"Calibri","sans-serif";color:#1f497d">ITKMesh-4.1.lib<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:"Calibri","sans-serif";color:#1f497d">ITKSpatialObjects-4.1.lib<u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:"Calibri","sans-serif";color:#1f497d">ITKPath-4.1.lib<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:"Calibri","sans-serif";color:#1f497d">ITKLabelMap-4.1.lib<u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:"Calibri","sans-serif";color:#1f497d">ITKQuadEdgeMesh-4.1.lib<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:"Calibri","sans-serif";color:#1f497d">ITKOptimizers-4.1.lib<u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:"Calibri","sans-serif";color:#1f497d">ITKPolynomials-4.1.lib<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:"Calibri","sans-serif";color:#1f497d">ITKBiasCorrection-4.1.lib<u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:"Calibri","sans-serif";color:#1f497d">ITKBioCell-4.1.lib<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:"Calibri","sans-serif";color:#1f497d">ITKDICOMParser-4.1.lib<u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:"Calibri","sans-serif";color:#1f497d">ITKIOXML-4.1.lib<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:"Calibri","sans-serif";color:#1f497d">ITKIOSpatialObjects-4.1.lib<u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:"Calibri","sans-serif";color:#1f497d">ITKFEM-4.1.lib<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:"Calibri","sans-serif";color:#1f497d">ITKIOIPL-4.1.lib<u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:"Calibri","sans-serif";color:#1f497d">ITKIOGE-4.1.lib<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:"Calibri","sans-serif";color:#1f497d">ITKIOSiemens-4.1.lib<u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:"Calibri","sans-serif";color:#1f497d">ITKKLMRegionGrowing-4.1.lib<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:"Calibri","sans-serif";color:#1f497d">ITKVTK-4.1.lib<u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:"Calibri","sans-serif";color:#1f497d">ITKWatersheds-4.1.lib<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:"Calibri","sans-serif";color:#1f497d">ITKDeprecated-4.1.lib<u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:"Calibri","sans-serif";color:#1f497d">ITKgiftiio-4.1.lib<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:"Calibri","sans-serif";color:#1f497d">ITKIOMesh-4.1.lib<u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:"Calibri","sans-serif";color:#1f497d">itkhdf5_cpp-4.1.lib<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:"Calibri","sans-serif";color:#1f497d">itkhdf5-4.1.lib<u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:"Calibri","sans-serif";color:#1f497d">ITKIOCSV-4.1.lib<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:"Calibri","sans-serif";color:#1f497d">ITKIOHDF5-4.1.lib<u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:"Calibri","sans-serif";color:#1f497d">ITKIOTransformBase-4.1.lib<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:"Calibri","sans-serif";color:#1f497d">ITKIOTransformHDF5-4.1.lib<u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:"Calibri","sans-serif";color:#1f497d">ITKIOTransformInsightLegacy-4.1.lib<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:"Calibri","sans-serif";color:#1f497d">ITKIOTransformMatlab-4.1.lib<u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:"Calibri","sans-serif";color:#1f497d">ITKOptimizersv4-4.1.lib<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:"Calibri","sans-serif";color:#1f497d">ITKReview-4.1.lib<u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:"Calibri","sans-serif";color:#1f497d">ITKVideoCore-4.1.lib<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:"Calibri","sans-serif";color:#1f497d">ITKVideoIO-4.1.lib<u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:"Calibri","sans-serif";color:#1f497d">itkgdcmIOD-4.1.lib<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:"Calibri","sans-serif";color:#1f497d">itkgdcmDSED-4.1.lib<u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:"Calibri","sans-serif";color:#1f497d">itkgdcmCommon-4.1.lib<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:"Calibri","sans-serif";color:#1f497d">itkgdcmjpeg8-4.1.lib<u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:"Calibri","sans-serif";color:#1f497d">itkgdcmjpeg12-4.1.lib<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:"Calibri","sans-serif";color:#1f497d">itkgdcmjpeg16-4.1.lib<u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:"Calibri","sans-serif";color:#1f497d">rpcrt4.lib<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:"Calibri","sans-serif";color:#1f497d">comctl32.lib<u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:"Calibri","sans-serif";color:#1f497d">wsock32.lib<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:"Calibri","sans-serif";color:#1f497d">ws2_32.lib<u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:"Calibri","sans-serif";color:#1f497d">ITKVNLInstantiation-4.1.lib<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:"Calibri","sans-serif";color:#1f497d">itkv3p_lsqr-4.1.lib<u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:"Calibri","sans-serif";color:#1f497d">itkvcl-4.1.lib<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p><p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:"Calibri","sans-serif";color:#1f497d">Regards,<u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:"Calibri","sans-serif";color:#1f497d">Wu, Pengfei<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p><p class="MsoNormal"><b><span style="font-size:10.0pt">发件人<span lang="EN-US">:</span></span></b><span lang="EN-US" style="font-size:10.0pt"> Bill Lorensen [mailto:<a href="mailto:bill.lorensen@gmail.com" target="_blank">bill.lorensen@gmail.com</a>] <br>
</span><b><span style="font-size:10.0pt">发送时间<span lang="EN-US">:</span></span></b><span lang="EN-US" style="font-size:10.0pt"> 2012</span><span style="font-size:10.0pt">年<span lang="EN-US">7</span>月<span lang="EN-US">5</span>日<span lang="EN-US"> 22:19<br>
</span><b>收件人<span lang="EN-US">:</span></b><span lang="EN-US"> </span>吴鹏飞<span lang="EN-US"><br></span><b>抄送<span lang="EN-US">:</span></b><span lang="EN-US"> <a href="mailto:insight-users@itk.org" target="_blank">insight-users@itk.org</a><br>
</span><b>主题<span lang="EN-US">:</span></b><span lang="EN-US"> Re: [Insight-users] Problem With ITKImageIO<u></u><u></u></span></span></p><div><div><p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>
<p class="MsoNormal" style="margin-bottom:12.0pt"><span lang="EN-US">Please show us your CMakeLists.txt file.<u></u><u></u></span></p><div><p class="MsoNormal"><span lang="EN-US">On Thu, Jul 5, 2012 at 7:57 AM, </span>吴鹏飞<span lang="EN-US"> <<a href="mailto:wpfnihao@gmail.com" target="_blank">wpfnihao@gmail.com</a>> wrote:<u></u><u></u></span></p>
<div><div><p class="MsoNormal"><span lang="EN-US" style="font-family:"Calibri","sans-serif"">Hello all,</span><span lang="EN-US"><u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US" style="font-family:"Calibri","sans-serif""> </span><span lang="EN-US"><u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family:"Calibri","sans-serif"">I am new to itk and tried to write my first program using itk and vtk to show an image, but I encountered a strange problem. It seems that my itk can’t infer from the file extension which ImageIO to use. If I commented the phrase </span><span lang="EN-US"><u></u><u></u></span></p>
<p class="MsoNormal" style="text-indent:21.0pt"><span lang="EN-US">reader->SetImageIO(itk::JPEGImageIO::New());</span><span lang="EN-US"><u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US" style="font-family:"Calibri","sans-serif"">out, the error </span><span lang="EN-US"><u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-family:"Calibri","sans-serif""> “</span><span lang="EN-US">Could not create IO object for file E:\1340858885.jpg</span><span lang="EN-US"><u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US"> Tried to create one of the following:</span><span lang="EN-US"><u></u><u></u></span></p><p class="MsoNormal" style="text-autospace:none"><span lang="EN-US"> You probably failed to set a file suffix, or</span><span lang="EN-US"><u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US"> set the suffix to an unsupported type.</span><span>”</span><span lang="EN-US"><u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US" style="font-family:"Calibri","sans-serif"">occurred, but the program worked properly with the phrase mentioned above. See my source code attached at the end of this mail.</span><span lang="EN-US"><u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family:"Calibri","sans-serif""> Is there someone can tell me why this happened?</span><span lang="EN-US"><u></u><u></u></span></p><p class="MsoNormal">
<span lang="EN-US" style="font-family:"Calibri","sans-serif""> </span><span lang="EN-US"><u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US" style="font-family:"Calibri","sans-serif"">Thanks a lot in advance!</span><span lang="EN-US"><u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family:"Calibri","sans-serif""> </span><span lang="EN-US"><u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US" style="font-family:"Calibri","sans-serif"">Wu, Pengfei</span><span lang="EN-US"><u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:"Calibri","sans-serif""> </span><span lang="EN-US"><u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US" style="font-size:14.0pt;font-family:"Calibri","sans-serif"">Code:</span><span lang="EN-US"><u></u><u></u></span></p>
<div class="MsoNormal" align="center" style="text-align:center;text-autospace:none"><span lang="EN-US" style="font-size:14.0pt;font-family:"Calibri","sans-serif""><hr size="2" width="100%" align="center">
</span></div><p class="MsoNormal" style="text-autospace:none"><span lang="EN-US">int</span><span lang="EN-US"> <span style="color:#010001">main</span>(<span style="color:blue">int</span> <span style="color:#010001">argc</span>, <span style="color:blue">char</span>* <span style="color:#010001">argv</span>[])</span><span lang="EN-US"><u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US">{</span><span lang="EN-US"><u></u><u></u></span></p><p class="MsoNormal" style="text-autospace:none"><span lang="EN-US"> <span style="color:blue">typedef</span> <span style="color:#010001">itk</span>::<span style="color:#010001">RGBPixel</span><<span style="color:blue">unsigned</span> <span style="color:blue">short</span>> <span style="color:#010001">PixelType</span>;</span><span lang="EN-US"><u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US"> <span style="color:blue">const</span> <span style="color:blue">unsigned</span> <span style="color:blue">int</span> <span style="color:#010001">Dimension</span> = 2;</span><span lang="EN-US"><u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US"> </span><span lang="EN-US"><u></u><u></u></span></p><p class="MsoNormal" style="text-autospace:none"><span lang="EN-US"> <span style="color:blue">typedef</span> <span style="color:#010001">itk</span>::<span style="color:#010001">Image</span><<span style="color:#010001">PixelType</span>, <span style="color:#010001">Dimension</span>> <span style="color:#010001">ImageType</span>;</span><span lang="EN-US"><u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US"> <span style="color:blue">typedef</span> <span style="color:#010001">itk</span>::<span style="color:#010001">ImageFileReader</span><<span style="color:#010001">ImageType</span>> <span style="color:#010001">ReaderType</span>;</span><span lang="EN-US"><u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US"> </span><span lang="EN-US"><u></u><u></u></span></p><p class="MsoNormal" style="text-autospace:none"><span lang="EN-US"> <span style="color:#010001">ReaderType</span>::<span style="color:#010001">Pointer</span> <span style="color:#010001">reader</span> = <span style="color:#010001">ReaderType</span>::<span style="color:#010001">New</span>();</span><span lang="EN-US"><u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US"> </span><span lang="EN-US"><u></u><u></u></span></p><p class="MsoNormal" style="text-autospace:none"><span lang="EN-US"> <span style="color:blue">const</span> <span style="color:blue">char</span> *<span style="color:#010001">filename</span> = <span style="color:#a31515">"E:\\1340858885.jpg"</span>;</span><span lang="EN-US"><u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US"> <span style="color:green">//reader->SetImageIO(itk::JPEGImageIO::New());</span></span><span lang="EN-US"><u></u><u></u></span></p><p class="MsoNormal" style="text-autospace:none">
<span lang="EN-US"> <span style="color:#010001">reader</span>-><span style="color:#010001">SetFileName</span>(<span style="color:#010001">filename</span>);</span><span lang="EN-US"><u></u><u></u></span></p><p class="MsoNormal" style="text-autospace:none">
<span lang="EN-US"> <span style="color:#010001">ImageType</span>::<span style="color:#010001">Pointer</span> <span style="color:#010001">image</span> = <span style="color:#010001">reader</span>-><span style="color:#010001">GetOutput</span>();</span><span lang="EN-US"><u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US"> </span><span lang="EN-US"><u></u><u></u></span></p><p class="MsoNormal" style="text-autospace:none"><span lang="EN-US"> </span><span lang="EN-US"><u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US"> <span style="color:blue">typedef</span> <span style="color:#010001">itk</span>::<span style="color:#010001">ImageToVTKImageFilter</span><<span style="color:#010001">ImageType</span>> <span style="color:#010001">FilterType</span>;</span><span lang="EN-US"><u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US"> <span style="color:#010001">FilterType</span>::<span style="color:#010001">Pointer</span> <span style="color:#010001">connecter</span> = <span style="color:#010001">FilterType</span>::<span style="color:#010001">New</span>();</span><span lang="EN-US"><u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US"> <span style="color:#010001">connecter</span>-><span style="color:#010001">SetInput</span>(<span style="color:#010001">image</span>);</span><span lang="EN-US"><u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US"> <span style="color:#010001">vtkImageViewer</span> *<span style="color:#010001">viewer</span> = <span style="color:#010001">vtkImageViewer</span>::<span style="color:#010001">New</span>();</span><span lang="EN-US"><u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US"> <span style="color:#010001">vtkRenderWindowInteractor</span> *<span style="color:#010001">renderWindowInteractor</span> = <span style="color:#010001">vtkRenderWindowInteractor</span>::<span style="color:#010001">New</span>();</span><span lang="EN-US"><u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US"> <span style="color:#010001">viewer</span>-><span style="color:#010001">SetupInteractor</span>(<span style="color:#010001">renderWindowInteractor</span>);</span><span lang="EN-US"><u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US"> <span style="color:#010001">viewer</span>-><span style="color:#010001">SetInput</span>(<span style="color:#010001">connecter</span>-><span style="color:#010001">GetOutput</span>());</span><span lang="EN-US"><u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US"> <span style="color:#010001">viewer</span>-><span style="color:#010001">Render</span>();</span><span lang="EN-US"><u></u><u></u></span></p><p class="MsoNormal" style="text-autospace:none">
<span lang="EN-US"> <span style="color:#010001">viewer</span>-><span style="color:#010001">SetColorWindow</span>(255);</span><span lang="EN-US"><u></u><u></u></span></p><p class="MsoNormal" style="text-autospace:none">
<span lang="EN-US"> <span style="color:#010001">viewer</span>-><span style="color:#010001">SetColorLevel</span>(128);</span><span lang="EN-US"><u></u><u></u></span></p><p class="MsoNormal" style="text-autospace:none">
<span lang="EN-US"> <span style="color:#010001">renderWindowInteractor</span>-><span style="color:#010001">Start</span>();</span><span lang="EN-US"><u></u><u></u></span></p><p class="MsoNormal" style="text-autospace:none">
<span lang="EN-US"> <span style="color:#010001">cin</span>.<span style="color:#010001">get</span>();</span><span lang="EN-US"><u></u><u></u></span></p><p class="MsoNormal" style="text-autospace:none"><span lang="EN-US"> <span style="color:blue">return</span> 0;</span><span lang="EN-US"><u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US">}</span><span lang="EN-US"><u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US" style="font-size:14.0pt;font-family:"Calibri","sans-serif"">-------------------------------------End of Code-------------------------------------------------------------</span><span lang="EN-US"><u></u><u></u></span></p>
</div></div><p class="MsoNormal" style="margin-bottom:12.0pt"><span lang="EN-US"><br>_____________________________________<br>Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br><br>Visit other Kitware open-source projects at<br>
<a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br><br>Kitware offers ITK Training Courses, for more information visit:<br><a href="http://www.kitware.com/products/protraining.php" target="_blank">http://www.kitware.com/products/protraining.php</a><br>
<br>Please keep messages on-topic and check the ITK FAQ at:<br><a href="http://www.itk.org/Wiki/ITK_FAQ" target="_blank">http://www.itk.org/Wiki/ITK_FAQ</a><br><br>Follow this link to subscribe/unsubscribe:<br><a href="http://www.itk.org/mailman/listinfo/insight-users" target="_blank">http://www.itk.org/mailman/listinfo/insight-users</a><u></u><u></u></span></p>
</div><p class="MsoNormal"><span lang="EN-US"><br><br clear="all"><u></u><u></u></span></p><div><p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p></div><p class="MsoNormal" style="margin-bottom:12.0pt"><span lang="EN-US">-- <br>
Unpaid intern in BillsBasement at noware dot com<u></u><u></u></span></p></div></div></div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br>Unpaid intern in BillsBasement at noware dot com<br><br>
</div>
</div>