Let’s assume that I have an N-dimensional image that includes a spectral dimension (e.g. XYZC). I’d like to iteratively access the channel vectors (i.e. the values across the spectral dimension) for all pixels in the image. My goal is to take the dot product of each channel vector and some other vector. It seems that this should be doable using
Views.hyperSlice as in Example6a4.java from the ImgLib2 examples.
The inputs for
Views.hyperSlice are not quite clear to me. I feel safe in assuming that
int fixedAxes is my spectral dimension which I can get with
int cDim = img.dimensionIndex(Axes.CHANNEL);. I’m not sure what I should be passing as
long position. I think this should be the position along the spectral dimension at which the hyperslice is taken; however, the doc suggests that
position is something else: “The position is passed as position vector in source space, i.e. the positions along fixed axes are ignored.” I’d appreciate any clarification someone can provide on this point. Alternative methods are also welcomed.