<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 "confused" 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 "vtkResliceImageViewer" class, which seems to be a very good starting point for me.</div><div>Is this a 'new' 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 "ResliceViewerCanvas", which embeds a vtkResliceImageViewer object.</div><div>In the GUI of my application, I have 3 ResliceViewerCanvas's, which shall implement the 3 different sectional views of MPR.</div>
<div>I have shared the same vtkResliceCursor across the 3 different ResliceViewerCanvas's (embedding vtkResliceImageViewer's) in my GUI, in such a way to implement "synchronization" 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("MouseMoveEvent", this, "vtkMouseMoved");<br> iren.AddObserver("LeftButtonPressEvent", this, "vtkLeftButtonPressed");<br> iren.AddObserver("RightButtonPressEvent", this, "vtkRightButtonPressed");<br>
resliceWidget.AddObserver("ResliceAxesChangedEvent", this, "vtkResliceAxesChanged");</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>