0001 function o = convert_vols(o, ver)
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022 if nargin < 2
0023 ver = mars_vol_utils('current_ver');
0024 end
0025
0026 SPM = des_struct(o);
0027 SPM = sf_conv(SPM, ver, 'xY', 'VY');
0028 SPM = sf_conv(SPM, ver, 'xM', 'VM');
0029 SPM = sf_conv(SPM, ver, 'xVol', 'VRpv');
0030 SPM = sf_conv(SPM, ver, 'Vbeta');
0031 SPM = sf_conv(SPM, ver, 'VResMS');
0032 SPM = sf_conv(SPM, ver, 'VM');
0033 o = des_struct(o, SPM);
0034
0035 xCon = get_contrasts(o);
0036 if ~isempty(xCon)
0037 for i = 1:length(xCon)
0038 xCon(i) = sf_conv(xCon(i), ver, 'Vcon');
0039 xCon(i) = sf_conv(xCon(i), ver, 'Vspm');
0040 end
0041 end
0042 o = set_contrasts(o, xCon, 0);
0043 return
0044
0045 function S = sf_conv(S, ver, varargin)
0046 V = mars_struct('getifthere', S, varargin{:});
0047 if ~isempty(V)
0048 V = mars_vol_utils('convert', V, ver);
0049 S = setfield(S, varargin{:}, V);
0050 end
0051 return