필터 지우기
필터 지우기

how to project an image stack in time dimension?

조회 수: 1 (최근 30일)
Peyman Obeidy
Peyman Obeidy 2016년 5월 9일
댓글: Peyman Obeidy 2016년 5월 9일
I have a tif format image stack which I upload using below script. Now I want to get an image which is the addition of all images together. This will help me to see the track that an object moved in time (third dimension). I would appreciate a help with this.
[fName, pName] = uigetfile('*.tif');
imageD1 = imread(fullfile(pName, fName));
imageD1=double(imageD1);
info = imfinfo(fName); num_images = numel(info);
dummy=1; for i=1:num_images imageData1(:,:,dummy) = imread(fullfile(pName, fName),i); dummy=dummy+1;
end

채택된 답변

Bjorn Gustavsson
Bjorn Gustavsson 2016년 5월 9일
It should be as simple as:
%%I just do this for all files in the same directory, you'll have to fix file-finding...
fNames = dir('*.tif');
totD = 0;
for iFiles = 1:numel(fNames)
imageD1 = imread(fNames(i1).name);
imageD1 = double(imageD1);
totD = totD + imageD1;
end
HTH
  댓글 수: 2
Peyman Obeidy
Peyman Obeidy 2016년 5월 9일
Thank you, perfect. Only a small amendment:
imageD1 = imread(fNames(iFiles).name);
Peyman Obeidy
Peyman Obeidy 2016년 5월 9일
any Idea about how to save the figure as a tif file;
these didnt work for me:
Name='rExFil_1';
imwrite(totD, '16bit.tif');
or
imwite(fNames.name)
or
imwrite(uint16( Name+min(min(Name)) ), 'Tm2ZeroSDx2Sig_ch1.tif', 'tif','Compression','none')

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by