We're Hiring!

Omero ImageJ Plugin source code

General and open developer discussion about using OMERO APIs from C++, Java, Python, Matlab and more! Please new questions at https://forum.image.sc/tags/omero
Please note:
Historical discussions about OMERO. Please look for and ask new questions at https://forum.image.sc/tags/omero

If you are having trouble with custom code, please provide a link to a public repository, ideally GitHub.

Omero ImageJ Plugin source code

Postby FiReTiTi » Tue Feb 11, 2014 10:04 am

Hi,
I would like the Omero ImageJ Plugin (OMERO.insight-ij-4.4.10-ice35-b112.zip) source code in order to develop a small and quick client.
Where can I find it?
Regards,
FiReTiTi
 
Posts: 26
Joined: Tue Feb 04, 2014 7:30 am
Location: Portland, OR, USA

Re: Omero ImageJ Plugin source code

Postby jmoore » Tue Feb 11, 2014 11:26 am

The main class is available under components/insight: https://github.com/openmicroscopy/openmicroscopy/blob/v.4.4.10/components/insight/SRC/org/openmicroscopy/shoola/MainIJPlugin.java

The top-level target
Code: Select all
./build.py release-clients
generates the bundle that we release.

~Josh
User avatar
jmoore
Site Admin
 
Posts: 1591
Joined: Fri May 22, 2009 1:29 pm
Location: Germany

Re: Omero ImageJ Plugin source code

Postby FiReTiTi » Tue Feb 11, 2014 12:18 pm

Thank you for your answer!
Ok for the main class, but I don't get the second part of your answer. Can I have some details please?
FiReTiTi
 
Posts: 26
Joined: Tue Feb 04, 2014 7:30 am
Location: Portland, OR, USA

Re: Omero ImageJ Plugin source code

Postby jburel » Tue Feb 11, 2014 8:23 pm

We use the same code base for the general OMERO.insight desktop client and for the OMERO.insight imageJ plugin.
The class that Josh indicated is the class that is used to start the plugin-in.
When the user clicks on an image, by default a call is made to start the Bioformats plugin (required plugin)
The following code shows how the BF plugin is invoked
Code: Select all
StringBuffer buffer = new StringBuffer();
      try {
         buffer.append("location=[OMERO] open=[omero:server=");
         buffer.append(lc.getHostName());
         buffer.append("\nuser=");
         buffer.append(lc.getUserName());
         buffer.append("\nport=");
         buffer.append(lc.getPort());
         buffer.append("\npass=");
         buffer.append(lc.getPassword());
         buffer.append("\ngroupID=");
         buffer.append(ctx.getGroupID());
         buffer.append("\niid=");
         buffer.append(id);
         buffer.append("]");
         IJ.runPlugIn("loci.plugins.LociImporter", buffer.toString());
      } catch (Exception e) {
         LogMessage message = new LogMessage();
         message.println("Opening in image J");
         message.print(e);
         container.getRegistry().getLogger().debug(this, message);
         IJ.showMessage("An error occurred while loading the image.");
      }


If you wish to modify the OMERO code base and adjust the plugin you will have to use the build command indicated by Josh in his previous post

Hope it helps

Jmarie
User avatar
jburel
Team Member
 
Posts: 348
Joined: Thu May 21, 2009 6:38 pm
Location: dundee

Re: Omero ImageJ Plugin source code

Postby FiReTiTi » Tue Feb 11, 2014 10:21 pm

Thank you for your help.
I do know Java, so I understand the main class code, but I didn't get that that python command would download the code.

Unfortunately, macport fails to install ice on my laptop, so I cannot use this command line to get the source code.
Is there any other way to get it?

Regards,
FiReTiTi
 
Posts: 26
Joined: Tue Feb 04, 2014 7:30 am
Location: Portland, OR, USA

Re: Omero ImageJ Plugin source code

Postby jmoore » Wed Feb 12, 2014 7:47 am

Sorry for the confusion. The build.py command I listed is how to compile the IJ plugin. What are you looking to do? Do you want to open the project in Eclipse? or are you more looking for, say, a zip of the appropriate classes?

Cheers,
~Josh
User avatar
jmoore
Site Admin
 
Posts: 1591
Joined: Fri May 22, 2009 1:29 pm
Location: Germany

Re: Omero ImageJ Plugin source code

Postby FiReTiTi » Wed Feb 12, 2014 8:40 am

Yes, I want to open the whole plugin in NetBeans in order to take a look to the source code.
I want to do an automatic simple/fast client for biologists I work with, so I need to understand how to exactly read images (so how to correctly use bio-format).
FiReTiTi
 
Posts: 26
Joined: Tue Feb 04, 2014 7:30 am
Location: Portland, OR, USA

Re: Omero ImageJ Plugin source code

Postby jmoore » Wed Feb 12, 2014 8:53 am

To get just the Java files you can use:
Code: Select all
git archive v.4.4.10 components/insight/SRC -o insight-src.zip

from insight of the git repository. Putting these into netbeans won't work without the addition of jars and similar.

If you wanted to have the whole code base in netbeans, we unfortunately don't have any examples but could help you get it all running in Eclipse if that would help. (That would require Ice though)

Cheers,
~Josh
User avatar
jmoore
Site Admin
 
Posts: 1591
Joined: Fri May 22, 2009 1:29 pm
Location: Germany

Re: Omero ImageJ Plugin source code

Postby FiReTiTi » Wed Feb 12, 2014 9:12 am

Thank you so much!
I am interested by the methods called when you right clic on an image and select "View in ImageJ".
The only missing part (but not the least) in my client is the image reading with bio-format.
FiReTiTi
 
Posts: 26
Joined: Tue Feb 04, 2014 7:30 am
Location: Portland, OR, USA

Re: Omero ImageJ Plugin source code

Postby jburel » Wed Feb 12, 2014 9:28 am

Hi

When you right-click and select "View in ImageJ". An event is posted (we heavily use the Publisher/Subscriber pattern).
The code handling the opening of the image in ImageJ using the Bio-Formats plugin can be found in TaskBarManager class.
https://github.com/openmicroscopy/openm ... nager.java

Code: Select all
private void runAsImageJ(long id, SecurityContext ctx)
   {
      UserCredentials lc = (UserCredentials) container.getRegistry().lookup(
            LookupNames.USER_CREDENTIALS);
      StringBuffer buffer = new StringBuffer();
      try {
         buffer.append("location=[OMERO] open=[omero:server=");
         buffer.append(lc.getHostName());
         buffer.append("\nuser=");
         buffer.append(lc.getUserName());
         buffer.append("\nport=");
         buffer.append(lc.getPort());
         buffer.append("\npass=");
         buffer.append(lc.getPassword());
         buffer.append("\ngroupID=");
         buffer.append(ctx.getGroupID());
         buffer.append("\niid=");
         buffer.append(id);
         buffer.append("]");
         IJ.runPlugIn("loci.plugins.LociImporter", buffer.toString());
      } catch (Exception e) {
         LogMessage message = new LogMessage();
         message.println("Opening in image J");
         message.print(e);
         container.getRegistry().getLogger().debug(this, message);
         IJ.showMessage("An error occurred while loading the image.");
      }
   }


Jmarie
User avatar
jburel
Team Member
 
Posts: 348
Joined: Thu May 21, 2009 6:38 pm
Location: dundee

Next

Return to Developer Discussion

Who is online

Users browsing this forum: Google [Bot] and 1 guest