Is the image you are displaying a 2D image or a 3D image ?<br><br><div class="gmail_quote">On Wed, Jan 12, 2011 at 4:40 AM, Xiaopeng Yang <span dir="ltr">&lt;<a href="mailto:yxp233@postech.ac.kr">yxp233@postech.ac.kr</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"><div link="blue" vlink="purple" lang="EN-US"><div><p class="MsoNormal"><span style="color: rgb(31, 73, 125);">Sorry, I mean pos[2] in the code, not pos[3].</span></p>
<p class="MsoNormal"><span style="color: rgb(31, 73, 125);"> </span></p><div><div style="border-width: 1pt medium medium; border-style: solid none none; border-color: rgb(181, 196, 223) -moz-use-text-color -moz-use-text-color; padding: 3pt 0in 0in;">
<p class="MsoNormal"><b><span style="font-size: 10pt;" lang="ZH-CN">发件人</span></b><b><span style="font-size: 10pt;">:</span></b><span style="font-size: 10pt;"> <a href="mailto:vtkusers-bounces@vtk.org" target="_blank">vtkusers-bounces@vtk.org</a> [mailto:<a href="mailto:vtkusers-bounces@vtk.org" target="_blank">vtkusers-bounces@vtk.org</a>] <b><span lang="ZH-CN">代表 </span></b>Xiaopeng Yang<br>
<b><span lang="ZH-CN">发送时间</span>:</b> 2011</span><span style="font-size: 10pt; font-family: &quot;Batang&quot;,&quot;serif&quot;;" lang="ZH-CN">년</span><span style="font-size: 10pt;"> 1</span><span style="font-size: 10pt; font-family: &quot;Batang&quot;,&quot;serif&quot;;" lang="ZH-CN">월</span><span style="font-size: 10pt;"> 12</span><span style="font-size: 10pt; font-family: &quot;Batang&quot;,&quot;serif&quot;;" lang="ZH-CN">일</span><span style="font-size: 10pt;" lang="ZH-CN"> </span><span style="font-size: 10pt; font-family: &quot;Batang&quot;,&quot;serif&quot;;" lang="ZH-CN">수요일</span><span style="font-size: 10pt;" lang="ZH-CN"> </span><span style="font-size: 10pt; font-family: &quot;Batang&quot;,&quot;serif&quot;;" lang="ZH-CN">오전</span><span style="font-size: 10pt;"> 8:07<div class="im">
<br><b><span lang="ZH-CN">收件人</span>:</b> &#39;vtk&#39;; <a href="mailto:insight-users@itk.org" target="_blank">insight-users@itk.org</a><br></div><b><span lang="ZH-CN">主题</span>:</b> Re: [vtkusers] [Insight-users] Problem in obtaining world position with vtkSeedWidget</span></p>
</div></div><div><div></div><div class="h5"><p class="MsoNormal"> </p><p class="MsoNormal"><span style="color: rgb(31, 73, 125);">The problem is still there. I am very confused why just pos[3] is not correct. If anyone of you have experienced the similar problem, please share your idea with me. I would appreciate a lot!</span></p>
<p class="MsoNormal"><span style="color: rgb(31, 73, 125);"> </span></p><p class="MsoNormal"><span style="color: rgb(31, 73, 125);">Thanks</span></p><p class="MsoNormal"><span style="color: rgb(31, 73, 125);"> </span></p>
<div><div style="border-width: 1pt medium medium; border-style: solid none none; border-color: rgb(181, 196, 223) -moz-use-text-color -moz-use-text-color; padding: 3pt 0in 0in;"><p class="MsoNormal"><b><span style="font-size: 10pt;" lang="ZH-CN">发件人</span></b><b><span style="font-size: 10pt;">:</span></b><span style="font-size: 10pt;"> <a href="mailto:insight-users-bounces@itk.org" target="_blank">insight-users-bounces@itk.org</a> [mailto:<a href="mailto:insight-users-bounces@itk.org" target="_blank">insight-users-bounces@itk.org</a>] <b><span lang="ZH-CN">代表 </span></b>Xiaopeng Yang<br>
<b><span lang="ZH-CN">发送时间</span>:</b> 2011</span><span style="font-size: 10pt; font-family: &quot;Batang&quot;,&quot;serif&quot;;" lang="ZH-CN">년</span><span style="font-size: 10pt;"> 1</span><span style="font-size: 10pt; font-family: &quot;Batang&quot;,&quot;serif&quot;;" lang="ZH-CN">월</span><span style="font-size: 10pt;"> 11</span><span style="font-size: 10pt; font-family: &quot;Batang&quot;,&quot;serif&quot;;" lang="ZH-CN">일</span><span style="font-size: 10pt;" lang="ZH-CN"> </span><span style="font-size: 10pt; font-family: &quot;Batang&quot;,&quot;serif&quot;;" lang="ZH-CN">화요일</span><span style="font-size: 10pt;" lang="ZH-CN"> </span><span style="font-size: 10pt; font-family: &quot;Batang&quot;,&quot;serif&quot;;" lang="ZH-CN">오후</span><span style="font-size: 10pt;"> 6:44<br>
<b><span lang="ZH-CN">收件人</span>:</b> &#39;vtk&#39;; <a href="mailto:insight-users@itk.org" target="_blank">insight-users@itk.org</a><br><b><span lang="ZH-CN">主题</span>:</b> [Insight-users] Problem in obtaining world position with vtkSeedWidget</span></p>
</div></div><p class="MsoNormal"> </p><p class="MsoNormal">Dear Users,</p><p class="MsoNormal"> </p><p class="MsoNormal">I am trying to get world position by SeedRepresentation-&gt;GetSeedWorldPosition(I, pos). But comparing with other software, I got the wrong value in z coordinate. The values of x and y coordinates are correct. I would appreciate if anyone can point me in the right direction. </p>
<p class="MsoNormal"> </p><p class="MsoNormal">Thanks,</p><p class="MsoNormal">Yang</p><p class="MsoNormal"> </p><p class="MsoNormal" style=""><span style="font-size: 10pt; font-family: DotumChe; color: blue;">class</span><span style="font-size: 10pt; font-family: DotumChe;"> vtkSeedCallback : <span style="color: blue;">public</span> vtkCommand</span></p>
<p class="MsoNormal" style=""><span style="font-size: 10pt; font-family: DotumChe;">{</span></p><p class="MsoNormal" style=""><span style="font-size: 10pt; font-family: DotumChe;">  <span style="color: blue;">public</span>:</span></p>
<p class="MsoNormal" style=""><span style="font-size: 10pt; font-family: DotumChe;">    <span style="color: blue;">static</span> vtkSeedCallback *New()</span></p><p class="MsoNormal" style=""><span style="font-size: 10pt; font-family: DotumChe;">    { </span></p>
<p class="MsoNormal" style=""><span style="font-size: 10pt; font-family: DotumChe;">      <span style="color: blue;">return</span> <span style="color: blue;">new</span> vtkSeedCallback; </span></p><p class="MsoNormal" style="">
<span style="font-size: 10pt; font-family: DotumChe;">    }</span></p><p class="MsoNormal" style=""><span style="font-size: 10pt; font-family: DotumChe;"> </span></p><p class="MsoNormal" style=""><span style="font-size: 10pt; font-family: DotumChe;">    vtkSeedCallback() {}</span></p>
<p class="MsoNormal" style=""><span style="font-size: 10pt; font-family: DotumChe;"> </span></p><p class="MsoNormal" style=""><span style="font-size: 10pt; font-family: DotumChe;">    <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)</span></p>
<p class="MsoNormal" style=""><span style="font-size: 10pt; font-family: DotumChe;">    {</span></p><p class="MsoNormal" style=""><span style="font-size: 10pt; font-family: DotumChe;">      <span style="color: blue;">if</span>(<span style="color: blue;">event</span> == vtkCommand::PlacePointEvent)</span></p>
<p class="MsoNormal" style=""><span style="font-size: 10pt; font-family: DotumChe;">      {</span></p><p class="MsoNormal" style=""><span style="font-size: 10pt; font-family: DotumChe;">        std::cout &lt;&lt; <span style="color: rgb(163, 21, 21);">&quot;Point placed, total of: &quot;</span> </span></p>
<p class="MsoNormal" style=""><span style="font-size: 10pt; font-family: DotumChe;">            &lt;&lt; <span style="color: blue;">this</span>-&gt;SeedRepresentation-&gt;GetNumberOfSeeds() &lt;&lt; std::endl;</span></p><p class="MsoNormal" style="">
<span style="font-size: 10pt; font-family: DotumChe;">      }</span></p><p class="MsoNormal" style=""><span style="font-size: 10pt; font-family: DotumChe;">      <span style="color: blue;">if</span>(<span style="color: blue;">event</span> == vtkCommand::InteractionEvent)</span></p>
<p class="MsoNormal" style=""><span style="font-size: 10pt; font-family: DotumChe;">      {</span></p><p class="MsoNormal" style=""><span style="font-size: 10pt; font-family: DotumChe;">        <span style="color: blue;">if</span>(calldata)</span></p>
<p class="MsoNormal" style=""><span style="font-size: 10pt; font-family: DotumChe;">        {</span></p><p class="MsoNormal" style=""><span style="font-size: 10pt; font-family: DotumChe;">          std::cout &lt;&lt; <span style="color: rgb(163, 21, 21);">&quot;Interacting with seed : &quot;</span> </span></p>
<p class="MsoNormal" style=""><span style="font-size: 10pt; font-family: DotumChe;">              &lt;&lt; *(<span style="color: blue;">static_cast</span>&lt; <span style="color: blue;">int</span> * &gt;(calldata)) &lt;&lt; std::endl;</span></p>
<p class="MsoNormal" style=""><span style="font-size: 10pt; font-family: DotumChe;">        }</span></p><p class="MsoNormal" style=""><span style="font-size: 10pt; font-family: DotumChe;">      }</span></p><p class="MsoNormal" style="">
<span style="font-size: 10pt; font-family: DotumChe;">  </span></p><p class="MsoNormal" style=""><span style="font-size: 10pt; font-family: DotumChe;">      std::cout &lt;&lt; <span style="color: rgb(163, 21, 21);">&quot;List of seeds (Display coordinates):&quot;</span> &lt;&lt; std::endl;</span></p>
<p class="MsoNormal" style=""><span style="font-size: 10pt; font-family: DotumChe;">         </span></p><p class="MsoNormal" style=""><span style="font-size: 10pt; font-family: DotumChe;">      <span style="color: blue;">for</span>(vtkIdType i = 0; i &lt; <span style="color: blue;">this</span>-&gt;SeedRepresentation-&gt;GetNumberOfSeeds(); i++)</span></p>
<p class="MsoNormal" style=""><span style="font-size: 10pt; font-family: DotumChe;">        {</span></p><p class="MsoNormal" style=""><span style="font-size: 10pt; font-family: DotumChe;">        <span style="color: blue;">double</span> pos[3];</span></p>
<p class="MsoNormal" style=""><span style="font-size: 10pt; font-family: DotumChe;">        <span style="color: blue;">this</span>-&gt;SeedRepresentation-&gt;GetSeedWorldPosition(i, pos);</span></p><p class="MsoNormal"><span style="font-size: 10pt; font-family: DotumChe;">        std::cout &lt;&lt; <span style="color: rgb(163, 21, 21);">&quot;(&quot;</span> &lt;&lt; pos[0] &lt;&lt; <span style="color: rgb(163, 21, 21);">&quot; &quot;</span> &lt;&lt; pos[1] &lt;&lt; <span style="color: rgb(163, 21, 21);">&quot; &quot;</span> &lt;&lt; pos[2] &lt;&lt; <span style="color: rgb(163, 21, 21);">&quot;)&quot;</span> &lt;&lt; std::endl;</span></p>
<p class="MsoNormal" style=""><span style="font-size: 10pt; font-family: DotumChe;">        }</span></p><p class="MsoNormal" style=""><span style="font-size: 10pt; font-family: DotumChe;">              </span></p><p class="MsoNormal" style="">
<span style="font-size: 10pt; font-family: DotumChe;">     }</span></p><p class="MsoNormal" style=""><span style="font-size: 10pt; font-family: DotumChe;">       </span></p><p class="MsoNormal" style=""><span style="font-size: 10pt; font-family: DotumChe;"> </span></p>
<p class="MsoNormal" style=""><span style="font-size: 10pt; font-family: DotumChe;">    <span style="color: blue;">void</span> SetRepresentation(vtkSmartPointer&lt;vtkSeedRepresentation&gt; rep) {<span style="color: blue;">this</span>-&gt;SeedRepresentation = rep;}</span></p>
<p class="MsoNormal" style=""><span style="font-size: 10pt; font-family: DotumChe;">    <span style="color: blue;">private</span>:</span></p><p class="MsoNormal" style=""><span style="font-size: 10pt; font-family: DotumChe;">    vtkSmartPointer&lt;vtkSeedRepresentation&gt; SeedRepresentation;</span></p>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: DotumChe;">};</span></p></div></div></div></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>
Kitware offers ITK Training Courses, for more information visit:<br>
<a 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 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>