API Documentation
This page provides documentation for the modules, structs, functions, methods, and additional components available when importing the KomaMRI package. It serves as a valuable reference when using the Julia REPL directly and when creating custom Julia scripts. Be sure not to overlook the section How to read the API docs, which contains important information for understanding the general structure of docstrings. The following is the table of contents for the API Documentation:
How to read the API docs
The API documentation includes predefined "template patterns" to assist users in understanding how to use modules, structs, functions, methods, and all the necessary aspects to make the most of what KomaMRI has to offer.
These documentation "template patterns" are based on the JJulia Blue Style documentation and other GitHub repositories that deal with MRI topics. However, some custom considerations were added to enhance understanding and provide a broader perspective.
When you encounter a docstring documentation, it will have the following structure:
out1, out2, ... = component_name(arg1, arg2, ...; kw1, kw2, ...)
This is a brief description of what component_name does.
Here can be placed a note if it is regarded necessary.
Arguments
arg1
: (::type
,=value
,[unit]
, opts: [opt1
,opt2
, ...]) the description for the arg1- ...
Keywords
kw1
: (::type
,=value
,[unit]
, opts: [opt1
,opt2
, ...]) the description for the kw1- ...
Returns
out1
: (::type
,=value
,[unit]
, opts: [opt1
,opt2
, ...]) the description for the out1- ...
References
- Sometimes it is a good idea to put some references or links
- ...
Examples
julia> arg1, arg2, valkw1, valkw2 = 3.5, "hello", 1, true
+API Documentation · KomaMRI.jl: General MRI simulation framework API Documentation
This page provides documentation for the modules, structs, functions, methods, and additional components available when importing the KomaMRI package. It serves as a valuable reference when using the Julia REPL directly and when creating custom Julia scripts. Be sure not to overlook the section How to read the API docs, which contains important information for understanding the general structure of docstrings. The following is the table of contents for the API Documentation:
How to read the API docs
The API documentation includes predefined "template patterns" to assist users in understanding how to use modules, structs, functions, methods, and all the necessary aspects to make the most of what KomaMRI has to offer.
These documentation "template patterns" are based on the JJulia Blue Style documentation and other GitHub repositories that deal with MRI topics. However, some custom considerations were added to enhance understanding and provide a broader perspective.
When you encounter a docstring documentation, it will have the following structure:
KomaMRI.component_name — Component out1, out2, ... = component_name(arg1, arg2, ...; kw1, kw2, ...)
This is a brief description of what component_name does.
Note Here can be placed a note if it is regarded necessary.
Arguments
arg1
: (::type
, =value
, [unit]
, opts: [opt1
, opt2
, ...]) the description for the arg1- ...
Keywords
kw1
: (::type
, =value
, [unit]
, opts: [opt1
, opt2
, ...]) the description for the kw1- ...
Returns
out1
: (::type
, =value
, [unit]
, opts: [opt1
, opt2
, ...]) the description for the out1- ...
References
- Sometimes it is a good idea to put some references or links
- ...
Examples
julia> arg1, arg2, valkw1, valkw2 = 3.5, "hello", 1, true
julia> out1, out2 = component_name(arg1, arg2; kw1=valkw1, kw2=valkw2)
The preceding docstring block will always start with the way the component is called (outputs = component_name(inputs), followed by a brief description of what the component does. If necessary, a note block will be displayed. In general, the following subsections are optional: Arguments, Keywords, Returns, References, and Examples, but they will be provided as needed. These subsections are self-explanatory, making it intuitive to understand their purpose.
Please note that every subitem in the sections Arguments, Keywords, and Returns represents variables. They include practical information along with a description. The information enclosed in parentheses is optional but highly useful when provided.
::type
: is the suggested type for the variable. If the input variable is of type ::type
, there won't be any issues, but it's always possible to test other subtypes. If the variable is an output, it will be forced to the type ::type
whenever possible.=value
: sometimes, for the inputs, a default value is defined if it is not assigned by the user.[unit]
: this is the suggested physical unit of measure for the variable. Everything will be fine if you stick with these units of measure.- opts: [
opt1
, opt2
, ...]: sometimes, the input value can only be interpreted if it is one of the predefined values.
Structs
Scanner
KomaMRICore.Scanner
— Typesys = Scanner(B0, B1, Gmax, Smax, ADC_Δt, seq_Δt, GR_Δt, RF_Δt,
RF_ring_down_T, RF_dead_time_T, ADC_dead_time_T)
The Scanner struct. It contains hardware limitations of the MRI resonator. It is an input for the simulation.
Arguments
B0
: (::Real
, =1.5
, [T]
) main magnetic field strengthB1
: (::Real
, =10e-6
, [T]
) maximum RF amplitudeGmax
: (::Real
, =60e-3
, [T/m]
) maximum gradient amplitudeSmax
: (::Real
, =500
, [mT/m/ms]
) gradient's maximum slew-rateADC_Δt
: (::Real
, =2e-6
, [s]
) ADC raster timeseq_Δt
: (::Real
, =1e-5
, [s]
) sequence-block raster timeGR_Δt
: (::Real
, =1e-5
, [s]
) gradient raster timeRF_Δt
: (::Real
, =1e-6
, [s]
) RF raster timeRF_ring_down_T
: (::Real
, =20e-6
, [s]
) RF ring down timeRF_dead_time_T
: (::Real
, =100e-6
, [s]
) RF dead timeADC_dead_time_T
: (::Real
, =10e-6
, [s]
) ADC dead time
Returns
sys
: (::Scanner
) Scanner struct
Examples
julia> sys = Scanner()
-julia> sys.B0
sourcePhantom
KomaMRICore.Phantom
— Typeobj = Phantom(name, x, y, z, ρ, T1, T2, T2s, Δw, Dλ1, Dλ2, Dθ, ux, uy, uz)
The Phantom struct. Most of its field names are vectors, with each element associated with a property value representing a spin. This struct serves as an input for the simulation.
Arguments
name
: (::String
) phantom namex
: (::AbstractVector{T<:Real}
, [m]
) spin x-position vectory
: (::AbstractVector{T<:Real}
, [m]
) spin y-position vectorz
: (::AbstractVector{T<:Real}
, [m]
) spin z-position vectorρ
: (::AbstractVector{T<:Real}
) spin proton density vectorT1
: (::AbstractVector{T<:Real}
, [s]
) spin T1 parameter vectorT2
: (::AbstractVector{T<:Real}
, [s]
) spin T2 parameter vectorT2s
: (::AbstractVector{T<:Real}
, [s]
) spin T2s parameter vectorΔw
: (::AbstractVector{T<:Real}
, [rad/s]
) spin off-resonance parameter vectorDλ1
: (::AbstractVector{T<:Real}
) spin Dλ1 (diffusion) parameter vectorDλ2
: (::AbstractVector{T<:Real}
) spin Dλ2 (diffusion) parameter vectorDθ
: (::AbstractVector{T<:Real}
) spin Dθ (diffusion) parameter vectorux
: (::Function
) displacement field in the x-axisuy
: (::Function
) displacement field in the y-axisuz
: (::Function
) displacement field in the z-axis
Returns
obj
: (::Phantom
) Phantom struct
Examples
julia> obj = Phantom(x=[0.0])
+julia> sys.B0
sourcePhantom
KomaMRICore.Phantom
— Typeobj = Phantom(name, x, y, z, ρ, T1, T2, T2s, Δw, Dλ1, Dλ2, Dθ, ux, uy, uz)
The Phantom struct. Most of its field names are vectors, with each element associated with a property value representing a spin. This struct serves as an input for the simulation.
Arguments
name
: (::String
) phantom namex
: (::AbstractVector{T<:Real}
, [m]
) spin x-position vectory
: (::AbstractVector{T<:Real}
, [m]
) spin y-position vectorz
: (::AbstractVector{T<:Real}
, [m]
) spin z-position vectorρ
: (::AbstractVector{T<:Real}
) spin proton density vectorT1
: (::AbstractVector{T<:Real}
, [s]
) spin T1 parameter vectorT2
: (::AbstractVector{T<:Real}
, [s]
) spin T2 parameter vectorT2s
: (::AbstractVector{T<:Real}
, [s]
) spin T2s parameter vectorΔw
: (::AbstractVector{T<:Real}
, [rad/s]
) spin off-resonance parameter vectorDλ1
: (::AbstractVector{T<:Real}
) spin Dλ1 (diffusion) parameter vectorDλ2
: (::AbstractVector{T<:Real}
) spin Dλ2 (diffusion) parameter vectorDθ
: (::AbstractVector{T<:Real}
) spin Dθ (diffusion) parameter vectorux
: (::Function
) displacement field in the x-axisuy
: (::Function
) displacement field in the y-axisuz
: (::Function
) displacement field in the z-axis
Returns
obj
: (::Phantom
) Phantom struct
Examples
julia> obj = Phantom(x=[0.0])
-julia> obj.ρ
sourceKomaMRICore.brain_phantom2D
— Functionobj = brain_phantom2D(; axis="axial", ss=4)
Creates a two-dimensional brain Phantom struct.
References
- B. Aubert-Broche, D.L. Collins, A.C. Evans: "A new improved version of the realistic digital brain phantom" NeuroImage, in review - 2006
- B. Aubert-Broche, M. Griffin, G.B. Pike, A.C. Evans and D.L. Collins: "20 new digital brain phantoms for creation of validation image data bases" IEEE TMI, in review - 2006
- https://brainweb.bic.mni.mcgill.ca/brainweb
Keywords
axis
: (::String
, ="axial"
, opts=["axial"
, "coronal"
, "sagittal"
]) orientation of the phantomss
: (::Integer
, =4
) subsampling parameter in all axis
Returns
obj
: (::Phantom
) Phantom struct
Examples
julia> obj = brain_phantom2D(; axis="sagittal", ss=1)
+julia> obj.ρ
sourceKomaMRICore.brain_phantom2D
— Functionobj = brain_phantom2D(; axis="axial", ss=4)
Creates a two-dimensional brain Phantom struct.
References
- B. Aubert-Broche, D.L. Collins, A.C. Evans: "A new improved version of the realistic digital brain phantom" NeuroImage, in review - 2006
- B. Aubert-Broche, M. Griffin, G.B. Pike, A.C. Evans and D.L. Collins: "20 new digital brain phantoms for creation of validation image data bases" IEEE TMI, in review - 2006
- https://brainweb.bic.mni.mcgill.ca/brainweb
Keywords
axis
: (::String
, ="axial"
, opts=["axial"
, "coronal"
, "sagittal"
]) orientation of the phantomss
: (::Integer
, =4
) subsampling parameter in all axis
Returns
obj
: (::Phantom
) Phantom struct
Examples
julia> obj = brain_phantom2D(; axis="sagittal", ss=1)
-julia> plot_phantom_map(obj, :ρ)
sourceKomaMRICore.brain_phantom3D
— Functionobj = brain_phantom3D(; ss=4)
Creates a three-dimentional brain Phantom struct.
References
- B. Aubert-Broche, D.L. Collins, A.C. Evans: "A new improved version of the realistic digital brain phantom" NeuroImage, in review - 2006
- B. Aubert-Broche, M. Griffin, G.B. Pike, A.C. Evans and D.L. Collins: "20 new digital brain phantoms for creation of validation image data bases" IEEE TMI, in review - 2006
- https://brainweb.bic.mni.mcgill.ca/brainweb
Keywords
ss
: (::Integer
, =4
) subsampling parameter in all axes
Returns
obj
: (::Phantom
) 3D Phantom struct
Examples
julia> obj = brain_phantom3D(; ss=5)
+julia> plot_phantom_map(obj, :ρ)
sourceKomaMRICore.brain_phantom3D
— Functionobj = brain_phantom3D(; ss=4)
Creates a three-dimentional brain Phantom struct.
References
- B. Aubert-Broche, D.L. Collins, A.C. Evans: "A new improved version of the realistic digital brain phantom" NeuroImage, in review - 2006
- B. Aubert-Broche, M. Griffin, G.B. Pike, A.C. Evans and D.L. Collins: "20 new digital brain phantoms for creation of validation image data bases" IEEE TMI, in review - 2006
- https://brainweb.bic.mni.mcgill.ca/brainweb
Keywords
ss
: (::Integer
, =4
) subsampling parameter in all axes
Returns
obj
: (::Phantom
) 3D Phantom struct
Examples
julia> obj = brain_phantom3D(; ss=5)
-julia> plot_phantom_map(obj, :ρ)
sourceSequence
KomaMRICore.Sequence
— Typeseq = Sequence()
+julia> plot_phantom_map(obj, :ρ)
sourceSequence
KomaMRICore.Sequence
— Typeseq = Sequence()
seq = Sequence(GR)
seq = Sequence(GR, RF)
seq = Sequence(GR, RF, ADC)
seq = Sequence(GR, RF, ADC, DUR)
seq = Sequence(GR::Array{Grad,1})
seq = Sequence(GR::Array{Grad,1}, RF::Array{RF,1})
-seq = Sequence(GR::Array{Grad,1}, RF::Array{RF,1}, A::ADC, DUR, DEF)
The Sequence struct. It contains events of an MRI sequence. Most field names (except for the DEF field) consist of matrices or vectors, where each column index represents a sequence block. This struct serves as an input for the simulation.
Arguments
GR
: (::Matrix{Grad}
) gradient matrix. Rows for x-y-z amplitudes and columns are for blocksRF
: (::Matrix{RF}
) RF matrix. The 1 row is for the coil and columns are for blocksADC
: (::Array{ADC,1}
) ADC block vectorDUR
: (::Vector
, [s]
) duration block vectorDEF
: (::Dict{String, Any}
) dictionary with relevant information of the sequence. Possible keys could be ["AdcRasterTime"
, "GradientRasterTime"
, "Name"
, "Nz"
, "Num_Blocks"
, "Nx"
, "Ny"
, "PulseqVersion"
, "BlockDurationRaster"
, "FileName"
, "RadiofrequencyRasterTime"
]
Returns
seq
: (::Sequence
) Sequence struct
sourceGrad
KomaMRICore.Grad
— Typegr = Grad(A, T)
+seq = Sequence(GR::Array{Grad,1}, RF::Array{RF,1}, A::ADC, DUR, DEF)
The Sequence struct. It contains events of an MRI sequence. Most field names (except for the DEF field) consist of matrices or vectors, where each column index represents a sequence block. This struct serves as an input for the simulation.
Arguments
GR
: (::Matrix{Grad}
) gradient matrix. Rows for x-y-z amplitudes and columns are for blocksRF
: (::Matrix{RF}
) RF matrix. The 1 row is for the coil and columns are for blocksADC
: (::Array{ADC,1}
) ADC block vectorDUR
: (::Vector
, [s]
) duration block vectorDEF
: (::Dict{String, Any}
) dictionary with relevant information of the sequence. Possible keys could be ["AdcRasterTime"
, "GradientRasterTime"
, "Name"
, "Nz"
, "Num_Blocks"
, "Nx"
, "Ny"
, "PulseqVersion"
, "BlockDurationRaster"
, "FileName"
, "RadiofrequencyRasterTime"
]
Returns
seq
: (::Sequence
) Sequence struct
sourceGrad
KomaMRICore.Grad
— Typegr = Grad(A, T)
gr = Grad(A, T, rise)
gr = Grad(A, T, rise, delay)
gr = Grad(A, T, rise, fall, delay)
The Grad struct represents a gradient of a sequence event.
Arguments
A
: (::Real
or ::Vector
, [T/m]
) amplitude of the gradientT
: (::Real
or ::Vector
, [s]
) duration of the flat-toprise
: (::Real
, [s]
) duration of the risefall
: (::Real
, [s]
) duration of the falldelay
: (::Real
, [s]
) duration of the delay
Returns
gr
: (::Grad
) gradient struct
Examples
julia> gr = Grad(1, 1, 0.1, 0.1, 0.2)
-julia> seq = Sequence([gr]); plot_seq(seq)
sourceKomaMRICore.Grad
— Methodgr = Grad(f::Function, T::Real, N::Integer; delay::Real)
Generates an arbitrary gradient waveform defined by the function f
in the interval t ∈ [0,T
]. The time separation between two consecutive samples is given by T/(N-1).
Arguments
f
: (::Function
) function that describes the gradient waveformT
: (::Real
, [s]
) duration of the gradient waveformN
: (::Integer
, =300
) number of samples of the gradient waveform
Keywords
delay
: (::Real
, =0
, [s]
) delay time of the waveform
Returns
gr
: (::Grad
) gradient struct
Examples
julia> gx = Grad(t -> sin(π*t / 0.8), 0.8)
+julia> seq = Sequence([gr]); plot_seq(seq)
sourceKomaMRICore.Grad
— Methodgr = Grad(f::Function, T::Real, N::Integer; delay::Real)
Generates an arbitrary gradient waveform defined by the function f
in the interval t ∈ [0,T
]. The time separation between two consecutive samples is given by T/(N-1).
Arguments
f
: (::Function
) function that describes the gradient waveformT
: (::Real
, [s]
) duration of the gradient waveformN
: (::Integer
, =300
) number of samples of the gradient waveform
Keywords
delay
: (::Real
, =0
, [s]
) delay time of the waveform
Returns
gr
: (::Grad
) gradient struct
Examples
julia> gx = Grad(t -> sin(π*t / 0.8), 0.8)
-julia> seq = Sequence([gx]); plot_seq(seq)
sourceRF
KomaMRICore.RF
— Typerf = RF(A, T)
+julia> seq = Sequence([gx]); plot_seq(seq)
sourceRF
KomaMRICore.RF
— Typerf = RF(A, T)
rf = RF(A, T, Δf)
rf = RF(A, T, Δf, delay)
The RF struct represents a Radio Frequency excitation of a sequence event.
Arguments
A
: (::Complex
, [T]
) RF complex amplitud modulation (AM), $B_1(t) = |B_1(t)| e^{i\phi(t)} = B_{1}(t) + iB_{1,y}(t)$T
: (::Real
, [s
]) RF durationΔf
: (::Real
or ::Vector
, [Hz
]) RF frequency difference with respect to the Larmor frequency. This can be a number but also a vector to represent frequency modulated signals (FM).delay
: (::Real
, [s
]) RF delay time
Returns
rf
: (::RF
) the RF struct
Examples
julia> rf = RF(1, 1, 0, 0.2)
-julia> seq = Sequence(); seq += rf; plot_seq(seq)
sourceADC
KomaMRICore.ADC
— Typeadc = ADC(N, T)
+julia> seq = Sequence(); seq += rf; plot_seq(seq)
sourceADC
KomaMRICore.ADC
— Typeadc = ADC(N, T)
adc = ADC(N, T, delay)
adc = ADC(N, T, delay, Δf, ϕ)
The ADC struct represents the Analog to Digital Converter (ADC) of a sequence event.
Arguments
N
: (::Int64
) number of acquired samplesT
: (::Float64
, [s
]) duration to acquire the samplesdelay
: (::Float64
, [s
]) delay time to start the acquisitionΔf
: (::Float64
, [Hz
]) delta frequency. It is meant to compensate RF pulse phasesϕ
: (::Float64
, [rad]
) phase. It is meant to compensate RF pulse phases
Returns
adc
: (::ADC
) ADC struct
Examples
julia> adc = ADC(16, 1, 0.1)
-julia> seq = Sequence(); seq += adc; plot_seq(seq)
sourceDelay
KomaMRICore.Delay
— Typedelay = Delay(T)
The Delay struct is meant to add a delay to a sequence by using a sum operator.
Arguments
T
: (::Real
, [s]
) time delay value
Returns
delay
: (::Delay
) delay struct
Examples
julia> delay = Delay(0.5)
+julia> seq = Sequence(); seq += adc; plot_seq(seq)
sourceDelay
KomaMRICore.Delay
— Typedelay = Delay(T)
The Delay struct is meant to add a delay to a sequence by using a sum operator.
Arguments
T
: (::Real
, [s]
) time delay value
Returns
delay
: (::Delay
) delay struct
Examples
julia> delay = Delay(0.5)
julia> s = Sequence([Grad(1, 1, 0.1)])
-julia> seq = delay + s; plot_seq(seq)
sourceRead Data
read_seq
KomaMRIFiles.read_seq
— Functionseq = read_seq(filename)
Returns the Sequence struct from a Pulseq file with .seq
extension.
Arguments
filename
: (::String
) absolute or relative path of the sequence file .seq
Returns
seq
: (::Sequence
) Sequence struct
Examples
julia> seq_file = joinpath(dirname(pathof(KomaMRI)), "../examples/1.sequences/spiral.seq")
+julia> seq = delay + s; plot_seq(seq)
sourceRead Data
read_seq
KomaMRIFiles.read_seq
— Functionseq = read_seq(filename)
Returns the Sequence struct from a Pulseq file with .seq
extension.
Arguments
filename
: (::String
) absolute or relative path of the sequence file .seq
Returns
seq
: (::Sequence
) 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)
sourceread_phantom_jemris
KomaMRIFiles.read_phantom_jemris
— Functionobj = read_phantom_jemris(filename)
Returns the Phantom struct from a JEMRIS phantom file .h5
.
Arguments
filename
: (::String
) the absolute or relative path of the phantom file .h5
Returns
obj
: (::Phantom
) Phantom struct
Examples
julia> obj_file = joinpath(dirname(pathof(KomaMRI)), "../examples/2.phantoms/brain.h5")
+julia> plot_seq(seq)
sourceread_phantom_jemris
KomaMRIFiles.read_phantom_jemris
— Functionobj = read_phantom_jemris(filename)
Returns the Phantom struct from a JEMRIS phantom file .h5
.
Arguments
filename
: (::String
) the absolute or relative path of the phantom file .h5
Returns
obj
: (::Phantom
) Phantom struct
Examples
julia> obj_file = joinpath(dirname(pathof(KomaMRI)), "../examples/2.phantoms/brain.h5")
julia> obj = read_phantom_jemris(obj_file)
-julia> plot_phantom_map(obj, :ρ)
sourceread_phantom_MRiLab
KomaMRIFiles.read_phantom_MRiLab
— Functionobj = read_phantom_MRiLab(filename)
Returns the Phantom struct from a MRiLab phantom file .mat
.
Arguments
filename
: (::String
) the absolute or relative path of the phantom file .mat
Returns
obj
: (::Phantom
) Phantom struct
Examples
julia> obj_file = joinpath(dirname(pathof(KomaMRI)), "../examples/2.phantoms/brain.mat")
+julia> plot_phantom_map(obj, :ρ)
sourceread_phantom_MRiLab
KomaMRIFiles.read_phantom_MRiLab
— Functionobj = read_phantom_MRiLab(filename)
Returns the Phantom struct from a MRiLab phantom file .mat
.
Arguments
filename
: (::String
) the absolute or relative path of the phantom file .mat
Returns
obj
: (::Phantom
) Phantom struct
Examples
julia> obj_file = joinpath(dirname(pathof(KomaMRI)), "../examples/2.phantoms/brain.mat")
julia> obj = read_phantom_MRiLab(obj_file)
-julia> plot_phantom_map(obj, :ρ)
sourcesignal_to_raw_data
KomaMRICore.signal_to_raw_data
— Functionraw = signal_to_raw_data(signal, seq; phantom_name, sys, sim_params)
Transforms the raw signal into a RawAcquisitionData struct (nearly equivalent to the ISMRMRD format) used for reconstruction with MRIReco.
Arguments
signal
: (::Matrix{Complex}
) raw signal matrixseq
: (::Sequence
) Sequence struct
Keywords
phantom_name
: (::String
, ="Phantom"
) phantom namesys
: (::Scanner
, =Scanner()
) Scanner structsim_params
: (::Dict{String, Any}
, =Dict{String,Any}()
) simulation parameter dictionary
Returns
raw
: (::RawAcquisitionData
) RawAcquisitionData struct
Examples
julia> seq_file = joinpath(dirname(pathof(KomaMRI)), "../examples/1.sequences/epi_se.seq")
+julia> plot_phantom_map(obj, :ρ)
sourcesignal_to_raw_data
KomaMRICore.signal_to_raw_data
— Functionraw = signal_to_raw_data(signal, seq; phantom_name, sys, sim_params)
Transforms the raw signal into a RawAcquisitionData struct (nearly equivalent to the ISMRMRD format) used for reconstruction with MRIReco.
Arguments
signal
: (::Matrix{Complex}
) raw signal matrixseq
: (::Sequence
) Sequence struct
Keywords
phantom_name
: (::String
, ="Phantom"
) phantom namesys
: (::Scanner
, =Scanner()
) Scanner structsim_params
: (::Dict{String, Any}
, =Dict{String,Any}()
) simulation parameter dictionary
Returns
raw
: (::RawAcquisitionData
) RawAcquisitionData struct
Examples
julia> seq_file = joinpath(dirname(pathof(KomaMRI)), "../examples/1.sequences/epi_se.seq")
julia> sys, obj, seq = Scanner(), brain_phantom2D(), read_seq(seq_file)
@@ -58,76 +58,76 @@
julia> raw = signal_to_raw_data(signal, seq)
-julia> plot_signal(raw)
sourcePulse Design
PulseDesigner
KomaMRICore.PulseDesigner
— ModulePulseDesigner
A module to define different pulse sequences.
sourcePulseDesigner.RF_hard
KomaMRICore.PulseDesigner.RF_hard
— Functionseq = RF_hard(B1, T, sys; G=[0, 0, 0], Δf=0)
Returns a sequence with a RF excitation pulse.
Arguments
B1
: (::Number
, [T]
) RF pulse amplitudeT
: (::Real
, [s]
) RF pulse durationsys
: (::Scanner
) Scanner struct
Keywords
G
: (::Vector{Real}
, =[0, 0, 0]
, [T/m]
) gradient amplitudes for x, y, zΔf
: (::Real
, =0
, [Hz]
) RF pulse carrier frequency displacement
Returns
seq
: (::Sequence
) Sequence struct with a RF pulse
Examples
julia> sys = Scanner(); durRF = π / 2 / (2π * γ * sys.B1);
+julia> plot_signal(raw)
sourcePulse Design
PulseDesigner
KomaMRICore.PulseDesigner
— ModulePulseDesigner
A module to define different pulse sequences.
sourcePulseDesigner.RF_hard
KomaMRICore.PulseDesigner.RF_hard
— Functionseq = RF_hard(B1, T, sys; G=[0, 0, 0], Δf=0)
Returns a sequence with a RF excitation pulse.
Arguments
B1
: (::Number
, [T]
) RF pulse amplitudeT
: (::Real
, [s]
) RF pulse durationsys
: (::Scanner
) Scanner struct
Keywords
G
: (::Vector{Real}
, =[0, 0, 0]
, [T/m]
) gradient amplitudes for x, y, zΔf
: (::Real
, =0
, [Hz]
) RF pulse carrier frequency displacement
Returns
seq
: (::Sequence
) Sequence struct with a RF pulse
Examples
julia> sys = Scanner(); durRF = π / 2 / (2π * γ * sys.B1);
julia> seq = PulseDesigner.RF_hard(sys.B1, durRF, sys);
-julia> plot_seq(seq)
sourcePulseDesigner.RF_sinc
KomaMRICore.PulseDesigner.RF_sinc
— Functionseq = RF_sinc(B1, T, sys; G=[0, 0, 0], Δf=0, a=0.46, TBP=4)
Returns a sequence with a RF sinc waveform.
References
- Matt A. Bernstein, Kevin F. King, Xiaohong Joe Zhou, Chapter 2 - Radiofrequency Pulse
Shapes, Handbook of MRI Pulse Sequences, 2004, Pages 35-66, https://doi.org/10.1016/B978-012092861-3/50006-6.
Arguments
B1
: (::Number
, [T]
) RF sinc amplitudeT
: (::Real
, [s]
) RF sinc durationsys
: (::Scanner
) Scanner struct
Keywords
G
: (::Vector{Real}
, =[0, 0, 0]
, [T/m]
) gradient amplitudes for x, y, zΔf
: (::Real
, =0
, [Hz]
) RF pulse carrier frequency displacementa
: (::Real
, =0.46
) height appodization window parameterTBP
: (::Real
, =4
) width appodization window parameter
Returns
seq
: (::Sequence
) Sequence struct with a RF pulse
Examples
julia> sys = Scanner(); durRF = π / 2 / (2π * γ * sys.B1);
+julia> plot_seq(seq)
sourcePulseDesigner.RF_sinc
KomaMRICore.PulseDesigner.RF_sinc
— Functionseq = RF_sinc(B1, T, sys; G=[0, 0, 0], Δf=0, a=0.46, TBP=4)
Returns a sequence with a RF sinc waveform.
References
- Matt A. Bernstein, Kevin F. King, Xiaohong Joe Zhou, Chapter 2 - Radiofrequency Pulse
Shapes, Handbook of MRI Pulse Sequences, 2004, Pages 35-66, https://doi.org/10.1016/B978-012092861-3/50006-6.
Arguments
B1
: (::Number
, [T]
) RF sinc amplitudeT
: (::Real
, [s]
) RF sinc durationsys
: (::Scanner
) Scanner struct
Keywords
G
: (::Vector{Real}
, =[0, 0, 0]
, [T/m]
) gradient amplitudes for x, y, zΔf
: (::Real
, =0
, [Hz]
) RF pulse carrier frequency displacementa
: (::Real
, =0.46
) height appodization window parameterTBP
: (::Real
, =4
) width appodization window parameter
Returns
seq
: (::Sequence
) Sequence struct with a RF pulse
Examples
julia> sys = Scanner(); durRF = π / 2 / (2π * γ * sys.B1);
julia> seq = PulseDesigner.RF_sinc(sys.B1, durRF, sys);
-julia> plot_seq(seq)
sourcePulseDesigner.EPI
KomaMRICore.PulseDesigner.EPI
— Functionseq = EPI(FOV::Real, N::Integer, sys::Scanner)
Returns a sequence with EPI gradients.
Arguments
FOV
: (::Real
, [m]
) field of viewN
: (::Integer
) number of pixels in the x and y axissys
: (::Scanner
) Scanner struct
Returns
seq
: (::Sequence
) Sequence struct with EPI gradients
Examples
julia> sys, FOV, N = Scanner(), 23e-2, 101
+julia> plot_seq(seq)
sourcePulseDesigner.EPI
KomaMRICore.PulseDesigner.EPI
— Functionseq = EPI(FOV::Real, N::Integer, sys::Scanner)
Returns a sequence with EPI gradients.
Arguments
FOV
: (::Real
, [m]
) field of viewN
: (::Integer
) number of pixels in the x and y axissys
: (::Scanner
) Scanner struct
Returns
seq
: (::Sequence
) Sequence struct with EPI gradients
Examples
julia> sys, FOV, N = Scanner(), 23e-2, 101
julia> seq = PulseDesigner.EPI(FOV, N, sys)
julia> plot_seq(seq)
-julia> plot_kspace(seq)
sourcePulseDesigner.radial_base
KomaMRICore.PulseDesigner.radial_base
— Functionseq = radial_base(FOV::Real, Nr::Integer, sys::Scanner)
Returns a sequence with radial gradients for a single trajectory.
Arguments
FOV
: (::Real
, [m]
) field of viewN
: (::Integer
) number of pixels along the diametersys
: (::Scanner
) Scanner struct
Returns
seq
: (::Sequence
) Sequence struct of a single radial trajectory
Examples
julia> sys, FOV, N = Scanner(), 23e-2, 101
+julia> plot_kspace(seq)
sourcePulseDesigner.radial_base
KomaMRICore.PulseDesigner.radial_base
— Functionseq = radial_base(FOV::Real, Nr::Integer, sys::Scanner)
Returns a sequence with radial gradients for a single trajectory.
Arguments
FOV
: (::Real
, [m]
) field of viewN
: (::Integer
) number of pixels along the diametersys
: (::Scanner
) Scanner struct
Returns
seq
: (::Sequence
) Sequence struct of a single radial trajectory
Examples
julia> sys, FOV, N = Scanner(), 23e-2, 101
julia> seq = PulseDesigner.radial_base(FOV, N, sys)
julia> plot_seq(seq)
-julia> plot_kspace(seq)
sourcePulseDesigner.spiral_base
KomaMRICore.PulseDesigner.spiral_base
— Functionspiral = spiral_base(FOV, N, sys; S0=sys.Smax*2/3, Nint=8, λ=Nint/FOV, BW=60e3)
Definition of a spiral base sequence.
References
- Glover, G.H. (1999), Simple analytic spiral K-space algorithm. Magn. Reson. Med.,
42: 412-415. https://doi.org/10.1002/(SICI)1522-2594(199908)42:2<412::AID-MRM25>3.0.CO;2-U
Arguments
FOV
: (::Real
, [m]
) field of viewN
: (::Integer
) number of pixels along the radioussys
: (::Scanner
) Scanner struct
Keywords
S0
: (::Vector{Real}
, =sys.Smax*2/3
, [T/m/s]
) slew rate referenceNint
: (::Integer
, =8
) number of interleavesλ
: (::Real
, =Nint/FOV
, [1/m]
) kspace spiral parameterBW
: (::Real
, =60e3
, [Hz]
) adquisition parameter
Returns
spiral
: (::Function
) function that returns a Sequence
struct when evaluated
Examples
julia> sys, FOV, N = Scanner(), 23e-2, 101
+julia> plot_kspace(seq)
sourcePulseDesigner.spiral_base
KomaMRICore.PulseDesigner.spiral_base
— Functionspiral = spiral_base(FOV, N, sys; S0=sys.Smax*2/3, Nint=8, λ=Nint/FOV, BW=60e3)
Definition of a spiral base sequence.
References
- Glover, G.H. (1999), Simple analytic spiral K-space algorithm. Magn. Reson. Med.,
42: 412-415. https://doi.org/10.1002/(SICI)1522-2594(199908)42:2<412::AID-MRM25>3.0.CO;2-U
Arguments
FOV
: (::Real
, [m]
) field of viewN
: (::Integer
) number of pixels along the radioussys
: (::Scanner
) Scanner struct
Keywords
S0
: (::Vector{Real}
, =sys.Smax*2/3
, [T/m/s]
) slew rate referenceNint
: (::Integer
, =8
) number of interleavesλ
: (::Real
, =Nint/FOV
, [1/m]
) kspace spiral parameterBW
: (::Real
, =60e3
, [Hz]
) adquisition parameter
Returns
spiral
: (::Function
) function that returns a Sequence
struct when evaluated
Examples
julia> sys, FOV, N = Scanner(), 23e-2, 101
julia> spiral = PulseDesigner.spiral_base(FOV, N, sys)
julia> seq = spiral(0)
-julia> plot_seq(seq)
sourcePulseDesigner.EPI_example
KomaMRICore.PulseDesigner.EPI_example
— Functionseq = EPI_example(; sys=Scanner())
Returns a sequence suitable for acquiring the 2D brain example in the provided examples.
Keywords
sys
: (::Scanner
) Scanner struct
Returns
seq
: (::Sequence
) EPI example Sequence struct
Examples
julia> seq = PulseDesigner.EPI_example();
+julia> plot_seq(seq)
sourcePulseDesigner.EPI_example
KomaMRICore.PulseDesigner.EPI_example
— Functionseq = EPI_example(; sys=Scanner())
Returns a sequence suitable for acquiring the 2D brain example in the provided examples.
Keywords
sys
: (::Scanner
) Scanner struct
Returns
seq
: (::Sequence
) EPI example Sequence struct
Examples
julia> seq = PulseDesigner.EPI_example();
-julia> plot_seq(seq)
sourceSimulation
simulate
KomaMRICore.simulate
— Functionout = simulate(obj::Phantom, seq::Sequence, sys::Scanner; sim_params, w)
Returns the raw signal or the last state of the magnetization according to the value of the "return_type"
key of the sim_params
dictionary.
Arguments
obj
: (::Phantom
) Phantom structseq
: (::Sequence
) Sequence structsys
: (::Scanner
) Scanner struct
Keywords
sim_params
: (::Dict{String,Any}
, =Dict{String,Any}()
) simulation parameter dictionaryw
: (::Blink.AtomShell.Window
, =nothing
) the window within which to display a progress bar in the Blink Window UI. If this variable is anything other than 'nothing', the progress bar will be considered
Returns
out
: (::Vector{Complex}
or ::SpinStateRepresentation
or ::RawAcquisitionData
) depending on whether "return_type" is "mat", "state" or "raw" (default), respectively
Examples
julia> seq_file = joinpath(dirname(pathof(KomaMRI)), "../examples/3.koma_paper/comparison_accuracy/sequences/EPI/epi_100x100_TE100_FOV230.seq");
+julia> plot_seq(seq)
sourceSimulation
simulate
KomaMRICore.simulate
— Functionout = simulate(obj::Phantom, seq::Sequence, sys::Scanner; sim_params, w)
Returns the raw signal or the last state of the magnetization according to the value of the "return_type"
key of the sim_params
dictionary.
Arguments
obj
: (::Phantom
) Phantom structseq
: (::Sequence
) Sequence structsys
: (::Scanner
) Scanner struct
Keywords
sim_params
: (::Dict{String,Any}
, =Dict{String,Any}()
) simulation parameter dictionaryw
: (::Blink.AtomShell.Window
, =nothing
) the window within which to display a progress bar in the Blink Window UI. If this variable is anything other than 'nothing', the progress bar will be considered
Returns
out
: (::Vector{Complex}
or ::SpinStateRepresentation
or ::RawAcquisitionData
) depending on whether "return_type" is "mat", "state" or "raw" (default), respectively
Examples
julia> seq_file = joinpath(dirname(pathof(KomaMRI)), "../examples/3.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)
sourcesimulate_slice_profile
KomaMRICore.simulate_slice_profile
— Functionmag = simulate_slice_profile(seq; z, sim_params)
Returns magnetization of spins distributed along z
after running the Sequence struct.
Arguments
seq
: (::Sequence
) Sequence struct
Keywords
z
: (=range(-2e-2,2e-2,200)
) range for the z axissim_params
: (::Dict{String, Any}
, =Dict{String,Any}("Δt_rf"=>1e-6)
) dictionary with simulation parameters
Returns
mag
: (::SpinStateRepresentation
) final state of the magnetization vector
sourcePlots
plot_phantom_map
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
t0
: (::Real
, =0
, [ms]
) time to see displacement of the phantomheight
: (::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 colorbar
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_signal(raw)
sourcesimulate_slice_profile
KomaMRICore.simulate_slice_profile
— Functionmag = simulate_slice_profile(seq; z, sim_params)
Returns magnetization of spins distributed along z
after running the Sequence struct.
Arguments
seq
: (::Sequence
) Sequence struct
Keywords
z
: (=range(-2e-2,2e-2,200)
) range for the z axissim_params
: (::Dict{String, Any}
, =Dict{String,Any}("Δt_rf"=>1e-6)
) dictionary with simulation parameters
Returns
mag
: (::SpinStateRepresentation
) final state of the magnetization vector
sourcePlots
plot_phantom_map
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
t0
: (::Real
, =0
, [ms]
) time to see displacement of the phantomheight
: (::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 colorbar
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, :ρ)
sourceplot_seq
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 titlemax_rf_samples
: (::Integer
, =100
) maximum number of RF samples
Returns
p
: (::PlotlyJS.SyncPlot
) plot of the Sequence struct
Examples
julia> seq_file = joinpath(dirname(pathof(KomaMRI)), "../examples/1.sequences/spiral.seq")
+julia> plot_phantom_map(obj3D, :ρ)
sourceplot_seq
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 titlemax_rf_samples
: (::Integer
, =100
) maximum number of RF samples
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)
sourceplot_kspace
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> plot_seq(seq)
sourceplot_kspace
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)
sourceplot_M0
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> plot_kspace(seq)
sourceplot_M0
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)
sourceplot_M1
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> plot_M0(seq)
sourceplot_M1
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)
sourceplot_M2
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> plot_M1(seq)
sourceplot_M2
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)
sourceplot_eddy_currents
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> plot_M2(seq)
sourceplot_eddy_currents
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)
sourceplot_slew_rate
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> plot_eddy_currents(seq, 80e-3)
sourceplot_slew_rate
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)
sourceplot_signal
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_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 initially
Returns
p
: (::PlotlyJS.SyncPlot
) plot of the raw signal
Examples
julia> seq_file = joinpath(dirname(pathof(KomaMRI)), "../examples/3.koma_paper/comparison_accuracy/sequences/EPI/epi_100x100_TE100_FOV230.seq");
+julia> plot_slew_rate(seq)
sourceplot_signal
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_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 initially
Returns
p
: (::PlotlyJS.SyncPlot
) plot of the raw signal
Examples
julia> seq_file = joinpath(dirname(pathof(KomaMRI)), "../examples/3.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)
sourceplot_image
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
sourceUI
KomaUI
KomaMRI.KomaUI
— Functionout = KomaUI(; kwargs...)
Launch the Koma's UI.
Keywords
darkmode
: (::Bool
, =true
) define dark mode style for the UIframe
: (::Bool
, =true
) display the upper frame of the Blink windowphantom_mode
: (::String
, ="2D"
, opts=["2D"
, "3D"
]) load the default phantom as a 2D or 3D brain examplesim
: (::Dict{String,Any}
, =Dict{String,Any}()
) simulation parameters dictionaryrec
: (::Dict{Symbol,Any}
, =Dict{Symbol,Any}()
) reconstruction parameters dictionaryreturn_window
: (::Bool
, =false
) make the out
be either 'nothing' or the Blink window, depending on whether the return_window
keyword argument is set to trueshow_window
: (::Bool
, =true
) display the Blink window
Returns
out
: (::Nothing
or ::Blink.AtomShell.Window
) returns either 'nothing' or the Blink window, depending on whether the return_window
keyword argument is set to true.
Examples
julia> KomaUI()
sourceSettings
This document was generated with Documenter.jl version 0.27.25 on Tuesday 19 December 2023. Using Julia version 1.9.4.
+julia> plot_signal(raw)
plot_image
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
UI
KomaUI
KomaMRI.KomaUI
— Functionout = KomaUI(; kwargs...)
Launch the Koma's UI.
Keywords
darkmode
: (::Bool
,=true
) define dark mode style for the UIframe
: (::Bool
,=true
) display the upper frame of the Blink windowphantom_mode
: (::String
,="2D"
, opts=["2D"
,"3D"
]) load the default phantom as a 2D or 3D brain examplesim
: (::Dict{String,Any}
,=Dict{String,Any}()
) simulation parameters dictionaryrec
: (::Dict{Symbol,Any}
,=Dict{Symbol,Any}()
) reconstruction parameters dictionaryreturn_window
: (::Bool
,=false
) make theout
be either 'nothing' or the Blink window, depending on whether thereturn_window
keyword argument is set to trueshow_window
: (::Bool
,=true
) display the Blink window
Returns
out
: (::Nothing
or::Blink.AtomShell.Window
) returns either 'nothing' or the Blink window, depending on whether thereturn_window
keyword argument is set to true.
Examples
julia> KomaUI()
Settings
This document was generated with Documenter.jl version 0.27.25 on Wednesday 20 December 2023. Using Julia version 1.9.4.