Zoom in on image with VTK

I have an image in VTK that I am viewing with vtkImageViewer2, and I want to zoom in on which the user clicks. I am working in Java. Does anyone know how to do this?

thanks

+4
source share
2 answers

I understand that you are asking for Java, but my experience with this was with C ++; Java equivalent syntax should work, minus customizability.

Take a look at these examples for selection and scaling. In addition, if you set the style of interaction with the image, the mouse wheel should cause scaling anywhere in the cursor. You probably do not want to literally do what you requested, but rather either scale the rubber band, or have a wheel for scaling. A click should do something, and not just change the look.

http://www.vtk.org/Wiki/VTK/Examples/Cxx/Images/PickingAPixel2

http://www.vtk.org/Wiki/VTK/Examples/Cxx/Interaction/RubberBandZoom

+3
source

Depending on what you mean by scaling, you want to either change the position and camera direction (likely), or change the truncation (unlikely).

Take a look at the setPosition () and setFocalPoint () methods in the vtkCamera class. Here is the vtkCamera documentation:

http://www.vtk.org/doc/nightly/html/classvtkCamera.html

0
source

Source: https://habr.com/ru/post/1337562/


All Articles