How can i import multiple fits images

3 visualizaciones (últimos 30 días)
Pruthvi Acharya
Pruthvi Acharya el 12 de Dic. de 2018
Comentada: assia assia el 30 de Jun. de 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.

Respuestas (1)

Mark Sherstan
Mark Sherstan el 13 de Dic. de 2018
Editada: Mark Sherstan el 13 de Dic. de 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