SimpleITK.Show() 在 Macbook 上的 ImageJ 中生成错误

发布于 01-18 08:05 字数 588 浏览 3 评论 0原文

我在Jupyter上与ImageJ斗争。这是我正在运行的代码的一部分:

def ImageGen(a,b,x_0,y_0, sigma_x, sigma_y, theta ):
    g=GaussianFunc(x_0,y_0,sigma_x,sigma_y,theta)
    g2=sitk.GetImageFromArray(g)
    res=a*g2+b
    if ("SITK_NOSHOW" not in os.environ):
        sitk.Show(res, title="res", debugOn=True)
Image_a=ImageGen(40,100,100,200,20,20,0)

输出是:

Exception thrown in SimpleITK Show: 
../../Code/IO/src/sitkImageViewer.cxx:620:
sitk::ERROR: No ImageJ/Fiji application found.

ImageJ已经在应用程序中并且运行良好,因此我不确定此错误的原因是什么。如果有人可以帮助我解决这个问题,我会很感激。先感谢您!

I'm struggling with imagej on Jupyter. This is part of the code that i'm running:

def ImageGen(a,b,x_0,y_0, sigma_x, sigma_y, theta ):
    g=GaussianFunc(x_0,y_0,sigma_x,sigma_y,theta)
    g2=sitk.GetImageFromArray(g)
    res=a*g2+b
    if ("SITK_NOSHOW" not in os.environ):
        sitk.Show(res, title="res", debugOn=True)
Image_a=ImageGen(40,100,100,200,20,20,0)

and the output is:

Exception thrown in SimpleITK Show: 
../../Code/IO/src/sitkImageViewer.cxx:620:
sitk::ERROR: No ImageJ/Fiji application found.

The ImageJ is already in the applications and it works well, so i'm not sure what is the reason for this error. I would be grateful if anyone can help me to fix that. Thank you in advance!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

提笔落墨2025-01-25 08:05:31

您的 ImageJ 可执行文件位于哪里?显然 SimpleITK 没有找到它。您可以使用 SITK_SHOW_COMMAND 环境变量给出 ImageJ 可执行文件的完整路径。

例如,在我的 Mac 上,我可以按如下方式设置 SITK_SHOW_COMMAND:

export SITK_SHOW_COMMAND=/Users/dchen/Applications/Fiji.app/Contents/MacOS/ImageJ-macosx

默认情况下 SimpleITK 在 /Applications 和 ~/Applications 中搜索 Fiji/ImageJ

您可以在此处阅读有关在 Jupyter 笔记本中使用 SimpleITK 显示图像的更多信息: http://insightsoftwareconsortium.github.io/SimpleITK-Notebooks/Python_html/04_Image_Display.html

Where is your ImageJ executable located? Clearly SimpleITK is not finding it. You can use the SITK_SHOW_COMMAND environment variable give the full path to the ImageJ executable.

For instance, on my Mac, I could set SITK_SHOW_COMMAND as follows:

export SITK_SHOW_COMMAND=/Users/dchen/Applications/Fiji.app/Contents/MacOS/ImageJ-macosx

By default SimpleITK searches for Fiji/ImageJ in /Applications and ~/Applications

You can read more about displaying images with SimpleITK in Jupyter notebooks here: http://insightsoftwareconsortium.github.io/SimpleITK-Notebooks/Python_html/04_Image_Display.html

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文