NSD Skill (Dataset-Orchestration Layer)
Overview
nsd-skill is the NeuroClaw orchestration skill for the Natural Scenes Dataset (NSD).
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 BIDS validation, stimulus extraction, and QC.
Core workflow (never bypassed):
- Identify input NSD 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 (
nsd_output/).
Research use only.
Quick Reference
| Task |
What needs to be done |
Delegate to |
Expected output |
| BIDS validation |
Validate NSD BIDS structure |
scripts/validate_nsd.py |
Validation report |
| sMRI processing |
Brain extraction, tissue segmentation |
smri-skill |
smri_output/ derivatives |
| task-fMRI processing |
Visual task GLM, voxel-wise encoding |
fmri-skill |
fmri_output/ task results |
| Stimulus extraction |
COCO image metadata, annotations |
scripts/extract_nsd_stimulus.py |
Stimulus metadata CSV |
| QC summary |
Per-subject quality control |
scripts/nsd_qc_summary.py |
QC summary + exclusion list |
Dataset Characteristics
- Cohort: 8 healthy adults (subj01-subj08)
- Scanner: 7T Siemens MAGNETOM
- Resolution: 1.8mm isotropic voxels
- Sessions: ~30-40 scanning sessions per subject
- Total fMRI: ~30 hours per subject
- Stimuli: ~73,000 natural scene images from COCO dataset
- Access: OSF (Open Science Framework) and Amazon S3
- Reference: Allen et al. (2021), Nature Neuroscience
Supported Modalities
| Modality |
Description |
Details |
| T1w |
High-resolution structural MRI |
7T anatomical scans |
| task-fMRI |
Visual task fMRI |
Natural scene viewing with fixation task |
| dMRI |
Diffusion-weighted imaging |
White matter tractography |
| Retinotopy |
Retinotopic mapping |
Visual area identification |
| Eye-tracking |
Gaze position data |
During image viewing |
NSD Task Paradigms
| Task |
Description |
Duration |
| NSD |
Natural scene viewing (COCO images) |
~30-40 sessions × ~15 min each |
| FIXATION |
Fixation task during image presentation |
Continuous |
COCO Stimulus Metadata
The NSD uses images from the COCO (Common Objects in Context) dataset:
- ~73,000 unique natural scene images
- Each image has: 5 captions, 80 object categories, segmentation masks
- Images are presented for 3 seconds each
- Subjects perform a fixation task (detect image repeat)
BIDS Preparation
Script: scripts/validate_nsd.py
Validates NSD BIDS structure and generates a compliance report.
python skills/nsd-skill/scripts/validate_nsd.py \
--input /path/to/NSD/bids \
--output /path/to/nsd_output/qc/bids_validation.csv
Features:
- BIDS directory structure validation
- Subject completeness check (8 subjects)
- Session count validation (~30-40 sessions per subject)
- Stimulus file presence verification
- Missing data identification
Core Workflow (Never Bypassed)
- Identify user target: full NSD processing, imaging subset, stimulus extraction, or BIDS validation only.
- Generate a numbered plan with tools, outputs, runtime, storage, and risks.
- Wait for explicit confirmation (
YES / execute / proceed).
- On confirmation, run BIDS validation using
scripts/validate_nsd.py.
- Delegate to
smri-skill for structural MRI processing.
- Delegate to
fmri-skill for task-fMRI processing (natural scene viewing).
- If stimulus extraction is requested, run
scripts/extract_nsd_stimulus.py.
- If QC summary is requested, run
scripts/nsd_qc_summary.py.
- Save outputs into
nsd_output/.
Modality Processing Delegation
| Modality |
Delegated skill |
Typical tasks |
Main outputs |
| sMRI (T1w) |
smri-skill |
brain extraction, tissue segmentation, cortical reconstruction |
smri_output/ derivatives |
| task-fMRI |
fmri-skill |
preprocessing, denoising, voxel-wise encoding |
fmri_output/ task results |
| dMRI |
fmri-skill |
diffusion preprocessing, tensor metrics |
dwi_output/ metrics |
Standard Output Layout
nsd_output/
├── bids/ # BIDS-staged data (or validation report)
├── smri/ # Structural MRI derivatives
├── fmri/ # Functional MRI derivatives (natural scene viewing)
├── stimulus/ # COCO stimulus metadata
├── 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 NSD data validation.
- If the task starts from NSD data already present on disk and only asks for BIDS validation:
- Skip the download stage
- Default to the narrow path
local NSD discovery -> BIDS 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
- NSD is a high-resolution 7T dataset; processing requires significant compute resources.
- 8 subjects with dense repeated measures (~30 hours of fMRI each).
- Visual neuroscience focus: standard task GLM may not apply; consider voxel-wise encoding models.
- COCO stimulus metadata is essential for stimulus-response analyses.
- Cortical surface-based representations using FreeSurfer outputs.
nsd-skill is orchestration-only; detailed preprocessing logic remains in modality skills.
When to Call This Skill
- User asks for end-to-end NSD workflow.
- User asks to process NSD task-fMRI data.
- User needs BIDS validation for NSD data.
- User asks to extract NSD stimulus metadata (COCO images, captions, categories).
- User asks for visual cortex analysis or voxel-wise encoding.
Complementary / Related Skills
smri-skill → structural MRI preprocessing
fmri-skill → functional MRI preprocessing and analysis
nibabel-skill → NIfTI I/O and surface data
bids-organizer → BIDS validation and organization
brain-visualization → visualization of derivatives
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: nsd-skill3description: Use this skill whenever the user wants an end-to-end workflow for the Natural Scenes Dataset (NSD), including data access, BIDS validation, multimodal processing of task-fMRI and structural MRI, stimulus metadata extraction, and QC integration. Triggers include: 'NSD', 'Natural Scenes Dataset', 'process NSD data', 'NSD fMRI', 'visual neuroscience', or any request to run the NSD multimodal pipeline.4license: MIT License (NeuroClaw custom skill - freely modifiable within t5---6# NSD Skill (Dataset-Orchestration Layer)
7
8## Overview
9
10`nsd-skill` is the NeuroClaw orchestration skill for the **Natural Scenes Dataset (NSD)**.
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 BIDS validation, stimulus extraction, and QC.
17
18**Core workflow (never bypassed):**
191. Identify input NSD 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 (`nsd_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| BIDS validation | Validate NSD BIDS structure | `scripts/validate_nsd.py` | Validation report |
34| sMRI processing | Brain extraction, tissue segmentation | `smri-skill` | `smri_output/` derivatives |
35| task-fMRI processing | Visual task GLM, voxel-wise encoding | `fmri-skill` | `fmri_output/` task results |
36| Stimulus extraction | COCO image metadata, annotations | `scripts/extract_nsd_stimulus.py` | Stimulus metadata CSV |
37| QC summary | Per-subject quality control | `scripts/nsd_qc_summary.py` | QC summary + exclusion list |
38
39---
40
41## Dataset Characteristics
42
43- **Cohort**: 8 healthy adults (subj01-subj08)
44- **Scanner**: 7T Siemens MAGNETOM
45- **Resolution**: 1.8mm isotropic voxels
46- **Sessions**: ~30-40 scanning sessions per subject
47- **Total fMRI**: ~30 hours per subject
48- **Stimuli**: ~73,000 natural scene images from COCO dataset
49- **Access**: OSF (Open Science Framework) and Amazon S3
50- **Reference**: Allen et al. (2021), Nature Neuroscience
51
52---
53
54## Supported Modalities
55
56| Modality | Description | Details |
57|---|---|---|
58| T1w | High-resolution structural MRI | 7T anatomical scans |
59| task-fMRI | Visual task fMRI | Natural scene viewing with fixation task |
60| dMRI | Diffusion-weighted imaging | White matter tractography |
61| Retinotopy | Retinotopic mapping | Visual area identification |
62| Eye-tracking | Gaze position data | During image viewing |
63
64---
65
66## NSD Task Paradigms
67
68| Task | Description | Duration |
69|---|---|---|
70| NSD | Natural scene viewing (COCO images) | ~30-40 sessions × ~15 min each |
71| FIXATION | Fixation task during image presentation | Continuous |
72
73---
74
75## COCO Stimulus Metadata
76
77The NSD uses images from the COCO (Common Objects in Context) dataset:
78- ~73,000 unique natural scene images
79- Each image has: 5 captions, 80 object categories, segmentation masks
80- Images are presented for 3 seconds each
81- Subjects perform a fixation task (detect image repeat)
82
83---
84
85## BIDS Preparation
86
87### Script: `scripts/validate_nsd.py`
88
89Validates NSD BIDS structure and generates a compliance report.
90
91```bash
92python skills/nsd-skill/scripts/validate_nsd.py \
93 --input /path/to/NSD/bids \
94 --output /path/to/nsd_output/qc/bids_validation.csv
95```
96
97Features:
98- BIDS directory structure validation
99- Subject completeness check (8 subjects)
100- Session count validation (~30-40 sessions per subject)
101- Stimulus file presence verification
102- Missing data identification
103
104---
105
106## Core Workflow (Never Bypassed)
107
1081. Identify user target: full NSD processing, imaging subset, stimulus extraction, or BIDS validation only.
1092. Generate a numbered plan with tools, outputs, runtime, storage, and risks.
1103. Wait for explicit confirmation (`YES` / `execute` / `proceed`).
1114. On confirmation, run BIDS validation using `scripts/validate_nsd.py`.
1125. Delegate to `smri-skill` for structural MRI processing.
1136. Delegate to `fmri-skill` for task-fMRI processing (natural scene viewing).
1147. If stimulus extraction is requested, run `scripts/extract_nsd_stimulus.py`.
1158. If QC summary is requested, run `scripts/nsd_qc_summary.py`.
1169. Save outputs into `nsd_output/`.
117
118---
119
120## Modality Processing Delegation
121
122| Modality | Delegated skill | Typical tasks | Main outputs |
123|---|---|---|---|
124| sMRI (T1w) | `smri-skill` | brain extraction, tissue segmentation, cortical reconstruction | `smri_output/` derivatives |
125| task-fMRI | `fmri-skill` | preprocessing, denoising, voxel-wise encoding | `fmri_output/` task results |
126| dMRI | `fmri-skill` | diffusion preprocessing, tensor metrics | `dwi_output/` metrics |
127
128---
129
130## Standard Output Layout
131
132```
133nsd_output/
134├── bids/ # BIDS-staged data (or validation report)
135├── smri/ # Structural MRI derivatives
136├── fmri/ # Functional MRI derivatives (natural scene viewing)
137├── stimulus/ # COCO stimulus metadata
138├── qc/ # QC summaries and exclusion lists
139└── logs/ # Processing logs
140```
141
142---
143
144## Benchmark Adapter Guidance
145
146For benchmark-style prompts, do not force the full orchestration when the task only asks for local NSD data validation.
147
148- If the task starts from NSD data already present on disk and only asks for BIDS validation:
149 - Skip the download stage
150 - Default to the narrow path `local NSD discovery -> BIDS validation -> report`
151- In benchmark mode, do not require explicit confirmation before presenting the validation solution.
152
153---
154
155## Safety and Execution Policy
156- No execution before explicit plan confirmation.
157- All execution must be routed via `claw-shell`.
158- Missing dependencies must be resolved by `dependency-planner` before running.
159
160---
161
162## Important Notes and Limitations
163- NSD is a high-resolution 7T dataset; processing requires significant compute resources.
164- 8 subjects with dense repeated measures (~30 hours of fMRI each).
165- Visual neuroscience focus: standard task GLM may not apply; consider voxel-wise encoding models.
166- COCO stimulus metadata is essential for stimulus-response analyses.
167- Cortical surface-based representations using FreeSurfer outputs.
168- `nsd-skill` is orchestration-only; detailed preprocessing logic remains in modality skills.
169
170---
171
172## When to Call This Skill
173- User asks for end-to-end NSD workflow.
174- User asks to process NSD task-fMRI data.
175- User needs BIDS validation for NSD data.
176- User asks to extract NSD stimulus metadata (COCO images, captions, categories).
177- User asks for visual cortex analysis or voxel-wise encoding.
178
179---
180
181## Complementary / Related Skills
182- `smri-skill` → structural MRI preprocessing
183- `fmri-skill` → functional MRI preprocessing and analysis
184- `nibabel-skill` → NIfTI I/O and surface data
185- `bids-organizer` → BIDS validation and organization
186- `brain-visualization` → visualization of derivatives
187- `dependency-planner` → dependency resolution
188- `conda-env-manager` → environment management
189- `claw-shell` → command execution
190
191---
192
193## Reference
194- NSD: https://naturalscenesdataset.org/
195- Allen et al. (2021): A massive 7T fMRI dataset to bridge cognitive neuroscience and artificial intelligence. Nature Neuroscience.
196- COCO: https://cocodataset.org/
197
198Created At: 2026-05-06 13:31 HKT
199Last Updated At: 2026-05-06 13:31 HKT
200Author: chengwang96