Closed tomerfried closed 3 years ago
@tomerfried This is probably the same issue as #129. I'll investigate when I have time!
@ctrueden @elevans so far I have confirmed that there is a negative interaction with the Bio-Formats plugins.config
. The importer sets Location=[Local machine] windowless=false
and if I instead pass an empty string, the Importer command is suddenly discovered within PyImageJ.
Other commands are similarly missing: Bio-Formats, Bio-Formats (Windowless) and Bio-Formats Windowless Importer (the latter two being the same command)
Oddly, the Bio-Formats (Remote) commands are both present.
To summarize the state of plugins.config
:
Location=[Local machine]
are not found, but Location=[Internet]
are (problem a space in the value?)"Location=[Internet]"
is OK but not "Location=[Internet] "
) 💥 So I guess the next step is to understand where these params are actually being parsed and interpreted. 😿
@tomerfried so part of the problem is that ImageJ 1.x's plugin structure is entirely directory based and even though you are specifying a local app, ImageJ 1.x is unable to fully connect the dots to where your plugins are.
With a local Fiji.app you can work around this by doing one of:
python
in a terminal from your Fiji.app
directoryplugins.dir
to your Fiji.app\plugins
directory, e.g.:
import imagej
from scyjava import jimport
from scyjava import sj
from skimage import io
sj.config.add_option('-Dplugins.dir=C:/Users/Tomer/Desktop/Hereon Project/Fiji.app/plugins') ij = imagej.init('C:/Users/Tomer/Desktop/Hereon Project/Fiji.app')
@elevans @ctrueden
This also works with a `jgo` initialization but it's kind of dumb since you have to know the jgo directory ahead of time.. e.g.:
import imagej import scyjava as sj sj.config.add_option('-Dplugins.dir=C:\Users\hiner\.jgo\net.imglib2\imglib2-imglyb\1.0.0+net.imagej-imagej-legacy-RELEASE+sc.fiji-fiji-RELEASE') ij = imagej.init('sc.fiji:fiji', headless=False) ij.ui().showUI()
If necessary we could add a bit of code to auto-set `plugins.dir` based on the initialization, but at least we have a workaround for now.
I'm now going to try and understand the mechanism behind the "best effort" plugin detection that still seems to be in play when `plugins.dir` is *not* set.
I'm now going to try and understand the mechanism behind the "best effort" plugin detection that still seems to be in play when plugins.dir is not set.
It's in imagej-legacy, of course.
This pattern is too restrictive. 👿
I'm trying to use "Bio Formats Importer" by running macros with pyimagej. this is the code:
and this is the error:
Iv'e tried using
run_plugin()
but the error is the same.Is there a solution for this? because I didn't find any in previous topics online. Basically, all I need is a good images importer for tiff files, captured from a microscope for a biological research. It is important that there would not be a loss of data when importing.
I'd like to hear any alternatives for Bio Formats if you guys know something
Thank you