Animating a series of TIFF files

8 views (last 30 days)
Guillermo
Guillermo on 19 Jul 2011
Hey guys,
I have a question, is there a way to "animate" a series of tiff files using a GUI ,i.e., a Play/Pause button. I'm aware that implay() will play the series of files, however, I need to be able to get the X,Y coordinates in certain areas of the tiffs ,i.e., the distal part of the legs of flies we recorded, by clicking on the image (the series of tiff files were created from a movie for this whole purpose). I can manually do this, by clicking next and previous buttons on the GUI, however, there are times where I need to view multiple images until I get to an image I need to digitize, therefore a play/pause button would decrease the amount of time I spend with each image set.
here's the code i have to load the images:
Load button:
helpmsg1 = 'Choose Picture to Analyse';
[imgname1,imgpath] = uigetfilehelp('*.*','Choose Picture to Analyse','helpmsg',helpmsg1);
if isnumeric(imgname1) && imgname1 == 0,
return;
end
handles.imgpath = imgpath;
filePattern = fullfile(imgpath, '*.tif');
tiffFiles = dir(filePattern);
handles.tiffFiles = tiffFiles;
handles.imglength = length(tiffFiles);
l = num2str(length(tiffFiles));
set(handles.ImageNumber_text,'String',l)
baseFileName = tiffFiles(k).name;
fullFileName = fullfile(imgpath, baseFileName);
fprintf(1, 'Now reading %s\n', fullFileName);
imageArray = imread(fullFileName);
imshow(imageArray); % Display image.
drawnow; % Force display to update immediately.
Next button:
k = handles.imagecounter + 1;
imgpath = handles.imgpath;
tiffFiles = handles.tiffFiles;
baseFileName = tiffFiles(k).name;
fullFileName = fullfile(imgpath, baseFileName);
fprintf(1, 'Now reading %s\n', fullFileName);
imageArray = imread(fullFileName);
imshow(imageArray); % Display image.
drawnow; % Force display to update immediately.
handles.imagecounter = k;
The Previous button is the same, except with k = ... -1.
I guess what I need to know is how could I create a loop that allows me to stop it on the image I want by pushing the same button a second time?

Answers (0)

Categories

Find more on Animation in Help Center and File Exchange

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!