Sam coreg: Difference between revisions
(Created page with " Return to Source Localization - SAM ==Description== sam_coreg is an algorithm which refines the coregistration between the MEG dataset and th...") |
No edit summary |
||
Line 3: | Line 3: | ||
==Description== |
==Description== |
||
sam_coreg is an algorithm which refines the coregistration between the MEG dataset and the MRI data using a cortical atlas derived from freesurfer. |
sam_coreg is an algorithm which refines the coregistration between the MEG dataset and the MRI data using a cortical atlas derived from freesurfer. Even if the fiducial points are placed in identical locations on the face of MRI and MEG scans, one cannot correct for movement of the brain within the skull due to the difference in supine vs. seated positions. sam_coreg is designed to compensate for this, and any other error in fiducial placement, in a data driven fashion. |
||
The algorithm is based upon the relationship between the error in the LCMV beamformer moment vector error and signal power (z^2). There is a known monotonic [statistical] relationship between source resolution & z^2 has been published. The accuracy of the linear solution for the moment vector is a function of z^2. |
In a traditional unconstrained SAM analysis, the orientation of each source voxel would be determined by choosing the direction that maximizes the power. Intuitively, this algorithm utilizes the known orientations, derived from the FreeSurfer surface reconstruction, to determine the best fit with the MEG data. The algorithm is based upon the relationship between the error in the LCMV beamformer moment vector error and signal power (z^2). There is a known monotonic [statistical] relationship between source resolution & z^2 has been published. The accuracy of the linear solution for the moment vector is a function of z^2. |
||
This is a brute-force algorithm that iterates on successive translations & rotations of the MEG sensors (both primary & reference) to maximize the [inverse of the] product-moment correlation coefficent of angular error with z^2. For each vertex in the atlas, two LCMV beamformer solutions are performed - one using only the MEG data to solve the linear solution for the unconstrained moment vector and the other using the normal vector for that vertex to compute z^2. The difference between these two vectors is the "angular error". The variance of this error over the vertices) should have a monotonic relationship with z^2 if the MEG and MRI are coregistered. In this version, the negative product-moment correlation of angular error (the arc cosine of the dot product of the unconstrained & constrained moment vectors) with z^2 from the constrained solution is used. For each pass, the program selects the transform giving the maximum correlation. In order to make the algorithm complete in a reasonable amount of time, a random subset of cortical normals is sampled for each iteration. Since a different random mesh is selected for each pass, one cannot expect correlation to improve with each pass. However, the average values of translation and rotation will converge to their best values. |
This is a brute-force algorithm that iterates on successive translations & rotations of the MEG sensors (both primary & reference) to maximize the [inverse of the] product-moment correlation coefficent of angular error with z^2. For each vertex in the atlas, two LCMV beamformer solutions are performed - one using only the MEG data to solve the linear solution for the unconstrained moment vector and the other using the normal vector for that vertex to compute z^2. The difference between these two vectors is the "angular error". The variance of this error over the vertices) should have a monotonic relationship with z^2 if the MEG and MRI are coregistered. In this version, the negative product-moment correlation of angular error (the arc cosine of the dot product of the unconstrained & constrained moment vectors) with z^2 from the constrained solution is used. For each pass, the program selects the transform giving the maximum correlation. In order to make the algorithm complete in a reasonable amount of time, a random subset of cortical normals is sampled for each iteration. There are around 250,000 vertices in a FreeSurfer surface, and sam_coreg selects 2000 each pass that have angular error below a fixed cutoff and SNR above a fixed cutoff. Persons interested in determining optimal values for these parameters are welcome to contact MEG Core Facility staff. Since a different random mesh is selected for each pass, one cannot expect correlation to improve with each pass. However, the average values of translation and rotation will converge to their best values. |
||
This program assumes that a high-quality atlas of the cortex has been segmented from an MRI of each subject being studied. The pial surface is recommended. Before running sam_coreg, the initial surface vertices are generated by FSnormals.py. It us recommended that the the 17-25 Hz frequency band is used for coregistration, because the signal to noise is maximal in that band. |
This program assumes that a high-quality atlas of the cortex has been segmented from an MRI of each subject being studied. The pial surface is recommended. It is important to note that geometric distortion of the MRI should be minimal. Before running sam_coreg, the initial surface vertices are generated by FSnormals.py. It us recommended that the the 17-25 Hz frequency band is used for coregistration, because the signal to noise is maximal in that band. Finally, use of this program is only sane if your subject has not moved significantly over the course of the MEG recording. Attempting to co-localize MEG and MRI to sub-millimeter precision when the participant moved 5mm over the course of the recording is pointless. |
||
Currently, this program is rather slow (on the order of 18-24 hours per subject). Future releases will (hopefully) include parallelization. |
Currently, this program is rather slow (on the order of 18-24 hours per subject). Future releases will (hopefully) include parallelization. |
Latest revision as of 15:14, 8 March 2019
Return to Source Localization - SAM
Description
sam_coreg is an algorithm which refines the coregistration between the MEG dataset and the MRI data using a cortical atlas derived from freesurfer. Even if the fiducial points are placed in identical locations on the face of MRI and MEG scans, one cannot correct for movement of the brain within the skull due to the difference in supine vs. seated positions. sam_coreg is designed to compensate for this, and any other error in fiducial placement, in a data driven fashion.
In a traditional unconstrained SAM analysis, the orientation of each source voxel would be determined by choosing the direction that maximizes the power. Intuitively, this algorithm utilizes the known orientations, derived from the FreeSurfer surface reconstruction, to determine the best fit with the MEG data. The algorithm is based upon the relationship between the error in the LCMV beamformer moment vector error and signal power (z^2). There is a known monotonic [statistical] relationship between source resolution & z^2 has been published. The accuracy of the linear solution for the moment vector is a function of z^2.
This is a brute-force algorithm that iterates on successive translations & rotations of the MEG sensors (both primary & reference) to maximize the [inverse of the] product-moment correlation coefficent of angular error with z^2. For each vertex in the atlas, two LCMV beamformer solutions are performed - one using only the MEG data to solve the linear solution for the unconstrained moment vector and the other using the normal vector for that vertex to compute z^2. The difference between these two vectors is the "angular error". The variance of this error over the vertices) should have a monotonic relationship with z^2 if the MEG and MRI are coregistered. In this version, the negative product-moment correlation of angular error (the arc cosine of the dot product of the unconstrained & constrained moment vectors) with z^2 from the constrained solution is used. For each pass, the program selects the transform giving the maximum correlation. In order to make the algorithm complete in a reasonable amount of time, a random subset of cortical normals is sampled for each iteration. There are around 250,000 vertices in a FreeSurfer surface, and sam_coreg selects 2000 each pass that have angular error below a fixed cutoff and SNR above a fixed cutoff. Persons interested in determining optimal values for these parameters are welcome to contact MEG Core Facility staff. Since a different random mesh is selected for each pass, one cannot expect correlation to improve with each pass. However, the average values of translation and rotation will converge to their best values.
This program assumes that a high-quality atlas of the cortex has been segmented from an MRI of each subject being studied. The pial surface is recommended. It is important to note that geometric distortion of the MRI should be minimal. Before running sam_coreg, the initial surface vertices are generated by FSnormals.py. It us recommended that the the 17-25 Hz frequency band is used for coregistration, because the signal to noise is maximal in that band. Finally, use of this program is only sane if your subject has not moved significantly over the course of the MEG recording. Attempting to co-localize MEG and MRI to sub-millimeter precision when the participant moved 5mm over the course of the recording is pointless.
Currently, this program is rather slow (on the order of 18-24 hours per subject). Future releases will (hopefully) include parallelization.
Usage
sam_coreg -r <dataset_name> -m <parameter_file> [options]
The -r flag designates the dataset name (with or without the .ds suffix), and -m designates the parameter file name.
Other options:
-v Verbose mode, without this flag sam_wts works silently except for error messages -p Output angular error and Z^2 for every vertex in each pass to a .txt file -h Show help
Required Parameters:
Atlas: File containing cortical normals, generated using FSNormals.py SurfaceType: type of surface used to generate the Atlas file Model: Head model, must be Nolte MRIDirectory: Specify where to locate the necessary MRI files, including Atlas file
Optional Parameters:
MRIDirectory: Specify where to locate the necessary MRI files PrefixLength: Specify characters used for identifying MRI and headmodel files.
Output Files
The sam_coreg program produces a rigid body transform that can be applied to the MEG sensors to bring them into precise alignment with the MRI data. The transformation is written into the SAM subdirectory of the dataset so that subsequent beamformer solutions can read the transformation using the parameter keyword "Transform". The default name for this file is Transform.xfm. A Transform.txt file is also produced, which gives the correlation of angular error and Z^2 for each translation and rotation tried. Optionally, a Meshnn.txt file can be created which gives the angular error and Z^2 for each individual vertex for each pass which can be visualized as a scatterplot.