Borrar filtros
Borrar filtros

.nii to .mat

44 visualizaciones (últimos 30 días)
João Mendes
João Mendes el 10 de Jun. de 2019
Comentada: Walter Roberson el 10 de Mzo. de 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 comentario
zahra ghadery
zahra ghadery el 9 de Sept. de 2020
hi
did you find your answer?
i have the same problem.

Iniciar sesión para comentar.

Respuesta aceptada

Walter Roberson
Walter Roberson el 9 de Sept. de 2020
niftiread() from R2017b.
There were File Exchange or Third Party contributions for reading nifti images before R2017b.

Más respuestas (1)

weipeng yang
weipeng yang el 10 de Mzo. de 2021
Editada: Walter Roberson el 10 de Mzo. de 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 comentario
Walter Roberson
Walter Roberson el 10 de Mzo. de 2021
Why do you load() back on top of what you just save()'d ?

Iniciar sesión para comentar.

Categorías

Más información sobre MATLAB en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by