API reference

RegisterWorkerApertures.AperturesType
Apertures(fixed, nodes, maxshift, λrange, [preprocess=identity]; kwargs...)

Create a worker object for apertured (blocked) image registration.

fixed is the single reference image. nodes is an N-tuple of node vectors (typically range objects) that define the aperture grid. maxshift is an N-tuple of integers giving the maximum shift (in pixels) to evaluate in each dimension. λrange is either a single Float64 (fixed regularization coefficient) or a (λmin, λmax) tuple; in the latter case the best λ is selected automatically via auto_λ and the search intermediates are available via monitor. preprocess is an optional function applied to each moving image before registration; fixed should already have the same transformation applied (see also PreprocessSNF).

Keyword arguments

  • overlap: N-vector of integers specifying the overlap (in pixels) between adjacent apertures; default zeros(Int, N).
  • normalization: :pixels (default) normalizes mismatch by aperture area; :intensity normalizes by total intensity in the aperture.
  • thresh_fac: factor used to compute thresh when not supplied explicitly; default (0.5)^ndims(fixed).
  • thresh: mismatch threshold below which a quadratic fit is attempted; computed from thresh_fac and normalization by default.
  • correctbias: apply bias correction to mismatch arrays; default true.
  • tid: thread/process ID for this worker; default 1.
  • dev: CUDA device index (>= 0 to use GPU, -1 for CPU); default -1.

Pass the returned object to driver or directly to worker.

Example

julia> using RegisterWorkerApertures

julia> fixed = rand(Float64, 50, 50);

julia> nodes = (range(1, 50, length=5), range(1, 50, length=7));

julia> alg = Apertures(fixed, nodes, (5, 5), (1e-6, 100.0));

julia> alg.dev
-1
source
RegisterWorkerShell.workerFunction
worker(algorithm::Apertures, img, tindex, mon)

Perform apertured registration of the image at time index tindex in img against the fixed reference stored in algorithm.

img is an image array with a time axis; tindex is the integer index into that axis. mon is a monitoring dict created by monitor; it is updated in-place with any requested outputs and returned.

Monitored keys written unconditionally:

  • :mismatch — total mismatch value after optimization
  • :u — the deformation field ϕ.u

Monitored keys written only when λrange is a (λmin, λmax) tuple:

  • — chosen regularization coefficient
  • :λs — all λ values tried by auto_λ
  • :datapenalty — data penalty at each λ
  • :sigmoid_quality — quality of the sigmoid fit

Monitored keys written only when present in mon:

  • :warped — preprocessed moving image warped by the recovered deformation ϕ
  • :warped0 — raw (unpreprocessed) moving image warped by ϕ
source