Effacer les filtres
Effacer les filtres

How to perform algebraic operations on an hyper stack image?

1 vue (au cours des 30 derniers jours)
ct8
ct8 le 14 Fév 2023
Commenté : ct8 le 3 Mar 2023
I have sets of images in folders A,B, ... containing images of dimension (n x m).
How do I group the images and then perform one operation to get outputs A',B',.. where A' = (A-X)/X [X is another image of dimensions (n x m)]

Réponse acceptée

Yuvraj Singh
Yuvraj Singh le 22 Fév 2023
Hi,
Below mentioned code takes all the files from a folder and save it to a matrix for matrix opeartion.
%chanage directory to the folder of your interest
cd /path_to_folder_of_interest
%lists all files/folders in the diretory
x = dir;
%iteerate over all files/folders inside a folder
for idx = 1:numel(x)
element = x(idx);
%checks if its not a directoey it will read from excel file and make it
%a matric for operation
if(~element.isdir)
if(exist("A","var"))
A = [A;table2array(readtable(element.name))];
else
A = table2array(readtable(element.name));
end
end
end
A1 = (A-X)/X;
It assumes all the file are excel files in the folder.

Plus de réponses (0)

Catégories

En savoir plus sur Images dans Help Center et File Exchange

Produits


Version

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by