MagneticResonanceImaging / MRIReco.jl

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

reading any bruker parameters takes 0.5 ms #94

Closed aTrotier closed 2 years ago

aTrotier commented 2 years ago

issue

Accessing parameters from bruker sequence is too long. Due to my modification in order to read all the parameters :/

It is an issue for the UTE reconstruction because I'm running the same command at each iteration https://github.com/MagneticResonanceImaging/MRIReco.jl/blob/effdcac6bf46addd49f9bef7670b8a0eaa3874f0/MRIFiles/src/Bruker/BrukerSequence.jl#L81

I change that in https://github.com/MagneticResonanceImaging/MRIReco.jl/commit/aaff63fe8aaf1ea4092df5abb786139be0ae9789 but It is still 0.5ms to access any parameters...

Benchmark

master branch of MRIFiles :

julia> @btime phaseFactor = MRIFiles.acqPhaseFactor(b)
  424.898 ms (38291 allocations: 2.46 MiB)
128

julia> @btime b["PVM_DigDw"]
    383.330 ms (38291 allocations: 2.46 MiB)
"0.01"

MRIFiles@0.1.0

julia> @btime phaseFactor = MRIFiles.acqPhaseFactor(b)
  452.843 ns (4 allocations: 128 bytes)
128

julia> @btime b["PVM_DigDw"]
  188.031 ns (2 allocations: 64 bytes)
"0.01"

NOTES

Do you think we should add some simple test benchmark for that ? (Like btime should be < 10 us ?)