This document provides comprehensive guidance for distributing and deploying DICOMKit components.
- Package Distribution
- CLI Tools Distribution
- Demo Applications
- Docker Deployment
- Integration Examples
DICOMKit is distributed as a Swift Package, making it easy to integrate into Swift projects.
In your Package.swift:
dependencies: [
.package(url: "https://github.com/Raster-Lab/DICOMKit.git", from: "1.0.0")
]Then add the specific modules you need to your targets:
.target(
name: "YourTarget",
dependencies: [
.product(name: "DICOMKit", package: "DICOMKit"), // High-level API
.product(name: "DICOMCore", package: "DICOMKit"), // Core parsing
.product(name: "DICOMNetwork", package: "DICOMKit"), // PACS networking
.product(name: "DICOMWeb", package: "DICOMKit"), // DICOMweb services
]
)- File → Add Package Dependencies...
- Enter:
https://github.com/Raster-Lab/DICOMKit.git - Select version: "1.0.0" (or "Up to Next Major")
- Choose the modules you need: DICOMKit, DICOMCore, DICOMNetwork, DICOMWeb
DICOMKit includes 35 command-line tools for working with DICOM files. Multiple distribution methods are available:
The easiest installation method for macOS users:
# Clone the repository
git clone https://github.com/Raster-Lab/DICOMKit.git
cd DICOMKit
# Install using local formula (builds from source)
brew install --build-from-source Formula/dicomkit.rbIf you have set up a dedicated Homebrew tap repository (see HOMEBREW_TAP_SETUP.md):
# Add the DICOMKit tap (requires separate repository)
brew tap Raster-Lab/dicomkit
brew install dicomkitNote: The
brew tapcommand requires a separate GitHub repository namedhomebrew-dicomkitto exist athttps://github.com/Raster-Lab/homebrew-dicomkit. See the tap setup guide for instructions on creating this repository.
Pre-built binaries are available from GitHub Releases:
- Go to https://github.com/Raster-Lab/DICOMKit/releases
- Download
dicomkit-cli-tools-v1.0.0-macos-arm64.tar.gz - Extract and install:
tar -xzf dicomkit-cli-tools-v1.0.0-macos-arm64.tar.gz
sudo cp bin/dicom-* /usr/local/bin/See INSTALLATION.md for detailed instructions.
git clone https://github.com/Raster-Lab/DICOMKit.git
cd DICOMKit
./Scripts/install-cli-tools.shPhase 1 - Core Tools (7 tools):
dicom-info- Display DICOM metadatadicom-convert- Convert transfer syntaxes and export imagesdicom-validate- Validate DICOM conformancedicom-anon- Anonymize patient informationdicom-dump- Hexadecimal inspectiondicom-query- Query PACS serversdicom-send- Send files to PACS
Phase 2 - Enhanced Workflow (4 tools):
dicom-diff- Compare DICOM filesdicom-retrieve- Retrieve from PACS (C-MOVE/C-GET)dicom-split- Extract frames from multi-frame imagesdicom-merge- Create multi-frame images
Phase 3 - Format Conversion (4 tools):
dicom-json- Convert to/from DICOM JSONdicom-xml- Convert to/from DICOM XMLdicom-pdf- Handle encapsulated PDF/CDA documentsdicom-image- Convert images to DICOM Secondary Capture
Phase 4 - Archive Management (3 tools):
dicom-dcmdir- Create and manage DICOMDIR filesdicom-archive- Local DICOM archive with indexingdicom-export- Advanced export with metadata embedding
Phase 5 - Network & Workflow (5 tools):
dicom-qr- Integrated query-retrieve workflowdicom-wado- DICOMweb client (WADO-RS, QIDO-RS, STOW-RS)dicom-echo- Network diagnostics (C-ECHO)dicom-mwl- Modality Worklist queriesdicom-mpps- Modality Performed Procedure Step
Phase 6 - Advanced Utilities (6 tools):
dicom-pixedit- Pixel data manipulationdicom-tags- Tag manipulation utilitiesdicom-uid- UID generation and managementdicom-compress- Compression/decompressiondicom-study- Study/Series organizationdicom-script- Workflow automation scripting
DICOM Studio is a native macOS application for viewing, analyzing, and managing DICOM medical imaging files. Multiple installer formats are available.
Download the DMG from GitHub Releases and drag DICOM Studio to your Applications folder:
- Go to https://github.com/Raster-Lab/DICOMKit/releases
- Download
DICOMStudio-<version>.dmg - Open the DMG and drag
DICOMStudio.appto the Applications folder
Or build the DMG locally:
git clone https://github.com/Raster-Lab/DICOMKit.git
cd DICOMKit
./Scripts/package-dicom-studio-dmg.sh --version 1.0.16Optional code signing and notarization:
./Scripts/package-dicom-studio-dmg.sh \
--version 1.0.16 \
--sign "Developer ID Application: Your Name (TEAM_ID)" \
--notarizeThe .pkg installer provides a guided installation experience:
- Go to https://github.com/Raster-Lab/DICOMKit/releases
- Download
DICOMStudio-<version>.pkg - Double-click to run the guided installer
Or build the .pkg locally:
git clone https://github.com/Raster-Lab/DICOMKit.git
cd DICOMKit
./Scripts/package-dicom-studio-pkg.sh --version 1.0.16Optional signing and notarization:
./Scripts/package-dicom-studio-pkg.sh \
--version 1.0.16 \
--sign "Developer ID Installer: Your Name (TEAM_ID)" \
--notarizeInstall DICOM Studio via Homebrew using the local cask formula (requires cloning the repository):
git clone https://github.com/Raster-Lab/DICOMKit.git
cd DICOMKit
brew install --cask Formula/dicomstudio.rbOr, if a Homebrew tap has been set up (see HOMEBREW_TAP_SETUP.md):
brew tap Raster-Lab/dicomkit
brew install --cask dicomstudioTo uninstall:
brew uninstall --cask dicomstudioDICOM Studio releases are automated via the dicom-studio-release.yml GitHub Actions workflow. The workflow is triggered by pushing a tag matching studio-v*.*.*:
git tag studio-v1.0.16
git push origin studio-v1.0.16This will:
- Validate the build and run DICOMStudio tests
- Build both DMG and .pkg installers
- Generate SHA-256 checksums
- Create a GitHub Release with all artifacts
DICOMKit includes three fully-functional demo applications:
Mobile DICOM viewer for iPhone and iPad.
Distribution Options:
- TestFlight (recommended for beta testing)
- App Store (for public distribution)
- Direct Installation (Xcode required)
Status: iOS viewer has been removed from the repository.
Status: macOS viewer has been removed from the repository.
Docker containers enable easy deployment of DICOMKit server components.
Create a Dockerfile for the DICOMweb server:
FROM swift:6.2-jammy
WORKDIR /app
# Copy source code
COPY . .
# Build DICOMweb server
RUN swift build -c release --product DICOMWebServer
# Expose DICOMweb ports
EXPOSE 8080
# Run server
CMD [".build/release/DICOMWebServer"]Build and run:
docker build -t dicomkit-server .
docker run -p 8080:8080 dicomkit-serverdocker-compose.yml example:
version: '3.8'
services:
dicomweb-server:
build: .
ports:
- "8080:8080"
environment:
- DICOM_STORAGE_PATH=/data/dicom
- LOG_LEVEL=info
volumes:
- dicom-data:/data/dicom
restart: unless-stopped
postgres:
image: postgres:15
environment:
POSTGRES_DB: dicomkit
POSTGRES_USER: dicom
POSTGRES_PASSWORD: changeme
volumes:
- postgres-data:/var/lib/postgresql/data
restart: unless-stopped
volumes:
dicom-data:
postgres-data:Start the stack:
docker-compose up -dExample Kubernetes deployment (k8s/deployment.yaml):
apiVersion: apps/v1
kind: Deployment
metadata:
name: dicomkit-server
spec:
replicas: 3
selector:
matchLabels:
app: dicomkit-server
template:
metadata:
labels:
app: dicomkit-server
spec:
containers:
- name: dicomkit
image: dicomkit-server:latest
ports:
- containerPort: 8080
env:
- name: LOG_LEVEL
value: "info"
resources:
requests:
memory: "512Mi"
cpu: "500m"
limits:
memory: "2Gi"
cpu: "2000m"
---
apiVersion: v1
kind: Service
metadata:
name: dicomkit-service
spec:
selector:
app: dicomkit-server
ports:
- protocol: TCP
port: 80
targetPort: 8080
type: LoadBalancerDeploy:
kubectl apply -f k8s/deployment.yamlimport SwiftUI
import DICOMKit
struct DICOMReaderView: View {
@State private var dicomFile: DICOMFile?
@State private var patientName: String = ""
var body: some View {
VStack {
Button("Open DICOM File") {
openDICOMFile()
}
if let file = dicomFile {
Text("Patient: \(patientName)")
.font(.headline)
}
}
}
func openDICOMFile() {
// File picker logic here
if let url = selectedFileURL {
do {
dicomFile = try DICOMFile(fileURL: url)
patientName = dicomFile?.dataSet.string(for: .patientName) ?? "Unknown"
} catch {
print("Error reading DICOM file: \(error)")
}
}
}
}#!/bin/bash
# Batch anonymization script
INPUT_DIR="/path/to/dicom/input"
OUTPUT_DIR="/path/to/dicom/output"
# Anonymize all DICOM files
for file in "$INPUT_DIR"/*.dcm; do
basename=$(basename "$file")
dicom-anon \
--input "$file" \
--output "$OUTPUT_DIR/$basename" \
--patient-name "Anonymous" \
--patient-id "ANON$(date +%s)"
done
echo "Anonymization complete: $(ls -1 $OUTPUT_DIR | wc -l) files"import DICOMWeb
let client = DICOMwebClient(baseURL: URL(string: "https://dicom.example.com")!)
// Query for studies
let studies = try await client.searchStudies(
patientName: "Doe^John",
studyDate: "20240101-20241231"
)
// Retrieve a study
for study in studies {
let instances = try await client.retrieveStudy(
studyUID: study.studyInstanceUID
)
print("Retrieved \(instances.count) instances")
}import DICOMNetwork
// Configure PACS connection
let config = AssociationConfiguration(
callingAE: "MY_APP",
calledAE: "PACS_SCP",
host: "pacs.hospital.org",
port: 11112
)
// Query for patients
let queryService = QueryService(configuration: config)
let results = try await queryService.findPatients(
patientName: "Smith*",
patientID: nil
)
// Retrieve studies
let retrieveService = RetrieveService(configuration: config)
for result in results {
try await retrieveService.moveStudy(
studyUID: result.studyInstanceUID,
destinationAE: "MY_STORAGE"
)
}- All tests pass (
swift test) - Code builds without warnings (
swift build -c release) - Security scan clean (CodeQL)
- Documentation up to date
- Version numbers updated
- CHANGELOG.md updated
- GitHub release created
- Release notes written
- Binaries built and uploaded
- Checksums generated
- Homebrew formula updated
- Documentation deployed
- Installation verified on clean system
- CLI tools work correctly
- Package Manager integration tested
- User documentation verified
- Announcement posted (if applicable)
- Documentation: https://github.com/Raster-Lab/DICOMKit/tree/main/Documentation
- Issues: https://github.com/Raster-Lab/DICOMKit/issues
- Installation Guide: INSTALLATION.md
- Homebrew Setup: HOMEBREW_TAP_SETUP.md
Last Updated: February 2026
Version: 1.0.0