Life Cycle of a plugin + good practices for referenced lib etc...

42 views
Skip to first unread message

Perrine Paul-Gilloteaux

unread,
Apr 12, 2013, 10:15:40 AM4/12/13
to icy-so...@googlegroups.com
Hi Icy Dev Team,
we successfully managed to interact with Icy from our image data base.
Then several questions come:
1) we need to refer to a jar file containg the API to communicate with our database server. What would be the best place to put it? I've seen that when you submit a plugin there is only a.jar to be uploaded. From Icy configuration of Eclipse, I was able to exort the source of the plugin in jar, but not to attach the referenced library. The jar is fionctional and can be launched from ICY (without Eclipse) but only if the api jar file is copy next to it. But putting it in ICY/lib directory is not working.
What would you advise? the api jar is specific for our database, so only of interest for our users.
2) Access to the data base in only of interset for our users, even external, I've seen there was some way in addition to the beta flag to specify a interest for a group, but I did not find the documentation for it.
3) How to indicate users of the database which plugin to use, if it is online?
4) Once the compute method is launched, what is happening exactly to any variable created? It looks that they stay in memory after the execution, which was actually good for us, but we did not understood why.
Best regards,
Perrine

Thomas Provoost

unread,
Apr 12, 2013, 11:17:07 AM4/12/13
to icy-so...@googlegroups.com
Hi,

1) Just copy the .jar of your API into the folder plugins/, and it'll be recognized in Icy.

2) In order to do so, you will have to specify a new "Repository", under Preferences. This repository is a .xml file with a structure similar to this one : http://icy.bioimageanalysis.org/repository/

You will have to host this xml file on a server only known by you and your users. If you want more privacy, you can also add a user/password authentication.

3) In Preferences > Online Plugins, you have the possibility to select the repository. When yours will be selected, only the plugins you decided to add will be visible.

4) What compute method are you referring to? Anyway, because every computation is plugin-specific, memory leakage is dependent on the developers' skills, and cannot be generalized to the whole software.

I hope that answers your questions.

Cheers,
Thomas

Stephane

unread,
Apr 12, 2013, 11:48:49 AM4/12/13
to
Hi Perrine,

To complete Thomas response for the first point, you can also unpack the content of your jar library file (.class files) and put them inside your plugin jar file so you have a "all-in-one" working solution.
That is not the "usual way", normally you should do a PluginLibrary containing only the library then you can add a dependence to plugin(s) which require it. But in your case, you would not worry about that as there is not point in sharing the library for something else.

Best,

- Stephane


Le vendredi 12 avril 2013 16:15:40 UTC+2, Perrine Paul-Gilloteaux a écrit :

Fab

unread,
Apr 15, 2013, 10:02:03 AM4/15/13
to icy-so...@googlegroups.com
Hi Perrine,

Do you have all the answers you need ?

Best,

Fabrice

Perrine Paul

unread,
Apr 17, 2013, 4:02:56 AM4/17/13
to icy-so...@googlegroups.com
Hi Fab, Thomas and Stéphane 
Many thanks for your reactivity (better than mine, sorry for the delay in my answers) and clear answers. For point 1 i would be happy to share the plugin it is just that there is a limited interest for a broad audience so the svn repository solution is good since I can also indicate it to external users. But explanations you gave me are clear.
For the point 4 I was actually talking about the connection to the database which stays open until you explictly close it or close ICY ( which is very good for us) and I was comparing with imageJ where when a similar plugin exits, the connection is closed by default even if not asked.
And I have a bonus question: my icy plugin template implements PluginImageAnalysis which is said to be deprecated: what is the new correct plugin "implements"?  I did not checkout the tutorial yet, I will certainly goes through.
In any case the Eclipse env. you set is very nice.
Cheers,
Perrine
--
You received this message because you are subscribed to a topic in the Google Groups "Icy imaging" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/icy-software/mjE0Q5LlhfA/unsubscribe?hl=en.
To unsubscribe from this group and all its topics, send an email to icy-software...@googlegroups.com.
To post to this group, send email to icy-so...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msg/icy-software/-/tgSG3o7XlKUJ.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Fab

unread,
Apr 17, 2013, 8:33:52 AM4/17/13
to icy-so...@googlegroups.com
Hi Perrine,

You should now extend PluginActionnable:

here is an example:

package plugins.fab.fly3d;

import icy.plugin.abstract_.PluginActionable;

public class Test extends PluginActionable {

   
@Override
   
public void run() {
       
// TODO Auto-generated method stub
       
   
}

   
   
}


You can also consider writing an EzPlug plugin, which helps very much at creating the GUI of your plugin. In this case this will look like this:

package plugins.fab.ringroi;

import plugins.adufour.ezplug.EzPlug;

public class Test extends EzPlug{

   
@Override
   
public void clean() {
       
// TODO Auto-generated method stub
       
   
}

   
@Override
   
protected void execute() {
       
// TODO Auto-generated method stub
       
   
}

   
@Override
   
protected void initialize() {
       
// TODO Auto-generated method stub
       
   
}

}

And to finish, you can also consider Blocks, to be graphically used in protocols:

package plugins.fab.colocalizer;

import icy.plugin.abstract_.Plugin;
import plugins.adufour.blocks.lang.Block;
import plugins.adufour.blocks.util.VarList;


   
public class Test extends Plugin implements Block {

       
@Override
       
public void run() {
           
// TODO Auto-generated method stub
           
       
}

       
@Override
       
public void declareInput(VarList inputMap) {
           
// TODO Auto-generated method stub
           
       
}

       
@Override
       
public void declareOutput(VarList outputMap) {
           
// TODO Auto-generated method stub
           
       
}
   
}


You can also combine EzPlug and Blocks.

If you use EzPlug or Blocks, don't forget to add the propers Jar file into the buildpath of your project in order to compile. ( plugins/adufour/blocks/blocks.jar and plugins/adufour/ezplug/ezplug.jar

Best,

Fabrice

Stephane

unread,
Apr 17, 2013, 8:39:16 AM4/17/13
to
Hi Perrine,

About your connection which stay alive, i guess it depends about how you designed your plugin.
I guess you have a graphical interface in both of your plugin (IJ and Icy).
If the connection object is inside your GUI then it won't be released until you close the GUI. I can't explain why it does not behave the same way in ImageJ though...
PluginImageAnalysis should be replaced with PluginActionable now (Fabrice was faster than me to reply here), normally javadoc give tips about what you should use instead when you meet deprecated classes or methods :) Unfortunately the online documentation and the tutorials are quite outdated but that is something we will change soon !
Glad you appreciate the eclipse development environment we defined for Icy :) It is actually not easy to deal with plugin development but we try to keep it as simple we can !

Cheers,

- Stephane

Perrine Paul

unread,
Apr 23, 2013, 6:38:12 AM4/23/13
to icy-so...@googlegroups.com
Hi Stephane and Fab
Sorry for the long delay in my answer. Thanks for the detailed plugin extension possibilities Fabrice. Stephane I finally managed to replicate the same behavior in ImageJ, outside of the GUI also.
Thanks again.
Cheers
Perrine


2013/4/17 Stephane <stephane.da...@pasteur.fr>
Hi Perrine,

About your connection which stay alive, i guess it depends about how you designed your plugin.
I guess you have a graphical interface in both of your plugin (IJ and Icy).
If the connection object is inside your GUI then it won't be released until you close the GUI. I can't explain why it does not behave the same way in ImageJ though...
PluginImageAnalysis should be replaced with PluginActionable now, normally javadoc give tips about what you should use instead when you meet deprecated classes or methods :) Unfortunately the documention and the tutorials are quite outdated but that is something we will change soon !

Glad you appreciate the eclipse development environment we defined for Icy :) It is actually not easy to deal with plugin development but we try to keep it as simple we can !

Cheers,

- Stephane




Le mercredi 17 avril 2013 10:02:56 UTC+2, Perrine Paul-Gilloteaux a écrit :
To view this discussion on the web visit https://groups.google.com/d/msg/icy-software/-/HwFNqJMofo0J.
Reply all
Reply to author
Forward
0 new messages