Opening and reading a given frame from a .tiff stack to then show on the screen
古いコメントを表示
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
採用された回答
その他の回答 (1 件)
hxen
2021 年 5 月 8 日
0 投票
1 件のコメント
DGM
2021 年 5 月 9 日
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]));
カテゴリ
ヘルプ センター および File Exchange で Convert Image Type についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!