フィルターのクリア

How to perform algebraic operations on an hyper stack image?

1 回表示 (過去 30 日間)
ct8
ct8 2023 年 2 月 14 日
コメント済み: ct8 2023 年 3 月 3 日
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)]

採用された回答

Yuvraj Singh
Yuvraj Singh 2023 年 2 月 22 日
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.

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeImages についてさらに検索

製品


リリース

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by