I have a bunch of .tiff files that are pictures of a diffraction pattern evolving with time. Each file is an array 480x640 where each entry in the array is an intensity value.
I want to load the .tiff files automatically into Matlab and obtain the total intensity for each file by adding each entry together until the total is reached. I want these total values to be remembered and at the end the total intensities are recalled and plotted as intensity vs. time.
I know how to load up an individual .tiff file using the imread function. I have spent a lot of time trying to figure out what commands I need but haven’t gotten far.
Does anyone have any thoughts on my problem please? Any help would be greatly appreciated.
No products are associated with this question.
Are the different time slices stored in different TIFF files? Then try something like this:
d = dir('myfiles*.tiff'); total = zeros(480,640); for k = 1:length(d) I = imread(d(k).name); total = total + double(I); end
Or are the different time slices all stored in a single TIFF file? Then try something like this:
total = zeros(480,640); info = imfinfo('myfile.tiff'); num_slices = length(info); for k = 1:num_slices I = imread('myfile.tiff','Info',info,'Index',k); total = total + double(I); end
As I said in your duplicate question ( http://www.mathworks.com/matlabcentral/answers/43372-importing-multiple-tiff-files-by-mfile-for-further-processing:
Two code examples are given in the FAQ: