imagej / napari-imagej

Use ImageJ functionality from napari
https://napari-imagej.readthedocs.io
BSD 2-Clause "Simplified" License
25 stars 4 forks source link

Run original ImageJ commands directly #286

Open ctrueden opened 1 year ago

ctrueden commented 1 year ago

I can't remember why we decided that original ImageJ commands should fail when you try to run them, instead telling you that you must run them from the ImageJ GUI. But it sure is annoying. (Maybe we did that because we don't want to let the user run them in headless mode? That's OK, but then why impose the restriction while in interactive mode?) It would be much better if they just ran directly—I can't think of a reason why not.

gselzer commented 1 year ago

I can't remember why we decided that original ImageJ commands should fail when you try to run them, instead telling you that you must run them from the ImageJ GUI. But it sure is annoying.

We did that because it is extremely difficult to get original ImageJ commands to work headlessly - see #207.

That's OK, but then why impose the restriction while in interactive mode?) It would be much better if they just ran directly—I can't think of a reason why not.

What I don't want happening is people trying to run a original ImageJ command from within the napari-imagej search results, and then finding out that things don't work because they didn't export their Layers to napari first. I think it's really confusing to run this and not see the Layers you want in the GenericDialogs, or see those no active Image dialogs, etc. If you have a better solution here, then I'm all ears, but know that while this seems doable to run them from napari, I've tried before and didn't come up with a nice solution.

ctrueden commented 1 year ago

while this seems doable to run them from napari, I've tried before and didn't come up with a nice solution.

Makes sense, thanks for the explanation. I think we can try again before giving up completely, though. For example, napari-imagej could perform a proactive layer sync when the user launches an original ImageJ command (or maybe any command or op? what's the downside?). And if PyImageJ and/or imagej-legacy do not yet have sufficient infrastructure for proactive syncing across the three paradigms (Python/ImageJ/ImgLib2), we can improve it.

gselzer commented 1 year ago

For example, napari-imagej could perform a proactive layer sync when the user launches an original ImageJ command (or maybe any command or op? what's the downside?)

Note that this was basically what was done in #205 - see that discussion for the issues. Of course, maybe I did something wrong there - if you have ideas, then let me know!