.nii to .mat
古いコメントを表示
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
2020 年 9 月 9 日
hi
did you find your answer?
i have the same problem.
採用された回答
その他の回答 (1 件)
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
2021 年 3 月 10 日
Why do you load() back on top of what you just save()'d ?
カテゴリ
ヘルプ センター および File Exchange で Coordinate Reference Systems についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!