compress_coils
Use this convenience function when the complete data array is the calibration input. For a separate calibration subset, use fit_coil_compression followed by apply_coil_compression. The returned arrays use the same fitted transform.
Example
using HighOrderMRI, Random
data = randn(MersenneTwister(21), ComplexF32, 64, 4)
csm = ones(ComplexF32, 8, 8, 1, 4)
data_cc, csm_cc, transform = compress_coils(data, csm;
data_coil_dim=2, csm_coil_dim=4, n_virtual_coils=2)
@assert size(data_cc, 2) == size(csm_cc, 4) == size(transform, 2)API
compress_coils(data::AbstractArray{Complex{T}},
csm::AbstractArray{Complex{T}};
data_coil_dim::Integer = ndims(data),
csm_coil_dim::Integer = ndims(csm),
n_virtual_coils::Union{Nothing, Integer} = nothing,
energy_threshold::Union{Nothing, Real} = nothing,
noise_covariance::Union{Nothing, AbstractMatrix} = nothing,
prewhitening_scale_factor::Real = 1) where T <: AbstractFloatFit a coil-compression transform from data and apply it consistently to both data and csm. Pass exactly one of n_virtual_coils and energy_threshold. Supply noise_covariance for noise-prewhitened SVD, which is preferred when a representative noise acquisition is available. Supply prewhitening_scale_factor when its dwell time or effective receiver bandwidth differs from the MRI acquisition. For calibration-region fitting, call fit_coil_compression on a calibration view and then apply the result to both full arrays with apply_coil_compression.
Return (compressed_data, compressed_csm, transform). Both arrays are CPU Arrays even when the inputs are CUDA arrays; transfer them after fitting if the chosen encoding backend requires GPU inputs.