Before running D2D, ensure you have:
- Python 3.8+ installed
- Poppler utilities installed (for PDF conversion)
cd /home/claudeagent/d2d
./run.shThe script will:
- Create a virtual environment
- Install all dependencies
- Create .env file from template
- Start the application
cd /home/claudeagent/d2d
# Create virtual environment
python3 -m venv venv
source venv/bin/activate
# Install dependencies
pip install -r requirements.txt
# Create environment file
cp .env.example .env
# Run the application
uvicorn app.main:app --reloadcd /home/claudeagent/d2d
# Build and run with Docker Compose
docker-compose up -d
# View logs
docker-compose logs -f
# Stop
docker-compose down-
Open your browser: http://localhost:8000
-
Upload a test file: Try uploading a PDF, JPG, or PNG
-
Fill in metadata:
- Patient Name: TEST^PATIENT
- Patient ID: TEST001
- Study Description: Test Conversion
-
Convert: Click "Convert to DICOM"
-
Check archive: Your DICOM file is saved in
./dicom_archive/
- Click "Manage Destinations"
- Fill in the form:
- Name: My PACS
- AE Title: PACS_SERVER
- Host: 192.168.1.100
- Port: 104
- Calling AE: D2D_SCU
- Click "Test Connection" before saving
- Verify you see: ✓ Successfully connected
- Select the destination in Step 3
- Check "Send immediately after conversion"
- Convert your document
Ubuntu/Debian:
sudo apt-get install poppler-utilsmacOS:
brew install popplerVerify installation:
which pdftoppmChange the port in .env:
PORT=8001Or run with custom port:
uvicorn app.main:app --port 8001-
Check connectivity:
ping <destination-host>
-
Check firewall: Ensure DICOM port (104/11112) is open
-
Verify AE titles: Must match on both sides
-
Use Test Connection: Built-in C-ECHO verification
Edit .env and increase:
MAX_FILE_SIZE=100000000 # 100MB1. Upload PDF report
2. Metadata:
- Patient Name: SMITH^JOHN
- Patient ID: MRN12345
- Study Description: Laboratory Report
- Series Description: Blood Work 2026-01-22
3. Convert and send to PACS
1. Upload JPG/PNG image
2. Metadata:
- Patient Name: DOE^JANE
- Patient ID: EXT001
- Study Description: External CT Scan
- Modality: CT
- Accession Number: ACC20260122
3. Convert (creates Secondary Capture)
For multiple files, use the API:
import requests
# Upload file
with open('document.pdf', 'rb') as f:
response = requests.post(
'http://localhost:8000/api/upload',
files={'file': f}
)
file_id = response.json()['file_id']
# Convert to DICOM
requests.post('http://localhost:8000/api/convert', json={
'file_id': file_id,
'metadata': {
'patient_name': 'TEST^PATIENT',
'patient_id': 'TEST001',
'study_description': 'Document Conversion'
},
'send_immediately': False
})Once running, visit:
- Swagger UI: http://localhost:8000/docs
- ReDoc: http://localhost:8000/redoc
- Uploads:
./uploads/(temporary) - Archives:
./dicom_archive/(permanent) - Destinations:
./destinations.json - Logs: Console output
- Configure your PACS destinations
- Test with sample files
- Integrate into your workflow
- Consider adding authentication for production use
For issues or questions:
- Check the main README.md
- Review error messages in console
- Verify Poppler installation
- Test DICOM connectivity with C-ECHO
Important: This application has no authentication!
For production:
- Add authentication middleware
- Use HTTPS/TLS
- Implement audit logging
- Run behind reverse proxy (nginx/Apache)
- Use proper database for destinations
- Implement user management
- Add role-based access control
Example nginx config:
server {
listen 80;
server_name d2d.yourcompany.com;
location / {
proxy_pass http://localhost:8000;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
}
}