How I can pause a GUI for next 20 iterations, while main program should run for every iteration.

조회 수: 1 (최근 30일)
Hi everyone!
I have a code, in which I am applying noise reduction techniques to set of 450 images. I want save each image after noise reduction, which is working. But I have two GUI two adjust weghting factors of each image for bone as well as soft tissue. I do not want to run these GUIs for each image, I just want to set weights for one image and apply the same weights to next 20 images using these GUIs. I do not understand, how I can pause my GUIs for next 20 iterations without pausing my main program. The part of code is given below. Thank you in advance.
for k=1:1:N
[high_img, high_imgObj] = ximread(sprintf('%s\\%s',xim_dir,high_files(k).name));
[low_img, low_imgObj] = ximread(sprintf('%s\\%s',xim_dir,low_files(k).name));
% Need to interpolate images since they are performed at different angles
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%weight optimization using weight gui for different gantry angles
gantryAngle = high_imgObj.KVSourceRtn.Value;
fprintf('Gantry Angle %d,soft_weight %s\n and bone_weight %s\n',gantryAngle,soft_weight,bone_weight);
soft_weight = helper_to_weight_gui('Tissue');
waitfor(soft_weight);
bone_weight = helper_to_bone_weight_gui('bone');
waitfor(bone_weight);

채택된 답변

Jan
Jan 2021년 4월 30일
askForWeights = 1;
for k = 1:N
...
if k = askForWeights
soft_weight = helper_to_weight_gui('Tissue');
waitfor(soft_weight);
bone_weight = helper_to_bone_weight_gui('bone');
waitfor(bone_weight);
askForWeights = askForWEights + 20;
end
...

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by