-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Full conversion of MMPthal atlas to MNI152NLin6Asym space
- Loading branch information
Showing
15 changed files
with
29 additions
and
118 deletions.
There are no files selected for viewing
File renamed without changes.
Binary file added
BIN
+72.5 KB
atlases-devel/atlas-MMPthal/atlas-MMP_space-MNI152NLin6Asym_res-02_dseg.nii.gz
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file added
BIN
+83.2 KB
atlases-devel/atlas-MMPthal/atlas-MMPthal_space-MNI152NLin6Asym_res-02_dseg.nii.gz
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#!/usr/bin/env python | ||
# | ||
# https://www.templateflow.org/usage/client/ | ||
|
||
from templateflow import api as tflow | ||
path = tflow.get('MNI152NLin6Asym', desc=None, resolution=2, | ||
suffix='T1w', extension='nii.gz') | ||
print(path) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,53 +1,42 @@ | ||
#!/usr/bin/env bash | ||
|
||
# Start with FSL Thalamus-maxprob atlas (1mm) | ||
fslmaths /usr/local/fsl/data/atlases/Thalamus/Thalamus-maxprob-thr25-1mm.nii.gz -bin thalmask | ||
|
||
# Resample to match MMP atlas (1.5mm) | ||
#flirt \ | ||
# -in thalmask \ | ||
# -ref space-MNI152NLin2009cAsym_atlas-MMP_dseg \ | ||
# -usesqform \ | ||
# -applyxfm \ | ||
# -interp nearestneighbour \ | ||
# -out rthalmask | ||
|
||
# We have 8464 voxels in the maxprob25 thalamus mask | ||
#fslstats -K rthalmask rthalmask -m -v | ||
|
||
#./make_thalamus_voxels.py | ||
# Process atlas-MMP_space-MNI152NLin2009cAsym_res-015 to match fmriprep MNI152NLin6Asym space, | ||
# and add thalamus voxel ROIs | ||
# | ||
# See get_templateflow.py to get specific atlas image for grid reference | ||
|
||
#fslmaths \ | ||
# space-MNI152NLin2009cAsym_atlas-MMP_dseg \ | ||
# -add rthalatlas \ | ||
# space-MNI152NLin2009cAsym_atlas-MMPthal_dseg | ||
|
||
|
||
## Alternative approach to match templateflow 2mm atlas tpl-MNI152NLin2009cAsym_res-02_T1w.nii.gz | ||
## and thereby match an available fmriprep output | ||
# Get thalamus mask from FSL maxprob and resample to template grid | ||
fslmaths /usr/local/fsl/data/atlases/Thalamus/Thalamus-maxprob-thr25-1mm.nii.gz -bin thalmask | ||
flirt \ | ||
-in thalmask \ | ||
-ref tpl-MNI152NLin2009cAsym_res-02_T1w.nii.gz \ | ||
-ref tpl-MNI152NLin6Asym_res-02_T1w \ | ||
-usesqform \ | ||
-applyxfm \ | ||
-interp nearestneighbour \ | ||
-out rthalmask | ||
|
||
fslstats -K rthalmask rthalmask -m -v | ||
|
||
# Make tsv labels for the MMP atlas | ||
./make_MMP_tsv.py | ||
|
||
# Make thalamus voxel ROIs and add their labels to the list | ||
./make_thalamus_voxels.py | ||
|
||
# Resample the source MMP atlas to desired grid | ||
flirt \ | ||
-in space-MNI152NLin2009cAsym_atlas-MMP_dseg \ | ||
-ref tpl-MNI152NLin2009cAsym_res-02_T1w.nii.gz \ | ||
-in atlas-MMP_space-MNI152NLin2009cAsym_res-015 \ | ||
-ref tpl-MNI152NLin6Asym_res-02_T1w \ | ||
-usesqform \ | ||
-applyxfm \ | ||
-interp nearestneighbour \ | ||
-out space-MNI152NLin2009cAsym_res-02_atlas-MMP_dseg | ||
-out atlas-MMP_space-MNI152NLin6Asym_res-02_dseg | ||
|
||
# Add the thalamus ROIs | ||
fslmaths \ | ||
space-MNI152NLin2009cAsym_res-02_atlas-MMP_dseg \ | ||
atlas-MMP_space-MNI152NLin6Asym_res-02_dseg \ | ||
-add rthalatlas \ | ||
space-MNI152NLin2009cAsym_res-02_atlas-MMPthal_dseg | ||
atlas-MMPthal_space-MNI152NLin6Asym_res-02_dseg | ||
|
||
|
||
|
||
|
||
|
Binary file not shown.
Binary file not shown.
Binary file removed
BIN
-75.7 KB
atlases-devel/atlas-MMPthal/space-MNI152NLin2009cAsym_res-02_atlas-MMP_dseg.nii.gz
Binary file not shown.
Binary file removed
BIN
-87 KB
atlases-devel/atlas-MMPthal/space-MNI152NLin2009cAsym_res-02_atlas-MMPthal_dseg.nii.gz
Binary file not shown.
Binary file removed
BIN
-1.68 MB
atlases-devel/atlas-MMPthal/tpl-MNI152NLin2009cAsym_res-02_T1w.nii.gz
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file added
BIN
+83.2 KB
atlases/atlas-MMPthal/atlas-MMPthal_space-MNI152NLin6Asym_res-02_dseg.nii.gz
Binary file not shown.
Binary file removed
BIN
-129 KB
atlases/atlas-MMPthal/space-MNI152NLin6Asym_res-2_atlas-MMPthal_dseg.nii.gz
Binary file not shown.