help image processing code
1 view (last 30 days)
Show older comments
mohd akmal masud
on 21 Jan 2018
Commented: mohd akmal masud
on 27 Feb 2018
Hi all
I want to display multiple images using GUI. I have 135 image. i want load 135 images in axes, then when i slide, it will show the image from 1 to 135. This is my code that i know to read 135 image:
P = zeros(256, 256, 135);
for K = 1 : 135
petname = sprintf('PET_I1001_PT%03d.dcm', K);
P(:,:,K) = dicomread(petname);
end
how to me write the command for 'load image button' and 'slider' in m file ??
hope anyone can help me
0 Comments
Accepted Answer
Image Analyst
on 21 Jan 2018
Set up your scroll bar to have 135 as the max and 1 as the min. Then in the scrollbar callback function:
scrollBarValue = round(handles.scrollbar1.Value);
petName = sprintf('PET_I1001_PT%03d.dcm', scrollBarValue);
fullFileName = fullfile(folder, petName);
thisImage = dicomread(fullFileName);
imshow(thisImage);
No loop is needed.
4 Comments
More Answers (0)
See Also
Categories
Find more on Migrate GUIDE Apps in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!