javascript - ImageJ API WaitForUserDialog -
i'm trying write plugin imagej prompt user select rectangular roi in region in image using rectangular selection tool button built menu bar. here code:
import ij.*; import ij.process.*; import ij.gui.*; import java.awt.*; import ij.plugin.*; public class computedop implements plugin { public void run(string arg) { ij.showmessage("dop plugin status","load image"); imageplus imp = ij.openimage(); imp.show(); ij.showmessage("dop plugin status","phantom loaded, select rectangle roi"); //image roi waitforuserdialog wait = new waitforuserdialog("select rectangular roi", "please press ok when done."); wait.show(); roi userroi = impphantom.getroi(); //create profile plot profileplot pplotphantom = new profileplot(impphantom, true); double[] phanprofile = pplotphantom.getprofile(); }
my problem focus shifts prompt dialog appears due waitforuserdialog. won't allow user use of menu tools built in imagej. goal halt plugin, , wait user click ok on dialog box appears. however, need user able use rectangle selection tool. should looking other way halt plugin , prompt user select roi?
you should use waitforuserdialog#show()
method make sure plugin waits user input , continues after ok pressed.
Comments
Post a Comment