<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
    <title></title>
  </head>
  <body bgcolor="#ffffff" text="#000000">
    Hi H-B,<br>
    <br>
    You're reading in the image and running it through a
    GradientMagnitudeImageFilter, but then you're not actually doing
    anything with it -- it's therefore not surprising that the image
    isn't being displayed (you never wrote the code to display it). The
    key point to bear in mind is that ITK is an *image processing*
    toolkit, not a *visualization* toolkit (that's what VTK is for). If
    you want to visualize things, you either have to use VTK, or
    visualize the image some other way (for instance, the way I do it in
    my code is to create OpenGL textures from the images and render
    texture-mapped polygons to visualize them). Just loading in the
    image isn't enough -- all that does is read the image into memory.<br>
    <br>
    Hope that helps!<br>
    Stu<br>
    <br>
    On 28/10/2010 10:32, H-B wrote:
    <blockquote cite="mid:325754.7915.qm@web38303.mail.mud.yahoo.com"
      type="cite">
      <table border="0" cellpadding="0" cellspacing="0">
        <tbody>
          <tr>
            <td style="font: inherit;" valign="top">
              <div>hi all, i am new ti itk </div>
              <div>&nbsp;</div>
              <div>the hello world run with out any problem</div>
              <div>&nbsp;</div>
              <div>but when run data-representation example no any image
                displayed,just the black screen appear quickly and
                disappear</div>
              <div>&nbsp;</div>
              <div>i dont know what is the problm ,, i set the file name
                to</div>
              <font size="2">
              </font>
              <div><font size="2">reader-&gt;SetFileName( </font><font
                  size="2" color="#a31515"><font size="2"
                    color="#a31515">"C:\Users\Rahaf\Pictures\1.jpg"</font></font><font
                  size="2">);</font></div>
              <div>&nbsp;</div>
              <div><font size="2">because i dont know how to set
                  parameters for argv[1] .......</font></div>
              <div>&nbsp;</div>
              <div><font size="2">i spent alot of time in reading and
                  searching , at the end i try to send this message
                  which i hope i will find answer to my questions.</font></div>
              <div>&nbsp;</div>
              <div><font size="2">her is the code:</font></div>
              <div>&nbsp;</div>
              <font size="2"><font size="2" color="#0000ff"><font
                    size="2" color="#0000ff">
                  </font></font>
                <div><font size="2" color="#0000ff"><font size="2"
                      color="#0000ff">#if</font></font><font size="2"> </font><font
                    size="2" color="#0000ff"><font size="2"
                      color="#0000ff">defined</font></font><font
                    size="2">(_MSC_VER)</font></div>
                <font size="2" color="#0000ff"><font size="2"
                    color="#0000ff">
                  </font></font>
                <div><font size="2" color="#0000ff"><font size="2"
                      color="#0000ff">#pragma</font></font><font
                    size="2"> </font><font size="2" color="#0000ff"><font
                      size="2" color="#0000ff">warning</font></font><font
                    size="2"> ( </font><font size="2" color="#0000ff"><font
                      size="2" color="#0000ff">disable</font></font><font
                    size="2"> : 4786 )</font></div>
                <font size="2" color="#0000ff"><font size="2"
                    color="#0000ff">
                  </font></font>
                <div><font size="2" color="#0000ff"><font size="2"
                      color="#0000ff">#endif</font></font></div>
                <div><font size="2" color="#0000ff"><font size="2"
                      color="#0000ff">#include</font></font><font
                    size="2"> </font><font size="2" color="#a31515"><font
                      size="2" color="#a31515">"itkImage.h"</font></font></div>
                <font size="2" color="#0000ff"><font size="2"
                    color="#0000ff">
                  </font></font>
                <div><font size="2" color="#0000ff"><font size="2"
                      color="#0000ff">#include</font></font><font
                    size="2"> </font><font size="2" color="#a31515"><font
                      size="2" color="#a31515">"itkImageFileReader.h"</font></font></div>
                <font size="2" color="#0000ff"><font size="2"
                    color="#0000ff">
                  </font></font>
                <div><font size="2" color="#0000ff"><font size="2"
                      color="#0000ff">#include</font></font><font
                    size="2"> </font><font size="2" color="#a31515"><font
                      size="2" color="#a31515">"itkGradientMagnitudeImageFilter.h"</font></font></div>
                <font size="2" color="#0000ff"><font size="2"
                    color="#0000ff">
                  </font></font>
                <div><font size="2" color="#0000ff"><font size="2"
                      color="#0000ff">int</font></font><font size="2">
                    main( </font><font size="2" color="#0000ff"><font
                      size="2" color="#0000ff">int</font></font><font
                    size="2"> argc, </font><font size="2"
                    color="#0000ff"><font size="2" color="#0000ff">char</font></font><font
                    size="2"> **argv ) {</font></div>
                <font size="2" color="#0000ff"><font size="2"
                    color="#0000ff">
                  </font></font>
                <div><font size="2" color="#0000ff"><font size="2"
                      color="#0000ff">typedef</font></font><font
                    size="2"> itk::Image&lt;</font><font size="2"
                    color="#0000ff"><font size="2" color="#0000ff">unsigned</font></font><font
                    size="2"> </font><font size="2" color="#0000ff"><font
                      size="2" color="#0000ff">short</font></font><font
                    size="2">,2&gt; ImageType;</font></div>
                <font size="2" color="#0000ff"><font size="2"
                    color="#0000ff">
                  </font></font>
                <div><font size="2" color="#0000ff"><font size="2"
                      color="#0000ff">typedef</font></font><font
                    size="2"> itk::ImageFileReader&lt;ImageType&gt;
                    ReaderType;</font></div>
                <font size="2" color="#0000ff"><font size="2"
                    color="#0000ff">
                  </font></font>
                <div><font size="2" color="#0000ff"><font size="2"
                      color="#0000ff">typedef</font></font><font
                    size="2"> itk::GradientMagnitudeImageFilter&lt; </font></div>
                <div><font size="2">ImageType,ImageType&gt; FilterType;</font></div>
                <div><font size="2">ReaderType::Pointer reader =
                    ReaderType::New();</font></div>
                <div><font size="2">FilterType::Pointer filter =
                    FilterType::New();</font></div>
                <div><font size="2">reader-&gt;SetFileName( </font><font
                    size="2" color="#a31515"><font size="2"
                      color="#a31515">"C:\Users\Rahaf\Pictures\1.jpg"</font></font><font
                    size="2"> );</font></div>
                <div><font size="2">filter-&gt;SetInput(
                    reader-&gt;GetOutput() );</font></div>
                <div><font size="2">filter-&gt;Update();</font></div>
                <font size="2" color="#0000ff"><font size="2"
                    color="#0000ff">
                  </font></font>
                <div><font size="2" color="#0000ff"><font size="2"
                      color="#0000ff">return</font></font><font size="2">
                    0;</font></div>
                <div><font size="2">}</font></div>
                <div><font size="2">&nbsp;</font></div>
                <div><font size="2">theCmakelists</font></div>
                <div><font size="2"><br>
                    PROJECT(ImageExamples)<br>
                    INCLUDE_REGULAR_EXPRESSION("^.*$")</font></div>
                <div><font size="2">FIND_PACKAGE ( ITK)<br>
                    IF ( ITK_FOUND)<br>
                    INCLUDE( ${USE_ITK_FILE} )<br>
                    ENDIF( ITK_FOUND)</font></div>
                <div><font size="2">&nbsp;</font></div>
                <div><font size="2">ADD_EXECUTABLE(Image2 Image2.cxx )<br>
                    TARGET_LINK_LIBRARIES(Image2 ITKBasicFilters
                    ITKCommon ITKIO)</font></div>
                <div><font size="2">&nbsp;</font></div>
                <div><font size="2">&nbsp;</font></div>
              </font></td>
          </tr>
        </tbody>
      </table>
      <br>
      <pre wrap="">
<fieldset class="mimeAttachmentHeader"></fieldset>
_____________________________________
Powered by <a class="moz-txt-link-abbreviated" href="http://www.kitware.com">www.kitware.com</a>

Visit other Kitware open-source projects at
<a class="moz-txt-link-freetext" href="http://www.kitware.com/opensource/opensource.html">http://www.kitware.com/opensource/opensource.html</a>

Kitware offers ITK Training Courses, for more information visit:
<a class="moz-txt-link-freetext" href="http://www.kitware.com/products/protraining.html">http://www.kitware.com/products/protraining.html</a>

Please keep messages on-topic and check the ITK FAQ at:
<a class="moz-txt-link-freetext" href="http://www.itk.org/Wiki/ITK_FAQ">http://www.itk.org/Wiki/ITK_FAQ</a>

Follow this link to subscribe/unsubscribe:
<a class="moz-txt-link-freetext" href="http://www.itk.org/mailman/listinfo/insight-users">http://www.itk.org/mailman/listinfo/insight-users</a>
</pre>
    </blockquote>
  </body>
</html>