Date jitter (preserve intervals)
Shift dates by a random offset while preserving time intervals.
Problem
You need to de-identify date fields in a DICOM study while preserving the time intervals between studies. A patient has a baseline scan and a follow-up scan 30 days later — if you zero out both dates to 19000101, you lose the 30-day interval that’s critical for measuring treatment response. You want to shift all dates by a consistent (deterministic) offset so that relative timing is preserved.
Steps
-
Open your DICOM file (⌘O) and switch to Anon mode (⌘2).
-
Set a manual offset — type a number (like
10) into the date shift input. Every date in the file will move forward by exactly 10 days. -
Or use Auto shift — click the Auto button to derive a deterministic offset from the Patient ID hash. The same Patient ID always gets the same offset, ensuring consistency across all studies from that patient.
-
Apply the anonymization.
-
Verify — switch to Edit mode (⌘3), filter for Study Date, and confirm the value is correctly shifted.
Expected Result
- Manual shift: Study Date
20051130+ 10 days →20051210. - Auto shift: A non-zero, non-empty deterministic offset is derived from the Patient ID.
- Determinism: Load the file twice, click Auto twice → same offset value both times.
- Missing Patient ID: Auto gracefully derives a fallback offset (no crash, no zero offset).
- Missing Study Date: If the tag was deleted before anonymization, the date shift still completes without error — the absent tag simply stays absent (no corruption of other fields).
- Invalid date formats entered in the Edit modal are rejected with a red validation message (e.g.
INVALID_DATE→ “Must be exactly 8 digits: YYYYMMDD”), preventing malformed dates from entering the pipeline. - All date fields (Study Date, Series Date, Acquisition Date, Content Date, etc.) are shifted by the same offset, preserving temporal relationships.