CTF .fid

Hi all,
I have a CTF .fid file that contains the locations of the 3 coils in the MEG after coregistration with the MRI. A surface matching procedue was used for this using the polhemus isotrak device.
Is there any way of converting the .fid coordinates to the MRI Viewer in Brainstorm?

I am stuck otherwise.


It is possible to enter manually the coordinates of the fiducial points, from the interface or from scripts. The problem is to understand the coordinate system transformations between the different programs.
This .fid files contains coordinates in what kind of coordinate system?

In the MRI viewer in Brainstorm, you can set the positions of the coils: LPA/RPA/NAS with a right-click on the figure > Set fiducials coordinates. But the coordinates you enter have to be in MRI coordinates, in millimeters, with the same orientation and origin used in Brainstorm. At this point, Brainstorm does not have anything else that it can use to indicate coordinates. After those three points are marked, it uses the same reference as the CTF software.
This page may help you understand those conversions: http://neuroimage.usc.edu/brainstorm/CoordinateSystems

An other problem is the segmentation. If you extracted the cortex surface with FreeSurfer, BrainVISA or BrainSuite, the MRI is normalized to a standardized space, and the coordinates in “MRI coordinates” are not valid anymore.

Those coordinates questions are very difficult, this is why we recommend to do everything in Brainstorm, this way there is no conversion problem.

Good luck.

Thanks Francois.
The .fid file contains coordinates in the CTF MEG coordinate space which is them used to co-register with the MRI. It’s based on fiducial points digitized with the polhemus after the MEG collection and a surface matching rather than identifiable markers on the MRI.

This data was collected a few years ago so I can’t go back.

I have entered the coordinates manually in the Brainstorm MRI Viewer but they don’t appear in the right places at all.

You need two sets of points 3 points to register the MRI and the MEG:

  1. The 3 points in the CTF MEG coordinates system, corresponding to the MEG coils tracked by the CTF system. Those are the three points you are talking about. You can force Brainstorm to use your own points instead of the coils positions saved in the .res4 file by adding a .pos file to the .ds folder (detailed below).
  2. The same 3 points in the MRI, in MRI coordinates (in millimteres): this you still have to mark manually in the MRI with the MRI Viewer in brainstorm, because apparently you are not using the MRI volume in CTF .mri format, that contains those points. You cannot use this .mri file for source reconstruction in Brainstorm anyways because you would not have the corresponding cortex and head surfaces.

There is probably more missing information than what you think, the .fid file by itself is not going to solve your registration problem.
You should add the headshape points as well and redo the registration within Brainstorm.

The easiest way for you would be to add a .pos file in the .ds folder, containing the positions of the CTF coils (your .fid file) plus the positions of all the headshape points.
To get an example of .pos file, please check in the datasets we distribute with the online tutorials: sample_raw.zip, sample_auditory.zip or sample_resting.zip.


The .pos file I have is the output of the polhemus digitization. It contains the headshape points and the location of the 3 coils on the head in the polhemus coordinate space. This is then fit to the subject’s extracted MRI surface that gives us the coregistered MEG/MRI. The .fid is the output of this coregistration in the CTF MEG coordinate system.

I have added the .pos file in the dataset and re-imported the dataset into Brainstorm. Can I read this into the MRI Viewer?

  1. Re-write your .pos file so that it matches the structure of the .pos files that are generated by the Brainstorm Digitizer (check the format in the example datasets available on the website in the Download section).
  2. Copy this .pos file in ALL the .ds folders you have for this session. These files will be read by Brainstorm to correct the “CTF coordinate system” that is saved in the .res4 file
  3. Re-import all the datasets into the Brainstorm database, answer YES to the question “Refine registration”. If you don’t get this question, your headshape points are not read correctly, the format of your .pos file is not matching what Brainstorm expects, go back to step #1.
  4. Those are not things that you can visualize in the MRI viewer. You have the MRI with the MRI points on one side, and the MEG coils with the Polhemus points (fiducials and headpoints). The MRI fiducial points are used as the ground truth, on which we align the MEG information. To see all those points displayed together, right-click on the channel file > MRI registration > Check. The green points are the headshape points, the blue ones the fiducials defined in the MRI Viewer, the orange ones the fiducials digitized with the Polhemus.
  5. In the example .pos files you will find multiple NAS/LPA/RPA points, this is because we add digitize twice or three times all those points and then use the average of them, this gives us a much better accuracy.