File size: 244 Bytes
72417f2 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | function ras = vox2ras(vox,vox2ras0)
if size(vox,2)==3
vox2=[vox'-1; ones(1,size(vox,1))]; % matlab 1-based indexing
else
vox2=[vox-1; ones(1,size(vox,2))];
end
ras = vox2ras0 * vox2([2 1 3 4],:); % matlab flip
ras = ras(1:3,:);
|