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

2 次查看(过去 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