Hi,
I am trying to access some ImageJ functionality from within a python script. my goal, in the end, is being able to call an imagej script that utilizes a plugin to some end goal.
But for now I am failing to create the bridge to a pre-installed ImageJ.
I have installed PyImageJ 1.0.0 via PIP (and also in PyCharm) and I am running on windows-10 with Python 3.8. My ImageJ version is 1.53e.
I tried directing %JAVA_HOME% to both jre1.8.0_261 and jdk-15.0.1
I try running this code in Python:
import imagej
import scyjava
scyjava.config.add_option('-Xmx6g')
ij = imagej.init('C:\\Programs\\ImageJ')
ij.getVersion()
I get the following error:
ij = imagej.init('C:\\Programs\\ImageJ')
File "C:\Projects\Code_GIT\Neptune\resolutiontargetanalyser\ResolutionTargetAnalyzer\ImagingTool_RTA_V7\source\venv\lib\site-packages\imagej\__init__.py", line 167, in init
ImageJ = sj.jimport('net.imagej.ImageJ')
File "C:\Projects\Code_GIT\Neptune\resolutiontargetanalyser\ResolutionTargetAnalyzer\ImagingTool_RTA_V7\source\venv\lib\site-packages\scyjava\__init__.py", line 151, in jimport
return jpype.JClass(class_name)
File "C:\Projects\Code_GIT\Neptune\resolutiontargetanalyser\ResolutionTargetAnalyzer\ImagingTool_RTA_V7\source\venv\lib\site-packages\jpype\_jclass.py", line 99, in __new__
return _jpype._getClass(jc)
TypeError: Class net.imagej.ImageJ is not found
Can anyone assume what is the problem? I am at a loss.