flirtmat_read

Type:
Class
Category:
Math Functions
License:
GNU General Public License
Language:
MATLAB
 
Description:
get FLIRT affine matrix from file as written by flirt -omat

Example:
mat = flirtmat_read(fname)

Versions Of This Snippet::

Ged Ridgway
Snippet ID Download Version Date Posted Author Delete
30.92009-07-27 07:27Ged RidgwayDelete

Download a raw-text version of this code by clicking on "Download Version"

 


Latest Snippet Version: :0.9

function mat = flirtmat_read(fname)
%flirtmat_read: get FLIRT affine matrix from file as written by flirt -omat
% Example:
%  mat = flirtmat_read(fname)
% See also: flirtmat_write, flirtmat2worldmat, worldmat2flirtmat

% Copyright 2009 Ged Ridgway <ged.ridgway gmail.com>

elements = textread(fname, '%f', 'delimiter', ' '); % read along rows
mat = reshape (elements,4,4); % stacked column wise, so needs:
mat = mat'; % transpose to give usual convention ([0 0 0 1] along 4th row)

		

Submit a new version

You can submit a new version of this snippet if you have modified it and you feel it is appropriate to share with others..