Home > fmri > fsl > flip_orientation.m

flip_orientation

PURPOSE ^

flip_orientation(infname)

SYNOPSIS ^

function flip_orientation(infname, outfname)

DESCRIPTION ^

 flip_orientation(infname)

 Flips the input image from radiological to neurological or vice versa

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function flip_orientation(infname, outfname)
0002 % flip_orientation(infname)
0003 %
0004 % Flips the input image from radiological to neurological or vice versa
0005 %
0006 %
0007 
0008 % 12/02/05 Petr Janata
0009 
0010 % Swap the data
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 % Swap the header
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

Generated on Sat 24-Aug-2019 04:00:39 by m2html © 2003