load multipages TIF image
Afficher commentaires plus anciens
Hello
I'm trying to open a multislices TIF image.
It works in GUI but when used in app designer it read only 1 slice.
What's wrong?
Many thanks for helps
I used this code:
function LoadImageButtonValueChanged(app, event)
value = app.LoadImageButton.Value;
% Selecting image file to process
[filename, pathname] = uigetfile('*.*', 'pick an image'); % pop up file open dialog to select image
filename = strcat(pathname,filename);
info = imfinfo(filename);
numberOfPages = length(info);
for k = 1 : numberOfPages
thisPage = imread(filename, k);
imshow(imadjust(thisPage),'Parent',app.UIAxes); %-show the kth image in this multipage tiff file
end
end
2 commentaires
Walter Roberson
le 12 Fév 2023
filename = strcat(pathname,filename);
should be
filename = fullfile(pathname, filename);
uigetfile does not promise that the directory name will have a directory separator at the end of it.
alfonso Davide pinelli
le 12 Fév 2023
Réponse acceptée
Plus de réponses (1)
alfonso Davide pinelli
le 16 Fév 2023
0 votes
Catégories
En savoir plus sur Images dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!