<div dir="ltr">Hi,<div>Below my code that i tried to pick the coordinates has been given.Please reply if any modifications needs to be done,or if my approach is wrong</div><div><br></div><div>Thanks in Advance</div><div><br></div><div><br></div><div><div>void MyVtkInteractorStyleImage::OnMouseMove()</div><div>{</div><div> //std::cout << "Picking pixel: " << this->Interactor->GetEventPosition()[0]<< " " << this->Interactor->GetEventPosition()[1] << std::endl;</div><div> this->Interactor->GetPicker()->Pick(this->Interactor->GetEventPosition()[0],</div><div> this->Interactor->GetEventPosition()[1],</div><div> 0, // always zero.</div><div> this->Interactor->GetRenderWindow()->GetRenderers()->GetFirstRenderer());</div><div><br></div><div> double pos[3];</div><div> this->Interactor->GetPicker()->GetPickPosition(pos);</div><div> //std::cout << "Picked value: " << pos[0] << " " << pos[1] << " " << pos[2] << std::endl;</div><div><br></div><div> int x = pos[0];</div><div> int y = pos[1];</div><div> std::cout << "(x,y) = (" << x << "," << y << ")" << std::endl;</div><div> vtkSmartPointer<vtkCoordinate> coordinate =</div><div> vtkSmartPointer<vtkCoordinate>::New();</div><div> coordinate->SetCoordinateSystemToWorld();</div><div> coordinate->SetValue(x,y,0);</div><div> double* world = coordinate->GetValue();</div><div> std::cout << "World coordinate: " << world[0] << ", " << world[1] << ", " << world[2] << std::endl;</div><div><br></div><div><br></div><div><br></div><div> // Forward events</div><div> vtkInteractorStyleImage::OnMouseMove();</div><div><br></div><div>}</div></div><div><br></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Sep 18, 2017 at 5:16 PM, Duster U <span dir="ltr"><<a href="mailto:aralol2015@gmail.com" target="_blank">aralol2015@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Hi <span style="color:rgb(0,0,0);white-space:pre-wrap">Liu Peng,,</span><div><span style="color:rgb(0,0,0);white-space:pre-wrap"><br></span></div><div><span style="color:rgb(0,0,0);white-space:pre-wrap">Thanks for the reply.Let me try the different coordinate system and will let u know if it works.</span></div><div><span style="color:rgb(0,0,0);white-space:pre-wrap"><br></span></div><div><span style="color:rgb(0,0,0);white-space:pre-wrap">Thanks</span></div></div><div class="gmail-HOEnZb"><div class="gmail-h5"><div class="gmail_extra"><br><div class="gmail_quote">On Sat, Sep 16, 2017 at 9:53 AM, Liu_tj <span dir="ltr"><<a href="mailto:tjlp@netease.com" target="_blank">tjlp@netease.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div>As there are several kind of coordinate system in VTK, you need to check the check values are world, viewport, normalized viewport coordinate.</div><div><br></div><div>Perhaps you can post your code here and the forum guys can help you.</div><div><br></div><div>Thanks<br></div><span>
<span>
</span>
<br> 在2017-09-15,"Duster U" <<a href="mailto:aralol2015@gmail.com" target="_blank">aralol2015@gmail.com</a>> 写道:
</span><blockquote id="gmail-m_-353536634894964160m_-860100116545477270isReplyContent" style="padding-left:1ex;margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204)"><span>
-----原始邮件-----<br>
<b>发件人:</b>"Duster U" <<a href="mailto:aralol2015@gmail.com" target="_blank">aralol2015@gmail.com</a>> <br>
</span><b>发送时间:</b>2017年09月15日 星期五<br>
<b>收件人:</b>"Liu_tj" <<a href="mailto:tjlp@netease.com" target="_blank">tjlp@netease.com</a>><br>
<b>抄送:</b>"vtkusers" <<a href="mailto:vtkusers@vtk.org" target="_blank">vtkusers@vtk.org</a>><br>
<b>主题:</b>Re: [vtkusers] Picking in DICOM series<div><div class="gmail-m_-353536634894964160h5"><br>
<br><div dir="ltr"><pre style="white-space:pre-wrap;color:rgb(0,0,0)">Hi Liu Peng,</pre><pre style="white-space:pre-wrap;color:rgb(0,0,0)">I have tried different dicom samples of different resolutions.When i use a sample of 320*320,the max value that i get from the picker is 150*150,and this too varies with samples.when i tried with another 320*320 sample max value that i got was 160*160.</pre><pre style="white-space:pre-wrap;color:rgb(0,0,0)"><br></pre><pre style="white-space:pre-wrap;color:rgb(0,0,0)">Thanks</pre></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Sep 14, 2017 at 5:50 PM, Liu_tj <span dir="ltr"><<a href="mailto:tjlp@netease.com" target="_blank">tjlp@netease.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">How do you know the values are wrong?<br><div><br><br></div>
<span>
</span>
<br> 在2017-09-14,"Duster U" <<a href="mailto:aralol2015@gmail.com" target="_blank">aralol2015@gmail.com</a>> 写道:
<blockquote id="gmail-m_-353536634894964160m_-860100116545477270m_6375408575272633594isReplyContent" style="padding-left:1ex;margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204)">
-----原始邮件-----<br>
<b>发件人:</b>"Duster U" <<a href="mailto:aralol2015@gmail.com" target="_blank">aralol2015@gmail.com</a>> <br>
<b>发送时间:</b>2017年09月14日 星期四<br>
<b>收件人:</b>"vtkusers" <<a href="mailto:vtkusers@vtk.org" target="_blank">vtkusers@vtk.org</a>><br>
<b>主题:</b>[vtkusers] Picking in DICOM series<div><div class="gmail-m_-353536634894964160m_-860100116545477270h5"><br>
<br><div dir="ltr"><br><div><span style="font-size:12.8px">Hi,</span><div style="font-size:12.8px"><br></div><div style="font-size:12.8px">I've been trying to implement a Picker in the OnMouseMove of a custom vtkinteractorstyleImage,so that i can get the pixel coordinates of an image while hovering over an image.Now I've tried both the Point Picker and the Prop Picker to do so,,both gives the coordinates but the problem is that the values are not correct.So am i missing anything?</div><div style="font-size:12.8px">and i am new to vtk,So please help me out</div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px">Thanks in Advance</div></div></div>
</div></div></blockquote><br><br><span title="neteasefooter"><p> </p></span></blockquote></div><br></div>
</div></div></blockquote></blockquote></div><br></div>
</div></div></blockquote></div><br></div></div>