I am having a problem with using ImageJ from Python in an Anaconda environment. I hesitated to install Anaconda as it adds yet another platform to my toolbox that I have to learn :-). It could bring me some nice stuff and then I will go for it. To determine if that is really the case, I will first sketch the original problem that I want to solve and then return to the Python / Anaconda question.
I develop tool for handling a set of image frames. I use ImageJ 1.53b in a Fiji installation. My code is an ijm macro. In a part where I need to do pixel-wise calculations with pixels from two stacks this code really becomes too slow. So I am looking for a solution where I can hopefully re-use most of the code that I have now.
So, I wondered how it would be possible to perform the pixelwise calculation in Python, as this is a language that I have been using before. I could not find directions on how to use Python scripts within ImageJ/Fiji (also because the site is down…) but I hit upon pyimagej.
I understand that with pyimagej I can run ImageJ WITH the GUI. Is this a GUI similar to that of the standalone versions? If so, this would probably fullfil my requirement to re-use the most of my current code.
Now my problem with pyimagej and Anaconda:
Yesterday I had a notification that something was wrong with mvn and imagej.net… I could not reproduce this today. [EDIT: i got the same notification as described on Github by AdvancedImagingUTSW (https://github.com/imagej/pyimagej/issues/68). Here I describe what I encountered now.
installed Anaconda succesfully I opened a CMD.exe prompt.
followed the instructions under https://github.com/imagej/pyimagej
REMARK: when opening the cmd.exe prompt when trying to reproduce the error there was a notification: path not found (in some other words)
This was resolved with conda init CMD.exe
Then I tried:
ij = imagej.init()
ij = imagej.init(‘sc.fiji:fiji+net.imagej:imagej-legacy’)
both without succcess (See screenshot).
As it is completely new to me I opened the Documentation in Anaconda Navigator (AN). I discovered something about environments, so I went to Environments in AN and selected the pyimagej environment. I had to install the CMD.exe prompt and after that I started the prompt and runned python in it. Here is the result of trying to use pyimagej: