Alternative ways to calculate the brain mask for ASL

Summary of what happened:

I noticed very high CBF values when exploring BASIL GM CBF. After exploration, the maps seem to be good and accurate, but the issue seems to be with the masks. When I explore the within-subject anatomical outputs, the brain masks look great (/anat/*_desc-brain_mask.nii.gz OR anat/*_space-MNI152NLin2009aSym_desc-brain_mask.nii.gz), but when exploring the perfusion outputs, the masks include non-brain tissue (/perf/*_space-T1w_desc-brain_mask.nii.gz OR /perf/*_space-MNI152NLin2009aSym_desc-brain_mask.nii.gz)

The problem is that masks that include non-brain tissue also include CBF values; even when the CBF values properly delineate brain tissue, some high CBF values still appear outside the brain.

I think the issue arises with the synthstrip implementation. Is there a way I can rerun it with alternative ways to calculate the brain mask for ASL?

Command used (and if a helper script was used, a link to the helper script or the command generated):

 cmd = (
                f'WORKDIR="$SLURM_TMPDIR/{subj}"; '
                f'mkdir -p "$WORKDIR" "{log_dir}"; '
                f'echo "Using node-local workdir: $WORKDIR"; '
                f'apptainer run --cleanenv '
                f'--env TEMPLATEFLOW_HOME=/templateflow '
                f'--bind {bids_dir}:/data:ro '
                f'--bind {output_dir}:/out '
                f'--bind {freesurfer_license_dir}:/freesurfer_license '
                f'--bind {templateflow_home}:/templateflow '
                f'--bind "$WORKDIR":/work '
                f'{singularity_image} '
                f'/data /out participant '
                f'--participant-label {subj_label} '
                f'--subject-anatomical-reference sessionwise '
                f'--skip-bids-validation '
                f'--output-spaces T1w MNI152NLin2009aSym '
                f'--fs-subjects-dir /work/freesurfer/{subj_label} '
                f'--random-seed 42 '
                f'--n_cpus 4 '
                f'--omp-nthreads 4 '
                f'--basil '
                f'--aggregate-session-reports 4 '
                f'--skull-strip-fixed-seed '
                f'--fs-license-file /freesurfer_license/license.txt '
                f'--work-dir /work '
                f'--clean-workdir '
                f'&> "{log_file}"'
            )

Version:

ASLPrep 26.1.0.dev8 (commit gca2d39e9a)

Environment (Docker, Singularity / Apptainer, custom installation):

Apptainer

Data formatted according to a validatable standard? Please provide the output of the validator:

PASTE VALIDATOR OUTPUT HERE

Relevant log outputs (up to 20 lines):

PASTE LOG OUTPUT HERE

Screenshots / relevant information:

CBF map on top of anatomical volume:

*_desc-rois_ASL.svg screenshot


Can you not apply the anatomical mask to the perfusion outputs after warping and/or resampling to the same space/resolution?

Unfortunately, there’s no good way to fine-tune with the mask generation approach within ASLPrep right now. It’s one area, along with motion correction, that I am planning to work on over the next month or so, but I have found in the past that ASL sequences are so variable that optimizing the skull-stripping settings for one variant typically makes things worse for another. It may be a good idea to add something like --synthstrip-config to let users control the synthstrip settings, but I’m not sure.

Can you go into a bit more detail about yoru ASL sequence? Are the data public? If I know more, I can try to incorporate a similar sequence into my test suite so I don’t miss it when I work on improving the masking.

This data is from the HCP-Aging dataset (multi-PLD 2D MB EPI pcASL). I remember processing some of it early in the year, and the CBF maps fit brains better (better ASL mask). Perhaps it could be possible to choose to opt in or out of the synthstrip method. I understand how hard it is to find a setting that matches every sequence. Thank you for replying!

That seems like a feature worth adding. So the old approach (pre-SynthStrip) worked best for your data? I’ll look into adding an --aslmask-method parameter or something similar.

EDIT: FWIW, I worked with some collaborators who are using an ASL protocol from the HCP Lifespan project (so the same as HCP-A) and the HCP-ASL pipeline has a number of features that are tailored to that protocol that aren’t in ASLPrep (including some that probably will never be). I just mention this in case using the HCP-ASL pipeline might be better for you.

Hi, sorry for the delay in getting back. I’ve been comparing the preprocessed outputs shared by HCP-Aging via Balsa with the values I get from ASLprep 26.0.3 since I suspected the use of the latest unstable version was impacting the values. Interestingly, I get a 2x increase in BASIL PVC GM and WM values. The values get bumped up to non-physiological ranges, but following the same patterns obtained by the HCP ASL pipeline (e.g., a bump up in the intercept for ASLprep mean values per subject). I’m not sure how much the mask is playing a role here, but beyond mask alternatives, I would suggest having more data in the logs on what is passed on to BASIL. The mean values per subject for the CBF maps (not PVC) look quite close. Although I understand there are several considerations made within the HCP-ASL pipeline for this data, I hope the details shared here help improve ASLprep.

See images below:

Upper image: PVC GM CBF from HCP ASL pipeline
lower image: BASIL PVC GM CBF from ASLprep

Upper image: CBF map from HCP ASL pipeline
lower image: CBF map from ASLprep

Here are some mean CBF values as examples from other subjects:

meanGM_CBF_preprocessed meanWM_CBF_preprocessed meanGM_CBF_aslprep meanWM_CBF_aslprep mean_cbf_preprocessed mean_cbf_ASLprep
1 not_available not_available not_available not_available not_available not_available
2 59.70713 13.42013 124.8256 27.74832 45.92542 56.46882
3 52.46825 13.83957 105.5547 26.3572 46.81718 49.83774
4 49.08373 13.62365 104.7593 24.792 41.03285 47.80724
5 38.05626 10.19777 85.87468 18.88252 40.66641 39.39466
6 26.87013 7.516137 not_available not_available 37.46984 not_available
7 60.31381 15.01103 109.1526 28.17507 50.79683 53.5037
8 79.85464 28.94184 not_available not_available 76.44991 not_available
9 56.54596 14.66352 not_available not_available 52.49093 not_available
10 38.72652 13.06732 not_available not_available 41.82057 not_available
11 41.6316 12.54604 86.32694 20.42498 38.12347 42.7492
12 48.30693 9.830005 not_available not_available 68.36763 not_available
13 15.93113 4.763614 39.32503 6.873834 27.65889 19.33994
14 28.47705 6.232411 58.66523 10.662 37.18128 28.86059
15 not_available not_available not_available not_available not_available not_available
16 57.0795 15.49507 not_available not_available 49.94629 not_available
17 59.05533 20.06087 116.1517 38.03111 43.73615 59.77094
18 66.83934 22.51852 134.2911 48.41723 49.24424 69.47704
19 59.41426 17.15362 not_available not_available 46.79675 not_available
20 70.93846 19.61734 134.6005 45.99252 48.95458 69.45022
21 75.54555 21.67275 150.1032 50.13523 53.3258 77.27033
22 55.36123 19.04379 114.613 36.83053 40.81204 59.69565
23 60.22383 18.26177 125.0503 38.02949 44.47619 63.1035
24 49.09277 15.32601 94.91631 26.70058 37.61659 48.45558
25 54.50311 17.34388 108.0194 33.49339 44.40516 54.16986
26 41.08361 13.07634 82.63515 18.76724 34.9752 39.93095
27 45.17038 13.94236 89.94451 27.52968 37.20581 44.38688
28 not_available not_available not_available not_available not_available not_available
29 41.33882 11.68801 87.16272 23.8037 36.58012 41.81266
30 43.60352 11.28313 89.38486 24.37281 38.21006 43.14122
31 39.06322 8.988371 72.06075 17.29161 44.85462 34.41427
32 52.547 14.3059 103.0467 22.5566 41.42005 51.07837
33 44.60352 11.15451 88.28558 23.43684 36.42872 43.81951
34 65.00878 15.27529 not_available not_available 54.58206 not_available
35 86.39666 21.54431 176.256 43.87768 64.56836 83.0956
36 48.49527 10.04988 100.377 16.7783 42.1835 47.09526
37 35.28036 8.824786 67.47615 11.81406 41.1794 34.23102
38 37.30129 9.792931 76.78462 15.00047 35.59026 36.72665
39 52.28942 12.41586 114.6381 21.30261 43.61203 53.91194
40 51.73375 14.63169 108.2691 23.20003 42.62908 52.9218

I have added --skull-strip-asl <legacy|synthstrip|anatomical> to give users more control over the brain masking procedure. Also, ASLPrep’s precomputed derivative collection should now grab the brain mask when it is provided through an ASLPrep-like derivative dataset.

Can you try using the current unstable release? I doubt it’ll make a massive difference, but I have made a number of minor changes that might improve your BASIL outputs, including the tissue probability maps that are used for PVC.

Hi, thank you! I will test the unstable version this weekend. For --skull-strip-asl Could you clarify what the difference is between legacy and anatomical? For example, would Anatomical take the T1w mask produced by the FreeSurfer preprocessing?

Oh nevermind, I see the documentation was updated. I’ll come back with results as soon as possible. Thank you

Hi, I found that the --skull-strip-asl flag was beneficial. Unfortunately, the PVC outcomes still show high CBF values. I’ll dig into the ASLprep code to understand how the PVC is done, particularly what is passed to BASIL; if you have any resources, let me know. Below are some pictures illustrating the mask effects and CBF values (0 to 200 ml/100g/min, where 200 is deep red, and 200 is non-physiological), images of GM CBF maps from the same subject, in their native space, for all comparisons. The upper images are CBF maps preprocessed by the HCP-ASL pipeline; the lower images are ASLprep outputs, different versions.