bids-neuroimaging / README.md
TobiasPitters's picture
Initial commit: BIDS neuroimaging viewer
aad6f22
metadata
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:
git clone <your-repo-url>
cd bids-neuroimaging
  1. Create a virtual environment and install dependencies:
python -m venv .venv
source .venv/bin/activate  # On Windows: .venv\Scripts\activate
pip install -r requirements.txt
  1. Install the custom datasets fork with BIDS loader:
pip install git+https://github.com/The-Obstacle-Is-The-Way/datasets.git@feat/bids-loader

Running the Application

Start the FastAPI server with:

fastapi dev main.py

Or using uvicorn directly:

uvicorn main:app --reload --host 0.0.0.0 --port 8000

Then open your browser and navigate to:

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