Skip to content

AbdullahMBdev/MTCHacks-2025

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Synapse - AI-Assisted Radiology Workflow Assistant

An AI-assisted radiology platform that integrates HOPPR AI for medical imaging analysis, enabling radiologists to annotate DICOM images side-by-side with AI findings and visualize consensus regions.

Project Overview

This project combines:

  • Frontend: React + TypeScript + Vite web application for DICOM viewing and annotation
  • AI Backend: Flask API server with HOPPR AI integration for chest radiography analysis
  • Features: Side-by-side comparison, consensus highlighting, combined overlay, and multi-model AI analysis

Technologies Used

Frontend

  • React 18
  • TypeScript
  • Vite
  • shadcn-ui components
  • Tailwind CSS
  • React Router
  • TanStack Query

Backend/AI

  • Python 3
  • Flask (REST API server)
  • Flask-CORS
  • HOPPR AI SDK (hopprai)
  • DICOM image processing
  • Cornerstone.js (DICOM rendering)

Getting Started

Prerequisites

Installation

  1. Clone the repository

    git clone <YOUR_GIT_URL>
    cd MTCHacks-2025
  2. Set up the frontend

    # Install Node dependencies
    npm install
  3. Set up the Python backend

    # Create and activate virtual environment
    python3 -m venv venv
    source venv/bin/activate  # On macOS/Linux
    # or: venv\Scripts\activate  # On Windows
    
    # Install Python dependencies
    pip install hopprai python-dotenv flask flask-cors
  4. Configure environment variables

    Create a .env file in the project root:

    HOPPR_API_KEY=your_api_key_here

Running the Application

Start the backend API server (in one terminal):

source venv/bin/activate
python api_server.py

Start the frontend development server (in another terminal):

npm run dev

Test the HOPPR AI integration:

source venv/bin/activate
python test_hoppr.py

Project Structure

MTCHacks-2025/
├── src/                        # React frontend source
│   ├── components/             # UI components
│   │   ├── Demo.tsx           # Main interactive demo
│   │   ├── AnnotatableDicomViewer.tsx  # Annotation interface
│   │   ├── CombinedDicomViewer.tsx     # Combined overlay view
│   │   └── DicomViewerWithOverlay.tsx  # AI findings overlay
│   ├── pages/                  # Page components
│   ├── hooks/                  # Custom React hooks
│   └── lib/                    # Utility functions
├── public/                     # Static assets
├── api_server.py              # Flask REST API server
├── hoppr_model.py             # HOPPR AI integration module
├── pathology_utils.py         # Pathology region mapping
├── test_hoppr.py              # AI model test script
├── main.py                    # Example HOPPR usage
├── dicom_images/              # Sample DICOM files
├── venv/                      # Python virtual environment
└── .env                       # Environment variables (not in git)

Key Features

  • Side-by-Side Comparison: View clinician annotations next to AI findings simultaneously
  • Interactive Annotations: Click to add annotations with custom comments on DICOM images
  • Combined Overlay: Merge both clinician and AI views with visual consensus highlighting
  • Consensus Detection: Automatically detect and highlight regions where AI and clinician agree (green glow)
  • Multi-Model AI Analysis: Analyze images across 13+ chest pathology models via HOPPR AI
  • Anatomically Accurate Regions: AI findings mapped to medically appropriate locations on X-rays
  • Real-time Analysis: Instant AI inference with visual feedback

HOPPR AI Integration

The hoppr_model.py module provides a simple interface:

from hoppr_model import HopprModelInterface

# Initialize the model
model = HopprModelInterface()

# Analyze a DICOM image
results = model.analyze_dicom_image("path/to/scan.dcm")

# Access AI insights
if results["success"]:
    insights = results["results"]
    print(insights)

Supported Pathologies

Atelectasis, Cardiomegaly, Pneumothorax, Lung Opacity, Pleural Effusion, Consolidation, Infiltration, Pleural Thickening, Aortic Enlargement, Calcification, Pulmonary Fibrosis, ILD, and Normal

Development

Frontend:

npm run dev      # Start dev server
npm run build    # Build for production
npm run lint     # Run linter

Python/AI:

# Always activate venv first
source venv/bin/activate

# Test AI integration
python test_hoppr.py

# Run example
python main.py

Environment Variables

Variable Description Required
HOPPR_API_KEY Your HOPPR AI API key Yes

Important Disclaimer

Synapse is a hackathon prototype intended for research and educational purposes only. This is not a medical device and is not approved for primary diagnostic use. All images shown are de-identified. Clinical decisions must be made by licensed healthcare professionals. The developers assume no liability for clinical outcomes.

Contributing

This project was built for MTCHacks 2025.

License

MIT License - See LICENSE file for details.

About

2025 MTCHacks project for the Hoppr route.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors