Skip to content

KomaMRIFiles

Sequence

KomaMRIFiles.read_seq Function
julia
seq = 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

Keywords

  • verify_signature: (::Bool, =false) verify the optional Pulseq [SIGNATURE] hash while loading

  • apply_rotations: (::Bool, =true) apply Pulseq ROTATIONS extensions to the gradients while keeping the extension events in seq.EXT

  • verbose: (::Bool, =true) show informational loading messages

Returns

  • seq: (::Sequence) Sequence struct

Examples

julia
julia> seq_file = joinpath(dirname(pathof(KomaMRI)), "../examples/1.sequences/spiral.seq")

julia> seq = read_seq(seq_file)

julia> plot_seq(seq)
source
KomaMRIFiles.read_seq_data Function
julia
data = read_seq_data(filename)

Read a Pulseq file into Pulseq's native block/event-library representation without materializing repeated Koma Sequence events.

source
KomaMRIFiles.write_seq Function
julia
write_seq(seq, filename)

Writes a Sequence struct to a Pulseq file with .seq extension.

Arguments

  • seq: (::Sequence) Sequence struct

  • filename: (::String) absolute or relative path of the sequence file .seq

  • sys: optional scanner used for hardware-limit validation and export raster times. If passed, sys raster times take precedence over seq.DEF.

  • verbose: (::Bool, =true) show informational writing/checking messages

Examples

julia
julia> seq = Sequence()
julia> @addblock seq += RF(2e-6, 3e-3)
julia> @addblock seq += ADC(100, 100e-3)
julia> write_seq(seq, "fid.seq")
source
KomaMRIFiles.write_seq_data Function
julia
data = write_seq_data(seq; sys=nothing, check_timing=true, check_hw_limits=true, verbose=true)

Prepare a Koma Sequence as PulseqSequenceData without writing a file. Without sys, timing and hardware checks use metadata stored in seq.DEF. With sys, timing, hardware checks, and export raster times use sys.

source
KomaMRIFiles.PulseqSequenceData Type
julia
PulseqSequenceData

Pulseq-native sequence representation used by read_seq_data and write_seq_data. It stores block event ids, event libraries, definitions, the Pulseq version, and the optional signature without materializing repeated Koma RF, Grad, and ADC objects.

Event amplitudes are stored in SI units (RF: T, gradients: T/m). Serialized time fields are normalized from μs/ns to seconds.

source

Phantom

KomaMRIFiles.read_phantom_jemris Function
julia
obj = 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
julia> obj_file = joinpath(dirname(pathof(KomaMRI)), "../examples/2.phantoms/brain.h5")

julia> obj = read_phantom_jemris(obj_file)

julia> plot_phantom_map(obj, )
source
KomaMRIFiles.read_phantom_MRiLab Function
julia
obj = 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
julia> obj_file = joinpath(dirname(pathof(KomaMRI)), "../examples/2.phantoms/brain.mat")

julia> obj = read_phantom_MRiLab(obj_file)

julia> plot_phantom_map(obj, )
source
KomaMRIFiles.read_phantom Function
julia
phantom = read_phantom(filename)

Reads a (.phantom) file and creates a Phantom structure from it

source
KomaMRIFiles.write_phantom Function
julia
phantom = write_phantom(ph,filename)

Writes a (.phantom) file from a Phantom struct.

source