.nii to .mat
19 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
João Mendes
le 10 Juin 2019
Commenté : Walter Roberson
le 10 Mar 2021
Hey guys, I was wondering if you could help me out.
I'm having some problems opening medical images in MATLAB.
Their extension is .nii and I need them to be .m ; is there any simple form to do the conversion?
Thanks
JM
1 commentaire
Réponse acceptée
Walter Roberson
le 9 Sep 2020
niftiread() from R2017b.
There were File Exchange or Third Party contributions for reading nifti images before R2017b.
0 commentaires
Plus de réponses (1)
weipeng yang
le 10 Mar 2021
Modifié(e) : Walter Roberson
le 10 Mar 2021
clc;
clear all;
file = dir('*.nii');
len = length(file);
for i = 1:len
nii_file = file(i).name;
nii = load_nii(nii_file);
img = nii.img;
mat_name = strcat('img_', int2str(i), '.mat');
save(mat_name);
load(mat_name);
figure(1)
subplot(4,5,i), imshow(img(:,:,1),[]), title(i)
end
1 commentaire
Voir également
Catégories
En savoir plus sur Read, Write, and Modify Image dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!