Gui to app designer
조회 수: 5 (최근 30일)
이전 댓글 표시
It's a gui code. Please change it to the code used by the app designer.
function clmap_Callback(hObject, eventdata, handles)
global g;
get(handles.figure1,'SelectionType');
if strcmp(get(handles.figure1,'SelectionType'),'normal')
index_selected = get(handles.listbox1,'Value');
file_list = get(handles.listbox1,'String');
filename = file_list{index_selected};
if handles.is_dir(handles.sorted_index(index_selected))
if strcmp(filename,'..')
handles.dfolder = fileparts(handles.dfolder);
% cd (filename)
load_listbox(handles.dfolder,handles)
elseif strcmp(filename,'.')
else
handles.dfolder = fullfile(handles.dfolder,filename);
% cd (filename)
load_listbox(handles.dfolder,handles)
end
else
fname = strtrim(filename);
fullname = fullfile(handles.dfolder , fname);
try
metadata = dicominfo(fullname);
catch
disp ('apparently not a DICOM file');
return
end
img = dicomread(fullname);
g.img=img;
clim =get(gca,'Clim');
clbarstat = get(handles.uitoggletool3,'State');
himg=imagesc(img);
set(himg,'ButtonDownFcn',@axes1_ButtonDownFcn);
set(himg,'UIContextMenu',handles.clmap);
if clim~=[0 1]
set(gca,'Clim', clim);
end
axis off
if strcmp(clbarstat,'on')
colorbar
end
ch = get(handles.HeaderList, 'value');
fields=char(fieldnames(metadata));
len = setdiff (1:size(fields,1), handles.hidden);
id=0;
for k=len,
estr=eval(['metadata.' fields(k,:)]);
if ischar(estr)
str=[fields(k,:) ' : ' estr];
elseif isnumeric(estr)
str=[fields(k,:) ' : ' num2str(estr(1:min(3,end))')];
else
str=[fields(k,:) ' : ...'];
end
id = id+1;
cstr{id}=sprintf('%3d %s',k,str);
end
set(handles.HeaderList,'Value',ch);
set(handles.HeaderList,'String',cstr);
guidata(hObject, handles);
return;
end
end
댓글 수: 1
Sampath Rachumallu
2020년 6월 26일
편집: Sampath Rachumallu
2020년 6월 26일
There is a matlab addon called "GUIDE to App Designer Migration Tool for MATLAB" . You can install it and use it to migrate guide gui to Appdesigner gui.
답변 (1개)
Aniket
2024년 11월 21일
You can convert your GUIDE app into App Designer depending on the MATLAB version you are using:
1. Starting with R2023a, you can run the migration tool from the MATLAB command line by downloading the tool and then calling the "appmigration.migrateGUIDEApp" function. To know more about this function, kindly follow this documentation:
2. For previous releases, you may use GUIDE to App Designer Migration Tool for MATLAB by MathWorks Team to convert app.
Hope this helps!
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Migrate GUIDE Apps에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!