BorgVR Guide

Reference

Command-line tools

Convert or generate datasets in automated workflows and operate Swift or C++ servers without a graphical interface.

Synthetic Mandelbulb dataset

TerminalConverterApp

The Swift converter reads DICOM directories, QVIS files, and NRRD/NHDR files or creates reproducible synthetic volumes. Every mode writes the bricked BorgVR format.

TerminalConverterApp D <input-directory> <output.data> <description> <brick-size> <overlap>
TerminalConverterApp Q <input-file>      <output.data> <description> <brick-size> <overlap>
TerminalConverterApp N <input-file>      <output.data> <description> <brick-size> <overlap>

Descriptions containing spaces must be quoted. brick-size and overlap are positive integers.

Synthetic datasets

TerminalConverterApp C <algorithm> <bytes-per-component> <components> \
  <size-x> <size-y> <size-z> <output.data> <description> \
  <brick-size> <overlap>
IDGeneratorExecution
LLinear test dataCPU
FSingle-precision MandelbulbMetal with automatic CPU fallback
DDouble-precision MandelbulbCPU
JQuaternion sine Julia setMetal with automatic CPU fallback
BMandelboxMetal with automatic CPU fallback
GGyroidMetal with automatic CPU fallback
P3D Shepp-Logan phantomMetal with automatic CPU fallback
TFrequency chirp with brick-boundary testMetal with automatic CPU fallback

GPU generators operate slice by slice, allowing large volumes to be created without keeping the complete result in GPU memory. The converter supports 1-, 2-, or 4-byte components and can write multi-component BorgVR files.

TerminalConverterApp C J 2 1 512 512 512 QuaternionJulia.data \
  "Quaternion Julia set" 64 2

TerminalConverterApp --help shows complete syntax; --version prints the tool version.

TerminalServerApp

The Swift server publishes .data, .tf1d, and .marker files from one directory. By default, it refreshes the catalog every ten seconds.

TerminalServerApp --directory /path/to/datasets \
  --port 12345 --web-port 8080
--directory, -d
Directory containing datasets, transfer functions, and markers; defaults to the home directory.
--port, -p
Native BorgVR protocol port.
--max-bricks, -m
Maximum number of bricks per GETBRICKS request.
--password
Optional password for native and WebGPU clients.
--scan-interval
Catalog refresh interval in seconds; 0 disables rescanning.
--web-port
Enables the embedded WebGPU server on this port.
--web-http
Uses local HTTP instead of HTTPS and binds only to localhost.
--web-certificate
PKCS#12 certificate as .p12 or .pfx; supply its password with --web-certificate-password.

Synchronization

TerminalServerApp --directory /srv/borgvr \
  --sync-server server-a.example 12345 300 secret \
  --sync-server server-b.example 12345 300

--sync-server is repeatable. The interval must be at least ten seconds; the optional password is not echoed in runtime output. Datasets, transfer functions, and marker files are synchronized, incomplete transfers resume, and alternate sources are tried after a stall.

BORGVRServerCPP

The C++17 server is the cross-platform alternative for macOS, Linux, and Windows. On macOS or Linux, make first builds a small bootstrap program that embeds the contents of web/ into the server using LZ4 compression.

cd BORGVRServerCPP
make
make CONFIG=debug
make run ARGS="12345 64 /path/to/datasets --web-port 8080"

The three positional arguments are port, maximum bricks per request, and dataset directory. They may be followed by scan interval, password, WebGPU port, and repeatable --sync-server entries.

BORGVRServerCPP 12345 64 /data/BorgVR \
  --sync-server 192.168.1.10 12345 300 secret

A Visual Studio solution is also included for Windows. The generated files src/GeneratedWebAssets.cpp and src/GeneratedWebAssets.h are build artifacts and are not tracked in the repository.

Output and automation

Both Swift tools report their version with --version and return a non-zero exit status for invalid arguments. The converter logs dimensions, brick counts, compression statistics, value range, metadata, file size, and elapsed time, making it suitable for reproducible pipelines.