Home > phiwave > @phiw_wvimg > doproc.m

doproc

PURPOSE ^

performs any necessary processing on wvimg object

SYNOPSIS ^

function wvimg = doproc(wvimg)

DESCRIPTION ^

 performs any necessary processing on wvimg object

 Processing is reading image, if currently only a vol struct, and
 performing wavelet transform, if not already done.
 
 $Id: doproc.m,v 1.3 2005/06/05 04:42:22 matthewbrett Exp $

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function wvimg = doproc(wvimg)
0002 % performs any necessary processing on wvimg object
0003 %
0004 % Processing is reading image, if currently only a vol struct, and
0005 % performing wavelet transform, if not already done.
0006 %
0007 % $Id: doproc.m,v 1.3 2005/06/05 04:42:22 matthewbrett Exp $
0008 
0009 % read the data if it's a vol struct
0010 if isstruct(wvimg.img)
0011   if wvimg.options.verbose
0012     fprintf('Reading image %s...\n', wvimg.img.fname);
0013   end
0014   wvimg.img = spm_read_vols(wvimg.img);
0015 end  
0016 
0017 % transform if not transformed
0018 if ~wvimg.wtf
0019   wvimg.changef = 1;
0020   if wvimg.options.verbose
0021     fprintf('Transforming data for %s...\n', wvfname(wvimg));
0022   end
0023   % set NaN to 0
0024   wvimg.img(isnan(wvimg.img)) = 0;
0025   [wvimg.img wvimg.oimgi] = transform(wvimg.img,wvimg.wavelet, ...
0026                       wvimg.scales);
0027   wvimg.wtf = 1;
0028   wvimg.descrip = strvcat(wvimg.descrip,['wt with ' ...
0029             descrip(wvimg.wavelet)]);
0030 end

Generated on Wed 06-Jul-2005 18:07:21 by m2html © 2003