Skip to content

Commit

Permalink
Small changes in plot_phantom_map
Browse files Browse the repository at this point in the history
  • Loading branch information
cncastillo committed May 5, 2024
1 parent 8062bdb commit 592b85f
Showing 1 changed file with 9 additions and 12 deletions.
21 changes: 9 additions & 12 deletions KomaMRIPlots/src/ui/DisplayFunctions.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1028,8 +1028,8 @@ function plot_phantom_map(
colorbar=true,
intermediate_time_samples=0,
max_time_samples=100,
max_spins=100000,
dt_frame=250,
max_spins=100_000,
frame_duration_ms=250,
kwargs...,
)
function process_times(motion::SimpleMotion)
Expand Down Expand Up @@ -1075,12 +1075,9 @@ function plot_phantom_map(
return ph[idx]
end

n_spins_before_decimate = length(ph)
ph = decimate_uniform_phantom(ph, max_spins)
n_spins_after_decimate = length(ph)
if n_spins_before_decimate > n_spins_after_decimate
@warn "Only $(n_spins_after_decimate) (approximately evenly spaced) of $(n_spins_before_decimate) spins are displayed in order to avoid CPU overload.
This affects display functions but not simulation functions."
if length(ph) > max_spins
ph = decimate_uniform_phantom(ph, max_spins)
@warn "For performance reasons, the number of displayed spins was capped to `max_spins`=$(max_spins)." maxlog=1
end

path = @__DIR__
Expand Down Expand Up @@ -1252,8 +1249,8 @@ function plot_phantom_map(
nothing,
attr(;
fromcurrent=true,
transition=(duration=dt_frame,),
frame=attr(; duration=dt_frame, redraw=true),
transition=(duration=frame_duration_ms,),
frame=attr(; duration=frame_duration_ms, redraw=true),
),
],
),
Expand All @@ -1265,8 +1262,8 @@ function plot_phantom_map(
attr(;
mode="immediate",
fromcurrent=true,
transition=attr(; duration=dt_frame),
frame=attr(; duration=dt_frame, redraw=true),
transition=attr(; duration=frame_duration_ms),
frame=attr(; duration=frame_duration_ms, redraw=true),
),
],
),
Expand Down

0 comments on commit 592b85f

Please sign in to comment.