I am trying to obtain sample-level expression data for each of 8 components (~parcels) from a data-driven cortical decomposition performed in CIVET space. I have both a LH/RH binary mask per component, with value 0/1 for each of 41k vertices, and a whole-brain atlas version of the components comprising a LH/RH file with a label between 1-8 per vertex.
Issue:
The samples returned for each component by get_samples_in_mask() sum up to 8695 samples total, which exceeds the number of unique AHBA samples (~3500). Based on the well_id values of the output dataframes, it appears that some samples are returned for >1 mask, even though the masks are non-overlapping.
Using instead the whole-brain components atlas with get_expression_data(atlas, region_agg=None), I get an expression dataframe with a more reasonable *1678 samples, but this dataframe unusually contains some NaN values - so it seems this approach is not working exactly as expected either.
*EDIT: This previously incorrectly said 1664, which is actually the number of samples I get if I don't use neuromaps.images.relabel_gifti() when loading in my LH/RH label giftis. 1678 samples is reproducible with the code below.
Steps to reproduce:
The masks/atlas were converted from .txt to .gii format using neuromaps.images.construct_shape_gii(). The CIVET midsurfaces used to construct abagen-style atlases were converted from .obj to .gii using neuromaps.images.obj_to_gifti().
I am trying to obtain sample-level expression data for each of 8 components (~parcels) from a data-driven cortical decomposition performed in CIVET space. I have both a LH/RH binary mask per component, with value 0/1 for each of 41k vertices, and a whole-brain atlas version of the components comprising a LH/RH file with a label between 1-8 per vertex.
Issue:
The samples returned for each component by
get_samples_in_mask()
sum up to 8695 samples total, which exceeds the number of unique AHBA samples (~3500). Based on thewell_id
values of the output dataframes, it appears that some samples are returned for >1 mask, even though the masks are non-overlapping.Using instead the whole-brain components atlas with
get_expression_data(atlas, region_agg=None)
, I get an expression dataframe with a more reasonable *1678 samples, but this dataframe unusually contains someNaN
values - so it seems this approach is not working exactly as expected either.*EDIT: This previously incorrectly said 1664, which is actually the number of samples I get if I don't use
neuromaps.images.relabel_gifti()
when loading in my LH/RH label giftis. 1678 samples is reproducible with the code below.Steps to reproduce:
The masks/atlas were converted from .txt to .gii format using
neuromaps.images.construct_shape_gii()
. The CIVET midsurfaces used to constructabagen
-style atlases were converted from .obj to .gii usingneuromaps.images.obj_to_gifti()
.Data for reproducing bug: abagen_sample_bug_data.zip
Code used to obtain expression data:
Any thoughts on how to troubleshoot this would be much appreciated!