Movie Player and message box (select picture from sequence)

4 views (last 30 days)
I am writing a program where I want to do freehand ROI selection on a sequence. This means I want to draw the freehand ROI selection on one of the pictures in the sequence, and then have this ROI added on all pictures.
The only way I found the freehand ROI selection to work is on one picture. So I was thinking about selection one picture out from the sequence, and then use the ROI freehand selection on this single picture, and then add the mask to all of the pictures in the sequence again.
My problem now is that I want to select anyone of the pictures in the sequence, so I have created a message box where the user can write the number of the picture he want to draw the ROI on. The only problem is that I can not look at all the pictures in the movie player when the message box is there. In other words, I want to look at the pictures and THEN write in the number of the picture I want to pull out from the sequence.
How can I both have the message window open and work with movie player? Or make the message box wait?
My code so far:
[NumPas,IndPas,Name,FileNames] = PasCount();
pasnr = 1;
numFrames = IndPas(pasnr,2)-IndPas(pasnr,1)+1;
% Preallocate an m-by-n-by-p array and read images into the array.
I = imread(FileNames{IndPas(pasnr,1)});
sequence = zeros([size(I) numFrames],class(I));
sequence(:,:,1) = I;
%
for p = 2:numFrames
sequence(:,:,p) = imread(FileNames{IndPas(pasnr,1)+p-1,1});
end
implay(sequence)
prompt={'Write the number of the picture you want to draw on:'};
% Create all your text fields with the questions specified by the variable prompt.
answer=inputdlg(prompt,title);
bildenr = str2num(answer{1});
% Convert these values to a number using str2num.

Answers (1)

Walter Roberson
Walter Roberson on 21 Jan 2016
You can pass struct('WindowStyle', 'normal') as the last parameter of inputdlg() to make the dialog non-modal -- that is, it will not block access to anything else. You must provide all of the options when you do this, including the default responses.

Community Treasure Hunt

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

Start Hunting!