<div dir="ltr"><div>Hi Enzo,</div><div><br></div><div>As a general solution, you can add a callback for the renderer's StartEvent.  The renderer emits this event immediately before it renders the scene, so a StartEvent callback can be used to compute the distance of each sphere from the slice plane, and can then call VisibilityOn() for all sphere actors that are close to the slice, and VisibilityOff() for all actors that are far from the slice.</div><div><br></div><div>I've found the StartEvent to be incredibly useful for manipulating annotations like spheres, arrows, text, and whatnot.</div><div><br></div><div> - David</div><br><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Feb 22, 2016 at 10:32 AM, Enzo Ferlin <span dir="ltr"><<a href="mailto:enzo.ferlin@micromar.com" target="_blank">enzo.ferlin@micromar.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hello,<div><br></div><div>I'm trying to add a sphere to the current slice of a rendered DICOM volume.</div><div><br></div><div>Basically, I'm using this code:</div><div><br></div><div><a href="http://web.mit.edu/16.225/dv/VTK/Examples/ImageProcessing/Cxx/ImageSlicing.cxx" target="_blank">http://web.mit.edu/16.225/dv/VTK/Examples/ImageProcessing/Cxx/ImageSlicing.cxx</a><br></div><div><br></div><div>The only difference being that I use MouseWheelForwardEvent/MouseWheelBackwardEvent to reslice and I intercept left button press on my custom interactor (vtkInteractorStyleImage) to add a sphere on that position.</div><div><br></div><div>The sphere is added in the correct position (as an addition, I can already measure the correct distance (mm) between 2 added spheres).</div><div>My problem is that when I scroll to go back/forward another slice, these spheres stays in front of the volume.</div><div><br></div><div>I want those spheres appear only when I pass through that particular slice that they were added.</div><div><br></div><div>How could I accomplish that?</div><div><br></div><div><br></div><div>Thank in advance.</div></div></blockquote></div></div></div>