-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy path01_dump.sh
More file actions
executable file
·54 lines (45 loc) · 3.22 KB
/
01_dump.sh
File metadata and controls
executable file
·54 lines (45 loc) · 3.22 KB
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
51
52
53
54
#!/usr/bin/env bash
# 01_dump.sh — dcmdump showcase
# Demonstrates the various output modes of dcmdump using the ABDOM CT series.
set -euo pipefail
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
ROOT="$SCRIPT_DIR/../.."
BIN="$ROOT/target/debug/dcmdump"
FILES="$SCRIPT_DIR/../testfiles"
if [[ ! -x "$BIN" ]]; then
echo "Binary not found — run: cargo build --bins"
exit 1
fi
DCM="$FILES/ABDOM_1.dcm"
echo "════════════════════════════════════════════════════════════"
echo " 1. Default dump (dataset only, truncated values)"
echo "════════════════════════════════════════════════════════════"
"$BIN" "$DCM"
echo ""
echo "════════════════════════════════════════════════════════════"
echo " 2. Include File Meta Information header (--meta)"
echo "════════════════════════════════════════════════════════════"
"$BIN" --meta "$DCM"
echo ""
echo "════════════════════════════════════════════════════════════"
echo " 3. No string length limit (--no-limit)"
echo "════════════════════════════════════════════════════════════"
"$BIN" --no-limit "$DCM" | head -30
echo ""
echo "════════════════════════════════════════════════════════════"
echo " 4. DICOM JSON output (--json)"
echo "════════════════════════════════════════════════════════════"
"$BIN" --json "$DCM" | head -40
echo ""
echo "════════════════════════════════════════════════════════════"
echo " 5. DICOM XML output (--xml)"
echo "════════════════════════════════════════════════════════════"
"$BIN" --xml "$DCM" | head -40
echo ""
echo "════════════════════════════════════════════════════════════"
echo " 6. Dump all 5 slices at once"
echo "════════════════════════════════════════════════════════════"
for f in "$FILES"/ABDOM_*.dcm; do
echo "--- $f ---"
"$BIN" "$f" | grep -E "^\(0010,0010\)|^\(0008,0060\)|^\(0020,0013\)|^\(0028,0010\)|^\(0028,0011\)"
done