Example Phiwave batch script
0001 % Example Phiwave batch script 0002 0003 % Make sure phiwave is loaded 0004 phiwave on 0005 0006 % SPM design path 0007 spm_name = spm_get(1, 'SPM.mat', 'Select SPM design'); 0008 0009 % Make phiwave design object 0010 D = phido(spm_name); 0011 0012 % Set some options for estimation (see @phido/estimate.m) 0013 params = struct('wavelet', phiw_lemarie(2), ... 0014 'scales', 4, ... 0015 'wtprefix', 'wv_'); 0016 0017 % Remove 's' prefix from image names in design, so we can work on the 0018 % unsmoothed images (which assumes they exist) 0019 D = prefix_images(D, 'remove', 's'); 0020 0021 % Estimate the design, doing wavelet transform on the way 0022 E = estimate(D, [], params); 0023 0024 % Add a good contrast we might be interested in, returning design and 0025 % contrast number. Of course this contrast will have to match the size 0026 % of your design matrix 0027 [E Ic] = add_contrasts(E, 'activation', 'T', [1 0 0]); 0028 0029 % Set some denoising options (see @phido/get_wdimg.m) 0030 d_params = struct(... 0031 'thcalc', 'sure', ... 0032 'thapp', 'soft', ... 0033 'write_err', 1); 0034 0035 % Write new denoised images with given file name 0036 % (std image prepended with 'std_', sort-of t prepended by 't_') 0037 Vcon = get_wdimg(E, Ic, d_params, 'denoised_sure'); 0038 0039 % Interactive display, using some Phiwave defaults 0040 phiw_display('display', 'orth', Vcon);