Skip to content

Commit

Permalink
Renamed intermediate_time_samples to time_samples
Browse files Browse the repository at this point in the history
  • Loading branch information
cncastillo committed Sep 30, 2024
1 parent 16cc122 commit 4c19dd8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions KomaMRIPlots/src/ui/DisplayFunctions.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1002,7 +1002,7 @@ Plots a phantom map for a specific spin parameter given by `key`.
- `view_2d`: (`::Bool`, `=false`) boolean to indicate whether to use a 2D scatter plot
- `colorbar`: (`::Bool`, `=true`) boolean to indicate whether to display a colorbar
- `max_spins`:(`::Int`, `=100_000`) maximum number of displayed spins
- `intermediate_time_samples`:(`::Int`, `=0`) intermediate time samples between motion `t_start` and `t_end`
- `time_samples`:(`::Int`, `=0`) intermediate time samples between motion `t_start` and `t_end`
- `max_time_samples`:(`::Int`, `=100`) maximum number of time samples
- `frame_duration_ms`:(`::Int`, `=250`) time in miliseconds between two frames
Expand Down Expand Up @@ -1031,16 +1031,16 @@ function plot_phantom_map(
view_2d=sum(KomaMRIBase.get_dims(obj)) < 3,
colorbar=true,
max_spins=20_000,
intermediate_time_samples=0,
time_samples=0,
max_time_samples=100,
kwargs...,
)
function interpolate_times(motion)
t = times(motion)
if length(t)>1
# Interpolate time points (as many as indicated by intermediate_time_samples)
itp = interpolate((1:(intermediate_time_samples + 1):(length(t) + intermediate_time_samples * (length(t) - 1)), ), t, Gridded(Linear()))
t = itp.(1:(length(t) + intermediate_time_samples * (length(t) - 1)))
# Interpolate time points (as many as indicated by time_samples)
itp = interpolate((1:(time_samples + 1):(length(t) + time_samples * (length(t) - 1)), ), t, Gridded(Linear()))
t = itp.(1:(length(t) + time_samples * (length(t) - 1)))
end
return t
end
Expand Down
2 changes: 1 addition & 1 deletion src/ui/ExportUIFunctions.jl
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ function view_ui_phantom!(
darkmode=true,
)
display_loading!(w, "Plotting phantom ...")
widget_plot = plot_phantom_map(obj, key; intermediate_time_samples=5, darkmode)
widget_plot = plot_phantom_map(obj, key; time_samples=5, darkmode)
div_content = dom"div"(hbox(buttons_obj...), widget_plot)
content!(w, "div#content", div_content)
@js_ w document.getElementById("content").dataset.content = "phantom"
Expand Down

0 comments on commit 4c19dd8

Please sign in to comment.