I’m a new brainstorm’s user and I have a little question :
When I import MRI, surfaces… in Brainstorm, they are all converted into the CTF coordinates system. And when I export them after my work with Brainstorm, they still are in this system. But I’m working with others images (fMRI, DTI…), I haven’t import in Brainstorm.
So my question is : Where can I find the transformation Brainstorm made when it imports an image?
Indeed, the surfaces and sensors coordinates are converted in SCS (subject coordinates system), which follows the CTF convention, when they are imported. Documentation available at: http://neuroimage.usc.edu/brainstorm/CoordinateSystems
To convert from a coordinates system to another, you can use the functions in brainstorm3/toolbox/cs. The transform from MRI to SCS is stored in the MRI file, in the field “SCS”.
To convert back into MRI coordinates the vertices of a surface :
Export the surface to Matlab (right click on surface file > File > Export to Matlab), to a variable called “surf”
Export the MRI to Matlab (variable “mri”)
Typing “scs2mri(mri, surf.Vertices)” in your Matlab command window will give you the positions of the vertices in MRI CS.
I have run the ‘scs2mri’ code and I observe a little error in the result. The origin is good, but the mesh is too small.
I think is just a problem of units (meter vs mm), because a x1000 homothety resolve it.
Hi Stephane,
You’re right, I did a little mistake in the function calls. The surfaces coordinates are stored in meters, while the mri2scs function takes millimeters in input.
The correct call to get your vertices in MRI coordinates is:
scs2mri(mri, surf.Vertices * 1000) / 1000
I have a question regarding the conversion from SCS to MRI. I followed the steps described before. For testing purposes I used the default T1-MRI (MNI_Colin27) as my mri and the cortex_10000V as surf and ran
scs2mri(mri,surf.Vertices*1000)
Question 1: MRI coordinates does that refer in my case MNI coordinates?
Question 2: In case these are MNI coordinates, why are all the coordinates positive?
MRI coordinates are NOT the standardized MNI coordinates, they are the coordinates in the real MRI volume, in meters.
Coordinate (0,0,0) represent the first pixel in the first slice of the volume, ie. one of the vertices of the cube.
Those coordinates are in millimeters. To convert them in number of voxels, you have to divide by the voxel size (mri.Voxsize).
You can use the function scs2ncs (NCS stands for Normalized Coordinate System, ie. talairach). It gives the last set of coordinates you get in the MRI Viewer.
But honestly, I wouldn’t use this. The transformation used in this function is too simple to be acceptable (affine by blocks).
If you want to compare cortical sources between subjects in Brainstorm, use the re-projection of the sources on the MNI/Colin brain (right-click on sources > project on default anatomy; need that you set the default anat to MNI/Colin27).
This uses an advanced ICP algorithm to register the individual cortex surface on the Colin cortex, and then re-interpolate the sources values from a surface to the other.
Maybe. You want to export the CTF coordinates of what exactly ?
If you are talking about the positions of the MEG coils, yes you can, but you would get a very limited amount of information compered with what you need to describe the coils.
In a general way, everything that is related with exporting data is accessible from the File menu when you right-click on the file to export in the database explorer.
If the direct export you need is not available there, the most general procedure to export something is:
You export your file to the Matlab workspace: right-click > File > Export to Matlab
You save the field you need in ASCII:
A= ExportVariable.FieldToSave;
save(‘test.txt’, ‘A’, ‘-ascii’);
or
dlmwrite(‘test.txt’, A);