BrainSpace
BrainSpace copied to clipboard
How to create a template_data to be able to use the code bellow:?
from brainspace.gradient import GradientMaps from brainspace.plotting import plot_hemispheres from brainspace.mesh import mesh_io as mio
Create a GradientMaps object for the template
Gt = GradientMaps(kernel='cosine', approach='dm')
Apply to template data
Gt.fit(template_data)
Create a GradientMaps object for the individuals
Gs = GradientMaps(approach='dm', kernel='cosine', alignment='procrustes')
Compute gradients for all subjects and align to template
Gs.fit([subject1_data, subject2_data], reference=Gt.gradients_)
Load surfaces
left_surface = mio.read_surface('left_surface_file.obj') right_surface = mio.read_surface('right_surface_file.obj')
Plot the first aligned gradient for subject 2
plot_hemispheres(left_surface, right_surface, Gs.aligned_[1][:, 0])
You would, for example, need an NxN matrix where N=n_vertices_left + n_vertices_right
I was thinking to create NxN matrix that would be the average of all the connectivity matrix for all my subjects. I have two groups: Group 1: NC subjects and Group 2: AD subjects. I want to use the template, but I am not sure whether create a template for NC and AD subjects (2 templates in total) or create only one template for NC and AD?
That would depend on your research question. If you want to compare, you would need to create one for each group
Should not both groups be aligned to the same template to enable comparability? Why one for each group?
I have the same question. Do groups have to be aligned to the same template for comparability or does it reduce differences, we might want to see when comparing groups?