How can i import multiple fits images

5 visualizzazioni (ultimi 30 giorni)
Pruthvi Acharya
Pruthvi Acharya il 12 Dic 2018
Commentato: assia assia il 30 Giu 2021
I have abou 900 fits images where i want to import them indivudually and store each image as part of a bigger matrix. So for example A = (image 1),(image 2)....
each image itself is 1023x1536.
FolderL = cd('C:\Users\pruth\Desktop\3070\LightsBadOut')
LDir = dir('*.fits');
for i =1:2
LightsC = fitsread(LDir(i).name)
i = i +1;
end
This code seems to only show me the values for when i = 2.

Risposte (1)

Mark Sherstan
Mark Sherstan il 13 Dic 2018
Modificato: Mark Sherstan il 13 Dic 2018
Try the following. If it doesent work please provide 2-3 of your images so we arent 100% blind trying to help you.
% Read in all images from a folder called 'images'
imgFolder = fullfile('images');
imgs = imageDatastore(imgFolder);
numOfImgs = length(imgs.Files);
for ii = 1:numOfImgs
LightsC{ii} = fitsread(imgs.Files{ii});
end

Community Treasure Hunt

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

Start Hunting!

Translated by