1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42
|
function selectmontage(braindata, map)
h = size(braindata, 1) ;
w = size(braindata, 2) ;
z = size(braindata, 4) ;
nc = ceil(sqrt(z)) ;
nl = ceil(z/nc) ;
if nargin ==2
montage(braindata, map, 'Size', [nl nc]) ;
else
montage(braindata, 'Size', [nl nc]) ;
end
im = getimage ;
close(gcf) ;
% Affichage du quadrillage
image(im, 'hittest', 'off') ;
colormap(map) ;
grid on ;
axis on ;
axis([0 nc*w 0 nl*h]) ;
set(gca, 'Xcolor', 'r', ...
'ycolor', 'r', ...
'XTick', linspace(w, nc*w, nc), ...
'YTick', linspace(h, nl*h, nl), ...
'ButtonDownFcn', @clickbtn, ...
'DataAspectRatio', [1 1 1], ...
'Hittest', 'on')
set(gcf, 'Color', 'k', 'Pointer', 'Hand')
%--------------------------------------------------------------------------
function clickbtn(obj, evt)
disp(get(gca, 'currentpoint'))
end
end |
Partager