bids-neuroimaging / README.md
TobiasPitters's picture
Initial commit: BIDS neuroimaging viewer
aad6f22
---
title: Bids Neuroimaging
emoji: πŸ‘
colorFrom: indigo
colorTo: indigo
sdk: docker
pinned: false
license: cc-by-4.0
short_description: Visualize Aphasia Recovery Cohort (ARC) Dataset - Mini Samp
---
# BIDS Neuroimaging Viewer
A FastAPI-based web application for visualizing neuroimaging data in BIDS format using NiiVue.
## Installation
1. Clone the repository:
```bash
git clone <your-repo-url>
cd bids-neuroimaging
```
2. Create a virtual environment and install dependencies:
```bash
python -m venv .venv
source .venv/bin/activate # On Windows: .venv\Scripts\activate
pip install -r requirements.txt
```
3. Install the custom datasets fork with BIDS loader:
```bash
pip install git+https://github.com/The-Obstacle-Is-The-Way/datasets.git@feat/bids-loader
```
## Running the Application
Start the FastAPI server with:
```bash
fastapi dev main.py
```
Or using uvicorn directly:
```bash
uvicorn main:app --reload --host 0.0.0.0 --port 8000
```
Then open your browser and navigate to:
- **Main viewer**: http://localhost:8000
- **Health check**: http://localhost:8000/health
## Features
- Interactive 3D visualization of NIfTI files using NiiVue
- Multiple viewing modes: Multiplanar + 3D, and 3D Render Only
- Next button to iterate through dataset samples (implement the `/next` endpoint)
## Development
The main application is in `main.py`. To implement the "Next" functionality:
1. Modify the `/next` endpoint in `main.py` to load and return the next sample
2. The endpoint should return a JSON with the base64-encoded NIfTI data
## Configuration Reference
For Hugging Face Spaces deployment, check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference