How to correct stacks of TIFF images with their respective laser energy readings?

1 次查看(过去 30 天)
I have stacks of tiff images and I want to correct them by their respective laser energy which are stored in a text file as attached. As you can see in the text file, I have 262 readings which corresponds to 262 tiff images I am working with. Essentially, I would like to divide every image by their corresponding value in the text file. Your help is much appreciated.

回答(1 个)

Syed Mashruk
Syed Mashruk 2018-2-15
solved the problem. Below is the code if anyone facing the similar problem:
[listOfFiles, folder] = uigetfile ('*.tif', 'Select your image', 'MultiSelect', 'on');
fullFileName = fullfile(folder, listOfFiles{1});
[I,cmap] = imread(fullFileName);
[rows, columns] = size(I);
image3d = zeros(rows, columns, NumImages);
if NumImages ~= length(listOfFiles)
msg = 'Error Occured - Image Number Mismatch';
error(msg);
else
for k = 1 : length(listOfFiles)
fullFileName = fullfile(folder, listOfFiles{k});
thisImage = imread(fullFileName);
image3d(:,:,k) = thisImage;
end
cd 'C:\NO PLIF data\6 Dec 2017\sample';
load test1.txt;
A=textread('test1.txt');
for k=1:length(listOfFiles)
filename=sprintf('%d.tif',k);
filename1=image3d(:,:,k)./A(k);
saveastiff(filename1,filename);
end
end

类别

Help CenterFile Exchange 中查找有关 Image Processing Toolbox 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by