NIFD Skill (Dataset-Orchestration Layer)
Overview
nifd-skill is the NeuroClaw orchestration skill for the Neuroimaging in Frontotemporal Dementia (NIFD) dataset, collected at the UCSF Memory and Aging Center.
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, phenotype extraction, and QC.
Core workflow (never bypassed):
- Identify input NIFD 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 (
nifd_output/).
Research use only.
Quick Reference
| Task |
What needs to be done |
Delegate to |
Expected output |
| BIDS validation |
Validate NIFD BIDS structure |
scripts/validate_nifd.py |
Validation report |
| sMRI processing |
Brain extraction, tissue segmentation, cortical thickness |
smri-skill |
smri_output/ derivatives |
| rs-fMRI processing |
Preprocessing, denoising, connectivity |
fmri-skill |
fmri_output/ connectivity |
| dMRI processing |
Diffusion preprocessing, tensor metrics, tractography |
dwi-skill |
dwi_output/ metrics |
| Phenotype extraction |
Diagnosis, cognitive scores, clinical measures |
scripts/extract_nifd_phenotype.py |
Merged phenotype CSV |
| QC summary |
Per-subject quality control |
scripts/nifd_qc_summary.py |
QC summary + exclusion list |
Dataset Characteristics
- Cohort: ~120 participants
- bvFTD: Behavioral variant frontotemporal dementia
- svPPA: Semantic variant primary progressive aphasia
- nfvPPA: Nonfluent variant primary progressive aphasia
- Healthy controls: Age-matched
- Scanner: 3T Siemens TIM Trio
- Modalities: T1w sMRI, rs-fMRI, dMRI/DTI
- Clinical: CDR, MMSE, neuropsychological battery
- Access: OpenNeuro ds004403 (or UCSF MAC portal)
- Format: BIDS-compliant
Supported Modalities
| Modality |
Description |
Details |
| T1w |
High-resolution structural MRI |
1mm isotropic, cortical thickness/atrophy |
| rs-fMRI |
Resting-state functional MRI |
Functional connectivity, network degeneration |
| dMRI |
Diffusion-weighted imaging |
DTI, white matter tract integrity |
NIFD Diagnostic Groups
| Group |
Description |
Typical N |
| bvFTD |
Behavioral variant FTD |
~40 |
| svPPA |
Semantic variant PPA |
~20 |
| nfvPPA |
Nonfluent variant PPA |
~15 |
| Control |
Healthy age-matched controls |
~45 |
BIDS Preparation
Script: scripts/validate_nifd.py
Validates NIFD BIDS structure and generates a compliance report.
python skills/nifd-skill/scripts/validate_nifd.py \
--input /path/to/NIFD/bids \
--output /path/to/nifd_output/qc/bids_validation.csv
Features:
- BIDS directory structure validation
- Diagnostic group completeness check
- Modality completeness (T1w, rs-fMRI, dMRI)
- Missing data identification
Core Workflow (Never Bypassed)
- Identify user target: full NIFD processing, imaging subset, phenotype 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_nifd.py.
- Delegate to
smri-skill for structural MRI processing.
- Delegate to
fmri-skill for rs-fMRI processing (functional connectivity).
- Delegate to
dwi-skill for dMRI processing (white matter integrity).
- If phenotype extraction is requested, run
scripts/extract_nifd_phenotype.py.
- If QC summary is requested, run
scripts/nifd_qc_summary.py.
- Save outputs into
nifd_output/.
Modality Processing Delegation
| Modality |
Delegated skill |
Typical tasks |
Main outputs |
| sMRI (T1w) |
smri-skill |
brain extraction, tissue segmentation, cortical thickness |
smri_output/ derivatives |
| rs-fMRI |
fmri-skill |
preprocessing, denoising, connectivity |
fmri_output/ connectivity |
| dMRI |
dwi-skill |
diffusion preprocessing, tensor metrics, tractography |
dwi_output/ metrics |
Standard Output Layout
nifd_output/
├── bids/ # BIDS-staged data (or validation report)
├── smri/ # Structural MRI derivatives
├── fmri/ # Functional MRI derivatives (rs-fMRI connectivity)
├── dwi/ # Diffusion MRI derivatives (DTI metrics)
├── phenotype/ # Merged phenotype tables (diagnosis, cognitive)
├── 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 NIFD data validation.
- If the task starts from NIFD data already present on disk and only asks for BIDS validation:
- Skip the download stage
- Default to the narrow path
local NIFD 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
- NIFD is a clinical cohort; patient data requires careful handling.
- Diagnostic groups (bvFTD, svPPA, nfvPPA) have distinct atrophy patterns; group-level analyses should account for heterogeneity.
- Cortical thickness and voxel-based morphometry are commonly used structural measures.
- Network degeneration hypothesis: FTD targets specific large-scale networks.
nifd-skill is orchestration-only; detailed preprocessing logic remains in modality skills.
When to Call This Skill
- User asks for end-to-end NIFD workflow.
- User asks to process NIFD neuroimaging data.
- User needs BIDS validation for NIFD data.
- User asks to extract NIFD phenotype data (diagnosis, cognitive scores).
- User asks for frontotemporal dementia neuroimaging analysis.
Complementary / Related Skills
smri-skill → structural MRI preprocessing
fmri-skill → functional MRI preprocessing and analysis
dwi-skill → diffusion MRI preprocessing
pet-skill → PET imaging (tau-PET, amyloid-PET if available)
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
- NIFD: UCSF Memory and Aging Center
- Frontotemporal Dementia: FTDC clinical diagnostic criteria
- OpenNeuro ds004403
Created At: 2026-05-06 13:55 HKT
Last Updated At: 2026-05-06 13:55 HKT
Author: chengwang96
1---2name: nifd-skill3description: Use this skill whenever the user wants an end-to-end workflow for the Neuroimaging in Frontotemporal Dementia (NIFD) dataset, including BIDS validation, multimodal processing of sMRI, rs-fMRI, and dMRI, phenotype extraction, and QC integration. Triggers include: 'NIFD', 'frontotemporal dementia', 'FTD', 'bvFTD', 'PPA', 'process NIFD data', or any request to run the NIFD multimodal pipeline.4license: MIT License (NeuroClaw custom skill - freely modifiable within t5---6# NIFD Skill (Dataset-Orchestration Layer)
7
8## Overview
9
10`nifd-skill` is the NeuroClaw orchestration skill for the **Neuroimaging in Frontotemporal Dementia (NIFD)** dataset, collected at the UCSF Memory and Aging Center.
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, phenotype extraction, and QC.
17
18**Core workflow (never bypassed):**
191. Identify input NIFD 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 (`nifd_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 NIFD BIDS structure | `scripts/validate_nifd.py` | Validation report |
34| sMRI processing | Brain extraction, tissue segmentation, cortical thickness | `smri-skill` | `smri_output/` derivatives |
35| rs-fMRI processing | Preprocessing, denoising, connectivity | `fmri-skill` | `fmri_output/` connectivity |
36| dMRI processing | Diffusion preprocessing, tensor metrics, tractography | `dwi-skill` | `dwi_output/` metrics |
37| Phenotype extraction | Diagnosis, cognitive scores, clinical measures | `scripts/extract_nifd_phenotype.py` | Merged phenotype CSV |
38| QC summary | Per-subject quality control | `scripts/nifd_qc_summary.py` | QC summary + exclusion list |
39
40---
41
42## Dataset Characteristics
43
44- **Cohort**: ~120 participants
45 - **bvFTD**: Behavioral variant frontotemporal dementia
46 - **svPPA**: Semantic variant primary progressive aphasia
47 - **nfvPPA**: Nonfluent variant primary progressive aphasia
48 - **Healthy controls**: Age-matched
49- **Scanner**: 3T Siemens TIM Trio
50- **Modalities**: T1w sMRI, rs-fMRI, dMRI/DTI
51- **Clinical**: CDR, MMSE, neuropsychological battery
52- **Access**: OpenNeuro ds004403 (or UCSF MAC portal)
53- **Format**: BIDS-compliant
54
55---
56
57## Supported Modalities
58
59| Modality | Description | Details |
60|---|---|---|
61| T1w | High-resolution structural MRI | 1mm isotropic, cortical thickness/atrophy |
62| rs-fMRI | Resting-state functional MRI | Functional connectivity, network degeneration |
63| dMRI | Diffusion-weighted imaging | DTI, white matter tract integrity |
64
65---
66
67## NIFD Diagnostic Groups
68
69| Group | Description | Typical N |
70|---|---|---|
71| bvFTD | Behavioral variant FTD | ~40 |
72| svPPA | Semantic variant PPA | ~20 |
73| nfvPPA | Nonfluent variant PPA | ~15 |
74| Control | Healthy age-matched controls | ~45 |
75
76---
77
78## BIDS Preparation
79
80### Script: `scripts/validate_nifd.py`
81
82Validates NIFD BIDS structure and generates a compliance report.
83
84```bash
85python skills/nifd-skill/scripts/validate_nifd.py \
86 --input /path/to/NIFD/bids \
87 --output /path/to/nifd_output/qc/bids_validation.csv
88```
89
90Features:
91- BIDS directory structure validation
92- Diagnostic group completeness check
93- Modality completeness (T1w, rs-fMRI, dMRI)
94- Missing data identification
95
96---
97
98## Core Workflow (Never Bypassed)
99
1001. Identify user target: full NIFD processing, imaging subset, phenotype extraction, or BIDS validation only.
1012. Generate a numbered plan with tools, outputs, runtime, storage, and risks.
1023. Wait for explicit confirmation (`YES` / `execute` / `proceed`).
1034. On confirmation, run BIDS validation using `scripts/validate_nifd.py`.
1045. Delegate to `smri-skill` for structural MRI processing.
1056. Delegate to `fmri-skill` for rs-fMRI processing (functional connectivity).
1067. Delegate to `dwi-skill` for dMRI processing (white matter integrity).
1078. If phenotype extraction is requested, run `scripts/extract_nifd_phenotype.py`.
1089. If QC summary is requested, run `scripts/nifd_qc_summary.py`.
10910. Save outputs into `nifd_output/`.
110
111---
112
113## Modality Processing Delegation
114
115| Modality | Delegated skill | Typical tasks | Main outputs |
116|---|---|---|---|
117| sMRI (T1w) | `smri-skill` | brain extraction, tissue segmentation, cortical thickness | `smri_output/` derivatives |
118| rs-fMRI | `fmri-skill` | preprocessing, denoising, connectivity | `fmri_output/` connectivity |
119| dMRI | `dwi-skill` | diffusion preprocessing, tensor metrics, tractography | `dwi_output/` metrics |
120
121---
122
123## Standard Output Layout
124
125```
126nifd_output/
127├── bids/ # BIDS-staged data (or validation report)
128├── smri/ # Structural MRI derivatives
129├── fmri/ # Functional MRI derivatives (rs-fMRI connectivity)
130├── dwi/ # Diffusion MRI derivatives (DTI metrics)
131├── phenotype/ # Merged phenotype tables (diagnosis, cognitive)
132├── qc/ # QC summaries and exclusion lists
133└── logs/ # Processing logs
134```
135
136---
137
138## Benchmark Adapter Guidance
139
140For benchmark-style prompts, do not force the full orchestration when the task only asks for local NIFD data validation.
141
142- If the task starts from NIFD data already present on disk and only asks for BIDS validation:
143 - Skip the download stage
144 - Default to the narrow path `local NIFD discovery -> BIDS validation -> report`
145- In benchmark mode, do not require explicit confirmation before presenting the validation solution.
146
147---
148
149## Safety and Execution Policy
150- No execution before explicit plan confirmation.
151- All execution must be routed via `claw-shell`.
152- Missing dependencies must be resolved by `dependency-planner` before running.
153
154---
155
156## Important Notes and Limitations
157- NIFD is a clinical cohort; patient data requires careful handling.
158- Diagnostic groups (bvFTD, svPPA, nfvPPA) have distinct atrophy patterns; group-level analyses should account for heterogeneity.
159- Cortical thickness and voxel-based morphometry are commonly used structural measures.
160- Network degeneration hypothesis: FTD targets specific large-scale networks.
161- `nifd-skill` is orchestration-only; detailed preprocessing logic remains in modality skills.
162
163---
164
165## When to Call This Skill
166- User asks for end-to-end NIFD workflow.
167- User asks to process NIFD neuroimaging data.
168- User needs BIDS validation for NIFD data.
169- User asks to extract NIFD phenotype data (diagnosis, cognitive scores).
170- User asks for frontotemporal dementia neuroimaging analysis.
171
172---
173
174## Complementary / Related Skills
175- `smri-skill` → structural MRI preprocessing
176- `fmri-skill` → functional MRI preprocessing and analysis
177- `dwi-skill` → diffusion MRI preprocessing
178- `pet-skill` → PET imaging (tau-PET, amyloid-PET if available)
179- `bids-organizer` → BIDS validation and organization
180- `brain-visualization` → visualization of derivatives
181- `dependency-planner` → dependency resolution
182- `conda-env-manager` → environment management
183- `claw-shell` → command execution
184
185---
186
187## Reference
188- NIFD: UCSF Memory and Aging Center
189- Frontotemporal Dementia: FTDC clinical diagnostic criteria
190- OpenNeuro ds004403
191
192Created At: 2026-05-06 13:55 HKT
193Last Updated At: 2026-05-06 13:55 HKT
194Author: chengwang96