Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New atlas: HCP-MMP1 subject space (FreeSurfer custom commands) #7

Open
ftadel opened this issue Jan 17, 2021 · 2 comments
Open

New atlas: HCP-MMP1 subject space (FreeSurfer custom commands) #7

ftadel opened this issue Jan 17, 2021 · 2 comments
Assignees
Labels
enhancement New feature or request

Comments

@ftadel
Copy link
Owner

ftadel commented Jan 17, 2021

No description provided.

@ftadel
Copy link
Owner Author

ftadel commented Jan 28, 2021

The HCP-MMP1 atlas is not really supposed to be used as a MNI atlas. Instead, we should use subject-space FreeSurfer surface parcellations. Source:

In IntrAnat, we haven't implemented the direct use of FreeSurfer .annot file, and we can't work directly in fsaverage space.
Therefore we need to project the .annot files (surface parcellations) to the subject space, and then interpolate these surface parcellations into the volume.

I came up with this sequence of FreeSurfer commands below, to be executed after downloading the HCP-MMP1 .annot files (https://figshare.com/articles/dataset/HCP-MMP1_0_projected_on_fsaverage/3498446?file=5528837)

export subjid=...
export subdir=$SUBJECTS_DIR/$subjid

# If the subject freesurfer segmentation is not in $SUBJECTS_DIR, create a link first
# ln -s "/home/ftadel/IntrAnat/localSubj/0001BAR - 27_11_2016/freesurfer" $subdir

# Project annot files from fsaverage to subject (left and right hemispheres separately)
mri_surf2surf --srcsubject fsaverage --trgsubject $subjid --hemi lh   --sval-annot /path/to/lh.HCP-MMP1.annot  --tval $subdir/label/lh.HCP-MMP1.annot
mri_surf2surf --srcsubject fsaverage --trgsubject $subjid --hemi rh   --sval-annot /path/to/rh.HCP-MMP1.annot  --tval $subdir/label/rh.HCP-MMP1.annot

# Convert from .annot to aseg.mgz volume (left hemi = original labels ; right hemi = 200 + original labels)
mri_surf2volseg --o $subdir/mri/HCP-MMP1+aseg.mgz --label-cortex --i $subdir/mri/aseg.mgz --threads 1 --lh-annot $subdir/label/lh.HCP-MMP1.annot 0 --lh-cortex-mask $subdir/label/lh.cortex.label --lh-white $subdir/surf/lh.white --lh-pial $subdir/surf/lh.pial --rh-annot $subdir/label/rh.HCP-MMP1.annot 200 --rh-cortex-mask $subdir/label/rh.cortex.label --rh-white $subdir/surf/rh.white --rh-pial $subdir/surf/rh.pial 

# Constrain to cortical ribbon (and remove the rest of the ASEG stuff)
mri_concat --combine --i $subdir/mri/lh.ribbon.mgz --i $subdir/mri/rh.ribbon.mgz --o $subdir/mri/ribbon_lr.mgz
mri_mask $subdir/mri/HCP-MMP1+aseg.mgz $subdir/mri/ribbon_lr.mgz $subdir/mri/HCP-MMP1.mgz

# Delete link if you created one
# rm $subdir

The idea of using mri_surf2volseg came from here:
https://www.mail-archive.com/[email protected]&q=subject:%22Re%5C%3A+%5C%5BFreesurfer%5C%5D+HCPMMP1+parcellation+to+aseg+%5C%28.mgz%5C%29%22&o=newest&f=1

@ftadel
Copy link
Owner Author

ftadel commented Jan 28, 2021

Import of the subject-level DKT and HCP-MMP1:
ca6ef82

@manikbh In order to add new these new files into the existing patients in the f-tract database, you can probably import ImageImport.py and call function importFsAtlas(). Example:

imgImport.importFsAtlas('0001BAR', 'Epilepsy', 'DKT', '/path/to/freesurfer/mri/aparc.DKTatlas+aseg.mgz')
imgImport.importFsAtlas('0001BAR', 'Epilepsy', 'HCP-MMP1', '/path/to/freesurfer/mri/HCP-MMP1.mgz')

@ftadel ftadel removed their assignment Jan 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants