Overview
BrainViz DK is a comprehensive brain visualization toolkit developed by Dilanjan DK, designed to provide advanced visualization capabilities for neuroimaging data analysis. This toolkit offers interactive 3D brain rendering, comprehensive visualization tools, and seamless integration with popular neuroimaging analysis workflows.
Key Features
3D Interactive Rendering
Interactive 3D brain rendering and visualization with Plotly integration for immersive data exploration
Multi-Format Support
Support for multiple neuroimaging data formats including NIfTI, CIFTI, and GIFTI files
Advanced Rendering
Advanced surface and volume rendering capabilities with customizable visualization parameters
Quality Presets
Multiple quality presets from draft to print quality for different use cases and performance needs
TemplateFlow Support
TemplateFlow support for standardized brain templates and seamless integration
CLI Interface
Command-line interface for batch processing and automated visualization workflows
Installation
Requirements
Installation Methods
PyPI (Recommended)
Recommendedpip install brainviz-dk
From Source
git clone https://github.com/DilanjanDK7/brainviz_dk.git
cd brainviz_dk
pip install -e .
Development
git clone https://github.com/DilanjanDK7/brainviz_dk.git
cd brainviz_dk
pip install -e .[dev]
Optional Features
Plotly 3D Interactive Viewer
Enable interactive 3D brain visualization
pip install brainviz-dk[plotly]
TemplateFlow Support
Access to additional brain templates
pip install brainviz-dk[templateflow]
Verify Installation
python -c "import brainviz_dk; print('BrainViz DK installed successfully!')"
Quick Start Guide
Basic Surface Plotting
import brainviz_dk as bv
# Single view plot
bv.plot_surface('path/to/surface_data.nii.gz')
# Multiple views
bv.plot_surface('path/to/surface_data.nii.gz', views=['lateral', 'medial', 'dorsal'])
Quality Presets
# Draft quality (fast preview)
bv.plot_surface('data.nii.gz', quality='draft')
# Publication quality
bv.plot_surface('data.nii.gz', quality='publication')
Volumetric Visualization
# Orthogonal slices
bv.plot_volume('path/to/volume_data.nii.gz', view_type='ortho')
# Glass brain
bv.plot_volume('path/to/volume_data.nii.gz', view_type='glass')
# Mosaic view
bv.plot_volume('path/to/volume_data.nii.gz', view_type='mosaic')
Command-Line Interface
Basic Usage
# Surface plotting
brainviz-dk surface data.nii.gz --output plot.png
# Volume plotting
brainviz-dk volume data.nii.gz --view-type ortho --output plot.png
# List available templates
brainviz-dk templates list
Advanced CLI Examples
# Custom quality settings
brainviz-dk surface data.nii.gz --quality publication --dpi 300 --output high_res.png
# Thresholded statistical maps
brainviz-dk surface stats.nii.gz --threshold 3.0 --colormap hot --output stats.png
# Batch processing
brainviz-dk surface *.nii.gz --output-dir plots/ --quality standard
Quality Presets
BrainViz DK offers several quality presets optimized for different use cases. Choose the right preset based on your needs:
Draft
Standard
Publication
Performance Comparison
Brain Templates
BrainViz DK supports multiple standardized brain templates for consistent visualization across studies:
MNI152
nilearn
Standard MNI space template widely used in neuroimaging research
MNI152NLin2009cAsym
TemplateFlow
High-resolution MNI template with improved anatomical accuracy
fsaverage
nilearn
FreeSurfer average template for surface-based analysis
Template Management
# List available templates
import brainviz_dk as bv
bv.list_templates()
# Load specific template
template = bv.load_template('MNI152')
Advanced Usage
Custom Figure Sizes
bv.plot_surface('data.nii.gz', figsize=(12, 8), quality='publication')
Threshold and Colormap Adjustments
bv.plot_surface('stats.nii.gz',
threshold=2.3,
colormap='hot',
vmin=2.3,
vmax=6.0)
ROI Overlays
bv.plot_surface('data.nii.gz',
roi_overlay='roi_mask.nii.gz',
roi_colors=['red', 'blue', 'green'])
Applications
- fMRI data visualization and analysis
- Structural MRI brain mapping
- Connectivity analysis visualization
- Statistical brain mapping
- Research presentation and publication graphics
- Educational neuroimaging demonstrations
- Quality control and data inspection
- Group analysis reports
Performance Considerations
- Memory Usage: High-resolution templates may require significant RAM
- Processing Time: Publication quality settings take longer but produce better results
- Disk Space: Template downloads require several GB of storage
- GPU Acceleration: Available for large datasets and complex visualizations
Documentation & Resources
- Official Documentation (ReadTheDocs)
- GitHub Repository
- README & Installation Guide
- Usage Examples
- PyPI Package
Troubleshooting
Common Issues
- Missing Dependencies: Ensure all required packages are installed
- Template Download Problems: Check internet connection and disk space
- Memory Concerns: Use lower resolution templates for large datasets
- Platform-Specific Issues: See documentation for OS-specific guidance
Contact
For questions, collaboration, or feature requests, contact Dilanjan DK at [email protected].