avw_converter_script.m
来自「mri_toolbox是一个工具用来MRI. 来自于SourceForge, 我」· M 代码 · 共 26 行
M
26 行
% avw_converter_script - convert byte order of .img files
% This function will convert byte order of Analyze files
% This example uses SPM example data, so
% cd to that data directory before calling this script
stat = mkdir(pwd,'tmp');
if stat,
files = {'T1' 'T2'}; % list of file prefixes
Ibyte = 'ieee-be';
Obyte = 'ieee-le';
Iorient = []; % auto determine orientation
Oorient = 0; % output axial unflipped
for f = 1:length(files),
avw = avw_img_read(files{f},Iorient,Ibyte);
% create new file in tmp subdirectory
newfile = [pwd filesep 'tmp' filesep files{f}];
% to write out header and image...
avw_img_write(avw,newfile,Oorient,Obyte);
% to write image only...
% avw.hdr = [];
% avw_img_write(avw,newfile,Oorient,Obyte);
% to write header only, see avw_hdr_write
end
end
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?