Skip to content

Commit 1069580

Browse files
committed
Full conversion of MMPthal atlas to MNI152NLin6Asym space
1 parent d9711c8 commit 1069580

15 files changed

+29
-118
lines changed
Binary file not shown.

atlases-devel/atlas-MMPthal/atlas-MMPthal_dseg.tsv

-43
Original file line numberDiff line numberDiff line change
@@ -3897,46 +3897,3 @@ index label
38973897
13535 thal_13535
38983898
13536 thal_13536
38993899
13537 thal_13537
3900-
13538 thal_13538
3901-
13539 thal_13539
3902-
13540 thal_13540
3903-
13541 thal_13541
3904-
13542 thal_13542
3905-
13543 thal_13543
3906-
13544 thal_13544
3907-
13545 thal_13545
3908-
13546 thal_13546
3909-
13547 thal_13547
3910-
13548 thal_13548
3911-
13549 thal_13549
3912-
13550 thal_13550
3913-
13551 thal_13551
3914-
13552 thal_13552
3915-
13553 thal_13553
3916-
13554 thal_13554
3917-
13555 thal_13555
3918-
13556 thal_13556
3919-
13557 thal_13557
3920-
13558 thal_13558
3921-
13559 thal_13559
3922-
13560 thal_13560
3923-
13561 thal_13561
3924-
13562 thal_13562
3925-
13563 thal_13563
3926-
13564 thal_13564
3927-
13565 thal_13565
3928-
13566 thal_13566
3929-
13567 thal_13567
3930-
13568 thal_13568
3931-
13569 thal_13569
3932-
13570 thal_13570
3933-
13571 thal_13571
3934-
13572 thal_13572
3935-
13573 thal_13573
3936-
13574 thal_13574
3937-
13575 thal_13575
3938-
13576 thal_13576
3939-
13577 thal_13577
3940-
13578 thal_13578
3941-
13579 thal_13579
3942-
13580 thal_13580
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/usr/bin/env python
2+
#
3+
# https://www.templateflow.org/usage/client/
4+
5+
from templateflow import api as tflow
6+
path = tflow.get('MNI152NLin6Asym', desc=None, resolution=2,
7+
suffix='T1w', extension='nii.gz')
8+
print(path)
Original file line numberDiff line numberDiff line change
@@ -1,53 +1,42 @@
11
#!/usr/bin/env bash
22

3-
# Start with FSL Thalamus-maxprob atlas (1mm)
4-
fslmaths /usr/local/fsl/data/atlases/Thalamus/Thalamus-maxprob-thr25-1mm.nii.gz -bin thalmask
5-
6-
# Resample to match MMP atlas (1.5mm)
7-
#flirt \
8-
# -in thalmask \
9-
# -ref space-MNI152NLin2009cAsym_atlas-MMP_dseg \
10-
# -usesqform \
11-
# -applyxfm \
12-
# -interp nearestneighbour \
13-
# -out rthalmask
14-
15-
# We have 8464 voxels in the maxprob25 thalamus mask
16-
#fslstats -K rthalmask rthalmask -m -v
17-
18-
#./make_thalamus_voxels.py
3+
# Process atlas-MMP_space-MNI152NLin2009cAsym_res-015 to match fmriprep MNI152NLin6Asym space,
4+
# and add thalamus voxel ROIs
5+
#
6+
# See get_templateflow.py to get specific atlas image for grid reference
197

20-
#fslmaths \
21-
# space-MNI152NLin2009cAsym_atlas-MMP_dseg \
22-
# -add rthalatlas \
23-
# space-MNI152NLin2009cAsym_atlas-MMPthal_dseg
24-
25-
26-
## Alternative approach to match templateflow 2mm atlas tpl-MNI152NLin2009cAsym_res-02_T1w.nii.gz
27-
## and thereby match an available fmriprep output
8+
# Get thalamus mask from FSL maxprob and resample to template grid
9+
fslmaths /usr/local/fsl/data/atlases/Thalamus/Thalamus-maxprob-thr25-1mm.nii.gz -bin thalmask
2810
flirt \
2911
-in thalmask \
30-
-ref tpl-MNI152NLin2009cAsym_res-02_T1w.nii.gz \
12+
-ref tpl-MNI152NLin6Asym_res-02_T1w \
3113
-usesqform \
3214
-applyxfm \
3315
-interp nearestneighbour \
3416
-out rthalmask
3517

36-
fslstats -K rthalmask rthalmask -m -v
37-
18+
# Make tsv labels for the MMP atlas
3819
./make_MMP_tsv.py
20+
21+
# Make thalamus voxel ROIs and add their labels to the list
3922
./make_thalamus_voxels.py
4023

24+
# Resample the source MMP atlas to desired grid
4125
flirt \
42-
-in space-MNI152NLin2009cAsym_atlas-MMP_dseg \
43-
-ref tpl-MNI152NLin2009cAsym_res-02_T1w.nii.gz \
26+
-in atlas-MMP_space-MNI152NLin2009cAsym_res-015 \
27+
-ref tpl-MNI152NLin6Asym_res-02_T1w \
4428
-usesqform \
4529
-applyxfm \
4630
-interp nearestneighbour \
47-
-out space-MNI152NLin2009cAsym_res-02_atlas-MMP_dseg
31+
-out atlas-MMP_space-MNI152NLin6Asym_res-02_dseg
4832

33+
# Add the thalamus ROIs
4934
fslmaths \
50-
space-MNI152NLin2009cAsym_res-02_atlas-MMP_dseg \
35+
atlas-MMP_space-MNI152NLin6Asym_res-02_dseg \
5136
-add rthalatlas \
52-
space-MNI152NLin2009cAsym_res-02_atlas-MMPthal_dseg
37+
atlas-MMPthal_space-MNI152NLin6Asym_res-02_dseg
38+
39+
40+
41+
5342

-3.66 KB
Binary file not shown.
-726 Bytes
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

atlases/atlas-MMPthal/atlas-MMPthal_dseg.tsv

-43
Original file line numberDiff line numberDiff line change
@@ -3897,46 +3897,3 @@ index label
38973897
13535 thal_13535
38983898
13536 thal_13536
38993899
13537 thal_13537
3900-
13538 thal_13538
3901-
13539 thal_13539
3902-
13540 thal_13540
3903-
13541 thal_13541
3904-
13542 thal_13542
3905-
13543 thal_13543
3906-
13544 thal_13544
3907-
13545 thal_13545
3908-
13546 thal_13546
3909-
13547 thal_13547
3910-
13548 thal_13548
3911-
13549 thal_13549
3912-
13550 thal_13550
3913-
13551 thal_13551
3914-
13552 thal_13552
3915-
13553 thal_13553
3916-
13554 thal_13554
3917-
13555 thal_13555
3918-
13556 thal_13556
3919-
13557 thal_13557
3920-
13558 thal_13558
3921-
13559 thal_13559
3922-
13560 thal_13560
3923-
13561 thal_13561
3924-
13562 thal_13562
3925-
13563 thal_13563
3926-
13564 thal_13564
3927-
13565 thal_13565
3928-
13566 thal_13566
3929-
13567 thal_13567
3930-
13568 thal_13568
3931-
13569 thal_13569
3932-
13570 thal_13570
3933-
13571 thal_13571
3934-
13572 thal_13572
3935-
13573 thal_13573
3936-
13574 thal_13574
3937-
13575 thal_13575
3938-
13576 thal_13576
3939-
13577 thal_13577
3940-
13578 thal_13578
3941-
13579 thal_13579
3942-
13580 thal_13580
Binary file not shown.
Binary file not shown.

0 commit comments

Comments
 (0)