-
Notifications
You must be signed in to change notification settings - Fork 23
WIP : Implement labels #558
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
@cncastillo can you take a look at the initial implementation before going further. ![]() |
@cncastillo forget to push the rest ! |
Sure! Thanks for implementing this, I will take a look later today. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi! This looks awesome. I just have a quick nitpick, I added comments to some code blocks that could be benefited by the use of multiple dispatch. I don't have a clear idea yet, so it is only a comment. But feel free to continue developing this.
I am able to use the label for multi-slice reconstruction with KomaMRI but we are limited by something in MRIReco.jl : In my local example the trajectory is the same so I just "cut" the trajectory at 1/3 of the total traj acq = AcquisitionData(raw)
acq.traj[1].nodes = acq.traj[1].nodes[:,1:4096]
params = Dict{Symbol,Any}()
params[:reco] = "direct"
params[:encodedSize] = acq.encodingSize[1:2]
params[:densityWeighting] = true
im_reco = reconstruction(acq,params) ![]() Reconstruction with cartesian labelsI was able to reconstruct the same dataset with the FFT (using the cartesian label LIN and PAR) : It requires the following modifications to the reconstruction pipeline :
raw2 = deepcopy(raw)
raw2.params["trajectory"] = "cartesian"
raw2.params["encodedSize"] = [seq.DEF["Nx"],seq.DEF["Ny"]]
#raw2.params["reconSize"] = [seq.DEF["Nx"],seq.DEF["Ny"]]
acq2 = AcquisitionData(raw2,estimateProfileCenter=true)
params = Dict{Symbol,Any}()
params[:reco] = "direct"
im_reco_2 = reconstruction(acq2,params) The reconstruction part might cause some issues between labeled "cartesian" sequence etc @cncastillo |
I removed the label from Sequence struct. It is easier to handle that way and is not directly connected to the sequence (issue with subset of sequence, or if the user already extract the label and continue to add block etc) now the label can be extracted with : |
I now estimates the center directly from ktraj it works for both cases with my simple example (I need a partial-fourier acquisition along the readout in order to see if it really works) 2 points remains to be added in the reconstruction part :
if haskey(seq.DEF, "FOV")
FOVx, FOVy, _ = seq.DEF["FOV"] #[m]
if FOVx > 1 FOVx *= 1e-3 end #mm to m, older versions of Pulseq saved FOV in mm
if FOVy > 1 FOVy *= 1e-3 end #mm to m, older versions of Pulseq saved FOV in mm
Nx = round(Int64, FOVx / Δx[1])
Ny = round(Int64, FOVy / Δx[2])
else
FOVx = Nx * Δx[1]
FOVy = Ny * Δx[2]
end 64,64 vs 63,63 (from the FOV). Should I put a BTW : I opened an issue to implement all the dimensions independently (SLC, ECO...) in MRIReco : MagneticResonanceImaging/MRIReco.jl#246 |
Oh sorry for the late reply.
I don't have a strong preference, So can this be used in the UI already? Or is there something that needs to be modified for the reconstruction to incorporate the labels? |
My example with 3 slices with SLC / LIN (/ PAR) set correctly can be reconstructed by KomaUI() with You can give it a try with the attached sequences : I am pretty sure it will failed at some point if the SLC label are not defined or if it is a 3D acquisition without label. The estimated matrix is still 63 (estimated from the FOV and k-space trajectory) it is not an issue for the reconstruction and not related to my modifications MRIReco only handles SLC / ECO / REP as label and only the eco can have a different trajectory (I think it is one of my PR that added this enhancement). |
I am not a user of the seq designer, do you have an idea about what should be done to implement the labels ? |
The seq designer is already compatible with label: lSet = LabelSet(1,"LIN")
seq = Sequence() # empty sequence
tmp_seq = Sequence([gr],[exc]) # adding RF-only block
tmp_seq.EXT = [[lSet]]
seq += tmp_seq What should I add to the documentation ?
After the doc enhancement, the remaining issue is mostly related to MRIReco limitations. It would be great if we could merge this feature before summer (I would like to start writing my MRI course with this possibility) |
Hi @aTrotier Thanks for the enhancements.
I think a literate tutorial would be great.
Awesome! I have no problems merging this before summer. @Stockless can you make sure this is merged asap and tag new versions so it is usable by summer? |
I'll wrote the literate example next week. Should I wrote the example using a dummy .seq séquence or with the koma sequence designer ? (And just mention that it works with pulseq labels) |
Hello everyone, Just stopping by to say a big thanks for this PR ! With this PR, it worked perfectly. I have to use the ECO label for now (I think it's preferable to use SET, and that's what I tried initially, but it's not implemented on the reconstruction side yet). There was only one tiny issue: I had to change the "EXT.jl" to "Ext.jl" here. |
This PR will read the labels section of PR and in the end fill each profile with the corresponding MDH.
It could be used to reconstruct multi-contrast / slice / rep and also to use the MDH for cartesian position of the data in kspace.
Related to : #308
Remaining things to do