first of all congrats to the developers for the SimpleITK 2.0 release!
I was just exploring it from Java and I’m wondering how to pipe pixels from another source into an ITK image. I do have various options for accessing pixels from our side but I can’t see a way for creating an ITK Image from them.
In my typical workflows, images exist as JNI Buffer, that’s an array allocated in a native C++ library, and Java has only a pointer to it. I could copy over that array in a Java float[] array (which appears a de-tour). Furthermore, I could offer the image encapsulated in various ImageJ objects. But that boils down to arrays of arrays of type float for example.
Is there a code example showing how to create a Simple ITK image from a Java float[] array or a JNI pointer and given dimensions? The opposite direction would be interesting as well. btw.
You are correct. The ImportImageFilter is not available for the Java interface ( nor any other wrapped language ) due to expose of raw buffer pointers.
The CSharpIntegration example may be of some use to figure out how to copy the buffer in Java.
Contributions to improve the documentation and efficiency of the interface is certainly welcome