Opening and reading a given frame from a .tiff stack to then show on the screen
Afficher commentaires plus anciens
Hello community. I have what I thought would be simple enough but having trouble opening a .tiff stack in matlab to do the following:
- For a 512x512 100 frame tiff file, first read a given frame (e.g. #5)
- display that image on the screen.
- Ultimately select a desired roi to then find the average pixel intensity.
For 1–2 above, with the following code I merely get a white screen. Yet (for those familary) with FiJi, I can see the actual image. I have not had need for image analysis for some time but recall this was very straight forward. Using the code attached, imshow(Z(:,:,5)) just shows a white screen, yet the matrix data is clearly there. Not sure what I might be doing wrong. Thanks in advance for the help.
fname = '01.tif';
info = imfinfo(fname);
num_images = numel(info)
imgs = zeros(512,512, num_images);
for jj = 1:num_images
imgs(:,:,jj) = double(imread(fname, jj, 'Info', info));
end
Réponse acceptée
Plus de réponses (1)
hxen
le 8 Mai 2021
0 votes
1 commentaire
DGM
le 9 Mai 2021
If you want to normalize an image to the extent of its data, you can do:
mn=min(inpict(:));
mx=max(inpict(:));
outpict=(inpict - mn) ./ (mx-mn);
If you have IPT, you can do the same with imadjust/stretchlim
outpict = imadjust(inpict,stretchlim(inpict,[0 1]));
Catégories
En savoir plus sur Convert Image Type 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!