Hello,
I have been given a Yokogawa MEG dataset (older NYU recordings) to analyze, and I followed your specific tutorial as well as the forum discussions about the extra head point files and Marker1 file, I still have some questions. The data do not come from the "Third party export", what I have is:
- MEG data (.sqd)
- Marker1 files (.sqd)
- .elp points from Polhemus
- .hsp points from Polhemus
-
I have a lot of headpoints per subject, which is great, but I noticed that for almost all my subjects, a lot of headpoints are outside from the helmet. Am I correct to say that it is not something I can adjust because it comes directly from the Marker and elp/hsp files? The only thing I can do is to adjust the headsurface relative to the headpoints, right?
-
Related to the previous question, if I have a really strange relationship between headpoints and helmet, it comes from my raw files and there is no way to "recover" anything for this subject?
-
What is the information read in the Marker1 file? Could you give me the link to the related brainstorm process/function?
Thank you!
Julie
Sorry for the late response: thanks, that helped a lot!!
Indeed for my question 2., the LPA and RPA were swapped, modifying the .elp file (exchanging LPA and RPA coordinates) helped put the points back on the head surface, but I still need to modify something else to put the head surface into the helmet
it seems that the naming comes from the function you refer to (in_fopen_kit):
% === COMPUTE DIG2MEG TRANSFORMATION ===
% Compute transformation: Digitizer => MEG device
[R,T] = rot3dfit(xyzDig(:,4:end)', xyzMeg');
R = R';
T = T';
% Report in 4x4 format
header.digitize.info.digitizer2meg = [R, T; 0 0 0 1];
header.digitize.info.meg2digitizer = inv(header.digitize.info.digitizer2meg);
header.digitize.info.done = 1;
% Add the position of the digitized points to the header
nPoints = size(xyzDig,2) + size(xyzHs,2);
cellPos = num2cell([xyzDig, xyzHs]);
cellLab = cat(2, {'fidnz', 'fidt9', 'fidt10', 'LPA', 'RPA', 'CPF', 'LPF', 'RPF'}, repmat({'hs'}, 1, size(xyzHs,2)));
header.digitize.point = repmat(struct('name', '', 'x', [0 0 0], 'y', [0 0 0], 'z', [0 0 0]), [1,nPoints]);
[header.digitize.point.x] = deal(cellPos{1,:});
[header.digitize.point.y] = deal(cellPos{2,:});
[header.digitize.point.z] = deal(cellPos{3,:});
[header.digitize.point.name] = deal(cellLab{:});
But it makes me wondering what makes them different from LPA and RPA? why are these ones used to correspond to the MRI defined (blue) fiducials rather than the LPA/RPA ones?
I'm not sure I understand what you mean.
I think the MEG coils are named fid..., and then LPA etc would likely be the anatomical points. These labels seem to indicate the order in which they're expected to be digitized in this file. Sorry I don't have time right now to dig deeper into the code to fully understand.
But if you have both coils and anatomical fiducials digitized, then the latter are used to define the Brainstorm subject coordinate system (SCS) and to align with those same points picked on the MRI (prior to "refine registration with head points").
You can't directly modify the head position with respect to the helmet, that's what the head coils are for, and you have to use the "real" position. All we want to do here is make sure the MEG coils appear at their true positions with respect to the head surface. Once that's done, the position should be correct, even if it's not optimal. If it intersects with the helmet and the coils are correctly placed as best you can, then perhaps one of them actually fell off during the recording. You should be able to tell by verifying the distances between coils (from their measured positions by the MEG). Then it's more of a guessing game if you want to rescue the data.
Thanks Mark!
I think I found the problem for two of my subjects: in the marker file, either the LPA or the RPA is probably missing, so that in the function in_fopen_kit the private function getYkgwHdrCoregist sets the xyz coordinates to 0.
header.coreg = getYkgwHdrCoregist(MrkFile);
xyzMeg = cat(1, header.coreg.hpi.meg_pos)';
but I cannot open this getYkgwHdrCoregist function to further check if the Marker*.sqd file is missing these LPA/RPA coordinates or if there is some error in the getYkgwHdrCoregist function when reading the MarkerFile. I will try to place it symmetrically and I hope it will work!
Thanks!
If some anatomical fiducials were not digitized, it might be simpler to just ignore them completely, and align with the MEG head coils. In other words, whether you align with the head points or manually, you must ensure the head coils appear at the right place on the head surface, e.g. by double-checking with pictures (recommended to always take some). The location of the anatomical fiducials is not essential in comparison if you rely on the head points for the final alignment.