BrainSpace icon indicating copy to clipboard operation
BrainSpace copied to clipboard

How to create a template_data to be able to use the code bellow:?

Open acamargofb opened this issue 1 year ago • 5 comments

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])

acamargofb avatar Oct 24 '23 16:10 acamargofb

You would, for example, need an NxN matrix where N=n_vertices_left + n_vertices_right

OualidBenkarim avatar Oct 24 '23 21:10 OualidBenkarim

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?

acamargofb avatar Oct 25 '23 16:10 acamargofb

That would depend on your research question. If you want to compare, you would need to create one for each group

OualidBenkarim avatar Oct 26 '23 20:10 OualidBenkarim

Should not both groups be aligned to the same template to enable comparability? Why one for each group?

Patricklv avatar Nov 10 '23 09:11 Patricklv

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?

hannahhac avatar Jan 10 '24 15:01 hannahhac