vanvalenlab / kiosk-imageJ-plugin

An ImageJ Plugin for interacting with the DeepCell Kiosk
Other
3 stars 2 forks source link

The plugin is not being populated in the ImageJ plugins menu. #1

Closed willgraf closed 4 years ago

willgraf commented 4 years ago

I can't get the jar to show up on ImageJ's plugins menu and I've been working on this for a while.

@Bookworm100 let's track progress on the problem here, please just make note of things you've tried, blogs/StackOverflows that are helpful, etc.

Bookworm100 commented 4 years ago

To resolve this, there were a lot of trials and errors, and the following changes, in no particular order, made it to the final working version:

  1. Rename the jar file with underscores, not spaces or dashes. For instance, I made the plugin name Kiosk_ImageJPlugin based on online reconommednations.
  2. I added import statements related to ImageJ (referred as ij), especially ij.plugin for the plugin class, and ij.text.TextWindow to convey messages to the user.
  3. I renamed the main class to match the jar (Kiosk_ImageJPlugin), though I’m not sure how much it helped.
  4. I also made the main class be an implementation of the PlugIn interface
  5. I renamed the main method of the Kiosk_ImageJPlugin class to be called “run” with a single string argument.
  6. I included a config file in a newly created src/main/resources directory that matched a certain format specified in an example, and I plan to actually figure out how that actually works if users want a description to show up in the menu. So far I have only tested the “Run Kiosk ImageJ Plugin” option, and it works.
  7. I had to copy the httpcomponents-client-4.5.11 library folder.

I think that about covers what I did to make the plugin work and show up in ImageJ’s menu. See the following in case this helps someone making ImageJ plugins: Plugins in general: https://imagej.nih.gov/ij/developer/api/ij/plugin/class-use/PlugIn.html#ij.plugin https://imagej.nih.gov/ij/docs/pdfs/tutorial10.pdf

Specifically coding the plugin, including the addition of a config file: https://imagej.nih.gov/ij/plugins/#examples https://imagej.net/Description_of_ImageJ's_plugin_architecture

Displaying a text window https://imagej.nih.gov/ij/developer/api/ij/text/TextWindow.html