| name | dataset-manifest-builder |
| description | Scan medical imaging directories and generate structured JSON or CSV manifests
with file-level metadata for DICOM and NIfTI assets.
|
| version | 0.1.0 |
| author | Medical AI Team <team@example.com> |
| license | MIT |
| tags | ["dataset","manifest","dicom","nifti","metadata"] |
| maturity | experimental |
| category | dataset-management |
| requires_extras | ["core","dicom"] |
Dataset Manifest Builder
Overview
This skill scans a directory tree, discovers supported medical image files, extracts lightweight header metadata, and writes a machine-readable manifest for downstream QC, curation, or pipeline orchestration.
Use this skill when you need a reproducible inventory of imaging data before preprocessing or model training.
Installation
pip install .[dicom]
Dependencies:
- Python >= 3.10
- nibabel >= 4.0.0
- pydicom >= 2.3.0 for DICOM support
Usage
python scripts/main.py --input-dir /path/to/images --output manifest.json [OPTIONS]
Arguments
| Argument | Required | Description |
|---|
--input-dir | Yes | Directory containing medical image files |
--output | Yes | Output manifest path (.json or .csv) |
Options
| Option | Default | Description |
|---|
--format | auto | Output format: json, csv, or infer from extension |
--recursive | false | Recursively scan subdirectories |
--pattern | * | Additional glob filter applied before header inspection |
--group-by | none | Group rows by patient, study, or series |
--verbose | false | Enable verbose logging |
--version | - | Show version and exit |
--help | - | Show help and exit |
Input Schema
Input is a filesystem directory containing a mix of supported and unsupported files.
Supported discovery targets:
- DICOM files, including extensionless files when they can be parsed as DICOM
- NIfTI files (
.nii, .nii.gz)
Output Schema
{
"metadata": {
"generated_at": "2024-01-15T10:30:00Z",
"source_directory": "/path/to/images",
"recursive": true,
"total_files": 150
},
"summary": {
"file_count": 150,
"modalities": ["CT", "MR"],
"patients": 25,
"studies": 40,
"series": 85
},
"entries": [
{
"file_path": "patient001/study001/series001/image001.dcm",
"absolute_path": "/abs/path/to/image001.dcm",
"modality": "CT",
"patient_id": "PAT001",
"study_id": "STD001",
"series_id": "1",
"file_type": "DICOM",
"file_size_bytes": 524288
}
]
}
Exit Codes
| Code | Meaning |
|---|
| 0 | Success |
| 1 | Validation error |
| 2 | Runtime error |
| 3 | Usage error |
Examples
python scripts/main.py --input-dir /data --output manifest.json --recursive
python scripts/main.py --input-dir /data --output manifest.csv --format csv
References
Disclaimer
For research use only. This skill is not intended for clinical use.