【问题标题】:ImageJ: Debug with bioformatsImageJ:使用生物格式进行调试
【发布时间】:2016-09-01 17:26:30
【问题描述】:

我已经下载了 imageJ 源并导入了 Eclipse。目前,我正在为 imageJ 开发一个插件,如果需要,我可以使用我的插件从 eclipse 运行 imageJ 并进行调试。我的问题是我希望从 Eclipse 中初始化 imageJ,但加载了 bioformats reader plugin,这样我就可以打开 .lif 文件了。如何将此插件引入 imageJ 源代码?我曾尝试在我的项目中将依赖项添加到 bioformats 的 .jar 文件中,但它不起作用。

【问题讨论】:

    标签: eclipse plugins imagej


    【解决方案1】:

    不要复制源文件,也不要复制 JAR 文件。您应该管理您的项目依赖项using Maven 或类似的 21 世纪构建工具(Gradle 也有效)。根据需要添加对 net.imagej:ijome:formats-gpl 以及其他 Bio-Formats 工件的依赖项。

    另见:

    【讨论】:

      【解决方案2】:

      只针对那些正在研究同样问题的人:

      1. 全部源代码下载:https://github.com/openmicroscopy/bioformats
      2. 将文件夹:bioformats-develop\components\bio-formats-plugins\src 复制到您的项目中。
      3. 将 loci.plugins.LociImporter.java 复制到 ij.plugin。
      4. 删除 loci.plugins.LociImporter.java
      5. 修改ij.plugin.LociImporter.java,添加arg这一行:

         public void run(String arg) {
             DebugTools.enableLogging("INFO");
             arg = "location=[Local machine] windowless=false "; //<-This one
             [...]
         }
        
      6. 修改 loci.plugins.in.Importer.java:

        //import loci.plugins.LociImporter;//substitute this import per
          import ij.plugin.LociImporter;//this one
        
      7. 修改ij.Menus.java:

        [...]
        Menu importMenu = getMenu("File>Import", true); 
        addPlugInItem(importMenu, "Bio-Formats", "ij.plugin.LociImporter",0,false);  //<-Add this line
        [...]
        
      8. bioformats.jar 作为外部库添加到项目中。

      运行项目。现在您可以从 file->import->Bio-Formats 打开 .lif。通过此修改,您将无法进行拖放,但您将能够使用此插件,只需使用此菜单打开文件。由于这仅使用“导入”,因此仅对打开有用。如果你想要一些关于保存的东西,你应该调用 loci.plugins.LociExporter("") ,就像我为导入所做的那样。 (实际上通过我的修改我们调用了 ij.plugin.LociImporter("location=[Local machine] windowless=false ")

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2013-10-20
        • 1970-01-01
        相关资源
        最近更新 更多