MagneticResonanceImaging / MRIReco.jl

Julia Package for MRI Reconstruction
https://magneticresonanceimaging.github.io/MRIReco.jl/latest/
Other
85 stars 22 forks source link

Undersampled Cartesian Simulation #127

Closed alexjaffray closed 1 year ago

alexjaffray commented 1 year ago

I wanted to generate some undersampled Cartesian data for a small teaching example (e.e to show aliasing) and it seems with the new changes to the package one can no longer generate undersampled simulated data.

The following MWE fails for me on MRIReco v0.7.0 and MRISimulation v0.1.1 with the error: DimensionMismatch("array could not be broadcast to match destination")


N = 256
numCoils = 8
I = shepp_logan(N)
I = circularShutterFreq!(I,1)
coilsens = birdcageSensitivity(N, numCoils, 1.5)

# simulation parameters
params = Dict{Symbol, Any}()
params[:simulation] = "fast"
params[:trajName] = "Cartesian"
params[:numProfiles] = N ÷ 4
params[:numSamplingPerProfile] = N
params[:AQ] = 2.0e-2
params[:senseMaps] = coilsens

# do simulation
acqData = MRISimulation.simulation(I, params)
tknopp commented 1 year ago

Thanks for the report. I will have a look. Are you sure that this worked before? I cannot directly see what has changed in that domain recently.

tknopp commented 1 year ago

Probably, this is the problematic line: https://github.com/MagneticResonanceImaging/MRIReco.jl/blob/master/MRIOperators/src/EncodingOp.jl#L155

If we find that a trajectory is Cartesian, we take the fast path and make a full FFT. Git blame says that this line is 4 years old.

@migrosser: you probably know better, what would be the best fix for that? I would say we need an "isUndersampling" function, that determines, whether a Cartesian trajectory is undersampled. Then we could somehow add the corresponding subsampling op (or do the subsampling manually)

tknopp commented 1 year ago

Hm, actually what I describe seems to be already there:

https://github.com/MagneticResonanceImaging/MRIReco.jl/blob/master/MRIOperators/src/EncodingOp.jl#L166

probably we don't get into the if.

tknopp commented 1 year ago

fixed by @migrosser in https://github.com/MagneticResonanceImaging/MRIReco.jl/commit/10b5d8d230e17006699610886cda45f1abb56fc2 Releases are triggered.