VolumeRegistration
VolumeRegistration.KrigingUpsampler
— MethodConstruct an upsampler with its matrix
VolumeRegistration.apply_deformation_map
— Methodapply_deformation_map(moving, shifts, blocks; spline_type)
Corrects a sequence of imaging stacks with a transformation found through non-rigid registration
optionally, specify the spline_type
for interpolations between found shifts other than linear
VolumeRegistration.apply_deformation_map
— MethodCorrects a plane or volume with a transformation found through non-rigid registration
VolumeRegistration.calc_snr
— MethodComputes the signal to noise ratio of a phase correlation array, defined as the ratio of the maximum phase correlation in the window divided by the maximal phase correlation outside of the region where the maximum is (the idea being that it will be low if the phase correlation is flat versus peaked)
VolumeRegistration.extract_low_frequencies
— MethodTakes the data corresponding to the real part of the corners of the phase correlation array of interest for shift finding
extract_low_frequencies(data, corner_size)
extract_low_frequencies(data, corner_size, interpolate_middle)
Arugments
VolumeRegistration.fft_translate
— MethodTranslate using discrete fourier transform
VolumeRegistration.find_deformation_map
— MethodFind deformation maps by splitting the dataset in blocks and aligning blocks with subpixel precision
Arguments
moving
: the stack to be registeredreference
: the stack to be registered toborder_σ
: how far to fade out the borders of the whole image/volumeblock_size::NTuple{N, Integer}
: size of blocks to compute deformationsblock_border_σ::Union{Real, NTuple{N, Real}}
: how far to fade out themax_shift::Union{Real, NTuple{N, Integer}}
: maximum displacement of a block in each dimensionσ_filter
: low-pass filter widthupsampling
: upsampling of the registration for subpixel alignmentupsample_padding
: how far to pad from the local maximum for upsamplingsnr_n_smooths::Integer=2
: number of times the correlation matrices are smoothed by wieghting with adjacent ones (if they are under signal-to-noise ratio)snr_threshold::Real
: the threshold of the "peakiness" of the correlation matrix, if it's smaller than that, it's value is obtained by smoothing neighborssnr_n_pad::Integer
: window size of the signal-to-noise calculation
VolumeRegistration.find_translation
— Methodfind_translation(movings, reference; interpolate_middle, kwargs...)
Find the shift to move moving
by to align with reference
Arguments
σ_filter
: standard deviation of a lowpass filter applied before finding translationmax_shift::Union{Integer, Tuple}
: the maximal shift in each dimensionborder_σ
: the width of the border kernel for a smooth faloff towards the edgesupsampling::Union{Integer, Tuple}=1
: If bigger than 1, how much to upsample the shifts by (for subpixel registration)upsample_padding::Union{Integer, Tuple}=nothing
how much ± pixels to take around maximum to upsampleinterpolate_middle::Bool
: whether to interpolate the middle correlation pixel (to avoid static camera noise)
VolumeRegistration.gaussian_fft_filter
— MethodGaussian filter in the fourier domain (a Gaussian in the fourier domain is again a gaussian with inverse variance)
VolumeRegistration.make_planewise_reference
— Methodmake_planewise_reference(stack; reference_kw...)
Make a plane-by-plane reference for 2-photon imaging data, by first finding a reference image for each plane, and then finding inter-plane shifts and correcting them. The keyword arguments are from make_reference
VolumeRegistration.make_reference
— Methodmake_reference(stack; kwargs...)
Make a reference for a stack
Arguments
stack
: the data to be aligned, time is assumed to be the list dimensiontime_range::AbstractUnitRange=Colon()
: the range of time to take the reference fromcorr_win
: size of the window around the middle of the stack to calculate the optimal referencen_refine_from
: how many frames to make the refined reference fromn_average
: number of frames to average for a nice referencen_iterations
: how many times to recalculate the reference from the best correlated moved frames
more keyword arguments for find_translation
can be supplied
VolumeRegistration.prepare_find_deformation_map
— MethodPrepare everything common for calculating deformation maps
VolumeRegistration.prepare_find_translation
— MethodPrepare everything common for all translations
VolumeRegistration.refine_reference
— MethodIterative refinement of a reference image by aligning more frames and then making a new reference out of the most correlated, aligned frames
VolumeRegistration.register_planewise!
— Methodregister_planewise!(destination, stack, reference; output_time_first, translation_kw...)
Registers a stack of data acquired plane-by-plane The keyword arguments are from find_translation
VolumeRegistration.register_volumes!
— Methodregister_volumes!(destination, dataset, reference; max_shift, σ_filter, border_σ, interpolate_middle, upsampling, upsample_padding, deform, max_shift_deform, σ_filter_deform, border_σ_deform, block_border_σ, block_size, upsampling_deform, snr_n_smooths, snr_threshold, interpolate_middle_deform, t_block_size, output_time_first, block_range, interpolation_deform)
Register volumes, by first finding a rigid translationa and then optionally applying piecewise affine shifts.
Arguments
destination
: the destination for the registered dataset, usually a Float32 subtype of a DiskArraydataset
: the stack to be registeredreference
: the static volume regerencedeform
: whether to additionally perform non-rigid registrationoutput_time_first
: whether to reorder the array to have time-first or time-last order
The arguments are from find_translation
for the pure translation, and from find_deformation_map
for the piecewise affine transfomration (with the suffix _deform
).
VolumeRegistration.split_into_blocks
— MethodSplits data into an array of blocks, augmenting the last blocks which may not be full to keep consistent size. Cast immediately into complex for further processing
VolumeRegistration.to_ntuple
— MethodSmall utilities to get window size from iterables or single number
VolumeRegistration.translate
— MethodTranslate an image by known shift using either reindexing (for integer shifts) of FFT-based phase-space translation for non-integer shifts.
VolumeRegistration.upsampled_shift
— MethodFinds the shift in the area around the center of the orignial window with upsampling