Handling large DICOM studies: CT and PET transfers

  • A standard CT scan can contain 1,000 to 3,000 slices, and combined PET/CT exams can exceed 5,000 slices and 4 GB.
  • Webhook receivers must stream incoming bytes to object storage instead of buffering entire studies in memory.
  • Classic DICOM C-STORE sends slices sequentially, each needing a separate request and response over one association.
  • Hospital modalities typically abort transfers if a receiver does not acknowledge within 30 to 60 seconds.
  • Per-instance webhooks limit failure blast radius to a single slice, while batch multipart requests risk retransmitting entire batches.

A multi-gigabyte medical imaging study does not arrive as a single large file. Modern scanners break high-slice exams into thousands of individual files. To ingest these scans reliably, stream each slice directly to object storage and assemble the study downstream.

A standard Computed Tomography (CT) scan often contains 1,000 to 3,000 image slices. Advanced Positron Emission Tomography (PET) exams combined with CT can exceed 5,000 slices and 4 GB of uncompressed data.

If your webhook receiver tries to buffer an entire study before responding, your service will fail. Connections will time out, server memory will spike, and scanners will abort transfers.

Why handling large DICOM studies breaks standard webhook receivers

Most webhooks in cloud software deliver small JSON documents. A webhook from a billing or source control platform rarely exceeds 10 KB. Web application servers can read the full payload into memory before executing application code.

Medical imaging transfers do not behave like JSON events. Each DICOM image file, known as an instance, contains raw binary pixel data and clinical metadata. A single uncompressed CT slice measures roughly 512 KB. A 2,000-slice chest and abdomen scan totals more than 1 GB.

CT / PET Scanner              Webhook Receiver                 Object Storage
      │                              │                               │
      │── 1. C-STORE / POST slice ──>│                               │
      │                              │── 2. Stream slice to S3 ─────>│
      │                              │<── 3. Storage confirmation ───│
      │<── 4. HTTP 202 Accepted ─────│                               │

When 5 scanners transmit studies at the same time, your server receives hundreds of megabytes every minute. If your web server buffers each request in RAM, memory consumption multiplies quickly. The operating system kernel terminates the process to protect the host.

To keep memory bounded, parse incoming HTTP requests as raw byte streams. For details on building streaming handlers, read our guide on designing a resilient webhook receiver for DICOMweb STOW-RS.

How high-slice CT and PET scans transfer over DICOM

In hospital networks, scanners transmit imaging data using the classic DICOM network protocol. The scanner opens an association with a receiver to send instances through C-STORE commands. To understand this protocol, see our comparison of DICOM C-STORE vs DICOMweb STOW-RS.

Under the DICOM Standard (PS3.7, Chapter 9), C-STORE is a sequential operation by default. The sender pushes one instance, waits for a status response, and then pushes the next slice. A study with 2,500 slices requires 2,500 individual request and response cycles over that single association.

Sender (SCU)                                            Receiver (SCP)
      │                                                       │
      │── A-ASSOCIATE-RQ ────────────────────────────────────>│
      │<── A-ASSOCIATE-AC ────────────────────────────────────│
      │                                                       │
      │── C-STORE-RQ (Instance 1, SOP Instance UID .1) ──────>│
      │<── C-STORE-RSP (Status: 0x0000 Success) ──────────────│
      │                                                       │
      │── C-STORE-RQ (Instance 2, SOP Instance UID .2) ──────>│
      │<── C-STORE-RSP (Status: 0x0000 Success) ──────────────│
      │                                                       │
      │   [Repeats for 1,000 to 5,000+ slices]                │
      │                                                       │
      │── A-RELEASE-RQ ──────────────────────────────────────>│
      │<── A-RELEASE-RP ──────────────────────────────────────│

When gateways forward these scans to cloud services, they translate each transfer into an HTTP STOW-RS request. Each instance or batch of instances arrives at your webhook destination. The sender maintains the underlying network association while it waits for your server to acknowledge each delivery.

If your endpoint delays its reply, the sender pauses. A 200 millisecond delay per slice adds 8 minutes of idle waiting across a 2,500-slice CT exam.

How do you prevent association and HTTP request timeouts?

Hospital modalities enforce strict network timeouts. Most scanners close connections if a receiver does not reply within 30 to 60 seconds.

When a timeout occurs, the scanner sends an A-ABORT message and stops transmitting. The transfer fails midway through the exam. The hospital Picture Archiving and Communication System (PACS) marks the job as failed and attempts a retry later.

Scanner (Modality)             Cloud Webhook Handler           Background Queue
      │                                  │                            │
      │── POST /dicom (Slice 42) ───────>│                            │
      │                                  │── Write slice to S3 ──────>│
      │                                  │── Enqueue metadata event ─>│
      │<── HTTP 202 Accepted (50ms) ─────│                            │
      │                                                               │
      │   [Scanner immediately sends Slice 43]                        │

To eliminate timeouts, separate ingestion from processing. Acknowledge each incoming request within 100 milliseconds:

  1. Validate request headers and authentication tokens.
  2. Pipe the binary payload directly into persistent cloud object storage.
  3. Publish a lightweight notification to an internal task queue.
  4. Return an HTTP 202 Accepted response immediately.

Never run metadata indexing, image parsing, or artificial intelligence inference inside the webhook request handler. If you delay the HTTP response to process pixel data, you will trigger gateway timeouts. You can review standard header contracts in our guide to handling STOW-RS deliveries.

Streaming instances directly instead of buffering the whole study

Traditional web applications save uploads to a local temporary folder before processing. In medical imaging, this approach causes disk exhaustion.

A high-volume imaging center can transmit 40 CT scans per hour. If multiple scanners push studies simultaneously, your receiver will run out of disk space. Disk input-output bottlenecks will slow down network ingestion.

Incoming TCP Socket
        │
        ▼
[HTTP Chunked Parser] (RFC 9112)
        │
        ▼
[Object Storage Client] (Direct Multipart Stream)
        │
        ▼
HTTP 202 Acknowledgment

Instead of saving files locally, stream incoming HTTP request bodies straight to cloud storage. As defined in RFC 9112, HTTP chunked transfer encoding sends data as a series of chunks. Your application consumes chunks from the network socket and forwards them to object storage in real time.

This pattern limits memory consumption. A worker only keeps active network buffers in RAM, regardless of how many gigabytes the overall study contains. To see how zero-retention architectures support data privacy regulations, read our article on stateless streaming pipelines for healthcare privacy.

How to assemble completed studies in downstream pipelines

In classic DICOM, there is no network message that indicates a study has finished sending. The C-STORE protocol has no “end of study” packet. Scanners send thousands of instances and then close the association.

Downstream systems need to know when all slices have arrived before starting viewer rendering or automated analysis. To solve this, downstream workers track arriving slices using the Study Instance UID. To understand how studies, series, and instances relate, see our guide explaining DICOM Instances, Series, and Studies.

Arriving Slices                 Study Tracker State               Final Pipeline
      │                                  │                              │
      │── Slice 1 (Study UID .100) ─────>│ (Reset timer to 60s)         │
      │── Slice 2 (Study UID .100) ─────>│ (Reset timer to 60s)         │
      │── Slice 3 (Study UID .100) ─────>│ (Reset timer to 60s)         │
      │                                  │                              │
      │   ... Slices arrive ...          │                              │
      │                                  │                              │
      │── Slice 1800 (Study UID .100) ──>│ (Reset timer to 60s)         │
      │                                  │                              │
      │   [No slices for 60 seconds]     │── Timer expires ────────────>│
      │                                  │   Trigger study completion   │

Use an asynchronous debouncing worker to track study completion:

  • When the first slice arrives, record the Study Instance UID with a 60-second timer.
  • As each subsequent slice arrives, append its SOP Instance UID to the record and reset the timer.
  • When the timer expires without new slices, mark the study as complete and emit a processing job.

This debouncing pattern has one real limitation. If a network interruption delays incoming slices for 65 seconds, the worker will trigger study processing prematurely. When remaining slices arrive later, your pipeline must handle them as an update to an existing study.

Trade-offs between per-instance webhooks and batch packaging

When designing your ingest pipeline, you must choose between two delivery strategies. You can accept one instance per HTTP request, or group multiple instances into a single multipart request.

Delivery Model Network Overhead Failure Blast Radius Memory Footprint
Per-instance webhooks Higher (HTTP headers per slice) Low (single slice retried on failure) Minimal (flat 500 KB to 2 MB per request)
Batch multipart requests Lower (shared HTTP connection) High (entire batch retried on drop) High (variable 50 MB to 500 MB per request)

We recommend per-instance webhooks for external ingestion. While per-instance requests create more HTTP round-trips, they give you isolated error handling. If network instability drops slice 1,420 of a 2,000-slice CT scan, the sender only re-sends that single slice.

Batching hundreds of instances into a single 500 MB HTTP request creates fragile transfers. A single dropped packet can force the sender to retransmit the entire batch from the beginning. Keep the edge ingestion per-instance, and batch files together only inside your internal cloud network.

Dicomly builds infrastructure for healthcare software teams that receive DICOM studies from hospitals. Why we built Dicomly →

Sources

  1. DICOM Standard Part 4 (PS3.4, Annex B — Storage Service Class) (dicom.nema.org)
  2. DICOM Standard Part 7 (PS3.7, Chapter 9 — DIMSE-C Service Protocol) (dicom.nema.org)
  3. DICOM Standard Part 18 (PS3.18, Section 10.5 — Store Instances Transaction / STOW-RS) (dicom.nema.org)
  4. RFC 9112 — HTTP/1.1 (datatracker.ietf.org)

Start receiving DICOM today.

Early access. No credit card. First endpoint free.