Usage Guideο
PRISM offers two ways to validate your data: a user-friendly Web Interface and a powerful Command Line Interface (CLI).
π₯οΈ Web Interface (Recommended)ο
The web interface is the easiest way to validate your data. It provides a visual dashboard, drag-and-drop support, and detailed error reports.
Starting the Web Interfaceο
Open your terminal/command prompt.
Navigate to the prism folder.
Run the start command:
macOS / Linux:
source .venv/bin/activate python prism-studio.py
Windows:
.venv\Scripts\activate python prism-studio.py
Open your browser and go to
http://127.0.0.1:5001.
Validating Dataο
Select Schema Version: Choose between
stable(recommended) or specific versions likev0.1.Upload Data:
Drag & Drop: Drag your dataset folder directly onto the drop zone.
Select Folder: Click to browse for a local folder.
Upload ZIP: Upload a compressed
.zipfile of your dataset.
View Results:
The dashboard will show a summary of Errors (must fix) and Warnings (should fix).
Click on any error to see exactly which file is affected and how to fix it.
Download Report: You can download a full JSON report of the validation results.
Notesο
Structure-only uploads: For large datasets, the Web UI may upload only metadata (e.g.,
.json,.tsv) and create placeholders for large binaries. In this mode, the validator checks dataset structure, filenames, and sidecar/schema consistency without transferring large imaging/stimulus files.Dataset description:
dataset_description.jsonis required and validated against the selected schema version.BIDS compatibility: When validating, the tool may update
.bidsignoreto hide PRISM-only folders from standard BIDS tools/apps.
β¨οΈ Command Line Interface (CLI)ο
For advanced users or batch processing, the CLI allows you to run validations directly from the terminal.
Basic Usageο
python prism.py /path/to/your/dataset
Optionsο
Flag |
Description |
Example |
|---|---|---|
|
Specify which schema version to use (default: |
|
|
Show detailed progress and file scanning info. |
|
|
Output results as JSON (compact). |
|
|
Output results as formatted JSON. |
|
|
Output format: json, sarif, junit, markdown, csv. |
|
|
Write output to file instead of stdout. |
|
|
Automatically fix common issues. |
|
|
Preview what βfix would do without making changes. |
|
|
List all auto-fixable issue types. |
|
|
Generate a plugin template in validators/. |
|
|
List loaded plugins for the dataset. |
|
|
Disable plugin loading. |
|
|
Run the standard BIDS validator in addition to PRISM validation. |
|
|
Show warnings from the BIDS validator (default: hidden). |
|
|
Show all available schema versions. |
|
Example Outputο
π Validating dataset: /data/study-01
============================================================
ποΈ DATASET SUMMARY
============================================================
π₯ Subjects: 15
π― MODALITIES:
β
survey: 15 files
β
biometrics: 15 files
============================================================
β
VALIDATION RESULTS
============================================================
π No issues found! Dataset is valid.
π§ Auto-Fix Modeο
PRISM can automatically fix common issues in your dataset.
Preview Fixes (Dry Run)ο
python prism.py /path/to/dataset --dry-run
Output:
π§ Found 3 fixable issue(s):
==============================================================
1. [PRISM001] Missing dataset_description.json
Action: create β dataset_description.json
2. [PRISM201] Missing sidecar for sub-01/survey/sub-01_task-bdi_survey.tsv
Action: create β sub-01_task-bdi_survey.json
3. [PRISM501] .bidsignore needs update for PRISM compatibility
Action: update β .bidsignore
==============================================================
π Dry run - no changes made.
Run with --fix to apply these changes.
Apply Fixesο
python prism.py /path/to/dataset --fix
List Fixable Issuesο
python prism.py --list-fixes
π Output Formatsο
JSON Output (for CI/CD)ο
# Compact JSON
python prism.py /data --json
# Pretty-printed JSON
python prism.py /data --json-pretty
SARIF (GitHub/GitLab Code Scanning)ο
python prism.py /data --format sarif -o report.sarif
Upload to GitHub Actions or GitLab SAST for inline annotations.
JUnit XML (CI Test Results)ο
python prism.py /data --format junit -o junit-results.xml
Compatible with Jenkins, GitLab CI, GitHub Actions test reporting.
Markdown Reportο
python prism.py /data --format markdown -o report.md
Generates a human-readable report with validation badge.
CSV Exportο
python prism.py /data --format csv -o issues.csv
Simple spreadsheet-compatible export of all issues.
π Plugin Systemο
Extend validation with custom checks by creating plugins.
Create a Pluginο
python prism.py /path/to/dataset --init-plugin my_custom_checks
This creates <dataset>/validators/my_custom_checks.py with a template.
Plugin Structureο
# validators/my_custom_checks.py
PLUGIN_NAME = "my_custom_checks"
PLUGIN_DESCRIPTION = "Custom validation rules"
PLUGIN_VERSION = "1.0.0"
def validate(dataset_path: str, context: dict) -> list:
"""
Returns list of issues as tuples: (severity, message, [file_path])
severity: "ERROR", "WARNING", or "INFO"
"""
issues = []
# Your custom validation logic here
if not os.path.exists(os.path.join(dataset_path, "README.md")):
issues.append(("WARNING", "Dataset should include a README file"))
return issues
List Loaded Pluginsο
python prism.py /path/to/dataset --list-plugins
Disable Pluginsο
python prism.py /path/to/dataset --no-plugins
π Project Configurationο
Create a .prismrc.json file in your dataset root:
{
"schema_version": "stable",
"strict_mode": false,
"run_bids": false,
"ignore_paths": ["sourcedata/", "derivatives/", "code/"],
"plugins": ["./validators/custom_checks.py"]
}
Setting |
Type |
Description |
|---|---|---|
|
string |
Schema version to use (default: βstableβ) |
|
boolean |
Treat warnings as errors |
|
boolean |
Run BIDS validator in addition to PRISM |
|
array |
Paths to skip during validation |
|
array |
Additional plugin paths to load |
CLI arguments override config file settings.
π REST APIο
PRISM includes a REST API for programmatic access.
Endpointsο
Method |
Endpoint |
Description |
|---|---|---|
GET |
|
Health check |
GET |
|
List available schemas |
POST |
|
Validate a dataset path |
Example: Validate via APIο
curl -X POST http://localhost:5001/api/v1/validate \
-H "Content-Type: application/json" \
-d '{"path": "/path/to/dataset"}'
Response:
{
"valid": false,
"summary": {"errors": 1, "warnings": 2, "info": 0},
"issues": [...],
"statistics": {...}
}