<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><a href="https://www.overleaf.com/read/prvfqjnzzxwq" class="">https://www.overleaf.com/read/prvfqjnzzxwq</a><div class=""><br class=""></div><div class="">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.</div><div class=""><br class=""></div><div class="">Cheers,</div><div class=""><br class=""></div><div class="">Jay</div><div class=""><br class=""></div><div class=""><div><blockquote type="cite" class=""><div class="">On Apr 7, 2015, at 11:06 AM, Mongis Cyril <cyril.mongis@googlemail.com> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class=""><div class=""><div class=""><div class=""><div class="">Hello everyone !<br class=""><br class=""></div>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 ?<br class=""></div><br class=""></div>Cheers<br class=""><br class=""></div>Cyril<br class=""><div class=""><div class=""><div class=""><br class=""><br class=""></div></div></div></div><div class="gmail_extra"><br class=""><div class="gmail_quote">2015-03-26 18:23 GMT+01:00 Brian Schlining <span dir="ltr" class=""><<a href="mailto:bschlining@gmail.com" target="_blank" class="">bschlining@gmail.com</a>></span>:<br class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word" class=""><div class=""><div class=""><br class="webkit-block-placeholder"></div></div><div class=""><div style="font-family: Helvetica, Arial; font-size: 13px; margin: 0px;" class="">Hi,</div><span class=""> <br class=""><p style="" class="">On March 26, 2015 at 8:49:21 AM, Mongis Cyril (<a href="mailto:cyril.mongis@googlemail.com" target="_blank" class="">cyril.mongis@googlemail.com</a>) wrote:</p> <div class=""><div class=""><blockquote type="cite" style="font-family: Helvetica, Arial; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;" class=""><span class=""><div class=""><div class=""></div><div class=""><div dir="ltr" class=""><div class=""><div class=""><br class=""></div>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.<span class=""> </span></div></div></div></div></span></blockquote></div><p class=""><br class=""></p></div></span></div><div class=""><div class=""><br class="webkit-block-placeholder"></div><p class="">I have some code that may help get you going. The source is under <a href="https://github.com/hohonuuli/assignments-openimaj" target="_blank" class="">https://github.com/hohonuuli/assignments-openimaj</a>. Specifically, you should take a look at the classes in <a href="https://github.com/hohonuuli/assignments-openimaj/tree/master/src/main/java/org/mbari/javafx/scene/image" target="_blank" class="">https://github.com/hohonuuli/assignments-openimaj/tree/master/src/main/java/org/mbari/javafx/scene/image</a></p><p class="">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:</p>
<pre class=""><code class="">import java.net.URL;
import org.mbari.javafx.scene.image.*;
JavaFX.namedWindow("My Window",
new URL("<a href="https://upload.wikimedia.org/wikipedia/en/2/24/Lenna.png" target="_blank" class="">https://upload.wikimedia.org/wikipedia/en/2/24/Lenna.png</a>"));
</code></pre><p class="">If you need a reference to the Stage you can do the following after you’ve created it:</p>
<pre class=""><code class="">Optional<ImageStage> stage = JavaFX.getNamedWindow("My Window");
</code></pre><p class="">Anyway, it will at least give you a starting point. There’s a method that takes a <a href="http://docs.oracle.com/javase/8/javafx/api/javafx/scene/image/Image.html" target="_blank" class="">javafx.scene.image.Image</a> 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. <code class="">Swing.namedWindow(...)</code> in the project.</p><p class="">Good Luck</p><span class="HOEnZb"><font color="#888888" class=""><p class="">–
Brian Schlining</p></font></span></div></div></blockquote></div><br class=""></div>
_______________________________________________<br class="">ImageJ-devel mailing list<br class="">ImageJ-devel@imagej.net<br class="">http://imagej.net/mailman/listinfo/imagej-devel<br class=""></div></blockquote></div><br class=""></div></body></html>