adds 3d matrix image vol to slice overlay FORMAT obj = add_matrix(imgno, mat3d, mat) Inputs obj - object mat3d - 3D matrix to add as img mat - optional 4x4 voxel->world translation imgno - optional img no to add to (defaults to last in object) Ouputs obj - modified object $Id: add_matrix.m,v 1.1 2005/04/20 15:05:36 matthewbrett Exp $
0001 function obj = add_matrix(obj, mat3d, mat, imgno) 0002 % adds 3d matrix image vol to slice overlay 0003 % FORMAT obj = add_matrix(imgno, mat3d, mat) 0004 % 0005 % Inputs 0006 % obj - object 0007 % mat3d - 3D matrix to add as img 0008 % mat - optional 4x4 voxel->world translation 0009 % imgno - optional img no to add to (defaults to last in object) 0010 % 0011 % Ouputs 0012 % obj - modified object 0013 % 0014 % $Id: add_matrix.m,v 1.1 2005/04/20 15:05:36 matthewbrett Exp $ 0015 0016 if nargin < 2 0017 return 0018 end 0019 if nargin < 3 0020 mat = []; 0021 end 0022 if nargin < 4 0023 imgno = []; 0024 end 0025 if isempty(imgno) 0026 imgno = length(obj.img); 0027 end 0028 if ~isempty(mat3d) 0029 obj.img(imgno).vol = pr_matrix2vol(mat3d, mat); 0030 end