Home > rest_20090422 > rest_spm5_files > nic_read_vols.m

nic_read_vols

PURPOSE ^

Read data using SPM5 functions

SYNOPSIS ^

function [data] = nic_read_vols(V)

DESCRIPTION ^

 Read data using SPM5 functions

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

DOWNLOAD ^

nic_read_vols.m

SOURCE CODE ^

0001 function [data] = nic_read_vols(V)
0002 % Read data using SPM5 functions
0003 
0004 % get the correct spm path
0005 [spmPath] = nic_getSPMPath(V(1));
0006 
0007 addpath(spmPath);
0008 
0009 oldDir = pwd;
0010 
0011 try
0012     
0013     cd(spmPath);
0014     
0015     % Initialise data
0016     data = zeros([V(1).dim(1:3), length(V)]);
0017 
0018     % read the data
0019     for ii = 1:length(V) 
0020         data(:, :, :, ii) = nic_spm_read_vols(V(ii));
0021     end
0022 
0023     cd(oldDir);
0024 
0025 catch
0026 
0027     cd(oldDir);
0028     nic_displayErrorMsg;
0029 
0030 end
0031

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