This script lets you easily extract a specific volumetric, binary mask file from the HCP-MMP1.0 parcellation atlas.
- Download all files.
- Unzip HCP_atlas.zip.
- Check that both the atlas files (.nii) and the mmp.csv file are in the same folder.
This is a simple script that takes the volumetric map of the Human Connectome Project MMP1.0 parcellation (included here), extracts a desired ROI, and saves it as a binary mask file. The volumetric map is in MNI space, and so will be the resulting mask files.
- Go to the ROI lookup table (mmp.csv). Find the ROI you are interested in, and write down the ROI code (num.roi column). You can run multiple ROIs or just one.
- call the create_HCP_mask() function.
- the roicode/s you looked up
- the folder where you put the atlas files
- an output folder
- operation: If you picked multiple rois you can either save all separately ('single'), or combine them into a single large ROI ('sum').
- laterality: You can select whether you want to extract left ('l'), right ('r'), or bilateral ('b') ROIs.
- dilation: Select whether you want to dilate the resulting ROI masks. The script will expand the ROI by n voxels in each direction, where n is the number you enter here. Default: n = 0 (no dilation).
Example: create_HCP_mask([1:3], '/MyAtlasFolder/', '/MyOutputFolder/', 'single', 'b', 2)
The atlas and lookup table files used here are not mine, all credits to the creators:
- volumetric HCP-MMN1.0 map: https://figshare.com/articles/dataset/HCP-MMP1_0_projected_on_MNI2009a_GM_volumetric_in_NIfTI_format/3501911
- ROI lookup table: https://github.com/mcfreund/stroop-rsa/blob/master/out/atlases/mmp.csv
- downloaded all files and unzip the HCP_atlas.zip file
- Matlab + SPM12 installed
If you find bugs in this script or have suggestions for improvement, please report both here https://github.com/davidwisniewski/fmri-extract-HCP-mask/issues