This is a question as much as a summary of what I discovered when using non-default IJ1 plugins within QuPath (0.1.2 [I think] and 0.2.0).
QuPath defines a location for ImageJ Plugins under
preferences > ImageJ > ImageJ plugins directory
So suppose I am adding MorphoLibJ.jar to this previously defined location
I then can find the plugin in ImageJ under
Plugins > MorphoLibJ > Etc...
However if I need to use the MorphoLibJ API from a QuPath script, it does not find the classes
In order to find and load the MorphoLibJ for use in a QuPath script, I need the MorphoLibJ.jar to be inside the
extensions directory inside the folder defined under
Preferences > Extensions > QuPath User Directory
Which brings me to the question: What is the rationale in not letting QuPath load the jars in
ImageJ plugins directory directly as well? In my mind, having a jar for ImageJ available within QuPath should allow me to call upon those classes from within a QuPath script directly. Currently I see two options.
- Duplicate the Jars and make the distinction between the ones where I will programmatically access them in QuPath and those I will use within QuPath’s ImageJ instance interactively (or using
IJ.run). Bit messy
- Make the
ImageJ plugins directorya subdirectory inside
QuPath User Directory/Extensions. Guess it solves the duplication issue, but now the ImageJ plugins are user-specific, and kind of kills the point of having these two preferences separate.
Another option would be to have QuPath load the jars in the
ImageJ plugins directory on startup, and not just the ones in
QuPath User Directory/Extensions
In my mind, the last paragraph makes the most sense, but would involve changes in the QuPath code, whereas the others do not, but are a bit wonky.
It would be good to know what the “official” recommendation is, so that I can write up a protocol for our users, as we often benefit from external ImageJ plugins not within QuPath.
All the best