MagneticResonanceImaging / MRIReco.jl

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

Spiral rawdata (pulseq acquisition) is reversed during conversion from raw to acq #191

Open aTrotier opened 3 months ago

aTrotier commented 3 months ago

This issue happens when read_dir[1] < 0 and I have a mismatch between the trajectory (extracted from the pulseq file and the data in the acquisition) https://github.com/MagneticResonanceImaging/MRIReco.jl/blob/f70b2e0c9bf7b1f54f9f91b3d978fba5d2fb5041/MRIBase/src/Datatypes/RawAcqData.jl#L268

Screenshot 2024-06-25 at 11 50 38

Does this line is required ? We have a reverse flag for that no ?

My temporary fix :

for p in eachindex(raw.profiles)
  raw.profiles[p].traj = Float32.(traj[:,:,p])
  raw.profiles[p].head.trajectory_dimensions=2
  # issue with reverse
  raw.profiles[p].head.read_dir = (0.0,0.0,0.0)
end
tknopp commented 3 months ago

But doesn't that imply that read_dir is wrong than? I would rather want to fix inconsistent/wrong data at the origin (BrukerFile -> RawDataAcq conversion) and not later.

aTrotier commented 3 months ago

I am not sure the read_dir is wrong. It is siemens acquisition (not a bruker one) and the read_dir is converted during siemens_to_ismrmrd. I think the value should be true.

julia> raw.profiles[1].head.read_dir
(-0.99999994f0, 5.9604645f-8, 0.0f0)

Interestingly the values are the same here : https://github.com/ismrmrd/ismrmrd/blob/d364e03d3faa3ca516da7807713b5acc72218a37/doc/mrd_files.md?plain=1#L44

I guess it is a numerical approximation for pure axial sequence : (-1,0,0)


I think the data should be revert only with the flag ? Otherwise the rotation is performed by the nifti viewer (if the metadata are correctly filled)