Can a single slider control 3 or 4 axes?

조회 수: 1 (최근 30일)
Stelios Fanourakis
Stelios Fanourakis 2018년 6월 9일
댓글: Stelios Fanourakis 2018년 6월 17일
I have done a figure controlled by a slider so images can run on the axes. Is it possible, somehow, to use the same single slider to control 3 or 4 axes at the same time and have those images run simultaneously?

답변 (1개)

Walter Roberson
Walter Roberson 2018년 6월 9일
You can have a slider callback do any amount of work necessary. However, sliders are linear so you cannot use a single slider to control two different things independently: you can only use any one slider to control multiple things in synchronization. For example it would be fine to have a slider control which respective image from a number of different data sets was to be displayed.
idx = 1 + floor(get(hObject, 'Value'));
image(handles.axes7, image7set{idx});
image(handles.axes8, image8set{idx});
If you are doing a lot of this, then it is better to create the images ahead of time and update their CDATA:
idx = 1 + floor(get(hObject, 'Value'));
set(handles.image7, 'CData', image7set{idx});
set(handles.image8, 'CData', image8set{idx});
  댓글 수: 9
Stelios Fanourakis
Stelios Fanourakis 2018년 6월 17일
My data is a stack of images. 3D DICOM images and b/w. I don't know if that helps.
Related to my poor reaction. I wasn't able to understand your question, since, as you saw at my last comment, I said that the slider was working properly for a couple of times and then stopped.
The solution was that I needed to combine frameindex and CurrentFrame. So, the minimum value of the frameindex would be the CurrentFrame and the maximum the NumFrames. And it worked.
Stelios Fanourakis
Stelios Fanourakis 2018년 6월 17일
@Walter. Can you please answer to my new question? Thanks!

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Display Image에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by