AI-powered MRI DICOM scan analysis using Claude.
- DICOM file loading - from local folder or drag & drop
- AI-assisted series selection - describe what you want to examine ("spine", "brain") and AI selects relevant series
- Multi-series selection - manually select multiple series
- Auto-filtering - localizer/scout images are automatically filtered
- Slice navigation - mouse wheel, arrow keys, slider
- Analysis modes:
- Overview (~10 slices) - quick overview
- Current - current slice only
- Selected - manually selected slices
- All - all loaded slices
- AI annotations - markers on images where AI found findings
- Contextual chat - continue conversation with AI about the scans
mri/
├── backend/ # Python FastAPI
│ ├── main.py # API endpoints
│ ├── dicom_utils.py # DICOM parsing
│ ├── claude_client.py # Claude API
│ └── requirements.txt
├── frontend/ # React + TypeScript + Vite
│ ├── src/
│ │ ├── App.tsx
│ │ ├── components/
│ │ │ ├── AuthScreen.tsx # Token input
│ │ │ ├── DicomViewer.tsx # DICOM viewer
│ │ │ ├── ChatPanel.tsx # AI chat
│ │ │ └── UploadZone.tsx # File upload
│ │ ├── hooks/
│ │ │ ├── useApi.ts
│ │ │ └── useStore.ts
│ │ └── types/
│ └── package.json
└── uploads/ # Temporary storage
- Python 3.11+
- Node.js 18+
- Claude API key (
sk-ant-api03-*)
cd backend
# Create virtual environment
python3 -m venv venv
# Activate (macOS/Linux)
source venv/bin/activate
# Activate (Windows)
# venv\Scripts\activate
# Install dependencies
pip install -r requirements.txtcd frontend
# Install dependencies
npm install./start.shmake install # First time only
make dev # Start both serversTerminal 1 - Backend:
cd backend
source venv/bin/activate
uvicorn main:app --reload --port 8000Terminal 2 - Frontend:
cd frontend
npm run dev-
Enter API token - Claude API key (starts with
sk-ant-api03-) -
Load DICOM files:
- Click "Load from local folder" and enter path to DICOM folder
- Or drag & drop files into the upload zone
-
Select series:
- AI selection: enter what you want to examine (e.g., "spine and lower back")
- Manual selection: click on series checkboxes
- Load All: load all non-localizer series
-
Navigation:
- Mouse wheel / arrow keys - switch slices
- Space - select slice for analysis
- Slider - quick navigation
-
Analysis:
- Select mode: Overview / Current / Selected / All
- Enter question or use Quick Actions
- AI will show findings with markers on images
| Endpoint | Method | Description |
|---|---|---|
/api/health |
GET | Health check |
/api/model-info |
GET | AI model information |
/api/validate-token |
POST | Validate API token |
/api/scan-folder |
POST | Scan DICOM folder |
/api/load-series/{id} |
POST | Load series |
/api/load-multiple-series/{id} |
POST | Load multiple series |
/api/ai-select-series/{id} |
POST | AI-assisted series selection |
/api/upload |
POST | Upload files |
/api/scan/{id} |
GET | Get scan data |
/api/analyze |
POST | Analyze with Claude |
/api/chat |
POST | Continue chat |
- FastAPI - async API server
- pydicom - DICOM parsing
- Pillow + numpy - image processing
- anthropic - Claude API SDK
- React 18 + TypeScript
- Vite - build tool
- TailwindCSS - styling
- Zustand - state management
- react-dropzone - file upload
- react-markdown - AI response rendering
Uses Claude Sonnet 4 (claude-sonnet-4-20250514).
The system prompt is configured for:
- Structural anomaly analysis
- Unusual signal detection
- Mass effect identification
- Atrophy detection
- Returning finding coordinates for marker display
- API token stored only in sessionStorage (not localStorage)
- Token passed in header with each request
- Files deleted after session
- Backend does not store tokens
If pyenv Python has SSL issues:
# Use Homebrew Python
/opt/homebrew/bin/python3 -m venv venv
./venv/bin/pip install -r requirements.txtFrontend must run on localhost:5173 (configured in CORS).
Make sure token starts with sk-ant-api03- (not sk-ant-sid or others).
AI analysis is for educational and informational purposes only. This is NOT a medical diagnosis. Always consult a qualified radiologist for professional interpretation.



