API Reference
Running registration
RegisterDriver.driver — Function
driver(outfile, algorithm, img, mon)
driver(outfile, algorithms, img, mon)Register the image(s) in img and save results to outfile in JLD format.
algorithm is a single AbstractWorker instance; algorithms is a Vector of such instances for parallel (multi-threaded) computation. See the RegisterWorkerShell module for details on constructing workers.
mon is a Dict mapping Symbol keys to communication values, or for the parallel form a Vector of such Dicts (one per worker). The keys specify which computed quantities are communicated back from each worker. Set them up with the worker's monitor function:
algorithm = RegisterRigid(fixed, params...) # construct an AbstractWorker
mon = monitor(algorithm, (:tform, :mismatch)) # select fields to record
driver("results.jld", algorithm, img, mon) # register and saveScalars are stored as plain vectors indexed by image number; bit-type arrays are stored as higher-dimensional HDF5 datasets; other values are stored per-image inside "stack<n>" groups.
Additional local worker variables can be recorded by adding their keys to mon and calling monitor_copy! inside the worker:
# inside the worker algorithm:
monitor_copy!(mon, :extra, extra) # saved only if :extra is a key in monReturns nothing.
driver(algorithm, img, mon) -> DictRegister the single image in img and return the populated result Dict.
img must contain exactly one image; for multi-image stacks use the file-saving form of driver. The returned Dict is the same object as mon, with each key's value updated to the quantity computed by the worker.
Example
algorithm = RegisterRigid(fixed, params...)
mon = monitor(algorithm, (:tform, :mismatch))
mon = driver(algorithm, img, mon)
tform = mon[:tform]Utilities
RegisterDriver.mm_package_loader — Function
mm_package_loader(algorithm::AbstractWorker)
mm_package_loader(algorithms::Vector{<:AbstractWorker})Load the mismatch-computation package appropriate for algorithm's compute device.
Thin wrapper around RegisterWorkerShell.load_mm_package that accepts either a single worker or a vector of workers (delegating to the first element). Call this before driver when the algorithm requires a device-specific backend (e.g., a CUDA mismatch package) to be loaded on the driver process.
Returns nothing.
RegisterDriver.threadids — Function
threadids() -> Vector{Int}Return the sorted list of thread IDs that Julia's scheduler actually assigns to tasks spawned with @threads and Threads.@spawn.
Julia's main thread (ID 1) typically does not execute worker tasks. The returned IDs are useful for configuring AbstractWorker instances that pin execution to a specific thread via the workertid field.
Example
# On a Julia session started with 4 threads
threadids() # e.g. [2, 3, 4, 5]