ds006072 dataset cifti parcelation issue

54 views
Skip to first unread message

Giannis Fotis

unread,
Nov 2, 2025, 7:54:55 PM (4 days ago) Nov 2
to HCP-Users
Hi everyone,

I am working on this dataset for my master's thesis, and I am trying to apply a parcelation on the cifti files in the NON_BIDS/ciftis/ folder using the hcp library in python. 

For some reason, it seems that all the parcelation maps have 91282 grayordinates, while the ciftis in my dataset have 91206 . Here's the exact error I'm getting:
IndexError: boolean index did not match indexed array along dimension 1; dimension is 91206 but corresponding boolean dimension is 91282

I havent managed to figure this out for a couple of days now... Can anyone help? Thanks!

Giannis

Tim Coalson

unread,
Nov 3, 2025, 7:20:15 PM (3 days ago) Nov 3
to hcp-...@humanconnectome.org
You can run wb_command -file-information -no-map-info on your cifti files and see how many indices are being used in each structure.  The standard 91k grayordinate space is 91282, and looks like this:

$ wb_command -file-information -no-map-info global/templates/91282_Greyordinates/91282_Greyordinates.dscalar.nii
<SNIP>
Number of Rows:                 91282
Number of Columns:              1
Volume Dim[0]:                  91
Volume Dim[1]:                  109
Volume Dim[2]:                  91
Palette Type:                   Map (Unique for each map)
CIFTI Dim[0]:                   1
CIFTI Dim[1]:                   91282
ALONG_ROW map type:             SCALARS
ALONG_COLUMN map type:          BRAIN_MODELS
    Has Volume Data:            true
    Volume Dims:                91,109,91
    Volume Space:               -2,0,0,90;0,2,0,-126;0,0,2,-72
    CortexLeft:                 29696 out of 32492 vertices
    CortexRight:                29716 out of 32492 vertices
    AccumbensLeft:              135 voxels
    AccumbensRight:             140 voxels
    AmygdalaLeft:               315 voxels
    AmygdalaRight:              332 voxels
    BrainStem:                  3472 voxels
    CaudateLeft:                728 voxels
    CaudateRight:               755 voxels
    CerebellumLeft:             8709 voxels
    CerebellumRight:            9144 voxels
    DiencephalonVentralLeft:    706 voxels
    DiencephalonVentralRight:   712 voxels
    HippocampusLeft:            764 voxels
    HippocampusRight:           795 voxels
    PallidumLeft:               297 voxels
    PallidumRight:              260 voxels
    PutamenLeft:                1060 voxels
    PutamenRight:               1010 voxels
    ThalamusLeft:               1288 voxels
    ThalamusRight:              1248 voxels

I have never seen 91206 before, but maybe someone intersected the medial wall ROIs?  nibabel should expose the information of exactly what vertices/voxels are used in the embedded XML extension, but I'm not familiar with its API.  There is also wb_command -cifti-export-dense-mapping if you want to inspect it via text files.

Tim


--
You received this message because you are subscribed to the Google Groups "HCP-Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hcp-users+...@humanconnectome.org.
To view this discussion visit https://groups.google.com/a/humanconnectome.org/d/msgid/hcp-users/de975df4-0ae5-4663-a136-6d37d884192cn%40humanconnectome.org.

Giannis Fotis

unread,
Nov 4, 2025, 3:37:29 AM (2 days ago) Nov 4
to HCP-Users, tim.c...@gmail.com
Dear Tim,

Thank you for the tip! Here's what I get when I run this command on my time series data:

Type:                           CIFTI - Dense Data Series
Structure:                      CortexLeft CortexRight
Metadata Start:                 -----------

[...]

Data Size:                      543.59 Megabytes
Maps to Surface:                true
Maps to Volume:                 true
Maps with LabelTable:           false
Maps with Palette:              true
All Map Palettes Equal:         true
Map Interval Units:             NIFTI_UNITS_SEC
Map Interval Start:             0.000
Map Interval Step:              1.761
Number of Rows:                 91206
Number of Columns:              1490

Volume Dim[0]:                  91
Volume Dim[1]:                  109
Volume Dim[2]:                  91
Palette Type:                   File (One for all maps)
CIFTI Dim[0]:                   1490
CIFTI Dim[1]:                   91206
ALONG_ROW map type:             SERIES
    Start:                      0.000
    Step:                       1.761
    Units:                      Seconds

ALONG_COLUMN map type:          BRAIN_MODELS
    Has Volume Data:            true
    Volume Dims:                91,109,91
    Volume Space:               2,0,0,-90;0,2,0,-126;0,0,2,-72

    CortexLeft:                 29696 out of 32492 vertices
    CortexRight:                29716 out of 32492 vertices
    AccumbensLeft:              84 voxels
    AccumbensRight:             111 voxels
    AmygdalaLeft:               256 voxels
    AmygdalaRight:              291 voxels
    BrainStem:                  3581 voxels
    CaudateLeft:                621 voxels
    CaudateRight:               618 voxels
    CerebellumLeft:             9316 voxels
    CerebellumRight:            9260 voxels
    DiencephalonVentralLeft:    734 voxels
    DiencephalonVentralRight:   724 voxels
    HippocampusLeft:            705 voxels
    HippocampusRight:           688 voxels
    PallidumLeft:               335 voxels
    PallidumRight:              332 voxels
    PutamenLeft:                772 voxels
    PutamenRight:               805 voxels
    ThalamusLeft:               1312 voxels
    ThalamusRight:              1249 voxels

Someone suggested to me that I "use wb_command -cifti-create-dense-from-template 1 to resample one to the other".  Does that sound right to you? And should I resample me time series data or the parcelation maps? Many thanks!

Best,
Giannis

Glasser, Matthew

unread,
Nov 4, 2025, 6:59:38 AM (2 days ago) Nov 4
to hcp-...@humanconnectome.org, tim.c...@gmail.com

Your subcortical voxels do not match ours.  How was this file generated?

    ThalamusRight:              1248 voxels

Matt.

 


The materials in this message are private and may contain Protected Healthcare Information or other information of a sensitive nature. If you are not the intended recipient, be advised that any unauthorized use, disclosure, copying or the taking of any action in reliance on the contents of this information is strictly prohibited. If you have received this email in error, please immediately notify the sender via telephone or return mail.

Giannis Fotis

unread,
Nov 4, 2025, 11:50:33 AM (2 days ago) Nov 4
to HCP-Users, glas...@wustl.edu, tim.c...@gmail.com
Dear Matt,

These files are the already preprocessed fMRI recordings in this openneuro.org dataset, found in the NON_BIDS/ciftis/ folder. They are were published together with the paper: 
Siegel, J.S., Subramanian, S., Perry, D. et al. Psilocybin desynchronizes the human brain. Nature 632, 131–138 (2024). https://doi.org/10.1038/s41586-024-07624-5 

This is pretty much the first time I work on fMRI data, so I probably can't say much more that would be accurate, and thats why I'm refering you to the source material... I hope this is useful. If there is anything specific I can search for you I'd be more than glad to. Thank you for your time.

Best,
Giannis

Tim Coalson

unread,
Nov 4, 2025, 5:49:40 PM (2 days ago) Nov 4
to Giannis Fotis, HCP-Users
Given that you have more brainstem and cerebellum voxels, and fewer voxels in many other cortical structures, I wonder whether the subcortical data in your file is actually in MNI space or not.  If it isn't, you will need to use a transform in -cifti-resample in order to preserve as much of the data as possible (-cifti-resample doesn't allow data to cross between subcortical structures, so if they aren't aligned, it will clip off data).

-cifti-create-dense-from-template would be reasonable when the subcortical definitions agree.  Here they don't, so -cifti-resample is the better choice (particularly because of its -volume-predilate option).  I also notice that your voxel data uses LPI order (the X spacing is positive), while the standard 91k grayordinates use RPI order (negative X spacing), so -cifti-create-dense-from-template would reject the file anyway.

Tim

Reply all
Reply to author
Forward
0 new messages