Connectome viewing

The color of the Destrieux scouts are loaded from the FreeSurfer parcellations:
https://github.com/brainstorm-tools/brainstorm3/blob/master/toolbox/io/import_label.m#L157
If you explicitly delete this information, then it is gone...

I cannot identify the surface panel Reset object

It was not referenced. I added it (update Brainstorm to get this new pointer):
https://github.com/brainstorm-tools/brainstorm3/commit/0bd2e9968f07b0b41bc3d17b348a611c47cac78b

Dear Francois, the viewer part is almost done. One of the remaining steps is to create an 'inner skull' surface, maybe via convhull, but one that would follow the cortex only, without the cerebellum, more akin to pial_outer_smoothed surfaces generated in freesurfer with the lgi routine. Is this possible in BST, or I would need to import the lgi surface? I need this type of surface for calculating scout center positions and their labels at some cortical smoothing levels via the smoothing sliders (just for display: relying on seeds or centrality measures, while accurate, is less optimal for display when smoothing is near 0, native cortex). Thank you. Octavian

You can create inner skull surfaces with a right-click on the subject > MRI segmentation > ...

Regarding the skull surfaces generation, I've seen this article published recently (but haven't read it yet):
https://link.springer.com/article/10.1007/s12021-020-09504-5

Thank you, Francois. The viewer is close to being ready to roll, the one issue remaining is displaying the scout 'label centers' when the cortex is in nonsmoothed ('native') state. I may not need to project those centers after all. I would appreciate your input with two issues (two potential methods to tackle the issue):

  1. how do I plot the cortex convhull ON TOP OF a cortical surface displayed by figure_3d.m (using custom commands/script), I am talking about
    tess_bem.m line 97:

[sCortex, ~] = tess_envelope(CortexFile, 'convhull', BemOptions.nvert(3), 0.001);

The plot may involve the whole convhull, or only the vertices as 3d points (no faces).

  1. how do I plot (all) the VertNormals ON TOP OF the same surface, with VertNormals from:

[Vertices, ~, VertexNormals, iVisibleVert] = panel_surface('GetSurfaceVertices', TessInfo.hPatch, isStructAtlas);

surfnorm command in matlab does not seem to work in this context (what I want is normals on top of surface as in the cylinder figures here https://www.mathworks.com/help/matlab/ref/surfnorm.html#mw_0393003d-de72-457c-9e79-1841cb9acfbd
I do not want to bother you with the rationale/explanation of why I need these at this point, but appreciate your help with these specific tasks.
Thank you,

Octavian

how do I plot the cortex convhull ON TOP OF a cortical surface displayed by figure_3d.m

You can use view_surface_matrix.m to plot any custom surface in a 3D figure.
Is it what you need?

how do I plot (all) the VertNormals ON TOP OF the same surface, with VertNormals from

Examples from the code on how to plot orientation vectors on top of a surface:

  • With the line function: figure_3d.m line 4417, orient=VertNormals
  • With the quiver3 function: view_leadfield.m, line 390: Vertices=HeadmodelMat{iLF}.GridLoc, orient=dataValue

Dear Francois, the viewer is almost ready. One issue is with aseg surface scouts. Is there a way to:

  1. generate full surface files from one selected scout (from another surface)?
  2. dilate the new surface (probably via creating a surface mask 1st, prior to tess_envelope dilate step). Step 1 optional if one could dilate a surface scout (I am thinking more about closed surfaces, such as hippocampi).
    Thank you, Octavian

generate full surface files from one selected scout (from another surface)?

Is it the menu Scout > Edit surface > Keep only selected scouts you are looking for?
https://neuroimage.usc.edu/brainstorm/Tutorials/LabelFreeSurfer#Subcortical_structures:_aseg_atlas

This done in this function:
https://github.com/brainstorm-tools/brainstorm3/blob/master/toolbox/gui/panel_scout.m#L3792

dilate the new surface (probably via creating a surface mask 1st, prior to tess_envelope dilate step). Step 1 optional if one could dilate a surface scout (I am thinking more about closed surfaces, such as hippocampi).

What do you mean with "dilating"?
You want to create a new surface larger than the previous one? By moving the vertices a few millimeters away from the center of mass along the normal to the surface?
This is a very tricky problem for non-convex elements, as it may quickly cause self-intersections...

Thank you, Francois. For #2, I found another method, Octavian