diff --git a/src/components/instant_gradients.jl b/src/components/instant_gradients.jl index 68f6b745985c855ed0abbb32ff3a575ba9c3a851..d78ffe7a1e9033646a1fdc180513186cf6197fcb 100644 --- a/src/components/instant_gradients.jl +++ b/src/components/instant_gradients.jl @@ -20,13 +20,13 @@ If the `orientation` is set an [`InstantGradient1D`](@ref) is returned, otherwis """ abstract type InstantGradient{N} <: EventComponent end -function (::Type{InstantGradient})(; orientation=nothing, group=nothing, qval=nothing, variables...) +function (::Type{InstantGradient})(; orientation=nothing, group=nothing, variables...) if isnothing(orientation) - res = InstantGradient3D(get_free_variable.(qval), group) + res = InstantGradient3D(nothing, group) else - res = InstantGradient1D(get_free_variable(qval), orientation, group) - if !(res.qval isa Number) - @constraint global_model() res.qval >= 0 + res = InstantGradient1D(nothing, orientation, group) + if !(res.qvec isa Number) + @constraint global_model() res.qvec >= 0 end end set_simple_constraints!(res, variables) @@ -52,11 +52,11 @@ struct InstantGradient3D <: InstantGradient{3} group :: Union{Nothing, Symbol} end -function InstantGradient3D(; qval=[nothing, nothing, nothing], group=nothing, variables...) - if isnothing(qval) - qval = [nothing, nothing, nothing] +function InstantGradient3D(; qvec=nothing, group=nothing, variables...) + if isnothing(qvec) + qvec = [nothing, nothing, nothing] end - res = InstantGradient3D(get_free_variable.(qval), group) + res = InstantGradient3D(get_free_variable.(qvec), group) set_simple_constraints!(res, variables) return res end diff --git a/src/parts/epi_readouts.jl b/src/parts/epi_readouts.jl index 8d775e7c874c127f21e4d95a61a784741b919957..a2a35bea57dc5badff8b34602239f2b4c84c57c6 100644 --- a/src/parts/epi_readouts.jl +++ b/src/parts/epi_readouts.jl @@ -55,7 +55,7 @@ function EPIReadout(; resolution::AbstractVector{<:Integer}, recenter=false, gro apply_simple_constraint!(variables.qvec(res.recenter_gradient), VariableType[sign * variables.qvec(pos)[1]/2, -ky_lines[end] * res.ky_step, 0.]) end for shift in unique(ky_lines[2:end] - ky_lines[1:end-1]) - res.blips[shift] = Trapezoid(orientation=[0, shift > 0 ? 1 : -1, 0], group=group, qval=abs(shift) * res.ky_step) + res.blips[shift] = Trapezoid(qvec=[0., shift * res.ky_step, 0.], group=group) end set_simple_constraints!(res, vars) return res