Animating a series of TIFF files

조회 수: 7 (최근 30일)
Guillermo
Guillermo 2011년 7월 19일
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?

답변 (0개)

카테고리

Help CenterFile Exchange에서 Animation에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by