gpt4 book ai didi

javascript - ImageJ API 等待用户对话框

转载 作者:行者123 更新时间:2023-12-03 09:32:18 25 4
gpt4 key购买 nike

我正在尝试为 ImageJ 编写一个插件,它将提示用户使用菜单栏中内置的矩形选择工具按钮在图像中的某个区域中选择矩形 ROI。这是我的代码:

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 a Rectangular ROI", "Please press OK when done.");
wait.show();
Roi userROI = impPhantom.getRoi();

//Create a profile plot
ProfilePlot pPlotPhantom = new ProfilePlot(impPhantom, true);
double[] phanProfile = pPlotPhantom.getProfile();



}

我的问题是焦点转移到由于WaitForUserDialog而出现的提示对话框。那么它将不允许用户使用 ImageJ 内置的任何菜单工具。我的目标是停止插件,并等待用户在出现的对话框中单击“确定”。但是,我需要我的用户能够使用矩形选择工具。我是否应该寻找其他方法来停止我的插件并提示用户选择投资返回率?

最佳答案

您应该使用WaitForUserDialog#show() method确保插件实际上等待用户输入并仅在按下“确定”后继续。

关于javascript - ImageJ API 等待用户对话框,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31466012/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com