rmldj / hcp-utils

Utilities to use HCP and HCP-like data with nilearn and other Python tools
MIT License
41 stars 7 forks source link

Support for HCP 7T data? #3

Open meng-du opened 4 years ago

meng-du commented 4 years ago

Hello! I was trying to use hcp-utils on some of the 7T data from HCP, which has a shape of (921, 170494). So the number of grayordinates is 170494 instead of 91282. However I noticed that in hcp-utils, struct and mesh both have hard coded indexes based on 3T HCP data (91282 grayordinates). Does this package support 7T data? If not, do you happen to know where I can find out how 7T data were subdivided?

Thank you very much!

rmldj commented 4 years ago

Hi,

hcp-utils currently unfortunately does not support 7T data. I was thinking of adding some support if there would be interest, but in any case it would take some time to do (also as it should not break the current default 3T setup).

For the moment, you can see the analogous data for the brain structures (this would make up struct for 7T data) using the following script (ran with the 7T HCP rfMRI file as the argument):

import nibabel as nib
import sys

r = nib.load(sys.argv[1])

map1=r.header.get_index_map(1)
bms=list(map1.brain_models)

for bm in bms:
    offset = bm.index_offset
    count = bm.index_count
    print('{} from {} to {} [{} grayordinates]'.format(bm.brain_structure, offset, offset + count, count))

The output is as follows:

CIFTI_STRUCTURE_CORTEX_LEFT from 0 to 54216 [54216 grayordinates]
CIFTI_STRUCTURE_CORTEX_RIGHT from 54216 to 108441 [54225 grayordinates]
CIFTI_STRUCTURE_ACCUMBENS_LEFT from 108441 to 108698 [257 grayordinates]
CIFTI_STRUCTURE_ACCUMBENS_RIGHT from 108698 to 108981 [283 grayordinates]
CIFTI_STRUCTURE_AMYGDALA_LEFT from 108981 to 109601 [620 grayordinates]
CIFTI_STRUCTURE_AMYGDALA_RIGHT from 109601 to 110255 [654 grayordinates]
CIFTI_STRUCTURE_BRAIN_STEM from 110255 to 116986 [6731 grayordinates]
CIFTI_STRUCTURE_CAUDATE_LEFT from 116986 to 118356 [1370 grayordinates]
CIFTI_STRUCTURE_CAUDATE_RIGHT from 118356 to 119787 [1431 grayordinates]
CIFTI_STRUCTURE_CEREBELLUM_LEFT from 119787 to 136892 [17105 grayordinates]
CIFTI_STRUCTURE_CEREBELLUM_RIGHT from 136892 to 154530 [17638 grayordinates]
CIFTI_STRUCTURE_DIENCEPHALON_VENTRAL_LEFT from 154530 to 155925 [1395 grayordinates]
CIFTI_STRUCTURE_DIENCEPHALON_VENTRAL_RIGHT from 155925 to 157310 [1385 grayordinates]
CIFTI_STRUCTURE_HIPPOCAMPUS_LEFT from 157310 to 158794 [1484 grayordinates]
CIFTI_STRUCTURE_HIPPOCAMPUS_RIGHT from 158794 to 160306 [1512 grayordinates]
CIFTI_STRUCTURE_PALLIDUM_LEFT from 160306 to 160889 [583 grayordinates]
CIFTI_STRUCTURE_PALLIDUM_RIGHT from 160889 to 161388 [499 grayordinates]
CIFTI_STRUCTURE_PUTAMEN_LEFT from 161388 to 163502 [2114 grayordinates]
CIFTI_STRUCTURE_PUTAMEN_RIGHT from 163502 to 165518 [2016 grayordinates]
CIFTI_STRUCTURE_THALAMUS_LEFT from 165518 to 168033 [2515 grayordinates]
CIFTI_STRUCTURE_THALAMUS_RIGHT from 168033 to 170494 [2461 grayordinates]
meng-du commented 4 years ago

Thank you so much for the script! This really helps.