Hi,
here are some news about the gifti coverter:
It seems to me that the GiftiToBrainvisaConerter has a problem in the index of the faces, it doesn t work on my example.
I ve written a basic converter in matlab which returns a gifti tesselation in the space of the volume given (usually the MRI from which has been extracted the mesh) and in the referential of SPM8:
function gifti_out=BVmesh2SPMgifti(mesh_file,vol_file)
%convert .mesh tesselation from BrainVISA into a gifti in the SPM
%referential
gifti_out=gifti;
[vert, faces, gifti_out.normals, vertex_number, faces_number] = loadmesh(mesh_file);
gifti_out.faces=faces+1;
N= nifti(vol_file);
gifti_out.mat=N.mat;
dim=size(N.dat);
vox_size=abs(diag(N.mat(1:3,1:3)));
minf_mat=[1/vox_size(1), 0, 0, 1; 0, -1/vox_size(2), 0, dim(2); 0, 0, -1/vox_size(3), dim(3); 0, 0, 0, 1 ];
vert(:,4) = 1;
new = vert * minf_mat';
gifti_out.vertices = new(:,1:3);
function SPMgifti2BVmesh(gifti,mesh_file,vol_file)
%convert a gifti in the SPM referential into a .mesh tesselation for
%BrainVISA
N= nifti(vol_file);
dim=size(N.dat);
vox_size=abs(diag(N.mat(1:3,1:3)));
minf_mat=[1/vox_size(1), 0, 0, 1; 0, -1/vox_size(2), 0, dim(2); 0, 0, -1/vox_size(3), dim(3); 0, 0, 0, 1 ];
vert=gifti.vertices;
vert(:,4) = 1;
if gifti.mat==eye(4);
vert = vert * inv(N.mat)';
end
new = vert * inv(minf_mat)';
vertex = new(:,1:3);
savemesh(mesh_file,vertex,gifti.faces-1,gifti.normals,'binar')
ps: the loadmesh function is in the BV_path/brainvisa/matlab/mesh and the gifti function comes from the matlab gifti class
http://www.artefact.tk/software/matlab/gifti/ which is also included in the SPM8 distribution, with the nifti calss
Guillaume