저는 프로그램에서 작업 중이며 주위에 GUI를 만들기로 결정했습니다. 내가 시작하고 싶은 것은 꽤 간단하며, 영화를로드하고 스크롤 할 수 있습니다. 저는 청취자에 관한 많은 질문을 살펴 보았습니다. 실제로 누군가이 질문을 던졌지 만 그 해결책은 저에게 효과적이지 않았습니다. GUI를 내 개방 기능에 나는 잘 작동연속 슬라이더 수신기가 새로운 빈 그림을 만듭니다.
handles.output = hObject;
handles.sliderListener = addlistener(handles.Image_Slider,'ContinuousValueChange', ...
@(hObject, event) Image_Slider_ContValueCallback(...
hObject, eventdata, handles));
% Update handles structure
guidata(hObject, handles);
And then I have the following two call backs :
function Image_Slider_Callback(hObject, eventdata, handles)
% hObject handle to Image_Slider (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
handles=guidata(hObject);
current_slice = round(get(handles.Image_Slider,'Value'));
%size(handles.Image_Sequence_Data(:,:,current_slice));
im =imagesc(handles.Image_Sequence_Data(:,:,current_slice),'Parent',handles.Image_Sequence_Plot);
colormap('gray');
(리스너 모든없이 제대로 다르게 동작)
을 한 후 나는 또한 내가 생각
function Image_Slider_ContValueCallback(hObject, eventdata, handles)
% hObject handle to Image_Slider (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
handles=guidata(hObject);
current_slice = round(get(handles.Image_Slider,'Value'));
%size(handles.Image_Sequence_Data(:,:,current_slice));
handles=guidata(hObject);
%im =
imagesc(handles.Image_Sequence_Data(:,:,current_slice),'Parent',handles.Image_Sequence_Plot);
colormap('gray');
이 호출 할 필요가 있습니다 슬라이더가 계속 움직일 때 내 문제는 슬라이더 값이 공백으로 변경 될 때마다 ("그림 1") 나타납니다. 실제 GUI 데이터가 올바르게 응답하지만, 왜이 '불량'인물이 어디에서 왔는지 이해할 수 없습니다.
누군가 도와주세요. 또한 imshow와 imagesc에 대한 의견이 더 좋습니다 (이 GUI는 이미지와 많은 사용자 상호 작용이 필요합니다).
감사합니다. 완벽하게 작동했습니다. –
큰 도움이 기쁩니다! –