MS Challenge Skill (Dataset-Orchestration Layer)
Overview
mschallenge-skill is the NeuroClaw orchestration skill for the Longitudinal MS Lesion Segmentation Challenge dataset.
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 via
claw-shell.
- Companion scripts in
scripts/ provide reference implementations for data validation, lesion analysis, and QC.
Core workflow (never bypassed):
- Identify input MS Challenge data and target modalities.
- 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 (
mschallenge_output/).
Research use only.
Quick Reference
| Task |
What needs to be done |
Delegate to |
Expected output |
| Data validation |
Validate MS Challenge directory structure |
scripts/validate_mschallenge.py |
Validation report |
| sMRI processing |
Brain extraction, tissue segmentation |
smri-skill |
smri_output/ derivatives |
| Lesion analysis |
Lesion volume, count, location analysis |
scripts/analyze_lesions.py |
Lesion statistics CSV |
| Longitudinal analysis |
Lesion change tracking across timepoints |
scripts/longitudinal_lesion.py |
Longitudinal change report |
| QC summary |
Per-subject quality control |
scripts/mschallenge_qc_summary.py |
QC summary + exclusion list |
Dataset Characteristics
- Origin: ISBI 2015 Longitudinal MS Lesion Segmentation Challenge
- Training: 5 subjects, each with 2 timepoints (longitudinal)
- Testing: 14 subjects (hidden ground truth), 4-6 timepoints each
- Modalities: T1w, T2w, FLAIR, PD (co-registered)
- Ground truth: Manual lesion segmentation masks (training only)
- Resolution: ~0.5 × 0.5 × 0.5 mm (isotropic)
- Preprocessing: Skull-stripped, co-registered to common space
- Reference: Carass et al. (2017), NeuroImage
Supported Modalities
| Modality |
Description |
Use in MS |
| T1w |
T1-weighted structural |
Brain atrophy, gray matter lesions |
| T2w |
T2-weighted |
White matter lesion detection |
| FLAIR |
Fluid-Attenuated Inversion Recovery |
Periventricular lesion detection |
| PD |
Proton Density |
Complementary lesion contrast |
Directory Structure (Native)
training/
├── subject01/
│ ├── time01/
│ │ ├── subject01_time01_T1.nii.gz
│ │ ├── subject01_time01_T2.nii.gz
│ │ ├── subject01_time01_FLAIR.nii.gz
│ │ ├── subject01_time01_PD.nii.gz
│ │ └── subject01_time01_lesion.nii.gz (ground truth)
│ └── time02/
│ └── ...
BIDS Preparation
Script: scripts/validate_mschallenge.py
Validates MS Challenge directory structure and generates a compliance report.
python skills/mschallenge-skill/scripts/validate_mschallenge.py \
--input /path/to/MSChallenge/training \
--output /path/to/mschallenge_output/qc/validation.csv
Features:
- Directory structure validation
- Modality completeness check (T1w, T2w, FLAIR, PD)
- Ground truth mask presence verification
- Longitudinal timepoint consistency
- Missing data identification
Core Workflow (Never Bypassed)
- Identify user target: full MS Challenge processing, lesion analysis, or validation only.
- Generate a numbered plan with tools, outputs, runtime, storage, and risks.
- Wait for explicit confirmation (
YES / execute / proceed).
- On confirmation, run data validation using
scripts/validate_mschallenge.py.
- Delegate to
smri-skill for structural MRI processing.
- If lesion analysis is requested, run
scripts/analyze_lesions.py.
- If longitudinal analysis is requested, run
scripts/longitudinal_lesion.py.
- If QC summary is requested, run
scripts/mschallenge_qc_summary.py.
- Save outputs into
mschallenge_output/.
Modality Processing Delegation
| Modality |
Delegated skill |
Typical tasks |
Main outputs |
| sMRI (T1w/T2w/FLAIR/PD) |
smri-skill |
brain extraction, tissue segmentation |
smri_output/ derivatives |
| Lesion masks |
nibabel-skill |
lesion volume, count, location |
Lesion statistics |
Standard Output Layout
mschallenge_output/
├── raw/ # Original MS Challenge files
├── validation/ # Validation reports
├── smri/ # Structural MRI derivatives
├── lesions/ # Lesion analysis results
│ ├── lesion_stats.csv
│ └── longitudinal_change.csv
├── qc/ # QC summaries and exclusion lists
└── logs/ # Processing logs
Benchmark Adapter Guidance
For benchmark-style prompts, do not force the full orchestration when the task only asks for local MS Challenge data validation.
- If the task starts from MS Challenge data already present on disk and only asks for validation:
- Skip the download stage
- Default to the narrow path
local MS Challenge discovery -> validation -> report
- In benchmark mode, do not require explicit confirmation before presenting the validation solution.
Safety and Execution Policy
- No execution before explicit plan confirmation.
- All execution must be routed via
claw-shell.
- Missing dependencies must be resolved by
dependency-planner before running.
Important Notes and Limitations
- MS Challenge is a longitudinal dataset; consider timepoint effects in analysis.
- Ground truth masks are only available for training subjects.
- All images are preprocessed (skull-stripped, co-registered).
- Lesion segmentation is the primary task; standard brain morphometry may be affected by lesions.
- The challenge is designed for benchmarking; results should be compared with published baselines.
mschallenge-skill is orchestration-only; detailed preprocessing logic remains in modality skills.
When to Call This Skill
- User asks for end-to-end MS Lesion Challenge workflow.
- User asks to validate MS Challenge data structure.
- User asks for lesion volume and count analysis.
- User asks for longitudinal lesion change tracking.
- User asks for MS lesion segmentation benchmarking.
Complementary / Related Skills
smri-skill → structural MRI preprocessing
nibabel-skill → NIfTI I/O and mask manipulation
brain-visualization → lesion overlay visualization
dependency-planner → dependency resolution
conda-env-manager → environment management
claw-shell → command execution
Reference
Created At: 2026-05-06 13:31 HKT
Last Updated At: 2026-05-06 13:31 HKT
Author: chengwang96
1---2name: mschallenge-skill3description: Use this skill whenever the user wants an end-to-end workflow for the Longitudinal MS Lesion Segmentation Challenge dataset, including data validation, multimodal processing of T1w, T2w, FLAIR, and PD, lesion segmentation, and QC integration. Triggers include: 'MS Lesion Challenge', 'MS Lesion', 'ISBI MS', 'longitudinal MS', 'multiple sclerosis lesion', or any request to run the MS lesion segmentation pipeline.4license: MIT License (NeuroClaw custom skill - freely modifiable within t5---6# MS Challenge Skill (Dataset-Orchestration Layer)
7
8## Overview
9
10`mschallenge-skill` is the NeuroClaw orchestration skill for the **Longitudinal MS Lesion Segmentation Challenge** dataset.
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 via `claw-shell`.
16- Companion scripts in `scripts/` provide reference implementations for data validation, lesion analysis, and QC.
17
18**Core workflow (never bypassed):**
191. Identify input MS Challenge data and target modalities.
202. Generate a **numbered execution plan** clearly stating WHAT needs to be done and which tool skill will handle each step.
213. Present the full plan, estimated runtime, resource requirements, and risks to the user and wait for explicit confirmation ("YES" / "execute" / "proceed").
224. On confirmation, delegate every step to the appropriate skill via `claw-shell`.
235. After execution, save all outputs in a clean directory structure (`mschallenge_output/`).
24
25**Research use only.**
26
27---
28
29## Quick Reference
30
31| Task | What needs to be done | Delegate to | Expected output |
32|---|---|---|---|
33| Data validation | Validate MS Challenge directory structure | `scripts/validate_mschallenge.py` | Validation report |
34| sMRI processing | Brain extraction, tissue segmentation | `smri-skill` | `smri_output/` derivatives |
35| Lesion analysis | Lesion volume, count, location analysis | `scripts/analyze_lesions.py` | Lesion statistics CSV |
36| Longitudinal analysis | Lesion change tracking across timepoints | `scripts/longitudinal_lesion.py` | Longitudinal change report |
37| QC summary | Per-subject quality control | `scripts/mschallenge_qc_summary.py` | QC summary + exclusion list |
38
39---
40
41## Dataset Characteristics
42
43- **Origin**: ISBI 2015 Longitudinal MS Lesion Segmentation Challenge
44- **Training**: 5 subjects, each with 2 timepoints (longitudinal)
45- **Testing**: 14 subjects (hidden ground truth), 4-6 timepoints each
46- **Modalities**: T1w, T2w, FLAIR, PD (co-registered)
47- **Ground truth**: Manual lesion segmentation masks (training only)
48- **Resolution**: ~0.5 × 0.5 × 0.5 mm (isotropic)
49- **Preprocessing**: Skull-stripped, co-registered to common space
50- **Reference**: Carass et al. (2017), NeuroImage
51
52---
53
54## Supported Modalities
55
56| Modality | Description | Use in MS |
57|---|---|---|
58| T1w | T1-weighted structural | Brain atrophy, gray matter lesions |
59| T2w | T2-weighted | White matter lesion detection |
60| FLAIR | Fluid-Attenuated Inversion Recovery | Periventricular lesion detection |
61| PD | Proton Density | Complementary lesion contrast |
62
63---
64
65## Directory Structure (Native)
66
67```
68training/
69├── subject01/
70│ ├── time01/
71│ │ ├── subject01_time01_T1.nii.gz
72│ │ ├── subject01_time01_T2.nii.gz
73│ │ ├── subject01_time01_FLAIR.nii.gz
74│ │ ├── subject01_time01_PD.nii.gz
75│ │ └── subject01_time01_lesion.nii.gz (ground truth)
76│ └── time02/
77│ └── ...
78```
79
80---
81
82## BIDS Preparation
83
84### Script: `scripts/validate_mschallenge.py`
85
86Validates MS Challenge directory structure and generates a compliance report.
87
88```bash
89python skills/mschallenge-skill/scripts/validate_mschallenge.py \
90 --input /path/to/MSChallenge/training \
91 --output /path/to/mschallenge_output/qc/validation.csv
92```
93
94Features:
95- Directory structure validation
96- Modality completeness check (T1w, T2w, FLAIR, PD)
97- Ground truth mask presence verification
98- Longitudinal timepoint consistency
99- Missing data identification
100
101---
102
103## Core Workflow (Never Bypassed)
104
1051. Identify user target: full MS Challenge processing, lesion analysis, or validation only.
1062. Generate a numbered plan with tools, outputs, runtime, storage, and risks.
1073. Wait for explicit confirmation (`YES` / `execute` / `proceed`).
1084. On confirmation, run data validation using `scripts/validate_mschallenge.py`.
1095. Delegate to `smri-skill` for structural MRI processing.
1106. If lesion analysis is requested, run `scripts/analyze_lesions.py`.
1117. If longitudinal analysis is requested, run `scripts/longitudinal_lesion.py`.
1128. If QC summary is requested, run `scripts/mschallenge_qc_summary.py`.
1139. Save outputs into `mschallenge_output/`.
114
115---
116
117## Modality Processing Delegation
118
119| Modality | Delegated skill | Typical tasks | Main outputs |
120|---|---|---|---|
121| sMRI (T1w/T2w/FLAIR/PD) | `smri-skill` | brain extraction, tissue segmentation | `smri_output/` derivatives |
122| Lesion masks | `nibabel-skill` | lesion volume, count, location | Lesion statistics |
123
124---
125
126## Standard Output Layout
127
128```
129mschallenge_output/
130├── raw/ # Original MS Challenge files
131├── validation/ # Validation reports
132├── smri/ # Structural MRI derivatives
133├── lesions/ # Lesion analysis results
134│ ├── lesion_stats.csv
135│ └── longitudinal_change.csv
136├── qc/ # QC summaries and exclusion lists
137└── logs/ # Processing logs
138```
139
140---
141
142## Benchmark Adapter Guidance
143
144For benchmark-style prompts, do not force the full orchestration when the task only asks for local MS Challenge data validation.
145
146- If the task starts from MS Challenge data already present on disk and only asks for validation:
147 - Skip the download stage
148 - Default to the narrow path `local MS Challenge discovery -> validation -> report`
149- In benchmark mode, do not require explicit confirmation before presenting the validation solution.
150
151---
152
153## Safety and Execution Policy
154- No execution before explicit plan confirmation.
155- All execution must be routed via `claw-shell`.
156- Missing dependencies must be resolved by `dependency-planner` before running.
157
158---
159
160## Important Notes and Limitations
161- MS Challenge is a longitudinal dataset; consider timepoint effects in analysis.
162- Ground truth masks are only available for training subjects.
163- All images are preprocessed (skull-stripped, co-registered).
164- Lesion segmentation is the primary task; standard brain morphometry may be affected by lesions.
165- The challenge is designed for benchmarking; results should be compared with published baselines.
166- `mschallenge-skill` is orchestration-only; detailed preprocessing logic remains in modality skills.
167
168---
169
170## When to Call This Skill
171- User asks for end-to-end MS Lesion Challenge workflow.
172- User asks to validate MS Challenge data structure.
173- User asks for lesion volume and count analysis.
174- User asks for longitudinal lesion change tracking.
175- User asks for MS lesion segmentation benchmarking.
176
177---
178
179## Complementary / Related Skills
180- `smri-skill` → structural MRI preprocessing
181- `nibabel-skill` → NIfTI I/O and mask manipulation
182- `brain-visualization` → lesion overlay visualization
183- `dependency-planner` → dependency resolution
184- `conda-env-manager` → environment management
185- `claw-shell` → command execution
186
187---
188
189## Reference
190- Carass et al. (2017): Longitudinal multiple sclerosis lesion segmentation: Resource and challenge. NeuroImage.
191- ISBI 2015 MS Lesion Challenge: https://smart-stats-tools.org/lesion-challenge
192
193Created At: 2026-05-06 13:31 HKT
194Last Updated At: 2026-05-06 13:31 HKT
195Author: chengwang96