Macquarie-MEG-Research / natural_conversations

Data analysis for the natural conversations study
0 stars 2 forks source link

ENH: extract ROI time series #9

Open JD-Zhu opened 5 months ago

JD-Zhu commented 5 months ago
  1. MNI305to152.py: utility to help read out anatomical labels from source localisation results.
  2. traditional_source_analysis_and_ROIs.py: run source analysis and save the STCs, then extract source timecourses from predefined ROIs.
JD-Zhu commented 4 months ago

Hi @larsoner ,

I think I'm still having some trouble with the volumetric version of the HCPMMP1 atlas. The label names load correctly when using the proper LUT file, but I still run into a problem when trying to use these labels with mne.extract_label_time_course(). Apparently the label name cannot be found in the atlas even though it shows up in the list:

Screenshot 2024-07-30 102640

Does the custom lut file need to be supplied to mne.extract_label_time_course()? I checked the documentation but couldn't find a way to do so.

Thanks in advance for any advice.

larsoner commented 3 months ago

Does the custom lut file need to be supplied to mne.extract_label_time_course()? I checked the documentation but couldn't find a way to do so.

Not exactly, this one is a bit tricky -- unpacking the extract_label_time_course docs:

Screenshot from 2024-08-01 12-30-28

It looks like you have passed a two-element tuple, the secend element being a list of str. Following the hint to look at setup_volume_source_space, you'll see this note about labels:

Screenshot from 2024-08-01 12-34-34

You are in the "use of other atlases" part, so instead of passing a list of str you need to pass a dict whose keys are the volume label names and the values are integer IDs used in the atlas. You should be able to get those integer IDs from your custom LUT. Does that make sense?

JD-Zhu commented 3 months ago

You are in the "use of other atlases" part, so instead of passing a list of str you need to pass a dict whose keys are the volume label names and the values are integer IDs used in the atlas. You should be able to get those integer IDs from your custom LUT. Does that make sense?

All works now - thank you!