Login  Register

Re: Writing ImageJ plugins using C++ or Python

Posted by Jan-2 on Feb 06, 2017; 5:45pm
URL: http://imagej.273.s1.nabble.com/Writing-ImageJ-plugins-using-C-or-Python-tp5018035p5018037.html

Some pros and cons for the C++ case:
Pros:
* Speed! Your plugin will be faster than a plugin written in Java.
* You don't have to rewrite your code in Java :)
Cons:
* You will have to use the Java Native Interface, to make your C++
methods available in Java. This can involve quite a bit of debugging,
memory management might be another issue here, since you have to provide
ways to free memory from within Java.
* Your code will not be platform-independence (in the Java sense). What
I mean by that is, that you have  to compile and provide dll/so library
files along with your plugin, which you have to manually load from your
Java code.

In short: Getting your C++ code to ImageJ will be related with some
work. Speed will be the reward, but using JNI can be a pain.

If you plan on using Python using Jython is one option here.
However, if your Python code wraps around a C++ library, you should
avoid the Python wrapper and use the C++ library directly. Which leads
us back to the C++ case.

Cheers,
Jan


On 2/6/2017 5:52 PM, Li, Xin (GE Global Research) wrote:
> Hello,
> I have some image analysis code in C++ that I would like to turn into ImageJ plugins. Are there any pros and cons to write plugins using C++ or Python instead of Java? Please also let me know if you have any suggestions about writing plugins using C++ or Python. Thank you so much!
>
> Xin
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
> .
>

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