DIPlib / diplib

Quantitative Image Analysis in C++, MATLAB and Python
https://diplib.org
Apache License 2.0
211 stars 48 forks source link

Add a Wrapper for Julia #164

Open RoyiAvital opened 3 days ago

RoyiAvital commented 3 days ago

It would be great to be able to use DIPLib in Julia.

I'd recommend having no dependency on the current Image library of Julia and just use the regular AbstractArray as the data type.

crisluengo commented 3 days ago

I looked into Julia bindings back in 2015 or so when I started thinking about the C++ rewrite of DIPlib. Back then there was only a C API, I don’t know if there’s a way to bind C++ libraries now.

But back then the Julia community seemed totally uninterested in DIPlib bindings, it seemed to me that they only wanted packages written in Julia. Which seems dumb to me, why would you re-implement algorithms just to have them be written in your own language? Maybe the ideas in the community are different now, I don’t know.

So, if it’s possible (and not too complicated) to bind a C++ library, and there are people in the Julia community actually interested in using it, then I’d be more than happy to accept Julia bindings in this repository.

I don’t know Julia at all (got disappointed in it back then, haven’t looked at it since), and don’t have the time for a major push like this on my own. But if you or anyone else is interested in writing these bindings, I’ll be happy to help.

RoyiAvital commented 3 days ago

I think back then it was indeed the trend. Do all in Julia.

Yet a decade later, the Julia eco system for Image Processing and Computer Vision is pretty lean.
So DIPLib could be a major boost.

I know no C++ and not enough low level Julia. Hopefully, someone with the proper knowledge will be exposed to this.

crisluengo commented 3 days ago

It looks like there is something similar in spirit to Pybind11 to wrap a C++ library for use in Julia: https://github.com/JuliaInterop/CxxWrap.jl

It being similar means we should be able to reuse a lot of the work we did for Python.

But Julia not having classes might make it hard to translate some core concepts such as the distinction between spatial dimensions and tensor dimensions, pixel sizes being attached to an image, etc. I don’t know enough Julia to say for sure, there might be some way to do this.