How to update the slider when I need to show different series of images (MATLAB GUI, not programmed)
4 次查看(过去 30 天)
显示 更早的评论
Hello. I have a problem when using the slider to update my images. I have a series of images. I first use the slider to update the images. It works. After some crop of the first series of images, I got another series of images. I wonder When I change my images to the series 2. How to update the slider. Because when I push the slider, it still update the first series images. Thank you.
3 个评论
Image Analyst
2017-2-24
And show a screenshot. I don't even have any idea if you're just dispalying one image at a time, or the whole series simultaneously. And what does "update" mean? Does it mean you just display one of the images, or does it mean that you use the slider value to apply some mathematical operation on the image data?
采纳的回答
Geoff Hayes
2017-2-25
Pan - since your slider2_Callback uses the images from handles.Img, then either you will need to replace them with the Img_2 set of images or use a different field within handles to manage the images to be used by this callback. For example, when you initialize handles.Img, then also initialize another field as
handles.sliderImages = handles.Img;
Then your slider callback would do
function slider2_Callback(hObject, eventdata, handles)
Img = handles.sliderImages;
% etc.
And when you initialize handles.Img_2, then you would replace the sliderImages too
handles.sliderImages = handles.Img;
Note that each time you update these images for the slider, you would then update the Min, Max, and SliderStep
set(handles.slider2,'Min',1,'Max',SIZE_Z);
set(handles.slider2,'SliderStep',[1/(SIZE_Z-1),1/(SIZE_Z-1)]);
(rather than updating these values within the callback) where SIZE_Z is the number of images in sliderImages.
3 个评论
更多回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!