-
Notifications
You must be signed in to change notification settings - Fork 3
Home
Parse CSA header information from Siemens MRI acquisitions with Python.
Siemens MRI scans include CSA (Common Siemens Architecture) headers - proprietary data structures stored in DICOM private tags that contain crucial acquisition parameters not available in standard DICOM fields.
Why CSA Headers Matter:
- Slice timing for fMRI preprocessing (SPM, FSL, AFNI)
- B-values and gradient directions for diffusion imaging (DTI/DWI)
- Complete scanner protocol parameters for QA and verification
- Advanced acquisition details for research and analysis
pip install csa_header→ Quick Start - Extract slice timing in 5 minutes with a simple example
→ Technical Reference - Deep dive into CSA1/CSA2 binary formats, DICOM tags, and ASCCONV protocol
→ User Guide - Practical examples for fMRI, DWI, and common use cases → Integration with NiBabel - Complete workflows combining csa_header with neuroimaging tools
→ Developer Guide - Architecture, implementation details, and contribution guidelines → GitHub Repository - Source code and issue tracker
→ Troubleshooting - FAQ, common errors, and debugging tips
flowchart LR
A[Siemens DICOM] --> B[CSA Header]
B --> C[Slice Timing]
B --> D[B-values & Gradients]
B --> E[Protocol Parameters]
B --> F[QA Metrics]
C --> G[fMRI Preprocessing]
D --> H[DTI/DWI Analysis]
E --> I[Protocol Verification]
F --> J[Quality Assurance]
style A fill:#e1f5ff
style B fill:#fff4e1
style C fill:#e8f5e9
style D fill:#e8f5e9
style E fill:#e8f5e9
style F fill:#e8f5e9
import pydicom
from csa_header import CsaHeader
# Load Siemens DICOM file
dcm = pydicom.dcmread('fmri_scan.dcm')
# Extract and parse CSA Series Header
series_header = CsaHeader(dcm[0x0029, 0x1010].value).read()
# Get slice timing for fMRI preprocessing
slice_times = series_header['MosaicRefAcqTimes']['value']
print(f"Slice times: {slice_times}")→ See Quick Start for complete working examples
- ✅ Fast and Lightweight - Minimal dependencies (numpy, pydicom)
- ✅ Comprehensive - Supports both CSA1 and CSA2 formats
- ✅ ASCCONV Parsing - Automatic extraction of scanner protocol parameters
- ✅ Type-Safe - Complete type hints for all public APIs
- ✅ Well-Tested - 96% coverage with 161 tests
- ✅ Python 3.9-3.13 - Modern Python with wide version support
- ✅ NiBabel Compatible - Seamless neuroimaging workflow integration
- Quick Start - 5-minute tutorial for beginners
- User Guide - Practical usage examples and common patterns
- Technical Reference - CSA format specifications and DICOM tags
- Integration with NiBabel - Neuroimaging workflow examples
- Glossary - Definitions of key terms and acronyms
- Troubleshooting - Common issues and solutions
- References - External resources and related tools
- Developer Guide - Architecture and contribution guidelines
- Report Issues: GitHub Issues
- Contribute: See CONTRIBUTING.md
- Source Code: GitHub Repository
- Package: PyPI
- pydicom - Read and write DICOM files in Python
- NiBabel - Access neuroimaging file formats
- dcm2niix - Convert DICOM to NIfTI with metadata extraction
License: MIT
Maintained by: The open-dicom community
Version: 1.0+