[FieldTrip] why realignment tilted in hcp_anatomy?

K Jeffrey Eriksen eriksenj at ohsu.edu
Wed Mar 15 23:56:21 CET 2017


All HCP_MEG users:

In the hope of getting some responses, let me simplify this to the bare minimum. By setting a flag in [hcp_anatomy.m] to allow visualization of the realignment result, I have discovered something that appears wrong. The coronal view in the attached “realignment result” is tilted at a 45 degree angle. My first question is simply: is this what I should see? If so, why is it tilted?

[cid:image001.png at 01D29D9F.396AFF00]
I have not modified the script except to turn on this visualization. The input file (T1w_acpc_dc_restore.nii) is from one of the publically available HCP_MEG subjects (177746) that I downloaded. So there can be no “user error” at this point on my account, unless it is using [hcp_anatomy] outside the context of the whole HCP_MEG pipeline. The above plot occurs on line 156 of [hcp_anatomy.m].

Thanks,
-Jeff

PS. Just in case I am marking the ac, pc, zx, and r landmark points wrong, here is what I marked:
[cid:image002.png at 01D29DA0.14D6DF00]
And here is all the console output up to the point of drawing the realignment result:

dicomfile =

A:\HCP_MEG_subs\HCP-MEG-177746\MEG\anatomy\T1w_acpc_dc_restore.nii

executing the anatomy pipeline for subject 177746
not using the high quality structural preprocessing results

-------------------------------------------------------------------------
Running the interactive part of the anatomy pipeline

Rescaling NIFTI: slope = 1, intercept = 0
Please identify the Anterior Commissure, Posterior Commissure, a point on the positive Z and X axes, and a point on the right part of the head
the input is volume data with dimensions [260 311 260]
1. To change the slice viewed in one plane, either:
   a. click (left mouse) in the image on a different plane. Eg, to view a more
      superior slice in the horizontal plane, click on a superior position in the
      coronal plane, or
   b. use the arrow keys to increase or decrease the slice number by one
2. To mark a fiducial position or anatomical landmark, do BOTH:
   a. select the position by clicking on it in any slice with the left mouse button
   b. identify it by pressing the letter corresponding to the fiducial/landmark:
      press a for ac, p for pc, z for xzpoint
      press r for an extra control point that should be on the right side
   You can mark the fiducials multiple times, until you are satisfied with the positions.
3. To change the display:
   a. press c on keyboard to toggle crosshair visibility
   b. press f on keyboard to toggle fiducial visibility
   c. press + or - on (numeric) keyboard to change the color range's upper limit
4. To finalize markers and quit interactive mode, press q on keyboard
==================================================================================
crosshair: voxel   7405710, index = [130 183  92], head = [-0.3 1.4 -8.3] mm
        ac: voxel       NaN, index = [NaN NaN NaN], head = [NaN NaN NaN] mm
        pc: voxel       NaN, index = [NaN NaN NaN], head = [NaN NaN NaN] mm
   xzpoint: voxel       NaN, index = [NaN NaN NaN], head = [NaN NaN NaN] mm
     right: voxel       NaN, index = [NaN NaN NaN], head = [NaN NaN NaN] mm
==================================================================================
selected ac
==================================================================================
crosshair: voxel   7405710, index = [130 183  92], head = [-0.3 1.4 -8.3] mm
        ac: voxel   7405710, index = [130 183  92], head = [-0.3 1.4 -8.3] mm
        pc: voxel       NaN, index = [NaN NaN NaN], head = [NaN NaN NaN] mm
   xzpoint: voxel       NaN, index = [NaN NaN NaN], head = [NaN NaN NaN] mm
     right: voxel       NaN, index = [NaN NaN NaN], head = [NaN NaN NaN] mm
==================================================================================
crosshair: voxel   9014850, index = [130 152 112], head = [-0.3 -20.3 5.7] mm
        ac: voxel   7405710, index = [130 183  92], head = [-0.3 1.4 -8.3] mm
        pc: voxel       NaN, index = [NaN NaN NaN], head = [NaN NaN NaN] mm
   xzpoint: voxel       NaN, index = [NaN NaN NaN], head = [NaN NaN NaN] mm
     right: voxel       NaN, index = [NaN NaN NaN], head = [NaN NaN NaN] mm
==================================================================================
selected pc
==================================================================================
crosshair: voxel   9014850, index = [130 152 112], head = [-0.3 -20.3 5.7] mm
        ac: voxel   7405710, index = [130 183  92], head = [-0.3 1.4 -8.3] mm
        pc: voxel   9014850, index = [130 152 112], head = [-0.3 -20.3 5.7] mm
   xzpoint: voxel       NaN, index = [NaN NaN NaN], head = [NaN NaN NaN] mm
     right: voxel       NaN, index = [NaN NaN NaN], head = [NaN NaN NaN] mm
==================================================================================
crosshair: voxel  14108972, index = [ 72 152 175], head = [40.3 -20.3 49.8] mm
        ac: voxel   7405710, index = [130 183  92], head = [-0.3 1.4 -8.3] mm
        pc: voxel   9014850, index = [130 152 112], head = [-0.3 -20.3 5.7] mm
   xzpoint: voxel       NaN, index = [NaN NaN NaN], head = [NaN NaN NaN] mm
     right: voxel       NaN, index = [NaN NaN NaN], head = [NaN NaN NaN] mm
==================================================================================
selected xzpoint
==================================================================================
crosshair: voxel  14108972, index = [ 72 152 175], head = [40.3 -20.3 49.8] mm
        ac: voxel   7405710, index = [130 183  92], head = [-0.3 1.4 -8.3] mm
        pc: voxel   9014850, index = [130 152 112], head = [-0.3 -20.3 5.7] mm
   xzpoint: voxel  14108972, index = [ 72 152 175], head = [40.3 -20.3 49.8] mm
     right: voxel       NaN, index = [NaN NaN NaN], head = [NaN NaN NaN] mm
==================================================================================
crosshair: voxel   6508124, index = [ 64 152  81], head = [45.9 -20.3 -16.0] mm
        ac: voxel   7405710, index = [130 183  92], head = [-0.3 1.4 -8.3] mm
        pc: voxel   9014850, index = [130 152 112], head = [-0.3 -20.3 5.7] mm
   xzpoint: voxel  14108972, index = [ 72 152 175], head = [40.3 -20.3 49.8] mm
     right: voxel       NaN, index = [NaN NaN NaN], head = [NaN NaN NaN] mm
==================================================================================
selected right
==================================================================================
crosshair: voxel   6508124, index = [ 64 152  81], head = [45.9 -20.3 -16.0] mm
        ac: voxel   7405710, index = [130 183  92], head = [-0.3 1.4 -8.3] mm
        pc: voxel   9014850, index = [130 152 112], head = [-0.3 -20.3 5.7] mm
   xzpoint: voxel  14108972, index = [ 72 152 175], head = [40.3 -20.3 49.8] mm
     right: voxel   6508124, index = [ 64 152  81], head = [45.9 -20.3 -16.0] mm
==================================================================================
crosshair: voxel   6508124, index = [ 64 152  81], head = [45.9 -20.3 -16.0] mm
        ac: voxel   7405710, index = [130 183  92], head = [-0.3 1.4 -8.3] mm
        pc: voxel   9014850, index = [130 152 112], head = [-0.3 -20.3 5.7] mm
   xzpoint: voxel  14108972, index = [ 72 152 175], head = [40.3 -20.3 49.8] mm
     right: voxel   6508124, index = [ 64 152  81], head = [45.9 -20.3 -16.0] mm
615     cfg.fiducial = opt.fiducial;
Warning: assuming that the units are "mm"
> In ft_estimate_units (line 49)
  In ft_plot_slice (line 197)
  In ft_plot_ortho (line 120)
  In ft_volumerealign>cb_redraw (line 1446)
  In ft_volumerealign (line 1293)
  In hcp_anatomy (line 156)
  In test_hcp_meg_anat (line 27)
Warning: assuming that the units are "mm"
> In ft_estimate_units (line 49)
  In ft_plot_slice (line 197)
  In ft_plot_ortho (line 134)
 In ft_volumerealign>cb_redraw (line 1446)
  In ft_volumerealign (line 1293)
  In hcp_anatomy (line 156)
  In test_hcp_meg_anat (line 27)
Warning: assuming that the units are "mm"
> In ft_estimate_units (line 49)
  In ft_plot_slice (line 197)
  In ft_plot_ortho (line 148)
  In ft_volumerealign>cb_redraw (line 1446)
  In ft_volumerealign (line 1293)
  In hcp_anatomy (line 156)
  In test_hcp_meg_anat (line 27)
K>>

From: Schoffelen, J.M. (Jan Mathijs) [mailto:jan.schoffelen at donders.ru.nl]
Sent: Monday, March 13, 2017 1:14 AM
To: FieldTrip discussion list; K Jeffrey Eriksen
Subject: Fwd: [HCP-Users] hcp_anatomy.m needs an hsfile?

Dear Jeff,

Let me forward your question to the discussion list.

Dear list,

Jeff is encountering some coregistration problems, which may be FieldTrip related, but also could be a user error. Perhaps somebody has encountered them before. Let us know if you have a solution.

The 45 degrees tilt looks odd. If this image was produced after reslicing the to-MNI-coregistered-image something went wrong with the realignment. If this image was produced prior to the reslicing, something funky has gone wrong with the acquisition sequence.

I don’t know anything about the specifics of Brainstorm, so I am afraid I cannot help there.

Best,

Jan-Mathijs



J.M.Schoffelen, MD PhD
Senior Researcher, VIDI-fellow - PI, language in interaction
Telephone: +31-24-3614793
Physical location: room 00.028
Donders Centre for Cognitive Neuroimaging, Nijmegen, The Netherlands




Begin forwarded message:

From: K Jeffrey Eriksen <eriksenj at ohsu.edu<mailto:eriksenj at ohsu.edu>>
Subject: RE: [HCP-Users] hcp_anatomy.m needs an hsfile?
Date: 11 March 2017 at 02:47:33 GMT+1
To: "Schoffelen, J.M. (Jan Mathijs)" <jan.schoffelen at donders.ru.nl<mailto:jan.schoffelen at donders.ru.nl>>

Hello again,

I encountered a problem when I tried to import into Brainstorm, even though I thought I had the transform text file correct. After importing the anatomy in Brainstorm, it was displayed with the brain rotated by 45 degrees in all axes. I then realized the I had visualized the registration of the headshape to the scalp surface and that looked good, but I had never visualized the MNI registration.

I went back into the HCP scripts and found where the MNI registration could be visualized and discovered the 45 degree rotation seemed to occur there. So I thought maybe our local HCP pipeline did something unusual. To test this I ran these three conditions:

1.       My hcp_anatomy_egi.m with our local HCP-pipeline produced T1
2.       original hcp_anatomy.m with our local T1
3.       original hcp_anatomy.m with downloaded HCM_MEG_pipeline produced T1

All three had the same apparent problem, shown on the attached images. I am quite puzzled by this since they are all the same, yet Brainstorm only imports #3 correctly (not counting #2 which is mixed).

I put all three cases in the attached Word doc, with the Brainstorm registration display and the HCP headshape registration display.

-Jeff


From: Schoffelen, J.M. (Jan Mathijs) [mailto:jan.schoffelen at donders.ru.nl]
Sent: Wednesday, March 08, 2017 8:52 AM
To: K Jeffrey Eriksen
Subject: Re: [HCP-Users] hcp_anatomy.m needs an hsfile?

Hi Jeff,

I made it all the way through hcp_anatomy_EGI.m (my version substituting ‘egi’ for ‘bti’. Amazing!

I could not figure out how to do the interactive fine registration of the EGI electrode “headshape” to the scalp surface – where is that documented?

Well it’s not extensively documented, but in the crude GUI you can fiddle around with translation and rotation parameters to move the electrode point cloud closer to the headsurface  mesh, created from the MRI segmentation.

The main remaining problem is that the BTI coordinate system has the X-axis toward the nasion, and the Y-axis toward the LPA. The EGI coordinate system has the X-axis toward the RPA and the Y-axis toward the nasion. Can you suggest the best way to change hcp_anatomy_EGI.m to reflect this?

Well, it sounds as if the EGI has an RAS convention, which may be similar to the ‘neuromag’ convention (as per http://www.fieldtriptoolbox.org/faq/how_are_the_different_head_and_mri_coordinate_systems_defined)

It could be that changing the required coordinate system (coordsys) to ‘neuromag’ while specifying the fiducials in ft_volumerealign (rather than ‘bti’) would do the trick.

Each of the supported coordinates systems must have some kind of master definition somewhere in the code, and that would be the best place to define the EGI system. I think it is similar to the BESA system.

The code that has the ‘intelligence’ to map the specification of defined fiducial/landmark locations is in https://github.com/fieldtrip/fieldtrip/blob/master/utilities/ft_headcoordinates.m
with a typo in line48/49 I noticed just now.

Feel free to suggest a new coordinate system if needed. Perhaps this is best done through the fieldtrip discussion list.

Best,
Jan-Mathijs






-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20170315/9f58df2b/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.png
Type: image/png
Size: 92989 bytes
Desc: image001.png
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20170315/9f58df2b/attachment-0002.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image002.png
Type: image/png
Size: 122781 bytes
Desc: image002.png
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20170315/9f58df2b/attachment-0003.png>


More information about the fieldtrip mailing list