-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathanonymize.sh
executable file
·50 lines (42 loc) · 1.35 KB
/
anonymize.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#!/bin/bash
##
## Example anonymization script for Mac which uses Docker for native ImageIO
## Place DICOM with PHI in the 'DICOM' directory
## and it will write anonymized DICOM to 'DICOM-ANON'
##
# The new, anonymous patient ID
PATIENTID="MRN1234"
# The new, anonymous, accession number:
ACCESSION="ACN1234"
# Anonymize dates by subtracting or adding this value, in days:
JITTER="-10"
OPTIND=1
while getopts "h?vd" opt; do
case "$opt" in
h|\?)
echo "Usage: $0 -dv"
echo " -d Wait for Java debugger to attach to port 8000"
echo " -v Verbose output"
exit 0
;;
v) VERBOSE="-Dlog4j.configuration=file:/app/log4j.properties"
;;
d) DEBUG="-agentlib:jdwp=transport=dt_socket,address=8000,server=y,suspend=y"
echo "Java debugging enabled"
;;
esac
done
shift $((OPTIND-1))
[[ "${1:-}" = "--" ]] && shift
docker run --rm -e JAVA_TOOL_OPTIONS=${DEBUG} \
-p 8000:8000 -v ${PWD}/scripts:/scripts -v ${PWD}:/data/dicom mirc-ctp java ${VERBOSE} -cp /app/DAT/* org.rsna.dicomanonymizertool.DicomAnonymizerTool -v -n 8 \
-in /data/dicom/DICOM \
-out /data/dicom/DICOM-ANON \
-dec \
-rec \
-f /scripts/stanford-filter.script \
-da /scripts/stanford-anonymizer.script \
-dpa /scripts/stanford-scrubber.script \
-pPATIENTID "$PATIENTID" \
-pJITTER "$JITTER" \
-pACCESSION "$ACCESSION"