load multipages TIF image
Mostrar comentarios más antiguos
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 comentarios
Walter Roberson
el 12 de Feb. de 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
el 12 de Feb. de 2023
Respuesta aceptada
Más respuestas (1)
alfonso Davide pinelli
el 16 de Feb. de 2023
0 votos
Categorías
Más información sobre Images en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!