Home > marsbar > @maroi_matrix > do_write_image.m

do_write_image

PURPOSE ^

method saves matrix as image and returns spm_vol

SYNOPSIS ^

function v = do_write_image(o, fname)

DESCRIPTION ^

 method saves matrix as image and returns spm_vol

 $Id$

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function v = do_write_image(o, fname)
0002 % method saves matrix as image and returns spm_vol
0003 %
0004 % $Id$
0005 
0006 v = mars_vol_utils('def_vol');
0007 v.fname = fname;
0008 v.mat = o.mat;
0009 v.dim = size(o.dat);
0010 
0011 if binarize(o)
0012   v = mars_vol_utils('set_type', v, 'uint8');
0013 else
0014   v = mars_vol_utils('set_type', v, 'float');
0015 end
0016 
0017 v = spm_create_vol(v);
0018 v = spm_write_vol(v, o.dat);

Generated on Sat 19-Nov-2011 16:12:40 by m2html © 2005