<div dir="ltr"><div>Hi Mengda,</div><div> </div><div>I am not familiar enough with the reslice cursor widget classes to advise further.</div><div> </div><div>I suggest you read the class documentation and do some experimenting to figure</div>
<div>out a solution, perhaps starting with the events that the widget fires during interaction.</div><div> </div><div>Dean</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Sun, Aug 4, 2013 at 2:06 AM, Mengda Wu <span dir="ltr">&lt;<a href="mailto:wumengda@gmail.com" target="_blank">wumengda@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div><div><div>Hi <span name="Dean Inglis">Dean,<br><br></span></div><span name="Dean Inglis">   I am trying your solution for this problem. But what exactly should I do for <br>
</span>      /** do something with ipwidget and rcwidget when the ipwidget fires a <br>
           an interaction event signal */?<br><br></div>   For <span>vtkImagePlaneWidget, we have UpdatePlacement() as done in Examples\GUI\Qt\FourPaneViewer\QtVTKRenderWindows.cxx. But we don&#39;t seem to have a similar method for </span>vtkResliceCursorWidget. Could you please give a more detailed answer?<br>

<br></div>Thanks,<br></div>Mengda<br></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Jun 24, 2013 at 10:44 AM, Dean Inglis <span dir="ltr">&lt;<a href="mailto:inglis.dl@gmail.com" target="_blank">inglis.dl@gmail.com</a>&gt;</span> wrote:<br>

<blockquote style="margin:0px 0px 0px 0.8ex;padding-left:1ex;border-left-color:rgb(204,204,204);border-left-width:1px;border-left-style:solid" class="gmail_quote"><div dir="ltr"><div><div>Hi,<br><br></div><div>try the following code snippet.  Basically, create a callback class wherein<br>

you decide how to update the reslice cursor widget from the image plane widget.<br></div><div>Add the callback to listen for the image plane widget&#39;s InteractionEvent.<br>
<br></div><div>regards,<br></div><div>Dean<br></div><div><br><br>class myCallback : public vtkCommand<br>{<br>  public:<br>    static myCallback *New() {<br>      return new myCallback; }<br><br>    void Execute( vtkObject* vtkNotUsed(caller), unsigned long vtkNotUsed(event),<br>


                  void * vtkNotUsed(callData) )<br>    {<br></div>      /** do something with ipwidget and rcwidget when the ipwidget fires a <br></div>           an interaction event signal */<br><div><div>    }<br><br>

 myCallback():ipwidget( 0 ), rcwidget( 0 ){}<br>
  ~myCallback(){ this-&gt;ipwidget= 0; this-&gt;rcwidget = 0; }<br>  vtkImagePlaneWidget* ipwidget;<br>  vtkResliceCursorWidget* rcwidget;<br>};<br><br><br></div><div>void myclass::some_setup_method()<br>{<br></div><div>

  vtkSmartPointer&lt;myCallback&gt; cbk = vtkSmartPointer&lt;myCallback&gt;::New();<br>
</div><div>  cbk-&gt;ipwidget = this-&gt;ipwidget;<br>  cbk-&gt;rcwidget = this-&gt;rcwidget;<br></div><div>  this-&gt;ipwidget-&gt;AddObserver( vtkCommand::InteractionEvent, cbk );<br></div><div>}<br></div><div><br></div>


</div></div><div class="gmail_extra"><br><br><div class="gmail_quote"><div><div>On Thu, Jun 20, 2013 at 10:15 PM, nil_debug <span dir="ltr">&lt;<a href="mailto:ljp19890525@163.com" target="_blank">ljp19890525@163.com</a>&gt;</span> wrote:<br>


</div></div><blockquote style="margin:0px 0px 0px 0.8ex;padding-left:1ex;border-left-color:rgb(204,204,204);border-left-width:1px;border-left-style:solid" class="gmail_quote"><div><div><u></u>





<div style="margin:10px">
<div><span style="font:14px/23px arial;text-transform:none;text-indent:0px;letter-spacing:normal;word-spacing:0px;float:none;display:inline!important;white-space:normal;font-size-adjust:none;font-stretch:normal">Hello,</span>
<div style="font:14px/23px arial;text-transform:none;text-indent:0px;letter-spacing:normal;word-spacing:0px;white-space:normal;font-size-adjust:none;font-stretch:normal">Is 
anyone can help me? Now I have defined a vtkImagePlaneWidget and a 
vtkResliceCursorWidget,  I would like to when dragging the 
 vtkImagePlaneWidget the   vtkResliceCursorWidget can move.In a 
word  I don&#39;t know how to a &quot;AddObserver&quot; for the vtkImagePlaneWidget 
from the vtkResliceCursorWidget! I do know  I should define a 
&quot;myCallBack&quot;,but How?</div>
<div style="font:14px/23px arial;text-transform:none;text-indent:0px;letter-spacing:normal;word-spacing:0px;white-space:normal;font-size-adjust:none;font-stretch:normal">Will 
be deeply grateful !</div></div>
<div> </div>
<hr style="width:210px;min-height:1px" align="left" color="#b5c4df" size="1"><span><font color="#888888">

<div><span>nil_debug</span></div></font></span></div>
<br></div></div>_______________________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the VTK FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers</a><br>
<br></blockquote></div><br></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 <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the VTK FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers</a><br>
<br></blockquote></div><br></div>
</blockquote></div><br></div>