load multipages TIF image
Mostra commenti meno recenti
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 Commenti
Walter Roberson
il 12 Feb 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
il 12 Feb 2023
Risposta accettata
Più risposte (1)
alfonso Davide pinelli
il 16 Feb 2023
0 voti
Categorie
Scopri di più su Images in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!