function liveviewRAY(hObject, eventdata, Empty_Button, Button, AxesD, AxesNMF, AxesAFS, AxesSOL, roton, rotoff, Radiogroup, usmn, lcs,basichi)

pt = get(hObject, 'CurrentPoint');
sz = get(hObject, 'Position');
xf = pt(1,1:2)./sz(1,3:4);
posD   = get(AxesD, 'Position');
posNMF = get(AxesNMF, 'Position');
posAFS = get(AxesAFS, 'Position');
posSOL = get(AxesSOL, 'Position');

if get(roton, 'Value') == 1
    if (posAFS(1) < xf(1)) && (xf(1) < posAFS(1)+posAFS(3)) && (posAFS(2) < xf(2)) && (xf(2) < posAFS(2)+posAFS(4))
%         rotate3d(AxesAFS, 'on');
        axv = get(AxesAFS, 'view');
    elseif ((posD(1) < xf(1)) && (xf(1) < posD(1)+posD(3)) && (posD(2) < xf(2)) && (xf(2) < posD(2)+posD(4)))
        set(roton, 'Value', 0);
        set(rotoff, 'Value', 1);
        rotate3d(AxesAFS, 'off');
    elseif ((posNMF(1) < xf(1)) && (xf(1) < posNMF(1)+posNMF(3)) && (posNMF(2) < xf(2)) && (xf(2) < posNMF(2)+posNMF(4)))
        set(roton, 'Value', 0);
        set(rotoff, 'Value', 1);
        rotate3d(AxesAFS, 'off');
    elseif ((posSOL(1) < xf(1)) && (xf(1) < posSOL(1)+posSOL(3)) && (posSOL(2) < xf(2)) && (xf(2) < posSOL(2)+posSOL(4)))
        set(roton, 'Value', 0);
        set(rotoff, 'Value', 1);
        rotate3d(AxesAFS, 'off');
    end
end

if get(usmn, 'Value') == 0
    return;
end
