ASL Skill (Modality Layer)
Overview
asl-skill is the NeuroClaw modality-layer interface skill responsible for all Arterial Spin Labeling (ASL) perfusion MRI data processing tasks.
It strictly follows the NeuroClaw hierarchical design principles:
- This skill only describes WHAT needs to be done and which tool skill to delegate to.
- It contains no implementation code or concrete commands.
- All concrete execution is delegated to existing base/tool skills:
fsl-tool, nibabel-skill, and claw-shell.
- Companion scripts in
scripts/ provide reference implementations for CBF quantification.
Core workflow (never bypassed):
- Identify input ASL data and labeling strategy (pCASL, CASL, or PASL).
- Ensure T1w structural data is available (via
smri-skill if not yet processed).
- Generate a numbered execution plan clearly stating WHAT needs to be done and which tool skill will handle each step.
- Present the full plan, estimated runtime, resource requirements, and risks to the user and wait for explicit confirmation ("YES" / "execute" / "proceed").
- On confirmation, delegate every step to the appropriate skill via
claw-shell.
- After execution, save all outputs in a clean directory structure (
asl_output/).
Research use only.
Quick Reference (Common ASL Tasks)
| Task |
What needs to be done |
Delegate to which tool skill |
Expected output |
| ASL preprocessing |
Motion correction, masking, registration to T1w |
fsl-tool (ASL_PREPCORE) |
Preprocessed ASL in T1w space |
| M0 normalization |
Divide ASL difference image by M0 reference image to get perfusion signal |
fsl-tool or scripts/compute_cbf.py |
Normalized perfusion map |
| CBF quantification |
Convert perfusion signal to absolute CBF (mL/100g/min) using Buxton model |
scripts/compute_cbf.py |
CBF map (NIfTI) + ROI summary (CSV) |
| Partial volume correction |
Correct CBF for gray/white matter partial volume effects |
fsl-tool + tissue segmentation |
PVC-corrected CBF map |
| ASL-to-MNI normalization |
Warp CBF map to MNI152 template for group analysis |
fsl-tool (FNIRT) or smri-skill |
CBF in MNI152 space |
| ROI-based CBF extraction |
Extract mean CBF from atlas-defined ROIs |
fsl-tool + atlas |
Per-region CBF values (CSV) |
| Quality control |
Check for outliers, low SNR, motion artifacts in ASL series |
scripts/compute_cbf.py (--qc) |
QC report |
ASL Labeling Strategies
| Strategy |
Description |
Typical Parameters |
| pCASL (pseudo-Continuous ASL) |
Most common; single PLD, good SNR |
Label duration: 1.5–2.0 s, PLD: 1.5–2.0 s |
| CASL (Continuous ASL) |
Longer labeling, higher SNR but more sensitive to transit effects |
Label duration: 2–4 s, PLD: 1–2 s |
| PASL (Pulsed ASL) |
Short labeling, lower SNR, no separate M0 needed (QUIPSS II) |
Bolus thickness: 10–15 cm, TI1/TI2: 700/1800 ms |
Core CBF Quantification Model
The Buxton single-compartment model for pCASL:
CBF = (6000 * ΔM * λ) / (2 * α * M0 * T1b * (exp(-w/T1b) - exp(-(τ+w)/T1b))) [mL/100g/min]
Where:
- ΔM = ASL difference image (control - label)
- M0 = equilibrium magnetization of arterial blood
- λ = blood-tissue water partition coefficient (0.9 mL/g)
- α = labeling efficiency (0.85 for pCASL, 0.95 for CASL, 0.98 for PASL)
- T1b = T1 of arterial blood at 3T (
1.65 s) or 1.5T (1.35 s)
- w = post-labeling delay (PLD)
- τ = label duration
Scripts
scripts/compute_cbf.py
Computes CBF maps from ASL difference images and M0 reference.
python skills/asl-skill/scripts/compute_cbf.py \
--diff /path/to/asl_diff.nii.gz \
--m0 /path/to/m0_reference.nii.gz \
--output /path/to/asl_output/cbf_map.nii.gz \
--roi-summary /path/to/asl_output/cbf_roi.csv \
--roi-atlas /path/to/atlas_in_asl_space.nii.gz \
--label-strategy pcasl \
--pld 1.8 \
--label-duration 1.8 \
--field-strength 3.0
Standard Output Layout
asl_output/
├── preprocessed/ # Motion-corrected, registered ASL
├── cbf/ # CBF maps
│ ├── cbf_map.nii.gz
│ ├── cbf_roi.csv
│ └── cbf_mni.nii.gz # (if normalization requested)
├── pvc/ # Partial volume corrected CBF (if requested)
├── qc/ # Quality control reports
│ └── asl_qc_report.csv
└── logs/
Installation (Handled by dependency-planner)
No manual installation required at this layer.
When first used, asl-skill automatically calls dependency-planner to ensure fsl-tool, nibabel-skill, and claw-shell are ready.
Important Notes & Limitations
- ASL has inherently low SNR compared to BOLD fMRI; averaging multiple control-label pairs is recommended.
- M0 image is required for absolute CBF quantification; if absent, only relative CBF can be computed.
- PLD and labeling duration must be known from the acquisition protocol; incorrect values invalidate CBF.
- At 3T, T1b ≈ 1.65 s; at 1.5T, T1b ≈ 1.35 s.
- Partial volume correction is important for ASL due to its low resolution (~3–4 mm).
- ASLPrep (https://aslprep.readthedocs.io/) is the recommended automated pipeline for large cohorts.
- This skill is for research workflows; not for clinical decision-making.
When to Call This Skill
- After
smri-skill when T1w structural preprocessing is complete and ASL data needs processing.
- When the user needs CBF quantification from pCASL, CASL, or PASL data.
- When ASL-to-T1w coregistration or normalization to MNI space is required.
- When partial volume correction is requested for ASL perfusion analysis.
- When dataset skills (e.g., PNC) delegate ASL processing.
Complementary / Related Skills
smri-skill → T1w structural preprocessing (brain extraction, tissue segmentation for PVC)
fmri-skill → if ASL is used alongside BOLD for multimodal analysis
fsl-tool → ASL_PREPCORE (preprocessing), FLIRT/FNIRT (registration/normalization), BASIL (CBF quantification)
nibabel-skill → NIfTI I/O for mask manipulation
nilearn-tool → ROI-based CBF extraction
brain-visualization → CBF map visualization
Reference
Created At: 2026-05-06 12:19 HKT
Last Updated At: 2026-05-06 12:19 HKT
Author: chengwang96
1---2name: asl-skill3description: Use this skill whenever the user wants to process Arterial Spin Labeling (ASL) perfusion MRI data including CBF (cerebral blood flow) quantification, ASL preprocessing (motion correction, partial volume correction, M0 normalization), or ASL-based brain perfusion analysis. Triggers include: 'ASL', 'ASL processing', 'CBF', 'cerebral blood flow', 'perfusion MRI', 'arterial spin labeling', 'pCASL', 'CASL', 'PASL', or any request involving ASL perfusion data.4license: MIT License (NeuroClaw custom skill – freely modifiable within t5---6# ASL Skill (Modality Layer)
7
8## Overview
9
10`asl-skill` is the NeuroClaw **modality-layer** interface skill responsible for all Arterial Spin Labeling (ASL) perfusion MRI data processing tasks.
11
12It strictly follows the NeuroClaw hierarchical design principles:
13- This skill **only describes WHAT needs to be done** and **which tool skill to delegate to**.
14- It contains **no implementation code or concrete commands**.
15- All concrete execution is delegated to existing base/tool skills: `fsl-tool`, `nibabel-skill`, and `claw-shell`.
16- Companion scripts in `scripts/` provide reference implementations for CBF quantification.
17
18**Core workflow (never bypassed):**
191. Identify input ASL data and labeling strategy (pCASL, CASL, or PASL).
202. Ensure T1w structural data is available (via `smri-skill` if not yet processed).
213. Generate a **numbered execution plan** clearly stating WHAT needs to be done and which tool skill will handle each step.
224. Present the full plan, estimated runtime, resource requirements, and risks to the user and wait for explicit confirmation ("YES" / "execute" / "proceed").
235. On confirmation, delegate every step to the appropriate skill via `claw-shell`.
246. After execution, save all outputs in a clean directory structure (`asl_output/`).
25
26**Research use only.**
27
28---
29
30## Quick Reference (Common ASL Tasks)
31
32| Task | What needs to be done | Delegate to which tool skill | Expected output |
33|---|---|---|---|
34| ASL preprocessing | Motion correction, masking, registration to T1w | `fsl-tool` (ASL_PREPCORE) | Preprocessed ASL in T1w space |
35| M0 normalization | Divide ASL difference image by M0 reference image to get perfusion signal | `fsl-tool` or `scripts/compute_cbf.py` | Normalized perfusion map |
36| CBF quantification | Convert perfusion signal to absolute CBF (mL/100g/min) using Buxton model | `scripts/compute_cbf.py` | CBF map (NIfTI) + ROI summary (CSV) |
37| Partial volume correction | Correct CBF for gray/white matter partial volume effects | `fsl-tool` + tissue segmentation | PVC-corrected CBF map |
38| ASL-to-MNI normalization | Warp CBF map to MNI152 template for group analysis | `fsl-tool` (FNIRT) or `smri-skill` | CBF in MNI152 space |
39| ROI-based CBF extraction | Extract mean CBF from atlas-defined ROIs | `fsl-tool` + atlas | Per-region CBF values (CSV) |
40| Quality control | Check for outliers, low SNR, motion artifacts in ASL series | `scripts/compute_cbf.py` (--qc) | QC report |
41
42---
43
44## ASL Labeling Strategies
45
46| Strategy | Description | Typical Parameters |
47|---|---|---|
48| **pCASL** (pseudo-Continuous ASL) | Most common; single PLD, good SNR | Label duration: 1.5–2.0 s, PLD: 1.5–2.0 s |
49| **CASL** (Continuous ASL) | Longer labeling, higher SNR but more sensitive to transit effects | Label duration: 2–4 s, PLD: 1–2 s |
50| **PASL** (Pulsed ASL) | Short labeling, lower SNR, no separate M0 needed (QUIPSS II) | Bolus thickness: 10–15 cm, TI1/TI2: 700/1800 ms |
51
52---
53
54## Core CBF Quantification Model
55
56The Buxton single-compartment model for pCASL:
57
58```
59CBF = (6000 * ΔM * λ) / (2 * α * M0 * T1b * (exp(-w/T1b) - exp(-(τ+w)/T1b))) [mL/100g/min]
60```
61
62Where:
63- ΔM = ASL difference image (control - label)
64- M0 = equilibrium magnetization of arterial blood
65- λ = blood-tissue water partition coefficient (0.9 mL/g)
66- α = labeling efficiency (0.85 for pCASL, 0.95 for CASL, 0.98 for PASL)
67- T1b = T1 of arterial blood at 3T (~1.65 s) or 1.5T (~1.35 s)
68- w = post-labeling delay (PLD)
69- τ = label duration
70
71---
72
73## Scripts
74
75### `scripts/compute_cbf.py`
76Computes CBF maps from ASL difference images and M0 reference.
77
78```bash
79python skills/asl-skill/scripts/compute_cbf.py \
80 --diff /path/to/asl_diff.nii.gz \
81 --m0 /path/to/m0_reference.nii.gz \
82 --output /path/to/asl_output/cbf_map.nii.gz \
83 --roi-summary /path/to/asl_output/cbf_roi.csv \
84 --roi-atlas /path/to/atlas_in_asl_space.nii.gz \
85 --label-strategy pcasl \
86 --pld 1.8 \
87 --label-duration 1.8 \
88 --field-strength 3.0
89```
90
91---
92
93## Standard Output Layout
94
95```
96asl_output/
97├── preprocessed/ # Motion-corrected, registered ASL
98├── cbf/ # CBF maps
99│ ├── cbf_map.nii.gz
100│ ├── cbf_roi.csv
101│ └── cbf_mni.nii.gz # (if normalization requested)
102├── pvc/ # Partial volume corrected CBF (if requested)
103├── qc/ # Quality control reports
104│ └── asl_qc_report.csv
105└── logs/
106```
107
108---
109
110## Installation (Handled by dependency-planner)
111
112No manual installation required at this layer.
113When first used, `asl-skill` automatically calls `dependency-planner` to ensure `fsl-tool`, `nibabel-skill`, and `claw-shell` are ready.
114
115---
116
117## Important Notes & Limitations
118
119- ASL has inherently low SNR compared to BOLD fMRI; averaging multiple control-label pairs is recommended.
120- M0 image is required for absolute CBF quantification; if absent, only relative CBF can be computed.
121- PLD and labeling duration must be known from the acquisition protocol; incorrect values invalidate CBF.
122- At 3T, T1b ≈ 1.65 s; at 1.5T, T1b ≈ 1.35 s.
123- Partial volume correction is important for ASL due to its low resolution (~3–4 mm).
124- ASLPrep (https://aslprep.readthedocs.io/) is the recommended automated pipeline for large cohorts.
125- This skill is for research workflows; not for clinical decision-making.
126
127---
128
129## When to Call This Skill
130
131- After `smri-skill` when T1w structural preprocessing is complete and ASL data needs processing.
132- When the user needs CBF quantification from pCASL, CASL, or PASL data.
133- When ASL-to-T1w coregistration or normalization to MNI space is required.
134- When partial volume correction is requested for ASL perfusion analysis.
135- When dataset skills (e.g., PNC) delegate ASL processing.
136
137---
138
139## Complementary / Related Skills
140
141- `smri-skill` → T1w structural preprocessing (brain extraction, tissue segmentation for PVC)
142- `fmri-skill` → if ASL is used alongside BOLD for multimodal analysis
143- `fsl-tool` → ASL_PREPCORE (preprocessing), FLIRT/FNIRT (registration/normalization), BASIL (CBF quantification)
144- `nibabel-skill` → NIfTI I/O for mask manipulation
145- `nilearn-tool` → ROI-based CBF extraction
146- `brain-visualization` → CBF map visualization
147
148---
149
150## Reference
151- Alsop et al. (2015): Recommended implementation of ASL (Magnetic Resonance in Medicine)
152- Buxton et al. (1998): General kinetic model for ASL (Journal of Cerebral Blood Flow & Metabolism)
153- ASLPrep: https://aslprep.readthedocs.io/
154- FSL BASIL: https://fsl.fmrib.ox.ac.uk/fsl/fslwiki/BASIL
155- BIDS ASL extension: https://bids-specification.readthedocs.io/en/stable/04-modality-specific-files/11-arterial-spin-labeling.html
156
157Created At: 2026-05-06 12:19 HKT
158Last Updated At: 2026-05-06 12:19 HKT
159Author: chengwang96