Home > rest_20090422 > rest_spm5_files > @read_nifti > private > read_extras.m

read_extras

PURPOSE ^

Read extra bits of information

SYNOPSIS ^

function extras = read_extras(fname)

DESCRIPTION ^

 Read extra bits of information
_______________________________________________________________________
 Copyright (C) 2005 Wellcome Department of Imaging Neuroscience

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

DOWNLOAD ^

read_extras.m

SOURCE CODE ^

0001 function extras = read_extras(fname)
0002 % Read extra bits of information
0003 %_______________________________________________________________________
0004 % Copyright (C) 2005 Wellcome Department of Imaging Neuroscience
0005 
0006 %
0007 % $Id: read_extras.m 443 2006-02-17 16:44:54Z john $
0008 
0009 
0010 extras = struct;
0011 [pth,nam,ext] = fileparts(fname);
0012 switch ext
0013 case {'.hdr','.img','.nii'}
0014     mname = fullfile(pth,[nam '.mat']);
0015 case {'.HDR','.IMG','.NII'}
0016     mname = fullfile(pth,[nam '.MAT']);
0017 otherwise
0018     mname = fullfile(pth,[nam '.mat']);
0019 end
0020 
0021 if exist(mname,'file'),
0022     try,
0023         extras = load(mname);
0024     catch,
0025         warning('Can not load "%s" as a binary MAT file.\n', mname);
0026     end;
0027 end;

Generated on Wed 29-Apr-2009 01:06:38 by m2html © 2005