Changing Output File Names
2 ビュー (過去 30 日間)
古いコメントを表示
I wrote the program:
a = {'path1'};
b = {'path2'};
c = {'path3'};
s_out = {'/Users/Desktop/output'};
for i = [a,b,c]
kk = 1:length(i);
t = spm_select('FPList', i(kk), '.*');
hdr = spm_dicom_headers(t);
spm_dicom_convert(hdr, 'all', 'flat', 'nii', char(s_out));
end
The output files are coming out as the same and overwriting each other, so I am only seeing 1 file in the output folder. I want three files to be put into the output directory with three different names, including 1, 2, 3, etc. I have been trying to solve this for a while, but can't seem to figure out how to write this command. Thanks!
0 件のコメント
回答 (1 件)
KSSV
2018 年 10 月 15 日
a = {'path1'};
b = {'path2'};
c = {'path3'};
s_out = {'/Users/Desktop/output'};
s = [a,b,c] ;
for kk = 1:length(s)
t = spm_select('FPList', s(kk), '.*');
hdr = spm_dicom_headers(t);
spm_dicom_convert(hdr, 'all', 'flat', 'nii', char(s_out));
end
参考
カテゴリ
Help Center および File Exchange で Graph and Network Algorithms についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!