This repository provides tools for coregistering optically pumped magnetometer (OPM) from QuSpin with MRI data.
The basic idea is that as the OPM sensors are placed on the scalp, we can use the scalp surface extracted from the MRI to align the sensor locations to the MRI coordinate system - in this way skipping the need for traditional fiducial-based coregistration.
To account for the offset between the OPM sensor’s sensitive volume and the scalp, the scalp surface is inflated by a fixed distance (default: 9 mm, consisting of a 6 mm sensor-casing offset and 3 mm foam padding).
- Perform an initial manual alignment using the
AlignmentViewer. See example scriptexample_scripts/align_coordinate_systems.pyfor details. - Use the keyboard controls to iteratively align the inflated scalp surface with the OPM sensor locations:
- Press
ito perform iterative closest point (ICP) matching. - Adjust the position as needed until satisfactory alignment is achieved.
- Press
- Press
sto save the resulting transformation matrix. - Plot the aligned sensors on the MRI scalp surface to verify the alignment without the inflated scalp. See example script
example_scripts/plot_aligned_sensors.pyfor details.