pyimagej icon indicating copy to clipboard operation
pyimagej copied to clipboard

Running customized plugin in ImageJ "locally" on Colab

Open CanYing0913 opened this issue 3 years ago • 0 comments

Following this post, I successfully downloaded Maven & OpenJDK (Linux version since Colab is on Linux) to Colab and set the corresponding environment variables (JAVA_HOME points to the corresponding jdk folder) and maven bin folder added to PATH (running mvn -v successfully prints out version). I used mamba to install pyimagej so I assume all required dependencies are installed.

However, the problem persists that I cannot run my customized plugin, Image_Stabilizer_Headless. It always throws:

->ij.IJ.run(imp, "Image Stabilizer Headless",
       "transformation=" + Transformation + " maximum_pyramid_levels=" + str(MAX_Pyramid_level) +
       " template_update_coefficient=" + str(update_coefficient) + " maximum_iterations=" + str(MAX_iteration) +
       " error_tolerance=" + str(error_tolerance))
[java.lang.Enum.toString] Plugin or class not found: "Image_Stabilizer_Headless"
(java.lang.ClassNotFoundException: Image_Stabilizer_Headless)[java.lang.Enum.toString] 

So does pyimagej support customized plugin on Colab? I have to initialize ij as a local installation since my plugin in not on the library. My Colab notebook is here if anyone want to replicate the error. It downloads required python code from my repo and use mamba to add dependencies. Any tiff file can serve as the input.

If it cannot work this way, is there any workaround I can manage to run my plugin on Colab? Thank you.

CanYing0913 avatar Nov 03 '22 22:11 CanYing0913