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"><<a href="mailto:yxp233@postech.ac.kr">yxp233@postech.ac.kr</a>></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: "Batang","serif";" lang="ZH-CN">년</span><span style="font-size: 10pt;"> 1</span><span style="font-size: 10pt; font-family: "Batang","serif";" lang="ZH-CN">월</span><span style="font-size: 10pt;"> 12</span><span style="font-size: 10pt; font-family: "Batang","serif";" lang="ZH-CN">일</span><span style="font-size: 10pt;" lang="ZH-CN"> </span><span style="font-size: 10pt; font-family: "Batang","serif";" lang="ZH-CN">수요일</span><span style="font-size: 10pt;" lang="ZH-CN"> </span><span style="font-size: 10pt; font-family: "Batang","serif";" lang="ZH-CN">오전</span><span style="font-size: 10pt;"> 8:07<div class="im">
<br><b><span lang="ZH-CN">收件人</span>:</b> 'vtk'; <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: "Batang","serif";" lang="ZH-CN">년</span><span style="font-size: 10pt;"> 1</span><span style="font-size: 10pt; font-family: "Batang","serif";" lang="ZH-CN">월</span><span style="font-size: 10pt;"> 11</span><span style="font-size: 10pt; font-family: "Batang","serif";" lang="ZH-CN">일</span><span style="font-size: 10pt;" lang="ZH-CN"> </span><span style="font-size: 10pt; font-family: "Batang","serif";" lang="ZH-CN">화요일</span><span style="font-size: 10pt;" lang="ZH-CN"> </span><span style="font-size: 10pt; font-family: "Batang","serif";" lang="ZH-CN">오후</span><span style="font-size: 10pt;"> 6:44<br>
<b><span lang="ZH-CN">收件人</span>:</b> 'vtk'; <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->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 << <span style="color: rgb(163, 21, 21);">"Point placed, total of: "</span> </span></p>
<p class="MsoNormal" style=""><span style="font-size: 10pt; font-family: DotumChe;"> << <span style="color: blue;">this</span>->SeedRepresentation->GetNumberOfSeeds() << 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 << <span style="color: rgb(163, 21, 21);">"Interacting with seed : "</span> </span></p>
<p class="MsoNormal" style=""><span style="font-size: 10pt; font-family: DotumChe;"> << *(<span style="color: blue;">static_cast</span>< <span style="color: blue;">int</span> * >(calldata)) << 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 << <span style="color: rgb(163, 21, 21);">"List of seeds (Display coordinates):"</span> << 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 < <span style="color: blue;">this</span>->SeedRepresentation->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>->SeedRepresentation->GetSeedWorldPosition(i, pos);</span></p><p class="MsoNormal"><span style="font-size: 10pt; font-family: DotumChe;"> std::cout << <span style="color: rgb(163, 21, 21);">"("</span> << pos[0] << <span style="color: rgb(163, 21, 21);">" "</span> << pos[1] << <span style="color: rgb(163, 21, 21);">" "</span> << pos[2] << <span style="color: rgb(163, 21, 21);">")"</span> << 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<vtkSeedRepresentation> rep) {<span style="color: blue;">this</span>->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<vtkSeedRepresentation> 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>