-
Notifications
You must be signed in to change notification settings - Fork 21
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
Fix motion bugs and add colorscale
keyword in plot_image
#536
Conversation
I think it's fine, is it ready to merge? |
I also took advantage of this PR to add a method definition for the multiplication of an julia> G1=Grad(3e-3,1e-3,0)
Grad(3.0 mT, 1.0 ms)
julia> G2=Grad(1.5e-3,2e-3,0)
Grad(1.5 mT, 2.0 ms)
julia> G3=Grad(4.5e-3,0.5e-3,0)
Grad(4.5 mT, 0.5 ms)
julia> g = [G1; G2; G3;;]
3×1 Matrix{Grad}:
Grad(3.0 mT, 1.0 ms)
Grad(1.5 mT, 2.0 ms)
Grad(4.5 mT, 0.5 ms)
julia> R = [0. 0. 1.; 0. -1. 0.; 1. 0. 0.]
3×3 Matrix{Float64}:
0.0 0.0 1.0
0.0 -1.0 0.0
1.0 0.0 0.0
julia> R * g
3×1 Matrix{Grad}:
Grad(4.5 mT, 2.0 ms)
Grad(-1.5 mT, 2.0 ms)
Grad(3.0 mT, 2.0 ms) I do not know if this is the expected behaviour, but I can assume it is not: *(x::Sequence, A::Matrix{Float64}) = Sequence(A*x.GR, x.RF, x.ADC, x.DUR, x.DEF) #TODO: change this, Rotation fo waveforms is broken
*(A::Matrix{Float64}, x::Sequence) = Sequence(A*x.GR, x.RF, x.ADC, x.DUR, x.DEF) #TODO: change this, Rotation fo waveforms is broken Now only the gradient amplitudes rotate, while the durations keep the same (I am not sure if this is correct for all cases): julia> R * g
3×1 Matrix{Grad}:
Grad(4.5 mT, 1.0 ms)
Grad(-1.5 mT, 2.0 ms)
Grad(3.0 mT, 0.5 ms) Please let me know if this change is correct, or tell me how you would do it and whether you would include it in this PR as well. |
I don't think the gradient rotation is correct. Do you really need it to be like that? |
I have needed this when creating a gre sequence and wanting to acquire different planes with it. In the initial basic sequence, which acquires the XY plane slice, there is a block with gradients of different durations. When rotating the sequence to acquire, for example, the YZ plane, all the gradients of the block end up having the same duration. I think this is an important use case. |
This reverts commit 36ab6c6.
This PR solves some motion-related bugs that appeared in previous PRs.
Additionally, I added a
colorscale
keyword for theplot_image
function (Let me know if I should include this in another PR or take advantage and include it in this one).