Hi Syrine,<br><br><br><div class="gmail_quote">On Wed, Jun 17, 2009 at 6:59 AM, Syrine Sahmim <span dir="ltr">&lt;<a href="mailto:syrine.sahmim@yahoo.fr">syrine.sahmim@yahoo.fr</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div><div style="font-family: times new roman,new york,times,serif; font-size: 12pt;"><div>hi,<br>i learned the tutorials and i have install itk correctly and i had learned the part of the software guide who explain how to read a dicom series. and then i passed to try the example in exaple/io directory but i get errors in running the program<br>
so<br>1. you have mentionned that i must know how to write my own cmakelists file; So how can i do it<br></div></div></div></blockquote><div><br><br>See page 35 of the &quot;Getting Started I&quot; Tutorial<br><a href="http://www.itk.org/CourseWare/Training/GettingStartedI-WebPage/img35.html">http://www.itk.org/CourseWare/Training/GettingStartedI-WebPage/img35.html</a><br>
<br> </div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div><div style="font-family: times new roman,new york,times,serif; font-size: 12pt;">
<div>2. what&#39;s the problem on the code i had send before.<br>thanks<br></div><div style="font-family: times new roman,new york,times,serif; font-size: 12pt;"><div class="hm"></div></div></div></div></blockquote><div><br>
<br>The code in your email looks fine.<br>However at this point, from your (many) reports,<br>It seems that you have:<br><br>A) A corrupted cached in the binary directory of the Example.<br>     (please delete the binary directory of the example and start from scratch)<br>
<br>B) An unnecessarily complicated CMakeLists.txt file<br>     Please use the one that I send you in the past two emails.<br><br><br>   Regards,<br><br><br>          Luis<br><br><br><br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div><div style="font-family: times new roman,new york,times,serif; font-size: 12pt;"><div style="font-family: times new roman,new york,times,serif; font-size: 12pt;"><div class="hm"><br></div><div style="font-family: times new roman,new york,times,serif; font-size: 12pt;">
<div class="hm"><font size="2" face="Tahoma"><hr size="1"><b><span style="font-weight: bold;">De :</span></b> Luis Ibanez &lt;<a href="mailto:luis.ibanez@kitware.com" target="_blank">luis.ibanez@kitware.com</a>&gt;<br><b><span style="font-weight: bold;">À :</span></b> Syrine
 Sahmim &lt;<a href="mailto:syrine.sahmim@yahoo.fr" target="_blank">syrine.sahmim@yahoo.fr</a>&gt;<br><b><span style="font-weight: bold;">Cc :</span></b> <a href="mailto:insight-users@itk.org" target="_blank">insight-users@itk.org</a><br>
<b><span style="font-weight: bold;">Envoyé le :</span></b> Mercredi, 17 Juin 2009, 11h51mn 35s<br><b><span style="font-weight: bold;">Objet :</span></b> Re: [Insight-users] i can&#39;t read image with itk<br></font></div>
<div><div></div><div class="h5"><br>Hi Syrine,<br><br><br>              Welcome to ITK !<br><br><br>Please follow first the ITK tutorials:<br><br><a rel="nofollow" href="http://www.itk.org/ITK/help/tutorials.html" target="_blank">http://www.itk.org/ITK/help/tutorials.html</a><br>
<br>In particular:<br>
<br>&quot;Getting Started I&quot;<br><a rel="nofollow" href="http://www.itk.org/CourseWare/Training/GettingStartedI-WebPage/index.htm" target="_blank">http://www.itk.org/CourseWare/Training/GettingStartedI-WebPage/index.htm</a><br>
<br>It will save you a lot of time.<br>
<br>The tutorial guide step-by-step on how to install<br>and use ITK.<br><br>You should also read the ITK Software Guide<br><br>    <a rel="nofollow" href="http://www.itk.org/ItkSoftwareGuide.pdf" target="_blank">http://www.itk.org/ItkSoftwareGuide.pdf</a><br>

<br><br>Regarding your code:<br><br>A) You are passing a PNG image as input to a reader.<br>     You are currently not passing a DICOM image.<br>   <br>     for instructions on how to read a DICOM image,<br>     please look at the Chapter  &quot;Reading and Writing Images&quot;<br>

     in the ITK Software Guide.<br><br>B) You CMakeLists.txt file was copies from the Examples<br>     directory. You may find easier to write your own, by<br>     following the instructions in the Tutorial.<br><br>You should only need something like<br>

<br>CMAKE_MINIMUM_REQUIRED(VERSION 2.4)<br>IF(COMMAND CMAKE_POLICY)<br>  CMAKE_POLICY(SET CMP0003 NEW)<br>ENDIF(COMMAND CMAKE_POLICY)<br><br>PROJECT(ImageExamples)<br>FIND_PACKAGE(ITK REQUIRED)<br>INCLUDE(${ITK_USE_FILE})<br>

<br><div>ADD_EXECUTABLE(Image2 Image2.cxx )<br>TARGET_LINK_LIBRARIES(Image2 ITKIO)<br><br><br></div>and then run the code from the command line.<br><br><br>C) Whenever you are in doubt about whether<br>     your messages make it to the mailing list,<br>

     you can check the Archives:<br><a rel="nofollow" href="http://www.itk.org/pipermail/insight-users/" target="_blank">http://www.itk.org/pipermail/insight-users/</a><br><br>     see for example:<br><a rel="nofollow" href="http://www.itk.org/pipermail/insight-users/2009-June/date.html" target="_blank">http://www.itk.org/pipermail/insight-users/2009-June/date.html</a><br>

<br><br><br>    Regards,<br><br><br>           Luis<br><br><br>------------------------------------------------------------------<br><div class="gmail_quote">On Wed, Jun 17, 2009 at 3:11 AM, Syrine Sahmim <span dir="ltr">&lt;<a rel="nofollow" href="mailto:syrine.sahmim@yahoo.fr" target="_blank">syrine.sahmim@yahoo.fr</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div><div style="font-family: times new roman,new york,times,serif; font-size: 12pt; color: rgb(0, 0, 0);">

<div>Hello,<br>I&#39;m a new user of ITK.<br>I succeed to install it and run it on c++.<br>I won&#39;t to read  dicom image and display it on screen at the begining.i tried the examples included on itk/example but i have many errors when i debogue the program.the build is successful.I have tried for many days but i can&#39;t debogue it . i have send many times to the forum but i don&#39;t reseived any answer. <br>

can somebody help me<br>Thanks<br><br><div>the c make file is as follow:<br>CMAKE_MINIMUM_REQUIRED(VERSION 2.4)<br>IF(COMMAND CMAKE_POLICY)<br>  CMAKE_POLICY(SET CMP0003 NEW)<br>ENDIF(COMMAND CMAKE_POLICY)<br><br>PROJECT(ImageExamples)<br>

FIND_PACKAGE(ITK REQUIRED)<br>INCLUDE(${ITK_USE_FILE})<br>INCLUDE_REGULAR_EXPRESSION(&quot;^.*$&quot;)<br><br>SET(TEMP
 ${ITK_BINARY_DIR}/Testing/Temporary)<br><br>ADD_EXECUTABLE(Image2 Image2.cxx )<br>TARGET_LINK_LIBRARIES(Image2 ITKIO)<br><br>SET(IMAGE_EXAMPLES2 ${CXX_TEST_PATH}/ImageExamples2)<br>IF( NOT ITK_DISABLE_CXX_TESTING )<br><br>

IF(BUILD_TESTING)<br><br>IF(NOT BORLAND)<br>  ADD_TEST(Image2Test ${IMAGE_EXAMPLES}<br>    Image2Test ${ITK_SOURCE_DIR}/Examples/Data/BrainMidSagittalSlice.png<br>  )<br>ENDIF(NOT BORLAND)<br>ENDIF(BUILD_TESTING)<br>ENDIF( NOT
 ITK_DISABLE_CXX_TESTING )<br><br>and the image2.cxx file is :<br>#if defined(_MSC_VER)<br>#pragma warning ( disable : 4786 )<br>#endif<br>#include &quot;itkImage.h&quot;<br></div>#include &quot;itkImageFileReader.h&quot;<br>

int main( int , char * argv[])<br>{typedef unsigned char          PixelType;<br>  const unsigned int             Dimension = 3;<br><br>  typedef itk::Image&lt; PixelType, Dimension &gt;   ImageType;<br>typedef itk::ImageFileReader&lt; ImageType &gt;  ReaderType;<br>

ReaderType::Pointer reader = ReaderType::New();<br>const char * filename = argv[1];<br>  reader-&gt;SetFileName( filename );<br>reader-&gt;Update();<br>ImageType::Pointer image = reader-&gt;GetOutput();<br> return 0;}<br>

<br></div></div><br>



      </div><br>_____________________________________<br>
Powered by <a rel="nofollow" href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at<br>
<a rel="nofollow" href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the ITK FAQ at: <a rel="nofollow" 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 rel="nofollow" href="http://www.itk.org/mailman/listinfo/insight-users" target="_blank">http://www.itk.org/mailman/listinfo/insight-users</a><br>
<br></blockquote></div><br>
</div></div></div></div></div><br>



      </div><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>
Please keep messages on-topic and check the ITK FAQ at: <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><br>
<br></blockquote></div><br>