KomaMRIFiles
Sequence
KomaMRIFiles.read_seq Function
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 loadingapply_rotations: (::Bool,=true) apply PulseqROTATIONSextensions to the gradients while keeping the extension events inseq.EXTverbose: (::Bool,=true) show informational loading messages
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)KomaMRIFiles.read_seq_data Function
data = read_seq_data(filename)Read a Pulseq file into Pulseq's native block/event-library representation without materializing repeated Koma Sequence events.
KomaMRIFiles.write_seq Function
write_seq(seq, filename)Writes a Sequence struct to a Pulseq file with .seq extension.
Arguments
seq: (::Sequence) Sequence structfilename: (::String) absolute or relative path of the sequence file.seqsys: optional scanner used for hardware-limit validation and export raster times. If passed,sysraster times take precedence overseq.DEF.verbose: (::Bool,=true) show informational writing/checking messages
Examples
julia> seq = Sequence()
julia> @addblock seq += RF(2e-6, 3e-3)
julia> @addblock seq += ADC(100, 100e-3)
julia> write_seq(seq, "fid.seq")KomaMRIFiles.write_seq_data Function
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.
KomaMRIFiles.PulseqSequenceData Type
PulseqSequenceDataPulseq-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.
sourcePhantom
KomaMRIFiles.read_phantom_jemris Function
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> obj_file = joinpath(dirname(pathof(KomaMRI)), "../examples/2.phantoms/brain.h5")
julia> obj = read_phantom_jemris(obj_file)
julia> plot_phantom_map(obj, :ρ)KomaMRIFiles.read_phantom_MRiLab Function
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> obj_file = joinpath(dirname(pathof(KomaMRI)), "../examples/2.phantoms/brain.mat")
julia> obj = read_phantom_MRiLab(obj_file)
julia> plot_phantom_map(obj, :ρ)KomaMRIFiles.read_phantom Function
phantom = read_phantom(filename)Reads a (.phantom) file and creates a Phantom structure from it
sourceKomaMRIFiles.write_phantom Function
phantom = write_phantom(ph,filename)Writes a (.phantom) file from a Phantom struct.
source