<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Thu, Feb 22, 2018 at 10:12 AM, ochampao <span dir="ltr"><<a href="mailto:ochampao@hotmail.com" target="_blank">ochampao@hotmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">I have also tried using vtkImageResliceMapper and vtkImageSlice, but<br>
unfortunately I was not able to make it work.<br></blockquote><div><br></div><div>The best example to work from is the following VTK test code:</div><div><a href="https://github.com/Kitware/VTK/blob/master/Rendering/Image/Testing/Cxx/TestImageResliceMapperAlpha.cxx">https://github.com/Kitware/VTK/blob/master/Rendering/Image/Testing/Cxx/TestImageResliceMapperAlpha.cxx</a><br></div><div><br></div><div>It shows a grid on top of an image, but you could modify it to load two</div><div>images.  Also, the interactor style can be changed as follows, which</div><div>will allow you to slice though the volumes simultaneously by holding</div><div>"Ctrl" while dragging the mouse:</div><div><br></div><div><div>  vtkInteractorStyleImage *style = vtkInteractorStyleImage::New();</div><div>  style->SetInteractionModeToImageSlicing();</div></div><div><br></div><div>For overlay, there is also a class called vtkImageStack that makes</div><div>image overlay more robust (it takes care of Z-buffer issues):</div><div><a href="https://lorensen.github.io/VTKExamples/site/Cxx/Images/ImageStack/">https://lorensen.github.io/VTKExamples/site/Cxx/Images/ImageStack/</a><br></div><div>Also see the overview of vtkImageSlice and vtkImageResliceMapper:</div><div><a href="https://www.vtk.org/Wiki/VTK/Image_Rendering_Classes">https://www.vtk.org/Wiki/VTK/Image_Rendering_Classes</a></div><div><br></div><div>There is also some test code that shows vtkImageStack in a different</div><div>configuration, where it shows a set of orthoplanes in a 3D view:</div><div><a href="https://github.com/Kitware/VTK/blob/master/Rendering/Image/Testing/Cxx/TestImageStack.cxx">https://github.com/Kitware/VTK/blob/master/Rendering/Image/Testing/Cxx/TestImageStack.cxx</a><br></div><div><br></div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
Is this only possible by writing my own vtkImageInteractionCallback that<br>
wheel handle, for example, vtkCommand::<wbr>MouseWheelBackwardEvent in order to<br>
change both slices at the same time?<br></blockquote><div><br></div><div>If you use vtkImageResliceMapper, then probably the best option is to</div><div>customize vtkInteractorStyleImage e.g. via subclassing and then modify</div><div>its code to achieve exactly the kind of interaction you want.</div><div><br></div><div>Cheers,</div><div> - David </div><div><br></div><div> </div><div><br></div><div><br></div><div> </div></div></div></div>