Skip to main content

A linter for neuroimaging data + universal format converter to BIDS

Project description

🧠 NeuroOps

A linter for neuroimaging data + universal format converter to BIDS

PyPI Python License Tests

InstallationQuick StartConverterChecks


Problem 1: Your fMRIPrep run fails at 3am because the input was a renamed DICOM.

Problem 2: You have 50 EDF files to convert to BIDS. It takes 2 weeks of scripting.

NeuroOps solves both.


Installation

pip install neuroops

For EEG format conversion:

pip install neuroops[convert]

Quick Start

Lint a file

neuroops check scan.nii.gz
🔍 Linting: scan.nii.gz
  ✅ gzip_magic: Valid gzip compression
  ✅ magic_bytes: Valid NIfTI header
  ✅ orientation_codes: Orientation defined
  ✅ snr: SNR = 8.2
  
✅ Result: PASS

Convert to BIDS

neuroops convert recording.edf -o ./bids -s 01 -t rest
✅ Conversion successful!
   Output: ./bids/sub-01/eeg/sub-01_task-rest_eeg.edf
   Format: .edf → BIDS

Format Converter

Convert any format to BIDS with one command. Saves 2+ weeks of scripting.

# Single file
neuroops convert recording.edf --output ./bids --subject 01 --task rest

# Batch convert folder
neuroops convert ./raw_data/ --output ./bids --subject 01 --batch

Supported formats

Format Extension
EDF .edf
BDF .bdf
EEGLAB .set
BrainVision .vhdr
Elekta/Neuromag .fif
NIfTI .nii, .nii.gz
DICOM .dcm, folder

What It Catches

Pipeline Killers

Problem Detection
Fake .gz file Checks 1f 8b magic bytes
Corrupted header Validates NIfTI magic
Zero-byte file Size check
NaN in affine Matrix validation

Silent Killers

Problem Detection
TR mismatch NIfTI header vs JSON sidecar
Missing orientation sform/qform code check
3D in func/ Dimension validation
Orphan sidecars File pairing check

Quality Warnings

Check Default
SNR > 5.0
Motion < 2.0 voxels
Dropout < 15% zeros
Ghost < 5% background

CLI Reference

neuroops check file.nii.gz                    # Lint single file
neuroops check file.nii.gz --allow-abnormalities  # Skip anatomy checks
neuroops scan ./dataset                       # Lint directory

neuroops convert file.edf -o ./bids -s 01 -t rest  # Convert to BIDS
neuroops convert ./folder -o ./bids -s 01 --batch  # Batch convert
Exit Code Meaning
0 PASS
1 WARN
2 FAIL

Python API

from neuroops.validation import IntegrityChecker
from neuroops.converter import FormatConverter

# Lint
checker = IntegrityChecker()
results = checker.run_all_checks("scan.nii.gz")

# Convert
converter = FormatConverter()
result = converter.to_bids("recording.edf", "./bids", subject="01", task="rest")

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

neuroops-0.3.0.tar.gz (113.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

neuroops-0.3.0-py3-none-any.whl (104.2 kB view details)

Uploaded Python 3

File details

Details for the file neuroops-0.3.0.tar.gz.

File metadata

  • Download URL: neuroops-0.3.0.tar.gz
  • Upload date:
  • Size: 113.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.0

File hashes

Hashes for neuroops-0.3.0.tar.gz
Algorithm Hash digest
SHA256 d642db6ed567cd418ddf3563d9f808bc97d9281de91b6d20e6c6c0e825d2ef3b
MD5 6b5339b1b622ed62669fb121f535950d
BLAKE2b-256 b144b434c0f7a934f287f11aeda2bcab12cbe21b10537e1ce80eb217d83c8066

See more details on using hashes here.

File details

Details for the file neuroops-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: neuroops-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 104.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.0

File hashes

Hashes for neuroops-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3df3ff6f5e789e9885aefe42ee2afd66a104096d8e5a2929ec9bd9b6f9e6b54a
MD5 fb1e3349877638425f7d5701057a22d3
BLAKE2b-256 9be25ff953abc5a262ef26b3322a8e4822ce95cec7396ea880ef2cea5fb0763d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page