2

シンプルな前/次のスライス GUI を使用して、調べているスライスの番号を表示したいと考えています。表示しているスライスの番号を保存handles.indexし、前、次のプッシュボタンで更新できます。

edit text コールバック関数について、次のように書きました。

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

当たり前ですが、プッシュボタンのコールバックを更新しましたが、正常に動作します:)

% --- 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 に答える