sets explicit mask into design FORMAT D = explicit_mask(D, mask_img) Input D - design mask_img - image name or vol struct Output D - modified design e.g. P = spm_get(1, 'img', 'Select mask image for design'); D = explicit_mask(D, P); $Id: explicit_mask.m,v 1.1 2005/06/21 03:59:04 matthewbrett Exp $
0001 function D = explicit_mask(D, mask_img) 0002 % sets explicit mask into design 0003 % FORMAT D = explicit_mask(D, mask_img) 0004 % 0005 % Input 0006 % D - design 0007 % mask_img - image name or vol struct 0008 % 0009 % Output 0010 % D - modified design 0011 % 0012 % e.g. 0013 % P = spm_get(1, 'img', 'Select mask image for design'); 0014 % D = explicit_mask(D, P); 0015 % 0016 % $Id: explicit_mask.m,v 1.1 2005/06/21 03:59:04 matthewbrett Exp $ 0017 0018 if nargin < 2 0019 error('Need masking image'); 0020 end 0021 if ischar(mask_img) 0022 mask_img = spm_vol(mask_img); 0023 end 0024 0025 xM = masking_struct(D); 0026 if isfield(xM, 'TH') 0027 xM.TH = ones(size(xM.TH)) * -Inf; 0028 end 0029 xM.VM = mask_img; 0030 D = masking_struct(D, xM);