Hi,
How can I align this parcellation (Schaefer-Yeo, from this thread) to errts file in original space?
Thanks,
Maya
Hi,
How can I align this parcellation (Schaefer-Yeo, from this thread) to errts file in original space?
Thanks,
Maya
Hi, Maya-
I'll assume this refers to volumetric alignment (the S-Y atlas is defined on surface meshes as well, which transfer to subject space meshes directly if using SUMA-standardized ones).
This process will likely involve running nonlinear alignment between each subject's anatomical volume and the template on which the Schaefer-Yeo atlas is defined.
I will assume here that the first is the case (going to subject anatomical space). Let me know if that is not the case. The steps then are:
sswarper2
(or the older @SSwarper
) already to skullstrip the anatomical, then you have this warp already in hand.sswarper2
to estimate the warp. You can use the skullstripping that you already have directly within the program now, if you have it.NB: I'll assume you are using the S-Y atlas that we have refined (downloadable from here, and described here), which sit on MNI-2009c space, and so MNI152_2009_template_SSW.nii.gz is an appropriate template space dataset.
1. The sswarper2 command
Cases:
if you have both a with-skull anatomical and a masked version or a mask that you trust deeply, so that you don't want it refined, then in AFNI version=25.0.12 and higher, you can run this:
sswarper2 \
-input DSET_ANAT_W_SKULL \
-mask_apply DSET_MASK \
-base MNI152_2009_template_SSW.nii.gz \
-subid ${subj} \
-odir o.ssw2_${subj}
... where DSET_MASK is either literally a binary mask dset or just the well-skullstripped dset (which will be binarized early on in the processing).
if you have both a with-skull anatomical and a masked version or a mask that you only sorta trust but would like refined further, you can run this (note the use of "-mask_ss" instead of "-mask_apply, which was used above):
sswarper2 \
-input DSET_ANAT_W_SKULL \
-mask_ss DSET_MASK \
-base MNI152_2009_template_SSW.nii.gz \
-subid ${subj} \
-odir o.ssw2_${subj}
... where DSET_MASK is either literally a binary mask dset or just the well-skullstripped dset (which will be binarized early on in the processing).
if you have onlywith-skull anatomical, run this:
sswarper2 \
-input DSET_ANAT_W_SKULL \
-base MNI152_2009_template_SSW.nii.gz \
-subid ${subj} \
-odir o.ssw2_${subj}
Check your sswarper2
results for happiness with the alignment. If happy, proceed and if not happy... let's troubleshoot that.
2. and 3.: Invert warps and apply
We can do these steps in one fell swoop. Here, I'll call the output sswarper2 directory ${odir}
, assuming it contains the affine part of the transform (anatQQ.*.aff12.1D
) and the nonlinear part (anatQQ.*_WARP.nii*
).
# create the inverse transform from sswarper2 and apply it to atlas in template space
3dNwarpApply \
-nwarp "INV($odir/anatQQ.${subj}.aff12.1D) \
INV(${odir}/anatQQ.${subj}_WARP.nii)" \
-ainterp NN \
-master "${errts_dset}" \
-source "${dset_schaefer_yeo_refined}" \
-prefix DSET_OUT
Check that things look good visually, and that the DSET_OUT is on the errts grid with:
3dinfo -same_all_grid "${errts_dset}" DSET_OUT
... which should show five 1s, verifying the five properties being checked to determine "same-grid-ness".
And a bonus step: reattach labels and colormap-choice from the original atlas dset to the new one:
3drefit -copytables "${dset_schaefer_yeo_refined}" DSET_OUT
3drefit -cmap INT_CMAP DSET_OUT
Then you could use 3dNetCorr, etc.
--pt
The National Institute of Mental Health (NIMH) is part of the National Institutes of Health (NIH), a component of the U.S. Department of Health and Human Services.
Freedom of Information Act |
HHS Vulnerability Disclosure
National Institute of Mental
Health | National Institutes of Health | U.S.
Department of Health and Human Services |