-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdemo.ps1
More file actions
78 lines (67 loc) · 3.52 KB
/
demo.ps1
File metadata and controls
78 lines (67 loc) · 3.52 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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
# demo.ps1 - full dicom-toolkit-rs CLI demonstration
#
# Runs all showcase scripts in order against the ABDOM CT test series.
# Builds the workspace first if the binaries are not present.
#
# Usage:
# pwsh -File demo.ps1 # run all demos non-interactively
# pwsh -File demo.ps1 -Pause # pause between demos (interactive)
#
# Windows execution policy note:
# If scripts are blocked, run once: Set-ExecutionPolicy -Scope CurrentUser RemoteSigned
[CmdletBinding()]
param(
[switch]$Pause
)
Set-StrictMode -Version Latest
$ErrorActionPreference = 'Stop'
$ScriptDir = Split-Path -Parent $MyInvocation.MyCommand.Path
$Root = Resolve-Path (Join-Path $ScriptDir '..\..')
$Ext = if (($env:OS -eq 'Windows_NT') -or ((Test-Path variable:IsWindows) -and $IsWindows)) { '.exe' } else { '' }
$Dcmdump = Join-Path $Root "target\debug\dcmdump$Ext"
function Banner($text) {
Write-Host ""
Write-Host ("*" * 64) -ForegroundColor Magenta
Write-Host (" " + $text) -ForegroundColor Magenta
Write-Host ("*" * 64) -ForegroundColor Magenta
}
function MaybePause {
if ($Pause) {
Write-Host ""
Read-Host " Press Enter to continue"
}
}
# ── Build if needed ──────────────────────────────────────────────────────────
if (-not (Test-Path $Dcmdump)) {
Write-Host "Building workspace..." -ForegroundColor Yellow
Push-Location $Root
try { cargo build --bins }
finally { Pop-Location }
}
# ── 01: dcmdump ──────────────────────────────────────────────────────────────
Banner "01 · dcmdump - print DICOM file contents"
& "$ScriptDir\01_dump.ps1"
MaybePause
# ── 02: network ──────────────────────────────────────────────────────────────
Banner "02 · echoscu + storescu + storescp - network transfer"
& "$ScriptDir\02_network.ps1"
MaybePause
# ── 03: query ────────────────────────────────────────────────────────────────
Banner "03 · findscu / getscu - Query/Retrieve examples"
& "$ScriptDir\03_query.ps1"
MaybePause
# ── 04: img2dcm ──────────────────────────────────────────────────────────────
Banner "04 · img2dcm - PNG to DICOM Secondary Capture"
& "$ScriptDir\04_img2dcm.ps1"
MaybePause
# ── 05: jpegls ───────────────────────────────────────────────────────────────
Banner "05 · dcmcjpls + dcmdjpls - JPEG-LS compress / decompress"
& "$ScriptDir\05_jpegls.ps1"
MaybePause
# ── 06: jp2k ─────────────────────────────────────────────────────────────────
Banner "06 · dcmcjp2k + dcmdjp2k - JPEG 2000 compress / decompress"
& "$ScriptDir\06_jp2k.ps1"
Write-Host ""
Write-Host ("*" * 64) -ForegroundColor Green
Write-Host " All demos complete." -ForegroundColor Green
Write-Host ("*" * 64) -ForegroundColor Green