ins-amu / scripts

prepare data for TVB
MIT License
23 stars 12 forks source link

Brain not in head #42

Closed maedoc closed 9 years ago

maedoc commented 9 years ago

The decimated cortical surface and BEM surfaces don't appear to be in the same coordinate system:

not in head

Normally, the BEM surfaces are in ras-tkr space, which is the same as the cortex. How did this happen?

maedoc commented 9 years ago

@timpx previously mentioned a post on the fs list

https://www.mail-archive.com/freesurfer@nmr.mgh.harvard.edu/msg40358.html

maedoc commented 9 years ago

ah perhaps @timpx already told me the answer...

when you export surfaces into ascii files, the surface is shifted compared to the original T1. you need to add the c_ras vector to the coordinates, that you can get by doing: mris_info surf/lh.pial

maedoc commented 9 years ago

Subtracting c_ras from the cortical coordinates (or adding to BEM coordinates) does the trick in head

timpx commented 9 years ago

However you have to be careful that we want BEM surfaces and cortex AND volumetric T1 aligned, so we better add to BEM coordinates than the opposite. Also I just thought it may be the reason why I was having so much trouble in mne_setup_forward_model with the function telling me each time that the surfaces were crossing, and I had to shift it a bit, we should check that out.

timpx commented 9 years ago

And nice visualization :)

maedoc commented 9 years ago

The BEM surfaces are always (unless you ask mne_watershed_bem to do otherwise) in correct ras-tkr coordinates. The decimated surface after the cras shift is then in these coordinates.

When you use the vox2raw-tkr transform on the T1.mgz, you have an aligned T1 & BEM surfaces. I'm fairly sure of this, as I've done it for a dozen subjects already. This is why I preferred to move your surface.

timpx commented 9 years ago

What I fear is that using mri_convert and vox2ras-tkr will give different results, this difference being the shift we discussed. SCRIPTS currently works using the mri_convert space, so we should think a bit what space is the best to use and make the changes accordingly

maedoc commented 9 years ago
mri_convert mri/T1.mgz mri/T1.mgz.nii

produces an image that when using the --vox2ras-tkr transform, is aligned witht eh BEM surfaces. Of this I am sure see my notes here

http://meg.univ-amu.fr/wiki/FreeSurferToFieldTrip

timpx commented 9 years ago

For future references, we have the vox2ras and the vox2ras-tkr coordinate systems, all surfaces in SCRIPTS will be produced in the vox2ras coordinate system.

maedoc commented 9 years ago

<pedantic> it's vox2ras-tkr with a t </pedantic>

timpx commented 9 years ago

Indeed, I updated