フィルターのクリア

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

5 ビュー (過去 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
...
  1 件のコメント
Mandeep Kaur
Mandeep Kaur 2021 年 4 月 30 日
It worked! Thank you much for your help. You saved my day. I really appericiate that.

サインインしてコメントする。

その他の回答 (0 件)

Community Treasure Hunt

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

Start Hunting!

Translated by