Login  Register

Re: Can ImageJ GUI (not library) be embedded into C++ somehow without rewriting the GUI?

Posted by Matti Viljamaa on May 23, 2018; 8:20pm
URL: http://imagej.273.s1.nabble.com/Can-ImageJ-GUI-not-library-be-embedded-into-C-somehow-without-rewriting-the-GUI-tp5020715p5020719.html

Thank you.

Well, because other libraries that I rely on require C++. It’s not even that I could use them as foreign functions in Java, but rather my program has to run as a C++ program.

This has also got me thinking that ImageJ might not serve me that well. Unless I rewrite the GUI.
But then I could use other libs as well, like OpenCV, ITK, …

GUI writing bugs me, because if it’s done once, then I find it waste of time having to basically rewrite nearly the same thing, just in a different framework.

BR, Matti

> Curtis Rueden <[hidden email]> kirjoitti 23.5.2018 kello 23.05:
>
> 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/software
> ImageJ2 lead, Fiji maintainer - https://imagej.net/User:Rueden
> Did 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

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html