0001 function [obj, wvol] = write_wtimg(obj, fname)
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014 if nargin < 2
0015 fname = [];
0016 end
0017
0018 if isstruct(fname),fname = fname.fname;end
0019 if isempty(fname), fname = wvfname(obj);end
0020
0021
0022 obj = doproc(obj);
0023 dim = size(obj.img);
0024 dim(4) = spm_type(obj.options.datatype);
0025 obj.wvol.dim = dim;
0026 obj.wvol.fname = fname;
0027 obj.wvol = mars_struct('fillafromb', obj.wvol,obj.ovol);
0028 obj.wvol.descrip = obj.descrip;
0029
0030
0031 obj.wvol = spm_write_vol(obj.wvol, obj.img);
0032
0033
0034 obj.changef = 0;
0035
0036
0037 putwave(obj.wvol, thin(obj));
0038
0039 wvol = obj.wvol;