Amazing function.
I had couple of questions Gus if you don't mind.
I am new to MATLAB (i'm a physician) and this is EXACTLY what I want - almost. I am trying to scroll through a whole stack of MRI images. So in order for this to work, I have to open lets say 25 seperate figure windows and then smoothly scroll through them. However - how can I just open ONE figure window and have ALL my images be scrolling through in it?
I am not much of a code write, but a nudge in the right direction will go a long way (meaning, i can use help function on MATLAB and attempt to write small code under your direction). Thanks!
Below is my workaround for similar functionality, however, not with the mouse wheel but rather the keyboard arrows.
function [TF] = GTscroll2006b(event,fig)
% GTscroll2006b Use the scroll wheel to navigate figure windows
%
% function GTscroll2006b(event,fig)
%
% Example:
%
% for n=1:length(imgfiles);
% figure(100+n);
% set(gcf,'position',pos1,'windowStyle','docked')
% imagesc(im1(:,:,n),[0 max(max(im1(:,:,workingImage)))]);hold on;
% end
%
% TF=1
%
% while TF == 1
% event = getkey
% TF = GTscroll2006b(event,gcf)
% end
%
% ************** Requires getkey from FileExchange***********************
% http://www.mathworks.com/matlabcentral/fileexchange/7465-getkey
% ***********************************************************************
%
% Esdiaz - Oct 2009
%% Cycle through figures
CH = get(0,'children');
H = sort(get(0,'children'));
if event == 28 || event == 31 % left or down arrow = scroll down
F = find(H<fig,1,'last');
elseif event == 29 || event == 30 % up or right arrow = scroll up
F = find(H>fig,1);
elseif event == 13
F=[];
end
if isempty(F),
% jump to first or last figure
if event == 28 || event == 31,
figure(H(1));
TF=1;
elseif event == 29 || event == 30
figure(H(end));
TF=1;
elseif event == 13
TF=0;
end;
else
% goto next figure
figure(H(mod(F-1,length(H))+1));
zoom;pause;
TF=1;
end;
%%
end
It would be nice if this worked with version 7.3.0 2006b, but, alas, it does not because as Matlab states..."There is no 'WindowScrollWheelFcn' property in the 'figure' class."
Is there any other solution?
Very nice idea Gus
I am struggling to find a way to make a scroll wheel modulate the frequency of a sound played by matlab. Would you happen to have an idea on how to proceed.
Best
Torben
Comment only