Fixed aopicroi function and renamed it to lightroi. I uploaded an old version of the function which was completely off in calculation.
The function now checks image channel size and works with luminance image (1-channel), XYZ colour images ( 3-channels) and aometer images (6-channels).