.nii to .mat

조회 수: 65(최근 30일)
João Mendes
João Mendes 2019년 6월 10일
댓글: Walter Roberson 2021년 3월 10일
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
zahra ghadery
zahra ghadery 2020년 9월 9일
hi
did you find your answer?
i have the same problem.

댓글을 달려면 로그인하십시오.

채택된 답변

Walter Roberson
Walter Roberson 2020년 9월 9일
niftiread() from R2017b.
There were File Exchange or Third Party contributions for reading nifti images before R2017b.

추가 답변(1개)

weipeng yang
weipeng yang 2021년 3월 10일
편집: Walter Roberson 2021년 3월 10일
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
Walter Roberson
Walter Roberson 2021년 3월 10일
Why do you load() back on top of what you just save()'d ?

댓글을 달려면 로그인하십시오.

태그

Community Treasure Hunt

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

Start Hunting!

Translated by