feat: Add DICOM (.dcm) file upload support with patient metadata extraction#120
Open
ironman1947 wants to merge 1 commit into
Open
feat: Add DICOM (.dcm) file upload support with patient metadata extraction#120ironman1947 wants to merge 1 commit into
ironman1947 wants to merge 1 commit into
Conversation
…ta extraction - Add pydicom>=2.4.0 dependency for DICOM file parsing - Implement process_dicom_file() helper to extract patient headers (age, gender, modality, field strength, scan sequence, manufacturer, study date) and normalize 16-bit pixel arrays to BGR for model ingestion - Extend ALLOWED_EXTENSIONS and /api/predict route to handle .dcm uploads - Display extracted DICOM metadata in a new 'Patient & Scan Metadata' report card (light + dark theme support) - Add DCM format badge and promote DICOM chip to Active in upload UI - Render inline SVG scanner placeholder for .dcm previews (browsers cannot natively display raw DICOM binary data in <img> tags) - Add cache-busting version params (?v=1.0.1) to style.css and script.js - Add unit tests for DICOM processing (test_dicom.py) — 38 tests pass Clinical motivation: DICOM is the universal standard format output by MRI/CT scanners. Supporting .dcm removes the manual PNG/JPG conversion step from clinical workflows and preserves the full 16-bit dynamic range of scan intensity values, avoiding diagnostic data loss from compression.
Author
|
This PR is for GSSoC 2026. DICOM support enables real clinical MRI scanner integration. Please review when you have a chance! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds native DICOM (.dcm) file upload support to NeuroVision,
enabling clinicians to upload MRI scans directly from scanner output
without manual conversion.
Key Features
✅ Parse DICOM headers (patient age, gender, modality, field strength, etc.)
✅ Normalize 16-bit pixel arrays to 8-bit for model inference
✅ Display extracted metadata in diagnostic report
✅ Lossless support for raw clinical MRI scanner output
✅ Backward compatible with PNG/JPG/TIFF uploads
Why DICOM Matters
DICOM is the universal standard format from all clinical MRI vendors
(Siemens, GE, Philips). Without DICOM support, NeuroVision cannot
integrate into real clinical workflows.
Changes
Testing
pip install -r requirements-web.txt pytest tests/ # All 38 tests passContributing to GSSoC 2026. Ready for review!