Apr 19, 2024

Public workspaceSpatial Localization of 3D Scanned EEG Electrodes with MeshLab

  • 1Semel Institute for Neuroscience and Human Behavior, University of California Los Angeles;
  • 2Institute of Medical Science, University of Toronto
Open access
Protocol CitationJoel P Diaz-Fong, Jordana Glouberman, Agatha Lenartowicz 2024. Spatial Localization of 3D Scanned EEG Electrodes with MeshLab. protocols.io https://dx.doi.org/10.17504/protocols.io.261geo8zjl47/v1
License: This is an open access protocol distributed under the terms of the Creative Commons Attribution License,  which permits unrestricted use, distribution, and reproduction in any medium, provided the original author and source are credited
Protocol status: Working
We use this protocol and it's working
Created: May 08, 2020
Last Modified: April 19, 2024
Protocol Integer ID: 36806
Keywords: digitization, electrode localization, cognitive neuroscience
Funders Acknowledgement:
National Institute of Mental Health
Grant ID: R01MH116268
Disclaimer
DISCLAIMER – FOR INFORMATIONAL PURPOSES ONLY; USE AT YOUR OWN RISK

The protocol content here is for informational purposes only and does not constitute legal, medical, clinical, or safety advice, or otherwise; content added to protocols.io is not peer reviewed and may not have undergone a formal approval of any kind. Information presented in this protocol should not substitute for independent professional judgment, advice, diagnosis, or treatment. Any action you take or refrain from taking using or relying upon the information presented here is strictly at your own risk. You agree that neither the Company nor any of the authors, contributors, administrators, or anyone else associated with protocols.io, can be held responsible for your use of the information contained in or linked to this protocol or any of our Sites/Apps and Services.
Abstract
This protocol outlines step-by-step instructions for utilizing Meshlab's PickPoints tool to facilitate spatial localization of electroencephalogram (EEG) electrodes from 3D scanned head models. These include mesh models created from structured-light/infrared, photogrammetry, and LiDAR scanners, to name a few.
Image Attribution
All images were generated using the MeshLab opensource software. The example 3D mesh model used in this protocol is a scanned mannequin head wearing an EGI HydroCel Geodesic Sensor Net (Electrical Geodesics Inc., Eugene, Oregon) that was custom ordered without the four facial electrodes (total of 125 electrodes). The 3D model was scanned using the Structure Sensor (Occipital Inc., Boulder, CO), a structured-light depth camera, mounted on an iPad 6 (Apple, Cupertino, CA). Data acquisition was performed with the itSeez3D software (Itseez3D, Inc., Santa Clara, CA).
Guidelines
Follow the Manufacturer's Instructions. Please refer to the user manual provided by the manufacturer of your 3D scanning device for instructions on how to obtain good quality scans with their device. The accuracy of the coordinates obtained using the method described in this protocol relies heavily on the quality of the 3D mesh model you provide. For details about the accuracy and precision of your device, please consult your device's technical specifications.
Materials
EEG, 3D mesh model, computer, meshlab software
Before start
Download the latest version of the MeshLab software using the installer found on their website (www.meshlab.net) or download their source code directly from GitHub (https://github.com/cnr-isti-vclab/meshlab). For 3D scanning sample data, please visit: https://osf.io/87av2/
3D Scanning Setup
3D Scanning Setup
10m
Participant Preparation
There are a few necessary steps to ensure that the participant is prepared in a way that guarantees a good quality scan. This includes:
Fiducial Visibility
  • Identify Key Fiducials. Determine the anatomical landmarks (fiducials) to be used for coordinate registration (e.g., bridge of the nose, ears).
  • Ensure Unobstructed View. Instruct participants to remove any accessories or items that may obstruct the visibility of fiducials during the scan. Also, verify that the bridge of the nose and ears are clearly visible in the final 3D mesh model.
Electrode Visibility
  • Check Electrode Placement. Verify the correct placement of electrodes on the participant's scalp according to the EEG system used. Ensure that no electrodes are obstructed by hair or any other objects.
  • Tuck Away Hair. Advise participants to ensure all strands of hair are neatly tucked away from the scanner's field of view of the electrodes.
Reduce Reflective Surfaces
  • Identify Reflective Surfaces. Identify any reflective surfaces in the scanning environment that may impact electrodes visibility.
  • Apply Non-Reflective Coverings. Use non-reflective stickers or a wax marker to cover reflective surfaces, especially those in close proximity to the electrodes.
Import Mesh Model
Import Mesh Model
2m
Import the Mesh Model
After acquiring a 3D mesh model, open the MeshLab software and import the 3D mesh file.
Software
MeshLab
NAME
Visual Computing Lab - ISTI - CNR
DEVELOPER

Note
In case you do not have a 3D model, please use the dataset below for practice.
Dataset
3D Scanning Sample Data for EEG Electrode Localization
NAME


Import mesh
  • To do so, select File > Import Mesh…

Note
The MeshLab software can import several types of 3D triangular mesh files
  • .obj, .ply, .stl, .3ds, etc.

Optional: Once the file is imported into the software, remove the trackball to get a better view of the mesh model.
  • Select View > Show Trackball
  • Unselect Show Trackball to remove the trackball


Imported mesh model with overlaid trackball

Spatial Localization
Spatial Localization
35m
Open the PickPoints Tool
  • Once the model is imported into the MeshLab software, you can begin to localize the fiducial and electrode coordinates with the PickPoints tool.
  • To start, find the PickPoints icon in the toolbar or select Edit > PickPoints
PickPoints Icon
Note
PickPoints Window
When first opening the PickPoints tool, the window will initially be empty. The Point Name should correspond to the electrodes you are trying to localize.



2m
Enter Point Names or load an existing template
  • Before you start selecting points on the mesh, manually enter each electrode label as a Point Name (see 5.2 about saving templates).
  • If you have an existing template, go to Template Controls, select Load and choose the .pptpl template file.

Note
PickPoints Window with Template
An example of a loaded template. The Point Name now includes the three fiducial labels and the electrode labels for EGI's HydroCell EEG net.


3m
Begin selecting points on the mesh
  • Locate the fiducial or electrode on the mesh model and right-click the location with your cursor. A green pin should appear at that location.
  • To rotate the mesh model, unselect PickPoints and rotate/drag the model with your curser. Once you've adjusted the model to the desired position, reselect PickPoints to continue.

Green pin placed on Nasion (NAS).

After right-clicking the model, XYZ coordinate points should appear next to the Point Name, and the checkbox in the active column will be selected. The next row will automatically be highlight.

30m
Selecting the fiducials
  • As mentioned in 1.1, the fiducials (anatomical landmarks) should be determined beforehand. The fiducials should also be the same across all your scans for a given study.
  • For the example in this protocol, we select the nasion (NAS), the left helix-tragus junction (LHJ), and the right helix-tragus junction (RHJ).
2m
Selecting the electrodes
  • Select each of the electrodes, point by point, following the order of the Point Names column.
  • For a good approximation of the electrode location, try to select the point at the center of the electrode. The green pin should appear perpendicular to the scalp if the surface of the electrode is flat.
28m
Save PickedPoints
Save PickedPoints
2m
Save electrode coordinates
  • Select Save at the upper right-hand corner of the PickPoints tool.

Note
Coordinate points are saved as an XML formatted picked point (.pp) file.

Optional: save a snapshot
  • Snapshots of the mesh model with the green coordinate pins can be saved as an image file, which is useful for documenting the quality of mesh model and how the fiducials were defined for the selected coordinate points.
  • Go to File > Save snapshot
Example snapshot of the mesh model with all the selected points. The model texture (or surface detail) can be removed for anonymity.

Optional: save the template of Point Names so the electrode labels can be loaded for processing multiple participants
  • Under Template Controls, select Save. Templates are saved as a .pptpl filetype.

Extract Coordinates
Extract Coordinates
5m
Finally, the coordinates should be extracted from the PickedPoints file and converted to a preferred format.
Convert PickedPoints XML file to text
Extract coordinates from XML file and convert them to text.
Convert coordinates to a standard space
The coordinates that are extracted from the PickedPoints file are typically the same unit of measurement and coordinate space as the mesh model. Use the fiducials as a reference point to convert the coordinate space to a standard format.
Protocol references
P. Cignoni, M. Callieri, M. Corsini, M. Dellepiane, F. Ganovelli, G. Ranzuglia. Cignoni, P., Callieri, M., Corsini, M., Dellepiane, M., Ganovelli, F., & Ranzuglia, G. (2008, July). Meshlab: an open-source mesh processing tool. In Eurographics Italian chapter conference (Vol. 2008, pp. 129-136).Sixth Eurographics Italian Chapter Conference, page 129-136, 2008