0001 function flip_orientation(infname, outfname)
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011 fsl_str = sprintf('/usr/local/fsl/bin/avwswapdim %s -x y z %s', infname, outfname);
0012 fprintf('%s\n', fsl_str);
0013 status = unix(fsl_str);
0014 if status
0015 error(sprintf('Failed to swap data orientation <%s>\n', infname))
0016 end
0017
0018
0019 fsl_str = sprintf('/usr/local/fsl/bin/avworient -swaporient %s', outfname);
0020 fprintf('%s\n', fsl_str);
0021 status = unix(fsl_str);
0022 if status
0023 error(sprintf('Failed to swap data orientation <%s>\n', outfname))
0024 end