# Mne\_analysis Digest, Vol 120, Issue 39

**URL:** <https://mne.discourse.group/t/mne-analysis-digest-vol-120-issue-39/1408>\
**Category:** Mailing List Archive (read-only)\
**Tags:** list-archive\
**Created:** [January 30, 2018, 8:06pm UTC](https://mne.discourse.group/t/mne-analysis-digest-vol-120-issue-39/1408 "2018-01-30T20:06:23Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/free1/uploads/mne/original/1X/85cc6bd2b69cb698a166dc6d880fb550510d0144.jpeg) [@system](https://mne.discourse.group/u/system)\
**Post date:** [January 30, 2018, 8:06pm UTC](https://mne.discourse.group/t/mne-analysis-digest-vol-120-issue-39/1408/1 "2018-01-30T20:06:23Z")

</div>

Hi Alex - thanks for your response!  
I've resolved part of my problem, and I think I have figured out what I really need.  
What I really need is to get the location of the fiducials from the digitizer space into mri space.

I have used mne\_ctf\_dig2fiff to put a text version of a Polhemus digitizer file into .fif format. I do not know the coordinate frame that these points are transformed to, if any.  
I have a freesurfer surface, with mri fiducials saved in a .fif file (this appears to be in the TkReg RAS coordinate frame, in meters)  
I used mne coreg to line up the digitizer head shape (including the marked fiducials) with the MRI.

Now, I want the coordinates of the fiducials marked using the digitizer in MRI space.  
These are obviously created by mne coreg, because they are plotted on the surface, I believed they are saved internally as transformed\_hsp\_nasion, etc. If there is any way to easily get these coordinates that would be fantastic.

I have tried:  
If, for instance, the location of the nasion coil that I put in .fif format with mne\_ctf\_dig2fiff is stored in a variable nasion\_xyz,  
mne.transforms.apply\_trans(trans\_head\_mri,nasion\_xyz)  
where trans\_head\_mri is the transform saved when I press the "Save As..." button in mne coreg

But this does not produce coordinates that are in the same coordinate frame as the MRI. This makes me think that mne\_ctf\_dig2fiff is transferring the coordinates to a different coordinate frame, but I don't know which one.

Anyway, the upshot of all this is that I need a way to get the coordinates of the headshape file fiducials in MRI space. If there's an easier way to do this, or a more transparent way of getting the headshape file into mne, let me know.  
Thanks!

Allison

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/free1/uploads/mne/original/1X/85cc6bd2b69cb698a166dc6d880fb550510d0144.jpeg) [@system](https://mne.discourse.group/u/system)\
**Post date:** [January 31, 2018, 8:09am UTC](https://mne.discourse.group/t/mne-analysis-digest-vol-120-issue-39/1408/2 "2018-01-31T08:09:41Z")

</div>

hi Allison,

I have never used CTF data with mne unix command line tools. Just in Python  
using the SPM dataset.

you can read the CTF data from python and if all goes well you should have  
the infos you need in the info['dig']. Otherwise you can update the  
content of this.

sorry not to be able to help more.

maybe someone here has more experience with CTF data using MNE.

ALex

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/free1/uploads/mne/original/1X/85cc6bd2b69cb698a166dc6d880fb550510d0144.jpeg) [@system](https://mne.discourse.group/u/system)\
**Post date:** [January 31, 2018, 3:09pm UTC](https://mne.discourse.group/t/mne-analysis-digest-vol-120-issue-39/1408/3 "2018-01-31T15:09:06Z")

</div>

Hi Allison,

I have only used the python tools as well, but using these tools I have  
been able to make sense of the various transforms.

My work flow is roughly  
1) put the digitization file inside the ds folder.  
2) use mne.io.read\_raw\_ctf to load the data  
3) use mne.io.write\_info to write out an info.fif file.  
4) do mne coreg using the info fif file with the points.  
5) the digitization points in the MNE\_HEAD\_COORD frame are stored in the  
info['dig'] structure. you can apply the trans file you saved as part of  
mne coreg to get to freesurfer TKR MRI space, and then use transforms in  
the T1.mgz file (via nibabel) to get to standard MRI space.

Here is a gist (  
[https://gist.github.com/bloyl/13cc7e78625ab8b262ab43dab8a05175](https://gist.github.com/bloyl/13cc7e78625ab8b262ab43dab8a05175)) that prints  
out the dig points in TKR space. and could serve as a basis to do what you  
need.

If there is interest I can also share some routines I use to write out  
points to a slicer3d fscv file in standard MRI world RAS space.

-Luke
