zoom image

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

zoom image

rickyxiangzhihai
Hi, I am new to Imagej Api, I am trying to zoom in a image in display, but
the image stays the same.
I have tried IJ.runPlugIn("ij.plugin.Zoom", "in"), which works, but I want
to stick to IJ2.
I tried two ways of doing it. one is use ZoomService, another is to use
command. here is my code.

                final ImageJ ij = new ImageJ();
                final Dataset dataset =
ij.scifio().datasetIO().open("0050000006\\dcm\\0000001.dcm");
                ij.launch(args);
                final ImageDisplay imageDisplay =
                                (ImageDisplay) ij.display().createDisplay(dataset);

                Context context = new Context(DefaultZoomService.class);
                ZoomService zoomService = context.getService(DefaultZoomService.class);
                zoomService.zoomIn(imageDisplay);
                CommandInfo info =
ij.command().getCommand("net.imagej.plugins.commands.zoom.ZoomIn");
                ij.command().run(info, true);


neither work. Please tell me the standard way of doing it. TY



--
Sent from: http://imagej.1557.x6.nabble.com/

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html