If I use Fiji application to open an image, then the image is displayed in a window where I can use + and - keys to zoom in and out, also I can hold down the space bar and drag the zoomed image with mouse to scroll through it.
I want to implement the same features in a java application using ImageJ API. If I use the following code (taken from here) to open an image, then the image is displayed in the same type of window as in Fiji case, but zoom and drag to scroll features are not active in the window.
Opener opener = new Opener();
ImagePlus imp = opener.openImage("/path/to/image.tif");
imp.show();
Could somebody suggest how to get the two features active? To me they look like standard features that everybody uses, so I expect that their activation could be easily available through the ImageJ API. However I found no hints in the API specs.
As far as I understand, the call imp.show();
in the code above is equivalent to the following:
ImageWindow imageWindow = new ImageWindow(imp);
imageWindow.setVisible(true);
If so, there should be some methods of this ImageWindow
class that would assure activation of zoom and of drag to scroll. Does anyone have a clue?
Or, maybe, could someone share a direct link to Fiji source code where these exact features are implemented? Is it supposed to be here? If yes, then where exactly?