# mne\_make\_cor\_set - transform problem

**URL:** <https://mne.discourse.group/t/mne-make-cor-set-transform-problem/1003>\
**Category:** Mailing List Archive (read-only)\
**Tags:** list-archive\
**Created:** [April 18, 2016, 3:31pm UTC](https://mne.discourse.group/t/mne-make-cor-set-transform-problem/1003 "2016-04-18T15:31:37Z")\
**Posts on this page:** 5\
**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:** [April 18, 2016, 3:31pm UTC](https://mne.discourse.group/t/mne-make-cor-set-transform-problem/1003/1 "2016-04-18T15:31:37Z")

</div>

This is a follow-on to a previous post to which Jon Houck helpfully suggested using mne\_make\_cor\_set.  
I am using this to convert .mgz files to .fif .  
I normally start with the original dicom set and convert them to .fif using ELEKTA's dicom\_access.  
But for these MEG data sets, I only have a defaced (via freesurfer) .mgz files.

In either case I then use the .fif files to do MEG coregistration with ELEKTA's Mrilab tool.  
Using Mrilab is part of my standard pipeline and I would like to stick with that if possible.

When I convert a standard dicom scan series to fif using ELEKTA's dicom\_access, the .fif is in MR RAS coordinates.  
But a .fif file obtained by conversions from .mgz with mne\_make\_cor\_set appears to be in tkr RAS coordinates instead.  
So the transform matrix that I get when I do the coregistration is: Head --\> tkrRAS rather than Head --\> RAS .

I tried spoofing mne\_make\_cor\_set with -talairach SomeOtherTransformation but Mrilab doesn't appear to care.  
In addition, it's not clear to me what transform to use even if it does work; maybe tkr2scanner .

Any thoughts would be welcome and thanks.

Best - Don

-------------- next part --------------  
An HTML attachment was scrubbed...  
URL: [http://mail.nmr.mgh.harvard.edu/pipermail/mne\_analysis/attachments/20160418/ac977172/attachment.html](http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20160418/ac977172/attachment.html)

---

<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:** [April 18, 2016, 3:35pm UTC](https://mne.discourse.group/t/mne-make-cor-set-transform-problem/1003/2 "2016-04-18T15:35:38Z")

</div>

Hi Don,

You can read the fif file mne\_make\_cor\_set made in mrilab and do the coordinate transformation there as you have used to and produce a new fif file where the transformation is in place.  
This does not deal with the different coordinate systems between the one derived from the DICOM files and the mgz files, though.

- Matti

---

<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:** [April 18, 2016, 3:53pm UTC](https://mne.discourse.group/t/mne-make-cor-set-transform-problem/1003/3 "2016-04-18T15:53:22Z")

</div>

Hi Matti,

Thanks for responding so quickly.  
I tried what you suggest for a scan for which I have dicoms.  
I created 2 .fif?s, one with dicom\_access and one with mne\_make\_cor\_set.

Here are the two transforms grabbed with show\_fiff:  
# dicom\_access  
# 222 = transform head -\> MRI  
# 0.999356 0.028735 -0.021495  
# -0.035189 0.902169 -0.429945  
# 0.007038 0.430425 0.902599  
# -4.798210 8.148447 -50.913933 (inv. 5.440169 14.701207 49.355110)  
# mne\_make\_cor\_set  
# 222 = transform head -\> MRI  
# 0.999505 0.024229 0.020096  
# -0.014078 0.915056 -0.403080  
# -0.028155 0.402598 0.914944  
# -3.010607 -9.352709 -35.697933 (inv. 1.872374 23.003098 28.952219)

I guess the rotations look pretty much the same and if I apply the tkr2scanner transform to the displacement, -3.010607 -9.352709 -35.697933, I get  
-5.14 6.311 -52.083 which is also pretty good.

That?s encouraging actually. Do you see any way to get it to kick out the correct displacements?

Don

---

<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:** [April 18, 2016, 4:00pm UTC](https://mne.discourse.group/t/mne-make-cor-set-transform-problem/1003/4 "2016-04-18T16:00:26Z")

</div>

Hi Don,

In fact, the coordinate transformation between the scanner coordinates and surface RAS coordinates is in the file produced my mne\_make\_cor\_set.  
You can see this when you do

mne\_show\_fiff ?verbose ?tag 222 ?in \<filename\>

To my understanding, it is only a displacement.

- Matti

---

<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:** [April 18, 2016, 5:53pm UTC](https://mne.discourse.group/t/mne-make-cor-set-transform-problem/1003/5 "2016-04-18T17:53:36Z")

</div>

Got it. Thank you very much.

Best - Don
