<div>Hi all.</div><div> </div><div>First of all, I am new to VTK, so please bear with me if some of my questions will be basic or a bit &quot;confused&quot; sometimes...</div><div> </div><div>I need to implement Multi-Planar Reconstruction in a Java-based medical application, hence I am using the Java version (wrapper) of VTK.</div>
<div> </div><div>By looking at the VTK documentation, I have found the &quot;vtkResliceImageViewer&quot; class, which seems to be a very good starting point for me.</div><div>Is this a &#39;new&#39; class? It does not seem to be present in the official VTK v5.8.0 yet. In fact, I downloaded and compiled the latest snapshot from the source repository.</div>
<div> </div><div>Basically, in my code I have a vtkCanvas-derived class named &quot;ResliceViewerCanvas&quot;, which embeds a vtkResliceImageViewer object.</div><div>In the GUI of my application, I have 3 ResliceViewerCanvas&#39;s, which shall implement the 3 different sectional views of MPR.</div>
<div>I have shared the same vtkResliceCursor across the 3 different ResliceViewerCanvas&#39;s (embedding vtkResliceImageViewer&#39;s) in my GUI, in such a way to implement &quot;synchronization&quot; across these 3 panels when acting upon the reslice cursor widget.</div>
<div> </div><div>Here is some of my initialization code (located in the constructor of my ResliceImageViewerCanvas class):</div><div> </div><div>[...]</div><div>    resliceImageViewer = new vtkResliceImageViewer();</div><div>
    resliceImageViewer.SetInput(myImgDataVTK);<br>    resliceImageViewer.SetColorWindow(myWinWidth);<br>    resliceImageViewer.SetColorLevel(myWinLevel);<br>    <br>    // TBD: set the correct size depending on original image<br>
    resliceImageViewer.SetSize(512, 512);<br>    <br>    resliceImageViewer.SetSliceOrientation(sliceOrient);<br>    <br>    Dimension dimension = super.getSize();<br>    rw = resliceImageViewer.GetRenderWindow();<br>    rw.SetSize(dimension.width, dimension.height);<br>
    ren = resliceImageViewer.GetRenderer();<br>    resliceImageViewer.SetupInteractor(iren);<br>    <br>    vtkResliceCursorWidget resliceWidget = resliceImageViewer.GetResliceCursorWidget();<br>    vtkResliceCursorLineRepresentation rep = (vtkResliceCursorLineRepresentation) resliceWidget.GetRepresentation();<br>
    rep.GetResliceCursorActor().GetCursorAlgorithm().SetReslicePlaneNormal(sliceOrient);<br>    <br>    resliceWidget.SetInteractor(iren);<br>    resliceWidget.ManagesCursorOn();<br>    resliceWidget.SetEnabled(1);<br>    <br>
    iren.AddObserver(&quot;MouseMoveEvent&quot;, this, &quot;vtkMouseMoved&quot;);<br>    iren.AddObserver(&quot;LeftButtonPressEvent&quot;, this, &quot;vtkLeftButtonPressed&quot;);<br>    iren.AddObserver(&quot;RightButtonPressEvent&quot;, this, &quot;vtkRightButtonPressed&quot;);<br>
    resliceWidget.AddObserver(&quot;ResliceAxesChangedEvent&quot;, this, &quot;vtkResliceAxesChanged&quot;);</div><div>[...]</div><div> </div><div>Obviously, I have defined the vtkMouseMoved(), vtkLeftButtonPressed(), vtkRightButtonPressed() and vtkResliceAxesChanged() methods in my ResliceImageViewer canvas class.</div>
<div> </div><div>Nevertheless, my vtkResliceAxesChanged() method never gets called. On the other side, vtkMouseMoved() and vtkRightButtonPressed() get correctly called.</div><div> </div><div>What am I doing wrong? How can I receive notifications by the vtkResliceCursorWidget when the reslice widget lines are moved, in such a way I can modify other views in my application?</div>
<div> </div><div>Thanks in advance for any hint/suggestion, and sorry for the long post.</div><div> </div><div>Regards,</div><div> </div><div>Marco</div><div> </div><div> </div><div> </div><div> </div><div> </div>