-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Independence from ImageJ and ImageJ2; support for Icy and Matlab #8
Comments
Hello @carlosuc3m , @haesleinhuepf , all.
Yes this is a great idea. Actually it might becomes a requirement in the future with the future version of JDK that require artifact separation to be matching package declarations :/
Ok with this we would achieve independence from the data structure underneath 'images', whatever they are. And I see the importance of this if we want to simplify our lives. I would instead make the core specific to interfaces, with a specific data structure, and I would pick imglib2. It's a compromise, because now we have something specific to imglib2. But the nice thing is that imglib2 is basically everywhere.
For MATLAB I am not sure yet. We can go through Java with the imglib2 bridge, but we could also make a C-binding? I would be in favor of addressing the first 3. |
Suggestion for package names CORE net.clesperanto.jclic Everything CLIC:
CORE with imglib2. net.clesperanto.jclic.imglib2 Limit the uses of imglib2 to this package (nothing above, so that we can ship the artefact without imglib2 dip). |
To manage and facilitate the copy from / to array[] / imglib2 interfaces: |
Hello, Core
For the core, I am basically wrapping the src/gen With respect to the actual processing routines in each Tier. My understanding is that we need to do the same with a code generation Script or will the users call for example ArrayJ
Thus we could reference directly ArrayJs from ImgLib2 arrays for visualization or single pixel access. It would also improve the conversion of ImgLib2 arrays into ArrayJ as it currently needs two copies. I am using the ImgLib2 ArrayJ-ImgLib2
This class contains static methods to copy from RandomAccessibleInterval to ArrayJ and from ArrayJ to ImgLib2 ArrayImg (it will be extended to other ImgLib2 Imgs). There are just two public static methods that convert back and forth:
Here is where I would also like to have a method that creates an imglib2 referencing the byte array of an ArrayJ. Sorry for the long comment but I wanted to make sure that I am following the correct direction. Regards, |
Also, I wanted to ask another couple of things. In which order are the bytes stores on the GPU, Little or Big endian? |
Couldn't it be done by simply renaming the output generated by JavaCPP? tell JavaCPP to directly generate a
The GPU memory bytearray can only be accessed by OpenCL operation. What is stored in What we need is to access a pointer array from an
OCL store the way you code it, if I didn't messed-up we are in c-style |
yes it can be done directly simply by changing the output of the java cpp code, as done here: In my experience however I have always found working with code directly generated by JavaCPP a little bit challenging.
Great now I understand better
okk |
got it. Normally I would not mind but we are already using wrapper on the C++ style with the It's ok for me if it does not make maintenance too complex or impare speed. |
makes a lot of sense. The wrapper is done already so I can show you in the next meeting and we can decide. For maintenance, I think we would need a Script that generated the wrapper for the functions if we were to decide to keep the wrapper. |
EDIT: the snippet of code provided only works with memory type: Here there is some progress on the core-imglib2 relationship. The code below opens a file with ImageJ, converts the ImageJ It seems to work well. The ImgLib2 <-> ArrayJ conversion is done in this isolated class: This snippet of code uses the wrappers for the JavaCPP generated code, which are up for discussion. Removing them would be straightforward and require minimal effort.
This is the pom file needed to run this small example:
I am using the images from the imglib2 tutorial: https://github.com/imglib/imglib2-tutorials/tree/master |
As discussed last week with @StRigaud we are trying to decide how we should present the different Tier methods in clesperantoj. Currently we are creating wrappers on the Javacpp generated code as, in my opinion, it is not clear at all. The key point is that there exist the possibility of accepting |
Just some update after @StRigaud and I discussed the possible prototypes. We have reduced the number of options to just 1:
Where the input object can be The mehtod is intended to be used like this:
The pull request is still the same: #40 |
A long-term wish from some users was to craft a jar file that is independent from ImageJ and/or ImageJ2. We should implement this later but have it in mind from the very beginning. I think this could be achieved by having packages structured like the following. We can later split these packages into separate repositories with different dependencies.
net.clesperanto.core
: This package contains all the functionality for processing images (e.g.gaussian_blur
. A user could theoretically run such code:However, this gateway does not contain
push()
,pull()
andimshow
functions. It might be marked as purely internal package.net.clesperanto.imagej
: This package contains things that depend on classical ImageJ such asImagePlus
andImageStack
. Users could run such code:net.clesperanto.imagej2
: This package contains things that depend on ImgLib2 and ImageJ2 such asRandomAccessibleInterval
,IterableInterval
andDataSet
. Users could theoretically run such code:net.clesperanto.icy
: This package contains things that depend on Icy, such aspush()
that takes a sequence as input.net.clesperanto.matlab
: This package contains things that depend on Matlab-specific code, such as MOCLIf we strive for such a solution, we would have multiple
Clesperanto
classes and theirpush()
andpull()
functions would have different parameter and return types.Alternative: In CLIJ we had a
push()
function retrieving any type and multiplepull()
functions such aspullRAI()
for ImageJ2,pullMat()
for Matlab andpullSequence()
for Icy compatibilty.Just for completeness, I'm adding the python version
pyclesperanto
: This package is naming-wise different to follow best-practices in pypi/python ecosystem. Users could run such code:This will not be implemented very soon. Opinions welcome!
The text was updated successfully, but these errors were encountered: