Applying MMP ROI masks to 7T HCP CIFTI data

Does anyone know of a good solution for extracting ROIs from cifti data in python? Specifically:

I have 7T HCP functional data (fsLR 59k, surface+volume)

I have the MMP parcellation (fsLR 59k, surface) it is not released in this resolution but someone projected it for now.

Say I want to apply a mask of a few different MMP parcels to extract an ROI time series for all of the grayordinates there from my functional data (without averaging over this roi). If I get_fdata() and create an index from the MMP data to apply to the functional data it does not work because they are different lengths and do not line up.

There is probably a better less hacky way, but if anyone else runs into this:

  • I ended up using wb_command -cifti-create-dense-from-template to make a new MMP parcellation dlabel file that includes volume (as all zeros) and matches with my functional surface+volume data that I wanted to extract the ROIs from.
  • using cifti.get_fdata() on the new dlabel and the functional file returns arrays that line up and can make a mask easily.