adds SPM blobs to img no 'imgno', as specified in FORMAT obj = add_blobs(obj, xyz, vals, mat, imgno) Inputs XYZ - 3xN voxel coordinates of N blob values vals - N blob intensity values mat - 4x4 matrix specifying voxels -> mm imgno - slice overlay img number to add to (defaults last in object) Outputs obj - modified object $Id: add_blobs.m,v 1.1 2005/04/20 15:05:36 matthewbrett Exp $
0001 function obj = add_blobs(obj, xyz, vals, mat, imgno) 0002 % adds SPM blobs to img no 'imgno', as specified in 0003 % FORMAT obj = add_blobs(obj, xyz, vals, mat, imgno) 0004 % 0005 % Inputs 0006 % XYZ - 3xN voxel coordinates of N blob values 0007 % vals - N blob intensity values 0008 % mat - 4x4 matrix specifying voxels -> mm 0009 % imgno - slice overlay img number to add to (defaults last in object) 0010 % 0011 % Outputs 0012 % obj - modified object 0013 % 0014 % $Id: add_blobs.m,v 1.1 2005/04/20 15:05:36 matthewbrett Exp $ 0015 0016 if nargin < 4 0017 error('Need all of object, xyz, vals, mat'); 0018 end 0019 if nargin < 5 0020 imgno = []; 0021 end 0022 if isempty(imgno) 0023 imgno = length(obj.img); 0024 end 0025 if ~isempty(xyz) 0026 obj.img(imgno).vol = blobs2vol(xyz,vals,mat); 0027 end 0028