Posted by
Curtis Rueden on
May 23, 2018; 8:05pm
URL: http://imagej.273.s1.nabble.com/Can-ImageJ-GUI-not-library-be-embedded-into-C-somehow-without-rewriting-the-GUI-tp5020715p5020718.html
Hi Matti,
> What are my options?
A. Link to libjvm from C++ and invoke Java code via the JNI Invocation API
[1]. Beware platform-specific issues such as starting AWT from the main
thread on macOS, though [2].
B. GraalVM. See "Top 10 Things To Do With GraalVM" [3], particularly items
3, 7 and 8.
C. Spawn java as another process from C++ to run ImageJ.
D. Use the ImageJ Server [4] to communicate with ImageJ from C++ via a REST
API.
Why does your program have to be in C++?
Regards,
Curtis
[1]
https://docs.oracle.com/javase/8/docs/technotes/guides/jni/spec/invocation.html
[2]
https://developer.apple.com/legacy/library/technotes/tn2147/_index.html#//apple_ref/doc/uid/DTS10003827-CH1-THREADED_INVOCATION
[3]
https://medium.com/graalvm/graalvm-ten-things-12d9111f307d[4]
https://imagej.net/Server--
Curtis Rueden
LOCI software architect -
https://loci.wisc.edu/softwareImageJ2 lead, Fiji maintainer -
https://imagej.net/User:RuedenDid you know ImageJ has a forum?
http://forum.imagej.net/On Wed, May 23, 2018 at 2:41 PM, Matti Viljamaa <
[hidden email]>
wrote:
> Hello,
>
> I want to use ImageJ in a C++ program. However, I found the GUI pretty
> useful as it is, but since it’s in Java, then I’m not sure, whether I can
> use it, because
> my program has to be in C++.
>
> And I don’t want to rewrite the GUI, since it’s done already.
>
> What are my options?
>
> BR, Matti
>
> Lähetetty Windows 10:n Sähköpostista
>
>
>
> ---
> This email has been checked for viruses by Avast antivirus software.
>
https://www.avast.com/antivirus>
> --
> ImageJ mailing list:
http://imagej.nih.gov/ij/list.html>
--
ImageJ mailing list:
http://imagej.nih.gov/ij/list.html