I need your assistance in resolving an issue I encountered while working with Brainstorm and FreeSurfer. Specifically, I have obtained the thickness of each dipole in Brainstorm. According to my code, the distance between the dipoles and the nearest white matter point should be equal to "thicknessPointPial," but I have noticed a discrepancy. The calculated distance is 0.0027, whereas the cortical thickness value obtained from Brainstorm is 1.77, both for the same vertex.
Here is the code where I calculate the distance for the first dipole:
%% Find nearest point of white matter to dipoles of ROI on pial surface
% Create a triangulation model for the high-resolution white matter surface
highResWhiteModel = triangulation(tess_cortex_white_high.Faces, tess_cortex_white_high.Vertices);
% Find dipoles of V1v on the left hemisphere
leftScoutVertices = scout_wangevc_70x2E900000e_00_7_lh.Scouts(2).Vertices(1,:);
v1vLeftHVertices = tess_lh_pial.Vertices(leftScoutVertices, :);
% For each row in the left hemisphere, find the corresponding indices in the pial surface
highResPialModel = triangulation(tess_cortex_pial_high.Faces, tess_cortex_pial_high.Vertices);
v1vLeftHPialVertices = nearestNeighbor(highResPialModel, v1vLeftHVertices(:, 1), v1vLeftHVertices(:, 2), v1vLeftHVertices(:, 3));
% Find the nearest point of each dipole of V1v to the white matter
nearestPointWhite = nearestNeighbor(highResWhiteModel, v1vLeftHVertices(:,1), v1vLeftHVertices(:,2), v1vLeftHVertices(:,3));
% Calculate the distance between the nearest white matter point and the dipole
distance = norm(tess_cortex_pial_high.Vertices(v1vLeftHPialVertices(1), :) - tess_cortex_white_high.Vertices(nearestPointWhite(1), :));
thicknessPointPial = Thickness.ImageGridAmp(v1vLeftHPialVertices(1), 1);
I would greatly appreciate your help in identifying the problem. Thank you!
At first glance the idea is sounding, although estimating the cortical thickness is a bit more complicated. Under that logic there will be points where the thickness will not be correct. An 2D example, consider a vertex (black dot) on the cortex surface (red), the thickness measure should be the green line, however the closest point in the white matter surface (yellow) is the purple line.
Also, I noticed this in your code: % Find dipoles of V1v on the left hemisphere leftScoutVertices = scout_wangevc_70x2E900000e_00_7_lh.Scouts(2).Vertices(1,:); v1vLeftHVertices = tess_lh_pial.Vertices(leftScoutVertices, :);
Keep in mind that although two surfaces have the same number of vertices, those vertices are not necessarily in the same order. Thus the vertices from the V1 Scout in one surface (scout_wangevc_70x2E900000e_00_7_lh) are not the necessarily the same vertices for the V1 Scout V1 in the second surface (tess_lh_pial.Vertices).
Project can be done only from none-default Atlas. Thus if the project option is not available, copy the desired Scout to a new atlas, and project it from there.
I attempted to project a scout onto another surface, but unfortunately, my efforts were unsuccessful. Here are the steps I took: I opened "lh.white" and "lh.pial" and proceeded to create a new atlas. Additionally, I included a scout from another atlas into this newly created one. However, despite these actions, I have not been able to execute the projection from "pial" to white matter yet. I would greatly appreciate your assistance in resolving this matter. Could you please provide further guidance?
Moreover, I believed that every vertex on the pial surface corresponds to a specific vertex number on the white matter surface in Freesurfer files. Could my understanding be incorrect?
The pial surface is created by expanding the white matter surface so that it closely follows the gray-CSF intensity gradient as found in the brainmask.mgz volume.
However, I'm not sure if this one-to-one correspondence holds when the surfaces are downsized (to 15k vertices).
Actually, I am doing it in the GUI.
I imported 'lh.white' and 'lh.pial' surfaces into the brainstorm by right-clicking on the subject. After opening them up, I selected my scout from one of the pial surfaces and created a new atlas on the white surface. Then, I exported a scout to MATLAB from the pial surface. Upon returning to the white surface, I imported that scout from MATLAB into the new atlas. However, despite choosing the scout from the new atlas, I encountered a problem when trying to project it onto another surface. If you are available, I could demonstrate it to you on AnyDesk. Please let me know if this is possible for you.
Additionally, I did not use the low-resolution cortex (15002). My current problem arises from the fact that my atlases are designed for both the left and right hemispheres, and I need these vertices to correspond to the entire brain, encompassing the whole cortex. In the past, I attempted to find the nearest point for each vertex on each hemisphere to the cortex, but I now realize that this approach is incorrect as well.
I imported atlases from my Freesurfer folders, but there are two parts: one for the left hemisphere (lh) and one for the right hemisphere (rh). Now, I want to locate their corresponding regions across the entire cortex actually.
Thanks for screenshot! It helped to identify the trouble.
Projection is only available between surfaces of type Cortex (). Thus it is needed to change the type:
Close all figures, right-click on the imported surfaces > Set surface type > Cortex
Select both cortex surfaces (lh.pial and rh.pial), right-click > Merge surfaces.
This should do the trick