You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The server only negotiates presentation contexts for the two mammography SOP classes sent by the Hologic Selenia Dimensions/3Dimensions:
39
+
40
+
- Digital mammography x-ray image storage – for presentation
41
+
- Digital mammography x-ray image storage – for processing
42
+
43
+
Other SOP classes (Secondary Capture, Breast Tomosynthesis, Dose SR, etc.) are rejected at association negotiation time so the modality knows not to send them.
44
+
45
+
### Image Processing Pipeline
46
+
47
+
When a C-STORE request arrives, the handler applies the following steps before writing to disk:
48
+
49
+
1.**Validate** — checks that required DICOM tags are present (`SOPInstanceUID`, `PatientID`, `StudyInstanceUID`, `SOPClassUID`) and that pixel data is consistent.
50
+
2.**Decompress** — if the image arrives in a compressed transfer syntax, it is decompressed before further processing.
51
+
3.**Resize** — if either dimension exceeds `DICOM_THUMBNAIL_SIZE` (default 400 px), the image is scaled down.
52
+
4.**Compress** — the pixel data is re-encoded as JPEG 2000 lossy at the configured compression ratio (`DICOM_COMPRESSION_RATIO`, default 15:1).
53
+
5.**Store** — the compressed DICOM file is written to the filesystem and indexed in the PACS database.
54
+
55
+
#### Why lossy compression and resizing?
56
+
57
+
Modalities send images in JPEG Lossless transfer syntax. The gateway PACS does not store clinical-grade images but rather reduced-resolution copies for display in Manage Breast Screening, where radiologists review appointment and worklist context rather than performing clinical reads. Full-resolution images remain on the BSU internal PACS. A 15:1 JPEG 2000 lossy compression ratio combined with a 400px resize reduces a typical mammography file from several hundred MB to tens of KB, which is appropriate for the thumbnail display use case and unproblematic for transferring via Azure Relay.
58
+
34
59
### Storage Structure
35
60
36
61
**Hash-based Directory Layout:**
62
+
37
63
```
38
64
storage/
39
65
├── b2/
@@ -48,6 +74,7 @@ storage/
48
74
```
49
75
50
76
Each file is stored using SHA256 hash of its SOP Instance UID:
77
+
51
78
- First 2 characters → Level 1 directory
52
79
- Characters 3-4 → Level 2 directory
53
80
- First 16 characters + `.dcm` → Filename
@@ -100,6 +127,8 @@ Environment variables:
100
127
|`PACS_PORT`|`4244`| DICOM service port |
101
128
|`PACS_STORAGE_PATH`|`/var/lib/pacs/storage`| Directory for DICOM files |
0 commit comments