How to call the popup element?

2 ビュー (過去 30 日間)
Meshooo
Meshooo 2013 年 4 月 24 日
編集済み: Meshooo 2014 年 1 月 23 日
Dear all, I am trying to build a GUI in order to register two gray scale images using the 'imregister' function.
We have three types of registration: 1) Affine; 2) similarity; 3) Rigid.
I want the user to select the desired registration method from a pop-up menu and then click the push button to register.
My call back code at the pop-up menu is as follows:
handles = guidata (hObject);
contents = get(hObject, 'Value');
switch contents
case 1
Z = 'affine';
case 2
Z = 'similarity';
case 3
Z = 'rigid';
otherwise
end
handles.Z = Z;
guidata(hObject, handles);
And in the pushbutton I want to call Z to make the desired type of registration. I wrote the following code which is not correct:
Z = handles.Z; % to import Z to this pushbutton function
movingRegistered = imregister (Moving, Fixed, 'Z', optimizer, metric);
I want Z to be affine or similarity or rigid, based on ones desired selection.
I will appreciate any help.
Meshoo

採用された回答

Image Analyst
Image Analyst 2013 年 4 月 24 日
handles.Z is already a string, so you don't want to wrap Z in single quotes, just put Z with no quotes.
movingRegistered = imregister (Moving, Fixed, Z, optimizer, metric);
  1 件のコメント
Meshooo
Meshooo 2013 年 4 月 24 日
Yes, you are right and it is working now. THANK YOU VERY MUCH.

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

その他の回答 (0 件)

Community Treasure Hunt

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

Start Hunting!

Translated by