Skip to content
uoy-researchPublic

About

No description, website, or topics provided.

Resources

Stars

2 stars

Watchers

0 watching

Forks

Repository files navigation

York OPM Registration Code (YORC)

A tool to perform co-registration between OPM-MEG data and MRI structural scans using a 3D scanning camera. This provides an alternative to the conventional Coil-On-Head based co-registration.

Overview

Two 3D scans must be recorded during the MEG session, one with the participant outside the MEG helmet, and one with the participant installed in the helmet with the sensors inserted. These are used in a 4-step process that ultimately registers the MEG sensor positions with the anatomy of the subjects brain in a structural MRI scan.

The overall process follows these steps:

  1. Register the 3D helmet scan with known landmarks in the device coordinate system.

  2. Define a head coordinate system using the pre-auricular points, and the nasion, on the head-outside 3D scan.

  3. Register the 3D helmet scan with the head-outside 3D scan to generate a device->head transform.

  4. Register the MRI scalp surface generated by FreeSurfer, with the head-outside 3D scan to generate a MRI->head transform

Getting started

Hardware

This project was developed using a Revopoint pop3 camera to record 3D images, and a FieldLine Inc. HEDscan MEG system to record OPM sensor positions and neurological MEG data.

In order to register the 3D scans with the HEDscan helmet, there must be a set of landmarks positions that can be identified in the 3D images, and which have known coordinates in the MEG device coordinate system.

This repository contains the file ![Landmarks.pdf}(/Landmarks.pdf) which is an image with some landmark labels that can be printed, cut out, and attached to the HEDscan helmet to ease the identification of the landmark positions in the 3D scans. The labels should be attached to small posts on the helmet, as seen in the images below:

Image of HEDscan helmet with landmark labels Image of HEDscan helmet with landmark labels Image of HEDscan helmet with landmark labels Image of HEDscan helmet with landmark labels

Acquiring 3D scans

Use a 3D camera to generate two colour-texture meshes of the participants head:

  1. Outside the MEG system to achieve better coverage for registration with MRI surface

  2. Inside the MEG system for registration with the MEG device coordinate system

In each case, start by directing the camera towards the participants right ear, and then circle the camera around the front of the participants head to the left ear, making sure to include the nose, eyebrows, and forehead.

A detailed guide to acquiring suitable 3D scans using a Revopoint pop3 camera can be found in the LIDAR Guide For Operators.

MRI data

The FreeSurfer recon-all tool can be used to segment structural MRI data, and the FreeSurfer mkheadsurf utility can then be used to generate a scalp surface, which can be converted to stl format using the mris_convert utility.

The FreeSurfer tools can be accessed here: FreeSurfer toolbox.

Installation

We recommend that you run the python script in a virtual environment to ensure that the required packages are available.

python3 -m venv /path/to/coreg_env

source /path/to/coreg_env/bin/activate

pip3 install -r ./requirements.txt

Code Usage

Please note that this tool will modify the input MEG data file to add an affine transform. We recommend that you take care to secure a seperate copy of the original file before using this tool.

source /path/to/coreg_env/bin/activate

python3 ./YORC.py -om LIDAR_head_mesh.ply -im LIDAR_helmet_mesh.ply -s Freesurfer_mriscalp.stl -m MEG_run01_raw.fif MEG_run02_raw.fif

On running the script from a terminal, instructions will be printed to the terminal prompting the user to mark the right pre-auricular, left pre-auricular and nasion on a 3D mesh of the subject.

You will then be presented with previews illustrating the registration of the two LIDAR images, and the MRI surface.

Finally, the user is presented with an illustration of the registered sensor positions on the subject MRI - note that the plotted positions are approximations of the position where the sensor casing contacts the head, not the positions of the magnetically sensitive region which lies ~6 mm further out.

Results

The script will add a device-to-head transform into input MEG data files, and generate a separate trans.fif file containing the MRI-to-head transform, in accordance with the approach used in MNE-python.

Troubleshooting

In some cases artifacts, such as extraneous material in the MRI or LIDAR data, may hinder the automated registration. In these cases, a semi-manual approach can be used.

source /path/to/coreg_env/bin/activate

python3 ./manual_YORC.py -om LIDAR_head_mesh.ply -im LIDAR_helmet_mesh.ply -s Freesurfer_mriscalp.stl -m MEG_run01_raw.fif MEG_run02_raw.fif -lm 1 2 3 4 5 6

This code allows the user to select a number of anchor points that are used for an initial crude registration. The steps are as follows:

  1. Helmet 3D scan - Mark the location of registration landmarks on the HEDscan helmet

  2. Head 3D scan - Mark the right pre-auricular, left pre-auricular and nasion.

  3. Helmet 3D scan - Mark the participant's eyes and the tip of their nose

  4. Head 3D scan - Mark the participant's eyes and the tip of their nose

  5. MRI scalp surface - Mark the eyes and nasion

  6. Helmet 3D scan - Mark the eyes and nasion

Support

For limited support, contact Richard.Aveyard@york.ac.uk

Contributing

We gladly welcome contributions to improve this project.

Authors and acknowledgment

This workflow and code is developed at York Neuroimaging Centre, at the University of York.

Richard Aveyard - University of York

Alex Wade - University of York

Joe Lyons - University of York

How to cite this material

Please cite this tool using this DOI: http://doi.org/10.5281/zenodo.20119082

License

Copyright (c) The University of York. All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
  3. Neither the name of the University nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE UNIVERSITY AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE UNIVERSITY OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

About

No description, website, or topics provided.

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages