How can i embed ImageJ into a webpage? Ideally im trying to incorporate it into an Oracel ADF web application, but i think i can get that figured out if i can first figure out how to run ImageJ in a web page as an applet. Any pointers would be greatly appreciated.
Note that Java applets are increasingly unsupported in modern browsers, though.
As for incorporating ImageJ into an Oracle ADF web application… as a rule of thumb, incorporating ImageJ2 components on the server side should be doable, whereas incorporating ImageJ1 may be hit or miss, since the headless support is quite limited.
If you elaborate more precisely what you are trying to achieve, we could comment further.
Thank you for the reply.
Essentially right now we have users using a web application and then going and opening another application that is installed locally on there machine in order to manipulate images and get measurements from the image. This software is costly and doesn’t do everything needed. I would like to try and incorporate imagej into the web application to save time from having to install more software on each clients machine. And imagej looks to do everything we need. Just trying to see if there is a way to stream line my users experience. Oracle ADF has the ability to use html objects, my first thought was just to try and embed imagej as an applet. I did see that the applet context is unsupported and may not be the best way though. Im not much of an html programmer so my knowledge lacks a bit in that department. I hadnt even realized there was an imagej2 i’ve got some more research to do i see
Another nice and doable option is Java Web Start: a button in the browser that the user clicks, and ImageJ then magically downloads and runs. Unfortunately, Web Start is also increasingly unsupported in modern browsers.
Your starting point will be the Development page. Good luck, and of course, let us know here in the forum if you have any questions.
So as a test im trying to replicate this page and i just get a blank box where the applet should be. My HTML is below. I have the html file in the same directory as ij.jar. ive tried with and without the image param. Any ideas why this wont work? I created a simple applet of my own and was able to run it within the html code, i just cant get imagej to do so.
<html> <head> <title>ImageJA Applet</title> </head> <body bgcolor=gray> <h1>ImageJ embedded in a website</h1> <applet codebase="." code="ij.ImageJApplet.class" archive="ij.jar" width=750 height=550 security=all-permissions> <param name=url1 value=pic.tif> </applet> </body> </html>
Some quick questions:
- Did you sign the JAR file? Since you request
all-permissionsthe JAR must be signed.
- Which browser are you using? (It won’t work in Chrome anymore.)
Personally, I would encourage you to find a different way to deliver your application to your users—e.g., Java Web Start, or a downloadable application. Using an applet is likely to present many obstacles.
That said, if you get it working, updating the ImageJ wiki with an applet guide would be most welcome.
Signing the JAR did the trick. We really want to try and have this embedded into the web application. I’m trying a number of ways and seeing what i can get to work with Oracle ADF. This at least gives me an applet example to play around with. Thanks for the info.
Great, glad to hear you got it working. Best of luck with the project.
This is a really interesting project.
In case you want to go further and change ImageJ into a web app, here are some resources that could help: