Dear BST experts,
I need to warp the default anatomy for some subjects without anatomical MRI by using the digitized points. However, in some cases the warped anatomy looks distorted.
-
One problem is probably badly digitized points:
This problem was raised in earlier threads, and I wonder if there is now a visually guided way to remove bad head points (or some plans to implement it).
-
In other cases, the cause is not evident to me (no outlier head point is evident), but the result is clearly bad:
Any suggestion?
Thanks,
Marco
with readable figures now.
Hi Francois,
I think I was not clear enough.
You need to edit the initial coregistration MEG-MRI:
This is what I did. The first figure comes from:
Right-click on the channel file > MRI registration > Edit.
However, there are no transformations that compensate the asymmetry generated by that row of head points that swirls out of the head surface on the right: these points were just not properly digitized. Ideally I would like to remove them by clicking on them, re-edit properly and warp. My question is: is there an alternative, easier way to remove them than going to fish them in the head points file?
Thanks,
Marco
No, there is currently no way to select and remove specific points.
Just edit the initial MEG/MRI registration manually instead of trying to use the automatic registration.
Ok thanks Francois.
One possibly simple change that could drastically improve warping would be to mark the head points rejected (with the percentage) in warping with a different color. This way I would know if the ones I visually identify as outliers are captured as such.
If you point me to the correct function (and line? ), I might try to do that.
Thanks!
Marco
Hi Marco,
I suspect this would not be very easy to do…
The exclusion of the outliers is done here: https://github.com/brainstorm-tools/brainstorm3/blob/master/toolbox/anatomy/bst_warp_prepare.m#L185
The plotting of the head points is done here: https://github.com/brainstorm-tools/brainstorm3/blob/master/toolbox/gui/figure_3d.m#L3382
There is really no link between the two. One is called from a process, the other is part of the interactive interface…
Francois
Thanks Francois, I’ll try and if I come up with something useful I’ll let you know.
Best,
Marco
Hi Francois,
sorry for bothering you again on this, but I am not sure that the outliers marked as such by the warping functions are the good ones.
Thanks to your indications, I tried to plot the outliers by:
- Removing the semicolon in
brainstorm3/toolbox/anatomy/bst_warp_prepare.m at master · brainstorm-tools/brainstorm3 · GitHub
- copying the outlier indexes in the variable iRemove that I set in
brainstorm3/toolbox/gui/figure_3d.m at master · brainstorm-tools/brainstorm3 · GitHub and adding another line command for the outliers:
% Highlight outliers in blue
iRemove = [2 3 1 8 326 304 4 517 89 518 118];
line(digLoc(iRemove,1), digLoc(iRemove,2), digLoc(iRemove,3), ...
'Parent', hAxes, ...
'LineWidth', 2, ...
'LineStyle', 'none', ...
'MarkerFaceColor', [0 0 1], ...
'MarkerEdgeColor', [.4 .7 .4], ...
'MarkerSize', 6, ...
'Marker', 'o', ...
'UserData', iExtra, ...
'Tag', 'HeadPointsMarkers');:
Figures below show the digitized points, the outliers marked in blue. Instead of marking the swirl of outliers that look evident to me on the right of the first figure, outliers lay on the inner right frontal part (second figure).
Am I doing something wrong? Thanks for your help.
Marco
I checked the code and couldn’t find any obvious index issues. I tried what you did on some data and the points that are removed (and displayed in blue) make sense.
On your screen captures, it’s difficult to see if these points make sense, there are supposed to be the furthest away from the scalp surface.
Thanks for checking so fast. In order for me to understand my bizarre head points, please tell me if the following is correct:
- First I manually edit the initial MEG/MRI registration and move my head points half-head on the right of the scalp
- Then I check the outliers as I did above. In this case, they should be on the rightest part of the head point set, is it correct?
Thanks,
Marco
Indeed, this is exactly what I did for testing the code (except that I moved the head points to the front instead of the right, but it doesn’t change anything).
Ok, I tested the outliers by moving the headpoints in different directions. When moving to the front, outliers are both in frontal and occipital head points, which makes sense. When moving to the right, outliers are more sparse, but now I understand that this is because the lateral borders of the scalp are less intuitively defined than the frontal-occipital ones.
In sum:
- warping works totally fine
- trying to visually infer the head points identified as outliers by the warping trasformation is misleading.
An easy workaround for these cases might be to plot the number of the head points when editing the MRI registration to manually remove the head points by modifying figure_3d script. Just a suggestion for anyone interested.
Thanks Francois.
Marco