# Understanding the "-trans.fif" file

**URL:** <https://mne.discourse.group/t/understanding-the-trans-fif-file/3180>\
**Category:** Support & Discussions\
**Tags:** ﻿source-localization, preprocessing, meg, mri\
**Created:** [May 29, 2021, 8:14am UTC](https://mne.discourse.group/t/understanding-the-trans-fif-file/3180 "2021-05-29T08:14:50Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![shirinV](https://avatars.discourse-cdn.com/v4/letter/s/779978/32.png) [@shirinV](https://mne.discourse.group/u/shirinV)\
**Post date:** [May 29, 2021, 8:14am UTC](https://mne.discourse.group/t/understanding-the-trans-fif-file/3180/1 "2021-05-29T08:14:50Z")

</div>

In this tutorial, it seems I have to have a “-trans.fif” file to be able to do the computations for source-localized data. However, I cannot find such a file in my freesurfer results. Shall this file be obtained through MRI? I also just have “.con” files as my MEG files.

I will put screenshot of my MRI directory:

 ![Screen Shot 2021-05-29 at 17.11.45](https://global.discourse-cdn.com/free1/uploads/mne/original/1X/2c48e62035b2a709e51f8cd121810a014e886cb4.png)  
 ![Screen Shot 2021-05-29 at 17.13.14](https://global.discourse-cdn.com/free1/uploads/mne/original/1X/c1d042b930ad804a1527dd9b640e0d351b665eb1.png)  
 ![Screen Shot 2021-05-29 at 17.13.36](https://global.discourse-cdn.com/free1/uploads/mne/original/1X/fd558dbc188653d0a57a98dcb145d7af13059849.png)

Which of these files should I use for -trans file? If it is not listed here, how should I obtain it?

Thanks in advance

- MNE-Python version: 0.23.0
- operating system: MacOS

---

<div class="post-metadata">

**Author:** ![shirinV](https://avatars.discourse-cdn.com/v4/letter/s/779978/32.png) [@shirinV](https://mne.discourse.group/u/shirinV)\
**Post date:** [May 29, 2021, 9:41am UTC](https://mne.discourse.group/t/understanding-the-trans-fif-file/3180/2 "2021-05-29T09:41:43Z")

</div>

My MEG files are in “.con” format…  
I could not use the “read\_trans” to read these files…

How should I solve the problem?  
 ![Screen Shot 2021-05-29 at 18.41.31](https://global.discourse-cdn.com/free1/uploads/mne/original/1X/f4da0bb74c605d067b1336092bc97aa49bb1629d.png)

---

<div class="post-metadata">

**Author:** ![marsipu](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/marsipu/32/196_2.png) [@marsipu](https://mne.discourse.group/u/marsipu)\
**Post date:** [May 30, 2021, 7:45am UTC](https://mne.discourse.group/t/understanding-the-trans-fif-file/3180/3 "2021-05-30T07:45:41Z")

</div>

Hello Shirin,

the “trans.fif”-file contains a matrix for the transformation between the the **“head”-coordinate-frame** from your measurement (defined by the digitization of the anatomical landmarks of the participant before the measurement) and the **“MRI”-coordinate-frame** of the 3D-Brain from the Freesurfer-Reconstruction (your MRI-Directory you showed).  
To acquire the “trans.fif”-file you need to align both coordinate-frames manually which is called coregistration. MNE-Python provides a [GUI](https://mne.tools/stable/generated/mne.gui.coregistration.html#mne.gui.coregistration) for that.  
[Here](https://mne.tools/stable/auto_tutorials/forward/20_source_alignment.html), you can find a tutorial [about the coordinate-frames](https://mne.tools/stable/auto_tutorials/forward/20_source_alignment.html#understanding-coordinate-frames) and the [usage of the Coregistration-GUI](https://mne.tools/stable/auto_tutorials/forward/20_source_alignment.html#defining-the-headmri-trans-using-the-gui).

Regarding your other question about your “.con”-MEG-files:  
You only need [`mne.read_trans()`](https://mne.tools/stable/generated/mne.read_trans.html?highlight=read_trans#mne.read_trans) to read the “.trans”-file you acquired using the Coregistration-GUI from above. The “.con”-files are your Raw-Data and you can read them using [`mne.io.read_raw_kit()`](https://mne.tools/stable/generated/mne.io.read_raw_kit.html#mne.io.read_raw_kit).

---

<div class="post-metadata">

**Author:** ![shirinV](https://avatars.discourse-cdn.com/v4/letter/s/779978/32.png) [@shirinV](https://mne.discourse.group/u/shirinV)\
**Post date:** [May 31, 2021, 3:46am UTC](https://mne.discourse.group/t/understanding-the-trans-fif-file/3180/4 "2021-05-31T03:46:18Z")

</div>

Thank you very much Martin!!!

---

<div class="post-metadata">

**Author:** ![shirinV](https://avatars.discourse-cdn.com/v4/letter/s/779978/32.png) [@shirinV](https://mne.discourse.group/u/shirinV)\
**Post date:** [June 16, 2021, 9:29am UTC](https://mne.discourse.group/t/understanding-the-trans-fif-file/3180/5 "2021-06-16T09:29:28Z")

</div>

If my understanding is correct, the “-trans.fif” file is only based on MRI data. Therefore, I need to calculate it one time even if I have multiple MEG session data.  
Is that right?

---

<div class="post-metadata">

**Author:** ![shirinV](https://avatars.discourse-cdn.com/v4/letter/s/779978/32.png) [@shirinV](https://mne.discourse.group/u/shirinV)\
**Post date:** [June 16, 2021, 9:31am UTC](https://mne.discourse.group/t/understanding-the-trans-fif-file/3180/6 "2021-06-16T09:31:20Z")

</div>

And is that true also for BEM surfaces?

---

<div class="post-metadata">

**Author:** ![agramfort](https://avatars.discourse-cdn.com/v4/letter/a/7c8e57/32.png) [@agramfort](https://mne.discourse.group/u/agramfort)\
**Post date:** [June 16, 2021, 9:42am UTC](https://mne.discourse.group/t/understanding-the-trans-fif-file/3180/7 "2021-06-16T09:42:21Z")

</div>

yes it’s one trans file per acquisition session not per MEG run.

HTH  
Alex
