Group-level analysis for surface searchlight

49 views
Skip to first unread message

Greg Valley

unread,
Jan 11, 2024, 8:44:39 PM1/11/24
to CoSMoMVPA
I have a question about conducting a group analysis for surface searchlight data in CosmoMVPA. I think there is a problem in my pipeline but not sure where to start and would appreciate any assistance. Here is a summary of my procedure:

1. functional data is preprocessed in native functional space to yield single-trial estimates

2. anatomical data is processed with freesurfer's recon-all

3. I used the prep_afni_surf.py script w/ the anatomical that is aligned with the native functional space

4. conducted the surface-based analysis with the volume data plus cosmo_surficial_neighborhood using the outputs of prep_afni_surf.py.

5. loaded the results and combined with cosmo_stack

6. GOAL: use cosmo_cluster_neighborhood to do group analysis

I am stuck at this point, because cosmo_cluster_neighborhood expects vertices and faces. However, cosmo_surficial_neighborhood for any given subjects gives me the same vertices, but different faces.

Where did I go wrong? Should I have performed (1) in standard space, and (3) with the standard-space anatomical?

Thank you in advance!

n.n.oosterhof

unread,
Jan 14, 2024, 5:16:43 AM1/14/24
to CoSMoMVPA
Greetings,

On Friday, January 12, 2024 at 2:44:39 AM UTC+1 gregva...@gmail.com wrote:
I have a question about conducting a group analysis for surface searchlight data in CosmoMVPA. I think there is a problem in my pipeline but not sure where to start and would appreciate any assistance. Here is a summary of my procedure:

1. functional data is preprocessed in native functional space to yield single-trial estimates

2. anatomical data is processed with freesurfer's recon-all

3. I used the prep_afni_surf.py script w/ the anatomical that is aligned with the native functional space

Did you create standardized surfaces using AFNI's MapIcosahedron (the ld option in prep_afni_surf.py)? 

4. conducted the surface-based analysis with the volume data plus cosmo_surficial_neighborhood using the outputs of prep_afni_surf.py.

I assume for each participant separately, correct? The output has one value for each surface vertex?
 
5. loaded the results and combined with cosmo_stack

In the combined dataset, is .samples field of size n_participants x n_vertices?
 
6. GOAL: use cosmo_cluster_neighborhood to do group analysis

I am stuck at this point, because cosmo_cluster_neighborhood expects vertices and faces. However, cosmo_surficial_neighborhood for any given subjects gives me the same vertices, but different faces.

It is possible that the vertex coordinates differ across participants, but that the face indices (defining which vertices make triangles on the surface) are identical? Because that is what I would expect for standardized surfaces after mapicosahedron. 

Greg Valley

unread,
Jan 15, 2024, 10:57:54 AM1/15/24
to CoSMoMVPA
Thanks Nick -- see below, tldr everything seems to check out (I got vertices and faces reversed in my original characterization -- vertices differ but faces are the same across subjects). So the question is, what should I input to cosmo_cluster_neighborhood for the vertices argument under these circumstances? 

 
Did you create standardized surfaces using AFNI's MapIcosahedron (the ld option in prep_afni_surf.py)? 

That is what I understood the script to be doing -- there is no ld option in prep_afni_surf.py from surfing and it throws an error if I include it -- should I have used the PyMVPA2 version of this script, instead? I didn't realize any difference. 
 

4. conducted the surface-based analysis with the volume data plus cosmo_surficial_neighborhood using the outputs of prep_afni_surf.py.

I assume for each participant separately, correct? The output has one value for each surface vertex?

Correct, each participant separately.
 
 
5. loaded the results and combined with cosmo_stack

In the combined dataset, is .samples field of size n_participants x n_vertices?

Yes.
 
 
6. GOAL: use cosmo_cluster_neighborhood to do group analysis

I am stuck at this point, because cosmo_cluster_neighborhood expects vertices and faces. However, cosmo_surficial_neighborhood for any given subjects gives me the same vertices, but different faces.

It is possible that the vertex coordinates differ across participants, but that the face indices (defining which vertices make triangles on the surface) are identical? Because that is what I would expect for standardized surfaces after mapicosahedron. 

Yes, my apologies -- I got it reversed. Vertices differ but faces are identical. 

Given that this is what you'd expect -- what should be the input to cosmo_cluster_neighborhood, for the vertices argument? 

Thanks again,
Greg'

 

Nick Oosterhof

unread,
Jan 15, 2024, 1:12:13 PM1/15/24
to Greg Valley, CoSMoMVPA
On Jan 15, 2024, at 16:57, Greg Valley <gregva...@gmail.com> wrote:

Thanks Nick -- see below, tldr everything seems to check out (I got vertices and faces reversed in my original characterization -- vertices differ but faces are the same across subjects). So the question is, what should I input to cosmo_cluster_neighborhood for the vertices argument under these circumstances? 
[…]
 
6. GOAL: use cosmo_cluster_neighborhood to do group analysis

I am stuck at this point, because cosmo_cluster_neighborhood expects vertices and faces. However, cosmo_surficial_neighborhood for any given subjects gives me the same vertices, but different faces.

It is possible that the vertex coordinates differ across participants, but that the face indices (defining which vertices make triangles on the surface) are identical? Because that is what I would expect for standardized surfaces after mapicosahedron. 

Yes, my apologies -- I got it reversed. Vertices differ but faces are identical. 

Given that this is what you'd expect -- what should be the input to cosmo_cluster_neighborhood, for the vertices argument? 

I’m not sure if there is a template brain one could use.

If not, the simplest approach would be to use the surface from a single representative participant.
However, that may result in idiosyncratic aspects being used in the group analysis. I don’t expect this to have a major effect on the results. Yet the surface area that is used for to each node used for monte_carlo_cluster_stat which uses the area for TFCE. 

Do consider the area, one could run cosmo_surficial_neighborhood for each participant. The .neighbors should be identical across participants, but the .fa.sizes values are most likely not. Thus store the .fa.sizes vector for each participant, and then compute the average (for each vertex, or feature, separately); and store this average in .fa.sizes to use it in a surficial neighborhood for group analysis. 

A rough sketch (haven’t tried this myself):

nbrhood1 = cosmo_surficial_neighborhood(…) # participant 1
nbrhood2 = cosmo_surficial_neighborhood(…) # participant 2
nbrhood2 = cosmo_surficial_neighborhood(…) # participant 3

% make sure they all have the same topology
assert isequal(nbrhood1.neighbors, nbrhood2.neighbors)
assert isequal(nbrhood1.neighbors, nbrhood3.neighbors)

group_nbrhood = nbrhood1
group_nbrhood.fa.sizes = mean([nbrhood1.fa.sizes; nbrhood2.fa.sizes; nbrhood3.fa.sizes], 1);


Greg Valley

unread,
Jan 15, 2024, 1:35:32 PM1/15/24
to CoSMoMVPA
Great, thanks Nick -- I'll try this. To be clear, though, what modification to my pipeline would get all participants into a standard space where they would all have same vertices/faces? Or is that even possible? I'm mixed up because that's what I thought I was doing. 

Nick Oosterhof

unread,
Jan 16, 2024, 1:27:18 AM1/16/24
to Greg Valley, CoSMoMVPA

On 15 Jan 2024, at 19:35, Greg Valley <gregva...@gmail.com> wrote:

Great, thanks Nick -- I'll try this. To be clear, though, what modification to my pipeline would get all participants into a standard space where they would all have same vertices/faces? Or is that even possible? I'm mixed up because that's what I thought I was doing. 

Assuming all surfaces have the same topology (faces) though mapicosahedron, I don’t think you need to change your pipeline. 

For the surface clustering neighbourhood: for accurate areas assigned to nodes it’s important to use a non-inflated surface. The node-wise average of the pail and white surface seems best to me.


--
You received this message because you are subscribed to the Google Groups "CoSMoMVPA" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cosmomvpa+...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/cosmomvpa/72104dcc-bc7c-4f38-ac62-1314da8d6240n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages