


Read data using SPM5 functions



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