<!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 Caleb,<br>
The code is here, very simple:<br>
/*****************************************/<br>
#include "itkImage.h"<br>
#include "itkImageFileReader.h"<br>
#include "itkImageToVTKImageFilter.h"<br>
<br>
#include "vtkImageViewer.h"<br>
#include "vtkRenderWindowInteractor.h"<br>
<br>
int main(int argc, char **argv){<br>
<br>
&nbsp;&nbsp;&nbsp; typedef itk::Image&lt;unsigned short, 2&gt; ImageType;<br>
&nbsp;&nbsp;&nbsp; typedef itk::ImageFileReader&lt;ImageType&gt; ReaderType;<br>
&nbsp;&nbsp;&nbsp; typedef itk::ImageToVTKImageFilter&lt;ImageType&gt; FilterType;<br>
<br>
&nbsp;&nbsp;&nbsp; ReaderType::Pointer reader = ReaderType::New();<br>
&nbsp;&nbsp;&nbsp; FilterType::Pointer connector = FilterType::New();<br>
<br>
&nbsp;&nbsp;&nbsp; reader-&gt;SetFileName(argv[1]);<br>
&nbsp;&nbsp;&nbsp; connector-&gt;SetInput(reader-&gt;GetOutput());<br>
<br>
&nbsp;&nbsp;&nbsp; vtkImageViewer *viewer = vtkImageViewer::New();<br>
<br>
&nbsp;&nbsp;&nbsp; vtkRenderWindowInteractor *renderWindowInteractor =
vtkRenderWindowInteractor::New();<br>
<br>
&nbsp;&nbsp;&nbsp; viewer-&gt;SetupInteractor(renderWindowInteractor);<br>
&nbsp;&nbsp;&nbsp; viewer-&gt;SetInput(connector-&gt;GetOutput());<br>
&nbsp;&nbsp;&nbsp; viewer-&gt;Render();<br>
&nbsp;&nbsp;&nbsp; viewer-&gt;SetColorWindow(2000);<br>
&nbsp;&nbsp;&nbsp; viewer-&gt;SetColorLevel(1000);<br>
&nbsp;&nbsp;&nbsp; renderWindowInteractor-&gt;Start();<br>
<br>
&nbsp;&nbsp;&nbsp; return 0;<br>
}<br>
/**************************************************/<br>
Best,<br>
Cheng<br>
&#20110; 2010/5/18 18:44, Caleb Johnston &#20889;&#36947;:
<blockquote
 cite="mid:AANLkTin2islYqHgmPBMiVs7cP1BF34gfzO9PsX90NrZO@mail.gmail.com"
 type="cite">I see the code listed in the example PDF. However, could
you send me your example source file? Or you can paste it in an email
if it is just that one example c file.<br>
  <br>
A segmentation fault is caused by your program attempting to access a
protected region of memory. Its possible that is happening in your code
accidentally.<br>
  <br>
Caleb<br>
  <br>
  <br>
  <div class="gmail_quote">On Tue, May 18, 2010 at 10:38 AM, Qian Cheng
  <span dir="ltr">&lt;<a moz-do-not-send="true"
 href="mailto:qianc@ee.ethz.ch">qianc@ee.ethz.ch</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;">Dear
all,<br>
I am compiling the simple example given by<br>
"<a moz-do-not-send="true"
 href="http://www.itk.org/CourseWare/Training/GettingStarted-II.pdf"
 target="_blank">http://www.itk.org/CourseWare/Training/GettingStarted-II.pdf</a>".<br>
It seems working(showing a picture in a window). But whenever I close<br>
the rendered window, "Segmentation fault" shows up in the command line.<br>
Does anybody know what's wrong? I am running ITK+VTK in my lab's<br>
sever("Linux 2.6.18-194.3.1.el5 #1 SMP Sun May 2 04:17:42 EDT 2010<br>
x86_64 x86_64 x86_64 GNU/Linux") without TCL, QT and FLTK wrapped.<br>
I am new to VTK&amp;ITK, I would appreciate if anybody can help out.<br>
Best,<br>
Cheng<br>
    <br>
_____________________________________<br>
Powered by <a moz-do-not-send="true" href="http://www.kitware.com"
 target="_blank">www.kitware.com</a><br>
    <br>
Visit other Kitware open-source projects at<br>
    <a moz-do-not-send="true"
 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 moz-do-not-send="true"
 href="http://www.kitware.com/products/protraining.html" target="_blank">http://www.kitware.com/products/protraining.html</a><br>
    <br>
Please keep messages on-topic and check the ITK FAQ at:<br>
    <a moz-do-not-send="true" 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 moz-do-not-send="true"
 href="http://www.itk.org/mailman/listinfo/insight-users"
 target="_blank">http://www.itk.org/mailman/listinfo/insight-users</a><br>
  </blockquote>
  </div>
  <br>
</blockquote>
<br>
</body>
</html>