zoom image
Posted by
rickyxiangzhihai on
Feb 05, 2020; 12:16am
URL: http://imagej.273.s1.nabble.com/zoom-image-tp5022917.html
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