MagneticResonanceImaging / MRIReco.jl

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

MRIFiles does not works for bruker datasets under PV360.X.X #157

Closed aTrotier closed 7 months ago

aTrotier commented 9 months ago

We have upgraded one of our scanner with the Paravision version PV360.3.4 (the other one is still in PV6.0.1) I am able to read the method file but I have an issue when reading acqp :

julia> b["ACQ_size"]
ERROR: StringIndexError: invalid index [48], valid nearby indices [47]=>'é', [49]=>'>'
Stacktrace:
  [1] string_index_err(s::String, i::Int64)
    @ Base ./strings/string.jl:12
  [2] getindex
    @ ./strings/string.jl:278 [inlined]
  [3] read(file::JcampdxFile, stream::IOStream, keylist::Vector{String}; maxEntries::Int64)
    @ MRIFiles ~/.julia/packages/MRIFiles/1yFM2/src/Bruker/Jcampdx.jl:84
  [4] read
    @ ~/.julia/packages/MRIFiles/1yFM2/src/Bruker/Jcampdx.jl:20 [inlined]
  [5] #88
    @ ~/.julia/packages/MRIFiles/1yFM2/src/Bruker/Jcampdx.jl:189 [inlined]
  [6] open(f::MRIFiles.var"#88#89"{Int64, JcampdxFile, Vector{String}}, args::String; kwargs::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
    @ Base ./io.jl:395
  [7] open(f::Function, args::String)
    @ Base ./io.jl:392
  [8] #read#87
    @ ~/.julia/packages/MRIFiles/1yFM2/src/Bruker/Jcampdx.jl:188 [inlined]
  [9] read (repeats 2 times)
    @ ~/.julia/packages/MRIFiles/1yFM2/src/Bruker/Jcampdx.jl:186 [inlined]
 [10] getindex(b::BrukerFile, parameter::String)
    @ MRIFiles ~/.julia/packages/MRIFiles/1yFM2/src/Bruker/Bruker.jl:44
 [11] top-level scope
    @ REPL[9]:1

I'll try to fix the jcampdx function but standard sequences also changed. For example Bruker now has the possibility to use Compressed-sensing and SMS in the FLASH sequence.

Should I try to keep a unified function RawAcquisitionDataFid for both PV360.X.X and PV6.0.X ?

I think it will be easier to create a dedicated RawAcquisitionDataFid function and dispatch with the field ACQ_sw_version rather than trying to unify both versions :

##$ACQ_sw_version=( 65 )
<PV-360.3.4>

@tknopp @alexjaffray are you still using Bruker systems ? Any thoughts about this ?

tknopp commented 9 months ago

I have not used PV360 and thus cannot really comment. It depends on how much changed whether to write a dedicated constructor. If there are only slight changes it is better to locally dispatch on ACQ_sw_version.

aTrotier commented 9 months ago

I will try to reconstruct the flash sequence with 3 encoding:

I think that will cover most of the case and give a good vision about the new implementation. For the SMS case, I don't know how it is managed in the MRD format.

aTrotier commented 9 months ago

Error are from that line :

findfirst_(A, v) = something(findfirst(isequal(v), A), 0)

line="<Plateforme d'imagerie biomédicale Bordeaux Cé>"

j=findfirst_(line,'>')
line[2:j-1]

which returns the error

ERROR: StringIndexError: invalid index [48], valid nearby indices [47]=>'é', [49]=>'>'

The problem is related to ASCII / UTF-8 number of bytes (see)

I can use : prevind(line,49) rather than j-1

tknopp commented 7 months ago

@aTrotier: can this issue be closed?

aTrotier commented 7 months ago

yes

Le jeu. 7 déc. 2023 à 09:22, Tobias Knopp @.***> a écrit :

@aTrotier https://github.com/aTrotier: can this issue be closed?

— Reply to this email directly, view it on GitHub https://github.com/MagneticResonanceImaging/MRIReco.jl/issues/157#issuecomment-1844874076, or unsubscribe https://github.com/notifications/unsubscribe-auth/AC5P7O6TSJHL7OQ25GRIT7DYIF4C3AVCNFSM6AAAAAA5SHLC3CVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNBUHA3TIMBXGY . You are receiving this because you were mentioned.Message ID: @.***>

--

TROTIER Aurélien 31 allée de la Biotte 33470 Gujan-Mestras 06.09.12.61.61 @.***