Or is it j,i, and k like with meshgrid?
It is this one, sad to say. You can check it like this
M=50; N=40; P=30;
ir = imref3d([M,N,P])
ir =
imref3d with properties:
XWorldLimits: [0.5000 40.5000]
YWorldLimits: [0.5000 50.5000]
ZWorldLimits: [0.5000 30.5000]
ImageSize: [50 40 30]
PixelExtentInWorldX: 1
PixelExtentInWorldY: 1
PixelExtentInWorldZ: 1
ImageExtentInWorldX: 40
ImageExtentInWorldY: 50
ImageExtentInWorldZ: 30
XIntrinsicLimits: [0.5000 40.5000]
YIntrinsicLimits: [0.5000 50.5000]
ZIntrinsicLimits: [0.5000 30.5000]
As you see, the image extents in X,Y,Z are N,M, and P, so the usual meshgrid interchanging of X and Y is at work here as well :-(
Best Answer