Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
bb5d2c0
Upgrade axios version
OzgeYurtsever Mar 25, 2026
c23c274
Upgrade npm package
OzgeYurtsever Mar 25, 2026
9b8bc80
Refactor series openning
OzgeYurtsever Apr 17, 2026
9ebe314
Implement mammogram viewing
OzgeYurtsever Apr 18, 2026
a279c55
Add Mammogramm specific tools
OzgeYurtsever Apr 18, 2026
66c6a0c
Implement expand functionality
OzgeYurtsever Apr 19, 2026
0f2fa52
Add stamp
OzgeYurtsever Apr 20, 2026
dc073e0
Add consoles
OzgeYurtsever Apr 20, 2026
6c12151
Fix case sensitivity at modality check
OzgeYurtsever Apr 20, 2026
0e20ea2
Improve mode and mammogram checks
OzgeYurtsever Apr 20, 2026
0040b9a
Add more consoles
OzgeYurtsever Apr 20, 2026
9c8a8c8
Fix modality support
OzgeYurtsever Apr 20, 2026
e9dd9e5
Fix mammogram toolbar and expand checkbox css
OzgeYurtsever Apr 20, 2026
9b4ab0f
Implement previous button
OzgeYurtsever Apr 21, 2026
41236e2
Move the mamogram toolbar
OzgeYurtsever Apr 21, 2026
7a228c6
Add overlay toggle bug
OzgeYurtsever Apr 21, 2026
243b1eb
Implement reordering modal
OzgeYurtsever Apr 28, 2026
5b18602
Enable new toolbar for all modalities
OzgeYurtsever Apr 28, 2026
a3f2a04
Display sig series based on pageOrder
OzgeYurtsever Apr 28, 2026
2515ee6
Integrte NEXT PREV button to pageorder logic
OzgeYurtsever Apr 28, 2026
932e00b
Fix bugs
OzgeYurtsever Apr 28, 2026
96df489
Implement reordering and state saving
OzgeYurtsever Apr 30, 2026
c8bd285
Show expand checkbox if the modality is MG
OzgeYurtsever May 24, 2026
d604bcf
Expand viewports with the selection order
OzgeYurtsever May 25, 2026
207265e
Set maxport limit to 8 for MG modality
OzgeYurtsever May 25, 2026
cd871fb
Fix MG detection and series order distribution
OzgeYurtsever May 26, 2026
3cde0d9
Add TRIM/UNTRIM button to mammogram toolbar
OzgeYurtsever May 26, 2026
963e207
Check some of the series are MG instead of every
OzgeYurtsever May 27, 2026
4e1bec6
Allow up to 8 significant series in teaching file flow
OzgeYurtsever May 27, 2026
9752ae7
Fix teaching file display: open page 1 series only on launch
OzgeYurtsever May 27, 2026
98ba36d
Fix empty getSeries result by retrying with forceDicomweb=true
OzgeYurtsever May 28, 2026
93b21c1
Retry getSeries with opposite forceDicomweb flag when empty
OzgeYurtsever May 28, 2026
715b065
Refresh display view after series reorder save
OzgeYurtsever May 29, 2026
b95e1fd
Display modalities in series selection modal
OzgeYurtsever May 29, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
83 changes: 83 additions & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
# CLAUDE.md

This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.

## Overview

ePAD JS is a React-based DICOM medical imaging viewer and annotation platform. It enables radiologists to view medical images from PACS systems, create/manage annotations (AIMs), and generate clinical reports.

## Commands

```bash
npm start # Development server
npm run build # Production build
npm test # Run tests (Jest + jsdom)
```

No lint script is defined. Tests use `react-app-rewired test --env=jsdom`.

To run a single test file:
```bash
npm test -- --testPathPattern=<filename>
```

## Architecture

### Tech Stack
- **React 16** (class components predominate, some hooks)
- **Redux + redux-thunk** for state management
- **React Router v4** for routing
- **Cornerstone.js** for DICOM image rendering
- **Keycloak** (v4.0.0-beta.2) for OAuth/OIDC authentication
- **Axios** for HTTP, with auth interceptors in `src/services/httpService.js`

### Routing (`src/App.js`)
All routes except `/login`/`/logout` are wrapped in `ProtectedRoute`:
- `/display` — DICOM viewer (main imaging workflow)
- `/list/:pid` — Patient/study search (SearchView)
- `/flex/:pid` — Flexible layout view
- `/anotate` — Annotation creation
- `/progress` — Upload progress tracking
- `/management` — Admin panel
- `/annotationSearch` — Cross-project annotation search

### Redux Store (`src/reducers.js`)
Three combined reducers:
- **`annotationsListReducer`** — Core viewer state: `openSeries[]`, `aimsList{}`, selected project/patients/studies, `projectMap{}`, AIM templates, UI toggles (`showAnnotations`, `showLabels`, etc.)
- **`searchViewReducer`** — Study list state, user-selected studies, Cornerstone instances
- **`managementReducer`** — Admin/management UI state

### Service Layer (`src/services/`)
19 service modules wrapping the backend API. Key ones:
- `httpService.js` — Axios instance with auth header injection; reads `apiUrl`/`wadoUrl` from `sessionStorage`
- `annotationServices.js` — AIM CRUD
- `seriesServices.js` / `studyServices.js` — DICOM data fetching
- `authService.js` — Keycloak integration
- `projectServices.js` — Project management

### Key Component Modules (`src/components/`)
- **`display/`** — DICOM viewer; `displayView.jsx` is the largest file (~116KB). Contains Cornerstone tool integration (Arrow, Circle, Line, Bidirectional, Freehand, Probe, segmentation)
- **`searchView/`** — Patient/study search with reporting (ADLA, RECIST, Waterfall), filters, and a drag-drop study grid
- **`annotationsList/`** — Annotation management with Redux reducer/actions; includes `annotationDock/`
- **`sideBar/`** — Left navigation: patient/project tree, worklist integration
- **`ToolMenu/`** — Drawing/measurement tool palette including SmartBrush for segmentation
- **`management/`** — Project/user/permission administration
- **`aimEditor/`** — AIM annotation editor with tag editing (`tagEditor/`)
- **`MediaExport/`** — GIF and PowerPoint export
- **`common/`** — Shared UI: `protectedRoute.jsx`, modals, `SelectModalMenu.jsx`

### Session & Persistence
- **`sessionStorage`**: API credentials (`apiUrl`, `wadoUrl`, `username`, tokens), operating mode (`lite` vs standard)
- **`localStorage`**: Tree data, PHI visibility preferences, filters

### Build Configuration
- `react-app-rewired` overrides CRA config via `config-overrides.js` — adds Node.js polyfills (`NodePolyfillPlugin`) for crypto/Buffer, TypeScript resolution, and `fs: false` fallback
- `jsconfig.json` sets `baseUrl: "src"` so imports can be relative to `src/` (e.g., `import X from 'components/...'`)
- Babel: `@babel/preset-env`, `@babel/react`, Emotion plugin

### Deployment
Docker multi-stage build: Node 11 Alpine for build → Nginx for serving. Nginx proxies:
- `/api` → `epad_lite:8080` (backend)
- `/pacs` → `epad_dicomweb:8090` (DICOM server)
- `/keycloak` → Keycloak auth server
- WADO images cached for 60 minutes
Loading