Hi,<div>I wrote a program using several vtkImageViewer to show a image series  for the user to choose one, and each vtkImageViewer contains one image with different Z slice. Here is the problem: how to know which vtkImageViewer is clicked and get its Z slice. I try to use addObserver, the code is like this:</div>
<div>              .......</div><div><div>              vtkWin32RenderWindowInteractor* interator = vtkWin32RenderWindowInteractor::New();</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>     vtkCallbackCommand* command = vtkCallbackCommand::New();<span class="Apple-tab-span" style="white-space:pre">        </span></div>
</div><div>             command-&gt;SetCallback(mycallback);</div><div>             myviewer-&gt;SetupInteractor(interator);</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>     interator-&gt;AddObserver(vtkCommand::LeftButtonPressEvent,command);</div>
<div>             .....</div><div>             </div><div>    here i don&#39;t know how to write, because the caller is not vtkImageViewer, if i write it like this:</div><div>             void mycallback(vtkObject *caller, unsigned long eid, void *clientdata, void *calldata)</div>
<div>          {          </div><div>                vtkImageViewer* viewer = reinterpret_cast&lt;vtkImageViewer*&gt;(caller);</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>        viewer -&gt;GetZSlice();</div>
<div>          }</div><div>   it works wrong, if i use</div><div><span class="Apple-style-span">        vtkWin32RenderWindowInteractor* interator = reinterpret_cast&lt;</span>vtkWin32RenderWindowInteractor<span class="Apple-style-span">*&gt;(caller);</span></div>
<div>   i wouldn&#39;t get the Z slice. can you give me some advice to solve this problem? Thanks very much and with regards.</div><div><br></div><div><br></div>