2

我想通过一个简单的上一个/下一个切片 GUI 查看我正在检查的切片的编号。我存储了正在查看的切片的编号,handles.index并且可以通过上一个、下一个按钮对其进行更新。

我在编辑文本回调函数上写了以下内容:

function edit2_Callback(hObject, eventdata, handles)
handles.output=hObject
set (edit2.handles,'Tag', handles.index); %also tried with the 'String' property and failed 

代码运行时,属性不会更新。它仍然是“编辑文本”,这里有什么问题?

完整代码Dicom 文件

4

1 回答 1

0

Duh, I made the update on the pushbutton callbacks, and it works fine :)

% --- Executes on button press in pushbutton2.
function pushbutton2_Callback(hObject, eventdata, handles)
% hObject    handle to pushbutton2 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
handles.output = hObject;
handles.index = handles.index+1;
Cek (hObject, eventdata, handles);
imshow(handles.image_data(:,:,handles.index),'DisplayRange',[]); 
set (handles.edit2,'String', handles.index);
于 2013-01-25T00:01:41.507 回答