<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=us-ascii"><meta name=Generator content="Microsoft Word 12 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:"Malgun Gothic";
        panose-1:0 0 0 0 0 0 0 0 0 0;}
@font-face
        {font-family:DotumChe;
        panose-1:2 11 6 9 0 1 1 1 1 1;}
@font-face
        {font-family:"\@DotumChe";
        panose-1:2 11 6 9 0 1 1 1 1 1;}
@font-face
        {font-family:"\@Malgun Gothic";
        panose-1:0 0 0 0 0 0 0 0 0 0;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.25in 1.0in 1.25in;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=EN-US link=blue vlink=purple><div class=WordSection1><p class=MsoNormal>Dear Members,<o:p></o:p></p><p class=MsoNormal><o:p>&nbsp;</o:p></p><p class=MsoNormal>In my 2D image viewer, users can click on an image and mark several points in this image. When users change the slices, the markers should disappear. But actually the markers never disappear. Could anybody share his or her ideas?<o:p></o:p></p><p class=MsoNormal><o:p>&nbsp;</o:p></p><p class=MsoNormal>I searched a lot through Google and spent much time on it. Still I could not get any solution.<o:p></o:p></p><p class=MsoNormal><o:p>&nbsp;</o:p></p><p class=MsoNormal>Attached please check my code. Could you point out where and how to change the code? Thank you so much!<o:p></o:p></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:DotumChe'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:DotumChe;color:green'>//This callback is responsible for setting the seed label<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:DotumChe;color:blue'>class</span><span style='font-size:10.0pt;font-family:DotumChe'> vtkSeedCallback : <span style='color:blue'>public</span> vtkCommand<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:DotumChe'>{<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:DotumChe'>&nbsp; <span style='color:blue'>public</span>:<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:DotumChe'>&nbsp;&nbsp;&nbsp; <span style='color:blue'>static</span> vtkSeedCallback *New()<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:DotumChe'>&nbsp;&nbsp;&nbsp; { <o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:DotumChe'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style='color:blue'>return</span> <span style='color:blue'>new</span> vtkSeedCallback; <o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:DotumChe'>&nbsp;&nbsp;&nbsp;&nbsp;}<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:DotumChe'> &nbsp;&nbsp;&nbsp;&nbsp;vtkSeedCallback() {}<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:DotumChe'> <o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:DotumChe'>&nbsp;&nbsp;&nbsp;&nbsp;<span style='color:blue'>virtual</span> <span style='color:blue'>void</span> Execute(vtkObject*, <span style='color:blue'>unsigned</span> <span style='color:blue'>long</span> <span style='color:blue'>event</span>, <span style='color:blue'>void</span> *calldata)<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:DotumChe'>&nbsp;&nbsp;&nbsp; {<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:DotumChe'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style='color:blue'>if</span>(<span style='color:blue'>event</span> == vtkCommand::PlacePointEvent)<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:DotumChe'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:DotumChe'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; std::cout &lt;&lt; <span style='color:#A31515'>&quot;Point placed, total of: &quot;</span> <o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:DotumChe'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;&lt; <span style='color:blue'>this</span>-&gt;SeedRepresentation-&gt;GetNumberOfSeeds() &lt;&lt; std::endl;<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:DotumChe'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:DotumChe'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style='color:blue'>if</span>(<span style='color:blue'>event</span> == vtkCommand::InteractionEvent)<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:DotumChe'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:DotumChe'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style='color:blue'>if</span>(calldata)<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:DotumChe'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:DotumChe'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; std::cout &lt;&lt; <span style='color:#A31515'>&quot;Interacting with seed : &quot;</span> <o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:DotumChe'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;&lt; *(<span style='color:blue'>static_cast</span>&lt; <span style='color:blue'>int</span> * &gt;(calldata)) &lt;&lt; std::endl;<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:DotumChe'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:DotumChe'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:DotumChe'>&nbsp; </span><span style='font-size:10.0pt;font-family:DotumChe'>&nbsp;</span><span style='font-size:10.0pt;font-family:DotumChe'>&nbsp;&nbsp;&nbsp;std::cout &lt;&lt; <span style='color:#A31515'>&quot;List of seeds (Display coordinates):&quot;</span> &lt;&lt; std::endl;<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:DotumChe'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; <o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:DotumChe'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style='color:blue'>for</span>(vtkIdType i = 0; i &lt; <span style='color:blue'>this</span>-&gt;SeedRepresentation-&gt;GetNumberOfSeeds(); i++)<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:DotumChe'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:DotumChe'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style='color:blue'>double</span> pos[3];<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:DotumChe'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style='color:blue'>this</span>-&gt;SeedRepresentation-&gt;GetSeedWorldPosition(i, pos);<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:DotumChe'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; std::cout &lt;&lt; <span style='color:#A31515'>&quot;(&quot;</span> &lt;&lt; pos[0] &lt;&lt; <span style='color:#A31515'>&quot; &quot;</span> &lt;&lt; pos[1] &lt;&lt; <span style='color:#A31515'>&quot; &quot;</span> &lt;&lt; pos[2] &lt;&lt; <span style='color:#A31515'>&quot;)&quot;</span> &lt;&lt; std::endl;</span><span style='font-size:10.0pt;font-family:DotumChe'><o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:DotumChe'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:DotumChe'>&nbsp;&nbsp;&nbsp;&nbsp; }</span><span style='font-size:10.0pt;font-family:DotumChe'><o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:DotumChe'>&nbsp;&nbsp;&nbsp; <span style='color:blue'>void</span> SetRepresentation(vtkSmartPointer&lt;vtkSeedRepresentation&gt; rep) {<span style='color:blue'>this</span>-&gt;SeedRepresentation = rep;}<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:DotumChe'>&nbsp;&nbsp;&nbsp; <span style='color:blue'>private</span>:<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:DotumChe'>&nbsp;&nbsp;&nbsp; vtkSmartPointer&lt;vtkSeedRepresentation&gt; SeedRepresentation;<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt;font-family:DotumChe'>};</span><span style='font-size:10.0pt;font-family:DotumChe'><o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt;font-family:DotumChe'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:DotumChe'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:DotumChe;color:blue'>class</span><span style='font-size:10.0pt;font-family:DotumChe'> vtkSliderCallback2 : <span style='color:blue'>public</span> vtkCommand<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:DotumChe'>{<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:DotumChe;color:blue'>public</span><span style='font-size:10.0pt;font-family:DotumChe'>:<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:DotumChe'>&nbsp; <span style='color:blue'>static</span> vtkSliderCallback2 *New() <o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:DotumChe'>&nbsp;&nbsp;&nbsp;&nbsp;{ <span style='color:blue'>return</span> <span style='color:blue'>new</span> vtkSliderCallback2; }<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:DotumChe'>&nbsp; <span style='color:blue'>void</span> SetImageViewer(vtkImageViewer2 *viewer)<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:DotumChe'>&nbsp;&nbsp;&nbsp; { <span style='color:blue'>this</span>-&gt;Viewer =&nbsp; viewer; }<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:DotumChe'>&nbsp; <span style='color:blue'>virtual</span> <span style='color:blue'>void</span> Execute(vtkObject *caller, <span style='color:blue'>unsigned</span> <span style='color:blue'>long</span> , <span style='color:blue'>void</span>* )<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:DotumChe'>&nbsp;&nbsp;&nbsp; {<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:DotumChe'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; vtkSliderWidget *slider = <span style='color:blue'>static_cast</span>&lt;vtkSliderWidget *&gt;(caller);<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:DotumChe'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; vtkSliderRepresentation *sliderRepres = <span style='color:blue'>static_cast</span>&lt;vtkSliderRepresentation *&gt;(slider-&gt;GetRepresentation());<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:DotumChe'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style='color:blue'>int</span> pos = <span style='color:blue'>static_cast</span>&lt;<span style='color:blue'>int</span>&gt;(sliderRepres-&gt;GetValue());<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:DotumChe'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:DotumChe'>&nbsp;&nbsp;&nbsp; <span style='color:blue'>this</span>-&gt;Viewer-&gt;SetSlice(pos);<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:DotumChe'>&nbsp;&nbsp;&nbsp; }<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:DotumChe;color:blue'>protected</span><span style='font-size:10.0pt;font-family:DotumChe'>:<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:DotumChe'>&nbsp; vtkImageViewer2 *Viewer;<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt;font-family:DotumChe'>};</span><span style='font-size:10.0pt;font-family:DotumChe'><o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt;font-family:DotumChe'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:DotumChe'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:DotumChe;color:blue'>int</span><span style='font-size:10.0pt;font-family:DotumChe'> main (<span style='color:blue'>int</span> argc, <span style='color:blue'>char</span> *argv[])<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:DotumChe'>{<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:DotumChe'>&nbsp; <span style='color:blue'>typedef</span>&nbsp;&nbsp;&nbsp; <span style='color:blue'>float</span>&nbsp;&nbsp;&nbsp; InputPixelType;<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:DotumChe'>&nbsp; <span style='color:blue'>typedef</span>&nbsp;&nbsp;&nbsp; <span style='color:blue'>float</span>&nbsp;&nbsp;&nbsp; OutputPixelType;<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:DotumChe'>&nbsp; <span style='color:blue'>typedef</span> itk::Image&lt; InputPixelType,&nbsp; 3 &gt;&nbsp;&nbsp; InputImageType;<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:DotumChe'>&nbsp; <span style='color:blue'>typedef</span> itk::Image&lt; OutputPixelType, 3 &gt;&nbsp;&nbsp; OutputImageType;<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:DotumChe'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:DotumChe'>&nbsp; <span style='color:green'>// Load DICOM files<o:p></o:p></span></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:DotumChe'>&nbsp; <span style='color:blue'>typedef</span> itk::ImageSeriesReader&lt; InputImageType &gt;&nbsp;&nbsp;&nbsp;&nbsp; ReaderType;<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:DotumChe'>&nbsp; ReaderType::Pointer reader = ReaderType::New();<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:DotumChe'>&nbsp; <span style='color:blue'>typedef</span> itk::GDCMImageIO&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ImageIOType;<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:DotumChe'>&nbsp; <span style='color:blue'>typedef</span> itk::GDCMSeriesFileNames&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; NamesGeneratorType;<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:DotumChe'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:DotumChe'>&nbsp; ImageIOType::Pointer gdcmIO = ImageIOType::New();<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:DotumChe'>&nbsp; NamesGeneratorType::Pointer namesGenerator = NamesGeneratorType::New();<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:DotumChe'>&nbsp; <o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:DotumChe'>&nbsp;&nbsp;namesGenerator-&gt;SetInputDirectory( <span style='color:#A31515'>&quot;D:/Hybrid Method/Hybrid/KimJaeHuan/Diffusion_filter&quot;</span> );<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:DotumChe'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:DotumChe'>&nbsp; <span style='color:blue'>const</span> ReaderType::FileNamesContainer &amp; filenames = <o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:DotumChe'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;namesGenerator-&gt;GetInputFileNames();<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:DotumChe'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:DotumChe'>&nbsp; <span style='color:blue'>unsigned</span> <span style='color:blue'>int</span> numberOfFilenames =&nbsp; filenames.size();<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:DotumChe'>&nbsp; std::cout &lt;&lt; numberOfFilenames &lt;&lt; <span style='color:#A31515'>&quot; images loaded&quot;</span> &lt;&lt; std::endl; <o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:DotumChe'>&nbsp;&nbsp;<span style='color:blue'>for</span>(<span style='color:blue'>unsigned</span> <span style='color:blue'>int</span> fni = 0; fni&lt;numberOfFilenames; fni++)<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:DotumChe'>&nbsp;&nbsp;&nbsp; {<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:DotumChe'>&nbsp;&nbsp;&nbsp; std::cout &lt;&lt; <span style='color:#A31515'>&quot;filename # &quot;</span> &lt;&lt; fni &lt;&lt; <span style='color:#A31515'>&quot; = &quot;</span>;<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:DotumChe'>&nbsp;&nbsp;&nbsp; std::cout &lt;&lt; filenames[fni] &lt;&lt; std::endl;<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:DotumChe'>&nbsp;&nbsp;&nbsp; }<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:DotumChe'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:DotumChe'>&nbsp; reader-&gt;SetImageIO( gdcmIO );<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:DotumChe'>&nbsp; reader-&gt;SetFileNames( filenames );<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:DotumChe'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:DotumChe'>&nbsp; <span style='color:blue'>typedef</span> itk::ImageToVTKImageFilter&lt;InputImageType&gt;FilterType;<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:DotumChe'>&nbsp; FilterType::Pointer connector = FilterType::New();<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:DotumChe'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:DotumChe'>&nbsp; reader-&gt;Update();<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:DotumChe'>&nbsp; connector-&gt;SetInput(reader-&gt;GetOutput());<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:DotumChe'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:DotumChe'>&nbsp; vtkSmartPointer&lt;vtkLookupTable&gt; table = vtkSmartPointer&lt;vtkLookupTable&gt;::New();<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:DotumChe'>&nbsp; table-&gt;SetRange(129, 137); <span style='color:green'>// image intensity range<o:p></o:p></span></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:DotumChe'>&nbsp; table-&gt;SetValueRange(0.0, 1.0); <span style='color:green'>// from black to white<o:p></o:p></span></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:DotumChe'>&nbsp; table-&gt;SetSaturationRange(0.0, 0.0); <span style='color:green'>// no color saturation<o:p></o:p></span></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:DotumChe'>&nbsp; table-&gt;SetRampToLinear();<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:DotumChe'>&nbsp; table-&gt;Build();<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:DotumChe'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:DotumChe'>&nbsp; vtkSmartPointer&lt;vtkImageMapToColors&gt; color = vtkSmartPointer&lt;vtkImageMapToColors&gt;::New();<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:DotumChe'>&nbsp; color-&gt;SetLookupTable(table);<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:DotumChe'>&nbsp; color-&gt;SetInput(connector-&gt;GetOutput());<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:DotumChe'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:DotumChe'>&nbsp; vtkImageViewer2 *imageViewer = vtkImageViewer2::New();<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:DotumChe'>&nbsp; imageViewer-&gt;SetInput(color-&gt;GetOutput());<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:DotumChe'>&nbsp; imageViewer-&gt;SetColorLevel(127);<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:DotumChe'>&nbsp; imageViewer-&gt;SetColorWindow(255);<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:DotumChe;color:green'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:DotumChe;color:green'>&nbsp; </span><span style='font-size:10.0pt;font-family:DotumChe;color:green'>// Create the representation<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:DotumChe'>&nbsp; vtkSmartPointer&lt;vtkPointHandleRepresentation2D&gt; handle = <o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:DotumChe'>&nbsp;&nbsp;&nbsp;&nbsp;vtkSmartPointer&lt;vtkPointHandleRepresentation2D&gt;::New();<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:DotumChe'>&nbsp; handle-&gt;GetProperty()-&gt;SetColor(1,0,0);<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:DotumChe'>&nbsp; vtkSmartPointer&lt;vtkSeedRepresentation&gt; rep = <o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:DotumChe'>&nbsp;&nbsp;&nbsp;&nbsp;vtkSmartPointer&lt;vtkSeedRepresentation&gt;::New();<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:DotumChe'>&nbsp; rep-&gt;SetHandleRepresentation(handle);<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:DotumChe'> <o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:DotumChe'>&nbsp;&nbsp;<span style='color:green'>// Seed widget<o:p></o:p></span></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:DotumChe'>&nbsp; vtkSmartPointer&lt;vtkSeedWidget&gt; seedWidget = <o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:DotumChe'>&nbsp;&nbsp;&nbsp;&nbsp;vtkSmartPointer&lt;vtkSeedWidget&gt;::New();<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:DotumChe'>&nbsp; seedWidget-&gt;SetInteractor(iren);<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:DotumChe'>&nbsp; seedWidget-&gt;SetRepresentation(rep);<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:DotumChe'> <o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:DotumChe'>&nbsp;&nbsp;vtkSmartPointer&lt;vtkSeedCallback&gt; seedCallback = <o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:DotumChe'>&nbsp;&nbsp;vtkSmartPointer&lt;vtkSeedCallback&gt;::New();<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:DotumChe'>&nbsp; seedCallback-&gt;SetRepresentation(rep);<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:DotumChe'>&nbsp; seedWidget-&gt;AddObserver(vtkCommand::PlacePointEvent,seedCallback);<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:DotumChe'>&nbsp; seedWidget-&gt;AddObserver(vtkCommand::InteractionEvent,seedCallback);<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:DotumChe'>&nbsp; <o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:DotumChe'>&nbsp;&nbsp;seedWidget-&gt;On();</span><span style='font-size:10.0pt;font-family:DotumChe;color:green'><o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:DotumChe'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:DotumChe'>&nbsp; vtkRenderWindowInteractor *iren = vtkRenderWindowInteractor::New();<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:DotumChe'>&nbsp; imageViewer-&gt;SetupInteractor(iren);<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:DotumChe'>&nbsp; imageViewer-&gt;GetRenderWindow()-&gt;SetMultiSamples(0);<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:DotumChe'>&nbsp; imageViewer-&gt;GetRenderWindow()-&gt;SetSize(512, 512);<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:DotumChe'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:DotumChe'>&nbsp; imageViewer-&gt;Render();<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:DotumChe'>&nbsp; imageViewer-&gt;GetRenderer()-&gt;ResetCamera();<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:DotumChe'>&nbsp; <o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:DotumChe'>&nbsp;&nbsp;vtkSliderRepresentation2D *SliderRepres = vtkSliderRepresentation2D::New();<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:DotumChe'>&nbsp; <span style='color:blue'>int</span> min = imageViewer-&gt;GetSliceMin();<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:DotumChe'>&nbsp; <span style='color:blue'>int</span> max = imageViewer-&gt;GetSliceMax();<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:DotumChe'>&nbsp; SliderRepres-&gt;SetMinimumValue(min);<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:DotumChe'>&nbsp; SliderRepres-&gt;SetMaximumValue(max);<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:DotumChe'>&nbsp; SliderRepres-&gt;SetValue(<span style='color:blue'>static_cast</span>&lt;<span style='color:blue'>int</span>&gt;((min + max) / 2));<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:DotumChe'>&nbsp; <span style='color:green'>//SliderRepres-&gt;SetTitleText(&quot;Slice&quot;);<o:p></o:p></span></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:DotumChe'>&nbsp; SliderRepres-&gt;GetPoint1Coordinate()-&gt;SetCoordinateSystemToNormalizedDisplay();<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:DotumChe'>&nbsp; SliderRepres-&gt;GetPoint1Coordinate()-&gt;SetValue(0.3, 0.05);<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:DotumChe'>&nbsp; SliderRepres-&gt;GetPoint2Coordinate()-&gt;SetCoordinateSystemToNormalizedDisplay();<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:DotumChe'>&nbsp; SliderRepres-&gt;GetPoint2Coordinate()-&gt;SetValue(0.7, 0.05);<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:DotumChe'>&nbsp; SliderRepres-&gt;SetSliderLength(0.02);<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:DotumChe'>&nbsp; SliderRepres-&gt;SetSliderWidth(0.03);<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:DotumChe'>&nbsp; SliderRepres-&gt;SetEndCapLength(0.01);<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:DotumChe'>&nbsp; SliderRepres-&gt;SetEndCapWidth(0.03);<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:DotumChe'>&nbsp; SliderRepres-&gt;SetTubeWidth(0.005);<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:DotumChe'>&nbsp; SliderRepres-&gt;SetLabelFormat(<span style='color:#A31515'>&quot;%3.0lf&quot;</span>);<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:DotumChe'>&nbsp; SliderRepres-&gt;SetTitleHeight(0.02);<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:DotumChe'>&nbsp; SliderRepres-&gt;SetLabelHeight(0.02);<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:DotumChe'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:DotumChe'>&nbsp; vtkSliderWidget *SliderWidget = vtkSliderWidget::New();<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:DotumChe'>&nbsp; SliderWidget-&gt;SetInteractor(iren);<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:DotumChe'>&nbsp; SliderWidget-&gt;SetRepresentation(SliderRepres);<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:DotumChe'>&nbsp; SliderWidget-&gt;KeyPressActivationOff();<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:DotumChe'>&nbsp; SliderWidget-&gt;SetAnimationModeToAnimate();<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:DotumChe'>&nbsp; SliderWidget-&gt;SetEnabled(<span style='color:blue'>true</span>);<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:DotumChe'>&nbsp; <o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:DotumChe'>&nbsp;&nbsp;vtkSliderCallback2 *SliderCb = vtkSliderCallback2::New();<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:DotumChe'>&nbsp; SliderCb-&gt;SetImageViewer(imageViewer);<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:DotumChe'>&nbsp; SliderWidget-&gt;AddObserver(vtkCommand::InteractionEvent, SliderCb);&nbsp; <o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:DotumChe'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:DotumChe'>&nbsp; imageViewer-&gt;SetSlice(<span style='color:blue'>static_cast</span>&lt;<span style='color:blue'>int</span>&gt;(SliderRepres-&gt;GetValue()));<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:DotumChe'>&nbsp; imageViewer-&gt;SetSliceOrientationToXY();<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:DotumChe'>&nbsp; iren-&gt;Start();<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:DotumChe'>&nbsp;&nbsp;&nbsp; <o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:DotumChe'>&nbsp;&nbsp;SliderRepres-&gt;Delete();<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:DotumChe'>&nbsp; SliderCb-&gt;Delete();<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:DotumChe'>&nbsp; imageViewer-&gt;Delete();<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:DotumChe'>&nbsp; SliderWidget-&gt;Delete();<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:DotumChe'>&nbsp; iren-&gt;Delete();<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:DotumChe'>&nbsp; <o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:DotumChe'>&nbsp;&nbsp;<span style='color:blue'>return</span> 0;<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt;font-family:DotumChe'>}</span><o:p></o:p></p></div></body></html>