API reference
RegisterWorkerApertures.Apertures — Type
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; defaultzeros(Int, N).normalization::pixels(default) normalizes mismatch by aperture area;:intensitynormalizes by total intensity in the aperture.thresh_fac: factor used to computethreshwhen not supplied explicitly; default(0.5)^ndims(fixed).thresh: mismatch threshold below which a quadratic fit is attempted; computed fromthresh_facandnormalizationby default.correctbias: apply bias correction to mismatch arrays; defaulttrue.tid: thread/process ID for this worker; default1.dev: CUDA device index (>= 0to use GPU,-1for 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
-1RegisterWorkerShell.worker — Function
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 byauto_λ: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ϕ