[ImageJ-devel] Developping new UI for ImageJ

Jay Warrick warrick at wisc.edu
Tue Apr 7 17:11:59 CDT 2015


https://www.overleaf.com/read/prvfqjnzzxwq

I wrote this up a while back. It only touches a bit on your topics (I think) at a high level but maybe it would help. Hopefully it isn't outdated anymore.

Cheers,

Jay

> On Apr 7, 2015, at 11:06 AM, Mongis Cyril <cyril.mongis at googlemail.com> wrote:
> 
> Hello everyone !
> 
> I had to put the project on pause for a couple of week but now I'm back on it. First, thank you for your help. Thanks to you, I succeeded to put the FxUI as prior UI. Also the JavaFX App is started in ImageJ. I could even generate a menu and all. I can call the "Open file" plugin and it uses the JavaFX routines to show the file dialogs and all. It's great. However, not much happens after that. My next questions goes about to the ImageDisplay stack. I have troubles understanding the "call stack" after the image has been open. What the difference between the DisplayService, ImageDisplay and ImageDisplayViewer ? An image is open but who decide of what and how ? Do I have to overwrite the ImageDisplayService or is it UI agnostic ?
> 
> Cheers
> 
> Cyril
> 
> 
> 
> 2015-03-26 18:23 GMT+01:00 Brian Schlining <bschlining at gmail.com <mailto:bschlining at gmail.com>>:
> 
> Hi,
> 
> On March 26, 2015 at 8:49:21 AM, Mongis Cyril (cyril.mongis at googlemail.com <mailto:cyril.mongis at googlemail.com>) wrote:
> 
>> 
>> I'm currently embedding ImageJ in one my application but I use JavaFX for the user interface. I would like to channel the image windows, which are created and handled by ImageJ, to JavaFX elements. In other words, when a plugin wants to display an image, this image would be displayed in a JavaFX element. 
> 
> 
> 
> I have some code that may help get you going. The source is under https://github.com/hohonuuli/assignments-openimaj <https://github.com/hohonuuli/assignments-openimaj>. Specifically, you should take a look at the classes in https://github.com/hohonuuli/assignments-openimaj/tree/master/src/main/java/org/mbari/javafx/scene/image <https://github.com/hohonuuli/assignments-openimaj/tree/master/src/main/java/org/mbari/javafx/scene/image>
> The code there is pretty straightforward. I wrote this code for an image processing course I was taking. You can display an image in a resizable JavaFX Stage likes so:
> 
> import java.net.URL;
> import org.mbari.javafx.scene.image.*;
> 
> JavaFX.namedWindow("My Window",  
>   new URL("https://upload.wikimedia.org/wikipedia/en/2/24/Lenna.png <https://upload.wikimedia.org/wikipedia/en/2/24/Lenna.png>"));
> If you need a reference to the Stage you can do the following after you’ve created it:
> 
> Optional<ImageStage> stage = JavaFX.getNamedWindow("My Window");
> Anyway, it will at least give you a starting point. There’s a method that takes a javafx.scene.image.Image <http://docs.oracle.com/javase/8/javafx/api/javafx/scene/image/Image.html> instead of a URL too. You’ll still need to implement a conversion between ImageJ/imglib2 image formats and JavaFX’s Image. There’s also a Swing class the does something similar (e.g. Swing.namedWindow(...) in the project.
> 
> Good Luck
> 
> – Brian Schlining
> 
> 
> _______________________________________________
> ImageJ-devel mailing list
> ImageJ-devel at imagej.net
> http://imagej.net/mailman/listinfo/imagej-devel

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://imagej.net/pipermail/imagej-devel/attachments/20150407/68a446f9/attachment.html>


More information about the ImageJ-devel mailing list