Hi!

I'm have a setup where I either process 2D, 3D or 4D arrays. The variation in the dimensionality depends on the number of direction I have in space(1D, 2D or 3D), but always includes the time dimension(space dimensions + time dimension).

I want to make a general framework to process these data, without the need to have specified functions depending on the number of dimensions.

I do however find it difficult to extract one time frame from an arbitrary data set.

So here is my question; is there an easy way to extract all data elements from an arbitrary array dimension?

For 1D you use:

af_array.row(index)/column(index).

2D: af_array.slice(index),

but how do you do this with higher dimensions, without doing af_array(span1, span2,..., spanN, index)?

Thanks,

Morten Wigen