diff --git a/KomaMRIBase/src/motion/actions/arbitraryactions/FlowPath.jl b/KomaMRIBase/src/motion/actions/arbitraryactions/FlowPath.jl index 391a56839..12971f8ab 100644 --- a/KomaMRIBase/src/motion/actions/arbitraryactions/FlowPath.jl +++ b/KomaMRIBase/src/motion/actions/arbitraryactions/FlowPath.jl @@ -36,6 +36,8 @@ julia> flowpath = FlowPath( spin_reset::AbstractArray{Bool} end +FlowPath(dx::AbstractArray{T}, dy::AbstractArray{T}, dz::AbstractArray{T}, spin_reset::BitMatrix) where T<:Real = FlowPath(dx, dy, dz, collect(spin_reset)) + function add_jump_times!(t, a::FlowPath, time_span::AbstractTimeSpan) jump_times = (times(time_span)[end] - times(time_span)[1])/(size(a.spin_reset)[2]-1) * (getindex.(findall(a.spin_reset .== 1), 2) .- 1) .- 1e-6 append!(t, jump_times) diff --git a/KomaMRIBase/test/runtests.jl b/KomaMRIBase/test/runtests.jl index ee2f18cb8..9a1e1a415 100644 --- a/KomaMRIBase/test/runtests.jl +++ b/KomaMRIBase/test/runtests.jl @@ -572,7 +572,7 @@ end dx = rand(Ns, Nt) dy = rand(Ns, Nt) dz = rand(Ns, Nt) - arbitrarymotion = FlowPath(dx, dy, dz, collect(Bool.(zeros(Ns, Nt))), TimeRange(t_start, t_end)) + arbitrarymotion = FlowPath(dx, dy, dz, Bool.(zeros(Ns, Nt)), TimeRange(t_start, t_end)) t = range(t_start, t_end, Nt) xt, yt, zt = get_spin_coords(arbitrarymotion, ph.x, ph.y, ph.z, t') @test xt == ph.x .+ dx @@ -587,7 +587,7 @@ end dx = rand(Ns, Nt) dy = rand(Ns, Nt) dz = rand(Ns, Nt) - arbitrarymotion = FlowPath(dx, dy, dz, collect(Bool.(zeros(Ns, Nt))), TimeRange(t_start, t_end)) + arbitrarymotion = FlowPath(dx, dy, dz, Bool.(zeros(Ns, Nt)), TimeRange(t_start, t_end)) t = range(t_start, t_end, Nt) xt, yt, zt = get_spin_coords(arbitrarymotion, ph.x, ph.y, ph.z, t') @test xt == ph.x .+ dx