Skip to content

Image2D, Image3D: methods only available with ByteBuffers, Pointers also needed #27

Description

@royerloic

Dear Olivier,

In the context of our work: https://clearvolume.github.io/ClearVolume/
We encounter the following issue: ByteBuffers are limited in size and
so when we upload 3D images of more that a few gigabytes (yes we do that!)
we run into trouble. Right now I use reflection to circumvent this and somehow
acess some private methods and fields. VERY DIRTY.
We use BridJ and an Unsafe based infrastructure to get
data from our microscopes. It would be great to expose the Pointer based function
calls so that users have the choice between ByteBuffers or Pointers.

Below is an example of the kind of helper functions I have to circumvent this problem:

public static CLEvent readImage3D(CLImage pCLImage,
                                  CLQueue pCLQueue,
                                  Pointer<?> pPointer,
                                  long pX,
                                  long pY,
                                  long pZ,
                                  long pWidth,
                                  long pHeight,
                                  long pDepth,
                                  boolean pBlocking)
  {
    try
    {
      return (CLEvent) JavaCLUtils.sReadMethod.invoke(pCLImage,
                                      pCLQueue,
                                      pointerToSizeTs(pX, pY, pZ),
                                      pointerToSizeTs(pWidth,
                                                      pHeight,
                                                      pDepth),
                                      0L,
                                      0L,
                                      pPointer,
                                      pBlocking,
                                      new CLEvent[0]);
    }
    catch (final Throwable e)
    {
      e.printStackTrace();
    }
    return null;
  }

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions