How to efficiently sample a volume matrix?

    Jan 17 2014 | 9:36 pm
    I would like to create a 3D matrix of values (jit.matrix 1 float32 32 32 32), then use a second matrix with three planes representing x,y,z coordinates as a look up (e.g., jit.matrix 3 float32 1000). The output would be a 1 x 1000 matrix (in the above case) with values corresponding to the value in the volume at that coordinate. Unless I'm missing something, sample and nearest do not seem to do what I was thinking. Any thoughts?

    • Jan 18 2014 | 1:32 pm
      just to be clear, you're looking to save 1000 values at each location in the 32^3 cube?
    • Jan 18 2014 | 2:52 pm
      Thanks for the question. No, I am merely looking to use the 1000 points as probe points to find specific values in the 32^3 volume. I can iterate through the 1000 points and create 1000 getcell messages with those points and pack the results into a separate 1000 x 1 matrix with the values I want -- but I am looking for an efficient way to do that rather than iterating, unpacking, creating message,and repacking the results.
    • Jan 31 2014 | 1:39 am
      Hi, Currently jit.gen's input matrices all have to be the same format. This means same type, planecount, and dimensionality. This will likely be relaxed in the future, but for now, it's not possible. You can sample an ND matrix, but any data you use to sample the matrix will also have to be packed in an ND matrix.
    • Jan 31 2014 | 3:08 pm
      OK. Thanks for clarifying. I'll look forward to trying this again in that more "relaxed" future.