MATLAB,GUIDE,查看dicom堆栈上的切片编号

时间:2013-01-24 23:13:13

标签: matlab matlab-guide

我想通过简单的上一个/下一个切片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 

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

Full CodeDicom file

1 个答案:

答案 0 :(得分:0)

Duh,我对按钮回调进行了更新,它运行正常:)

% --- 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);