Skip to content

Commit

Permalink
Merge pull request #141 from MagneticResonanceImaging/SNR_opt_reco
Browse files Browse the repository at this point in the history
Noise decorrelation implementation for multiCoilMultiEcho reconstruction
  • Loading branch information
tknopp authored Jul 12, 2023
2 parents 8a60db9 + 72520af commit 0f33494
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
9 changes: 8 additions & 1 deletion src/Reconstruction/IterativeReconstruction.jl
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,7 @@ function reconstruction_multiCoilMultiEcho(acqData::AcquisitionData{T}
, reg::Vector{Regularization}
, sparseTrafo
, weights::Vector{Vector{Complex{T}}}
, L_inv::Union{LowerTriangular{Complex{T}, Matrix{Complex{T}}}, Nothing}
, solvername::String
, senseMaps::Array{Complex{T}}
, normalize::Bool=false
Expand All @@ -246,6 +247,9 @@ function reconstruction_multiCoilMultiEcho(acqData::AcquisitionData{T}
numContr, numChan, numSl, numRep = numContrasts(acqData), numChannels(acqData), numSlices(acqData), numRepetitions(acqData)
encParams = getEncodingOperatorParams(;params...)

# noise decorrelation
senseMapsUnCorr = decorrelateSenseMaps(L_inv, senseMaps, numChan)

# set sparse trafo in reg
reg[1].params[:sparseTrafo] = DiagOp( repeat([sparseTrafo],numContr)... )

Expand All @@ -256,10 +260,13 @@ function reconstruction_multiCoilMultiEcho(acqData::AcquisitionData{T}
if encodingOps != nothing
E = encodingOps[i]
else
E = encodingOp_multiEcho_parallel(acqData, reconSize, senseMaps; slice=i, encParams...)
E = encodingOp_multiEcho_parallel(acqData, reconSize, senseMapsUnCorr; slice=i, encParams...)
end

kdata = multiCoilMultiEchoData(acqData, i) .* repeat(vcat(weights...), numChan)
if !isnothing(L_inv)
kdata = vec(reshape(kdata, :, numChan) * L_inv')
end

EFull = (W, E)#, isWeighting=true)
EFullᴴEFull = normalOperator(EFull)
Expand Down
3 changes: 2 additions & 1 deletion src/Reconstruction/RecoParameters.jl
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,8 @@ function setupIterativeReco(acqData::AcquisitionData{T}, recoParams::Dict) where
if isempty(noiseData)
L_inv = nothing
else
L = cholesky(covariance(noiseData), check = true)
psi = convert(typeof(noiseData), covariance(noiseData))
L = cholesky(psi, check = true)
L_inv = inv(L.L) #noise decorrelation matrix
end

Expand Down
2 changes: 1 addition & 1 deletion src/Reconstruction/Reconstruction.jl
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ function reconstruction(acqData::AcquisitionData, recoParams::Dict)
elseif recoParams[:reco] == "multiCoil"
return reconstruction_multiCoil(acqData, reconSize[1:encodingDims], reg, sparseTrafo, weights, L_inv, solvername, senseMaps, normalize, encOps, recoParams)
elseif recoParams[:reco] == "multiCoilMultiEcho"
return reconstruction_multiCoilMultiEcho(acqData, reconSize[1:encodingDims], reg, sparseTrafo, weights, solvername, senseMaps, normalize, encOps, recoParams)
return reconstruction_multiCoilMultiEcho(acqData, reconSize[1:encodingDims], reg, sparseTrafo, weights, L_inv, solvername, senseMaps, normalize, encOps, recoParams)
else
@error "reco modell $(recoParams[:reco]) not found"
end
Expand Down

0 comments on commit 0f33494

Please sign in to comment.