KomaMRIPlots
Plotting Phantom
KomaMRIPlots.plot_phantom_map
โ Functionp = plot_phantom_map(obj::Phantom, key::Symbol; kwargs...)
Plots a phantom map for a specific spin parameter given by key
.
Arguments
obj
: (::Phantom
) Phantom structkey
: (::Symbol
, opts: [:ฯ
,:T1
,:T2
,:T2s
,:x
,:y
,:z
]) symbol for displaying different parameters of the phantom spins
Keywords
height
: (::Integer
,=600
) plot heightwidth
: (::Integer
,=nothing
) plot widthdarkmode
: (::Bool
,=false
) boolean to indicate whether to display darkmode styleview_2d
: (::Bool
,=false
) boolean to indicate whether to use a 2D scatter plotcolorbar
: (::Bool
,=true
) boolean to indicate whether to display a colorbarmax_spins
:(::Int
,=100_000
) maximum number of displayed spinstime_samples
:(::Int
,=0
) intermediate time samples between motiont_start
andt_end
max_time_samples
:(::Int
,=100
) maximum number of time samplesframe_duration_ms
:(::Int
,=250
) time in miliseconds between two frames
Returns
p
: (::PlotlyJS.SyncPlot
) plot of the phantom map for a specific spin parameter
References
Colormaps from https://github.com/markgriswold/MRFColormaps Towards Unified Colormaps for Quantitative MRF Data, Mark Griswold, et al. (2018).
Examples
julia> obj2D, obj3D = brain_phantom2D(), brain_phantom3D();
julia> plot_phantom_map(obj2D, :ฯ)
julia> plot_phantom_map(obj3D, :ฯ)
Plotting Sequence
KomaMRIPlots.plot_seq
โ Functionp = plot_seq(seq::Sequence; kwargs...)
Plots a sequence struct.
Arguments
seq
: (::Sequence
) Sequence struct
Keywords
width
: (::Integer
,=nothing
) plot widthheight
: (::Integer
,=nothing
) plot heightslider
: (::Bool
,=true
) boolean to indicate whether to display a slidershow_seq_blocks
: (::Bool
,=false
) boolean to indicate whether to display sequence blocksdarkmode
: (::Bool
,=false
) boolean to indicate whether to display darkmode stylerange
: (::Vector{Real}
,=[]
) time range to be displayed initiallytitle
: (::String
,=""
) plot titlefreq_in_phase
: (::Bool
,=true
) Include FM modulation in RF phasegl
: (::Bool
,=false
) usePlotlyJS.scattergl
backend (faster)max_rf_samples
: (::Integer
,=100
) maximum number of RF samplesshow_adc
: (::Bool
,=false
) plot ADC samples with markers
Returns
p
: (::PlotlyJS.SyncPlot
) plot of the Sequence struct
Examples
julia> seq_file = joinpath(dirname(pathof(KomaMRI)), "../examples/1.sequences/spiral.seq")
julia> seq = read_seq(seq_file)
julia> plot_seq(seq)
KomaMRIPlots.plot_kspace
โ Functionp = plot_kspace(seq::Sequence; width=nothing, height=nothing, darkmode=false)
Plots the k-space of a Sequence struct.
Arguments
seq
: (::Sequence
) Sequence struct
Keywords
width
: (::Integer
,=nothing
) plot widthheight
: (::Integer
,=nothing
) plot heightdarkmode
: (::Bool
,=false
) boolean to indicate whether to display darkmode style
Returns
p
: (::PlotlyJS.SyncPlot
) plot of the k-space of the Sequence struct
Examples
julia> seq_file = joinpath(dirname(pathof(KomaMRI)), "../examples/1.sequences/spiral.seq")
julia> seq = read_seq(seq_file)
julia> plot_kspace(seq)
KomaMRIPlots.plot_M0
โ Functionp = plot_M0(seq::Sequence; kwargs...)
Plots the zero order moment (M0) of a Sequence struct.
Arguments
seq
: (::Sequence
) Sequence struct
Keywords
width
: (::Integer
,=nothing
) plot widthheight
: (::Integer
,=nothing
) plot heightslider
: (::Bool
,=true
) boolean to indicate whether to display a slidershow_seq_blocks
: (::Bool
,=false
) boolean to indicate whether to display sequence blocksdarkmode
: (::Bool
,=false
) boolean to indicate whether to display darkmode stylerange
: (::Vector{Real}
,=[]
) time range to be displayed initiallytitle
: (::String
,=""
) plot title
Returns
p
: (::PlotlyJS.SyncPlot
) plot of the moment M0 of the Sequence struct
Examples
julia> seq_file = joinpath(dirname(pathof(KomaMRI)), "../examples/1.sequences/spiral.seq")
julia> seq = read_seq(seq_file)
julia> plot_M0(seq)
KomaMRIPlots.plot_M1
โ Functionp = plot_M1(seq::Sequence; kwargs...)
Plots the first order moment (M1) of a Sequence struct.
Arguments
seq
: (::Sequence
) Sequence struct
Keywords
width
: (::Integer
,=nothing
) plot widthheight
: (::Integer
,=nothing
) plot heightslider
: (::Bool
,=true
) boolean to indicate whether to display a slidershow_seq_blocks
: (::Bool
,=false
) boolean to indicate whether to display sequence blocksdarkmode
: (::Bool
,=false
) boolean to indicate whether to display darkmode stylerange
: (::Vector{Real}
,=[]
) time range to be displayed initiallytitle
: (::String
,=""
) plot title
Returns
p
: (::PlotlyJS.SyncPlot
) plot of the moment M1 of the Sequence struct
Examples
julia> seq_file = joinpath(dirname(pathof(KomaMRI)), "../examples/1.sequences/spiral.seq")
julia> seq = read_seq(seq_file)
julia> plot_M1(seq)
KomaMRIPlots.plot_M2
โ Functionp = plot_M2(seq::Sequence; kwargs...)
Plots the second order moment (M2) of a Sequence struct.
Arguments
seq
: (::Sequence
) Sequence struct
Keywords
width
: (::Integer
,=nothing
) plot widthheight
: (::Integer
,=nothing
) plot heightslider
: (::Bool
,=true
) boolean to indicate whether to display a slidershow_seq_blocks
: (::Bool
,=false
) boolean to indicate whether to display sequence blocksdarkmode
: (::Bool
,=false
) boolean to indicate whether to display darkmode stylerange
: (::Vector{Real}
,=[]
) time range to be displayed initiallytitle
: (::String
,=""
) plot title
Returns
p
: (::PlotlyJS.SyncPlot
) plot of the moment M2 of the Sequence struct
Examples
julia> seq_file = joinpath(dirname(pathof(KomaMRI)), "../examples/1.sequences/spiral.seq")
julia> seq = read_seq(seq_file)
julia> plot_M2(seq)
KomaMRIPlots.plot_eddy_currents
โ Functionp = plot_eddy_currents(seq::Sequence, ฮป; kwargs...)
Plots the eddy currents of a Sequence struct.
Arguments
seq
: (::Sequence
) Sequence structฮป
: (::Real
,[s]
) time constant for the decay of Eddy currents
Keywords
ฮฑ
: (::Vector{Real}
,=ones(size(ฮป))
) eddy currents factorswidth
: (::Integer
,=nothing
) plot widthheight
: (::Integer
,=nothing
) plot heightslider
: (::Bool
,=true
) boolean to indicate whether to display a slidershow_seq_blocks
: (::Bool
,=false
) boolean to indicate whether to display sequence blocksdarkmode
: (::Bool
,=false
) boolean to indicate whether to display darkmode stylerange
: (::Vector{Real}
,=[]
) time range to be displayed initiallytitle
: (::String
,=""
) plot title
Returns
p
: (::PlotlyJS.SyncPlot
) plot of the Eddy currents of the Sequence struct
Examples
julia> seq_file = joinpath(dirname(pathof(KomaMRI)), "../examples/1.sequences/spiral.seq")
julia> seq = read_seq(seq_file)
julia> plot_eddy_currents(seq, 80e-3)
KomaMRIPlots.plot_slew_rate
โ Functionp = plot_slew_rate(seq::Sequence; kwargs...)
Plots the slew rate currents of a Sequence struct.
Arguments
seq
: (::Sequence
) Sequence struct
Keywords
width
: (::Integer
,=nothing
) plot widthheight
: (::Integer
,=nothing
) plot heightslider
: (::Bool
,=true
) boolean to indicate whether to display a slidershow_seq_blocks
: (::Bool
,=false
) boolean to indicate whether to display sequence blocksdarkmode
: (::Bool
,=false
) boolean to indicate whether to display darkmode stylerange
: (::Vector{Real}
,=[]
) time range to be displayed initiallytitle
: (::String
,=""
) plot title
Returns
p
: (::PlotlyJS.SyncPlot
) plot of the slew rate currents of the Sequence struct
Examples
julia> seq_file = joinpath(dirname(pathof(KomaMRI)), "../examples/1.sequences/spiral.seq")
julia> seq = read_seq(seq_file)
julia> plot_slew_rate(seq)
KomaMRIPlots.plot_seqd
โ Functionp = plot_seqd(seq::Sequence; sampling_params=KomaMRIBase.default_sampling_params())
Plots a sampled sequence struct.
Arguments
seq
: (::Sequence
) Sequence struct
Keywords
sampling_params
: (::Dict{String,Any}()
,=KomaMRIBase.default_sampling_params()
) dictionary of sampling parameters
Returns
p
: (::PlotlyJS.SyncPlot
) plot of the sampled Sequence struct
Examples
julia> seq_file = joinpath(dirname(pathof(KomaMRI)), "../examples/1.sequences/spiral.seq")
julia> seq = read_seq(seq_file)
julia> plot_seqd(seq)
Plotting RawAcquisitionData
KomaMRIPlots.plot_signal
โ Functionp = plot_signal(raw::RawAcquisitionData; kwargs...)
Plots a raw signal in ISMRMRD format.
Arguments
raw
: (::RawAcquisitionData
) RawAcquisitionData struct (raw signal in ISMRMRD format)
Keywords
width
: (::Integer
,=nothing
) plot widthheight
: (::Integer
,=nothing
) plot heightslider
: (::Bool
,=true
) boolean to indicate whether to display a slidershow_sim_blocks
: (::Bool
,=false
) boolean to indicate whether to display sequence blocksdarkmode
: (::Bool
,=false
) boolean to indicate whether to display darkmode stylerange
: (::Vector{Real}
,=[]
) time range to be displayed initially
Returns
p
: (::PlotlyJS.SyncPlot
) plot of the raw signal
Examples
julia> seq_file = joinpath(dirname(pathof(KomaMRI)), "../examples/5.koma_paper/comparison_accuracy/sequences/EPI/epi_100x100_TE100_FOV230.seq");
julia> sys, obj, seq = Scanner(), brain_phantom2D(), read_seq(seq_file)
julia> raw = simulate(obj, seq, sys)
julia> plot_signal(raw)
Plotting images
KomaMRIPlots.plot_image
โ Functionp = plot_image(image; height, width, zmin, zmax, darkmode, title)
Plots an image matrix.
Arguments
image
: (::Matrix{Number}
) image matrix
Keywords
width
: (::Integer
,=nothing
) plot widthheight
: (::Integer
,=nothing
) plot heightzmin
: (::Real
,=minimum(abs.(image[:]))
) reference value for minimum colorzmax
: (::Real
,=maximum(abs.(image[:]))
) reference value for maximum colordarkmode
: (::Bool
,=false
) boolean to indicate whether to display darkmode styletitle
: (::String
,=""
) plot title
Returns
p
: (::PlotlyJS.SyncPlot
) plot of the image matrix
Others
KomaMRIPlots.plot_dict
โ Functionstr = plot_dict(dict::Dict)
Generates an HTML table based on the dictionary dict
.
Arguments
dict
: (::Dict
) dictionary
Returns
str
: (::String
) dictionary as an HTML table