Thank you very much! I really appreciate your work.
I downloaded the updated function and tested it. Yes, it gave me the unrounded xd (subX), yd (subY) and zd (subZ) which I needed. Great! Thanks!
Since I also need the values of the extracted plane from subX, subY and subZ (sorry for not metioning it in my previous email), I added the line to extractSlice before "for" loop,
h = slice(volume, subX, subY, subZ);
For a point on the plane, plane(i,j), I can get its coordinate [subX(i,j), subY(i,j) subZ(i,j)].
Hope what I did makes sense to you. I am happy to hear your comments.
I checked again and was wrong with what I mentioned in my previous email. The shift is right!
After rotation, xd, yd and zd are rounded before "for" loop of ExtractSlice. I am wondering if it is possible for ExtractSlice to extract slice with xd,yd and zd without rounding.
Thanks for your help in advance.