Skip to content

MATLAB API Reference

Complete reference for PulsePal MATLAB functions.

A

  • addBlock - Adds a new block of events to a Pulseq sequence. It offers three ways to add a block: 1) using a...
  • addGradients - This function superposes multiple gradient waveforms. It takes a cell array of gradient waveforms...
  • addRamps - This function adds ramp segments to a k-space trajectory to ensure smooth transitions between zer...
  • align - This function aligns the objects within a Pulseq block based on a specified alignment type ('left...
  • applySoftDelay - This function adjusts the durations of blocks within a Pulseq sequence based on user-specified so...
  • applyToBlock - This helper function processes a sequence of Pulseq events (potentially within a block) and conve...
  • applyToSeq - This helper function applies a transformation defined by an object obj to a Pulseq sequence `se...

C

  • calcAdcSeg - This function calculates the optimal splitting of an ADC (Analog-to-Digital Converter) signal int...
  • calcDuration - Calculates the duration of a Pulseq event, a sequence of events, or a block structure. It iterat...
  • calcMomentsBtensor - Calculates the magnetic field (B) and its first three moments (m1, m2, m3) from a Pulseq sequence...
  • calcPNS - Calculates peripheral nerve stimulation (PNS) levels using the safe model implementation by Szcze...
  • calcRamp - Calculates a k-space trajectory connecting two given points (k0 and kend) while adhering to gradi...
  • calcRfBandwidth - Calculates the bandwidth of an RF pulse using a Fast Fourier Transform (FFT). It assumes a low-a...
  • calcRfCenter - Calculates the effective center time point of an RF pulse. For shaped pulses, it determines the t...
  • calcRfPower - Calculates the relative power of an RF pulse. It returns the relative energy of the pulse in uni...
  • calculateKspacePP - Calculates the k-space trajectory of a Pulseq sequence using a piecewise-polynomial gradient wave...
  • checkTiming - This function checks the timing and other parameters of all blocks and objects within a Pulseq se...
  • compressShape - Compresses a gradient or pulse waveform using a run-length encoding scheme applied to its derivat...
  • compressShape_mat - Compresses a gradient or pulse waveform using a run-length encoding scheme applied to its derivat...
  • conjugate - This function computes the conjugate of a quaternion or a collection of quaternions. A quaternio...
  • convert - Converts numerical data between different units used in magnetic resonance imaging (MRI) gradient...

D

  • decompressShape - Decompresses a gradient or pulse shape that has been compressed using a run-length encoding schem...
  • duration - Calculates the total duration of a Pulseq sequence and optionally returns the number of blocks an...

E

  • EventLibrary - Internal library class for storing and managing MRI sequence events (RF pulses, gradients, ADC ev...
  • evalLabels - This function evaluates the values of labels used within a Pulseq sequence. It can calculate the ...

F

  • findBlockByTime - This helper function finds the index of the block in a Pulseq sequence that contains a given time...
  • findFlank - This function finds the x-coordinate of the left flank of a given function f. It determines the f...
  • flipGradAxis - This helper function inverts all gradients along a specified axis or channel within a Pulseq sequ...
  • fromRotMat - This function converts a 3x3 rotation matrix into a normalized quaternion. It handles potential ...

G

  • getBlock - Retrieves a specific block from a Pulseq sequence object. The function decompresses all events a...
  • getDefinition - Retrieves the value associated with a specified key from a custom definitions structure within a ...
  • getSupportedLabels - This function returns a cell array of strings representing supported labels for Pulseq sequence p...
  • getSupportedRfUse - This function returns a cell array containing strings representing the supported RF pulse uses in...

I

  • install - Installs a Pulseq sequence onto a Siemens MRI system. The function detects the scanner environme...
  • isOctave - This function checks if the code is running within the Octave environment. It uses a persistent v...

M

  • makeAdc - Creates an ADC readout event for Pulseq sequence design. It defines parameters for the analog-to...
  • makeAdiabaticPulse - Generates adiabatic inversion pulses of type 'hypsec' (hyperbolic secant) or 'wurst' (wideband, u...
  • makeArbitraryGrad - Creates a gradient event with an arbitrary waveform. The function ensures the waveform adheres t...
  • makeArbitraryRf - Creates an arbitrary RF pulse with a specified shape and parameters. The function takes a comple...
  • makeBlockPulse - Generates a block RF pulse with optional slice-selective capabilities. The function creates a Pu...
  • makeDelay - Creates a delay event for use in a Pulseq sequence. This function generates a structure represen...
  • makeDigitalOutputPulse - Creates a digital output pulse event, also known as a trigger, for a specified channel. This fun...
  • makeExtendedTrapezoid - Creates an extended trapezoid gradient waveform. This function allows the definition of a gradie...
  • makeExtendedTrapezoidArea - Generates the shortest possible extended trapezoid gradient waveform with a specified area, start...
  • makeGaussPulse - Generates a Gaussian RF pulse, optionally with slice-selective gradients. The function creates a...
  • makeLabel - Creates a label event for use in Pulseq sequences. This function generates a structure defining ...
  • makeSLRpulse - Generates a selective excitation RF pulse using the Shinnar-Le Roux (SLR) algorithm. This functio...
  • makeSincPulse - Generates a slice-selective sinc pulse and optionally its corresponding slice selection and refoc...
  • makeSoftDelay - Creates a soft delay event for use with Pulseq sequences. This event modifies the duration of an ...
  • makeTrapezoid - Generates a trapezoidal gradient waveform for a specified channel in a Pulseq sequence. The func...
  • makeTrigger - Creates a trigger event for synchronization with an external signal. This function generates a s...
  • modGradAxis - This function modifies the amplitude of gradient events along a specified axis ('x', 'y', or 'z')...
  • multiply - This function calculates the product of two quaternions. A quaternion is represented as a 1x4 ve...

N

  • normalize - This function normalizes a quaternion or an array of quaternions. It scales each quaternion to h...

O

  • opts - Sets gradient limits and other system properties of the MR system. It allows users to define or ...

P

  • paperPlot - This helper function generates a plot of a Pulseq sequence in a style suitable for scientific pub...
  • plot - This function plots a Pulseq sequence object in a new figure. It offers various options to contr...
  • pts2waveform - This function interpolates a set of points (times, amplitudes) to generate a waveform with a spec...

R

  • read - Loads a Pulseq sequence from a specified file into a sequence object. The function reads definit...
  • readBinary - Loads a Pulseq sequence from a binary file. This function reads a binary file containing a Pulse...
  • readasc - Reads Siemens ASC ASCII-formatted text files and returns a MATLAB structure containing the data. ...
  • registerGradEvent -
  • registerLabelEvent -
  • registerRfEvent -
  • restoreAdditionalShapeSamples - This function post-processes a gradient waveform, specifically addressing issues that can arise w...
  • rotate - Rotates a 3D vector by a given unit quaternion. The function efficiently implements quaternion r...
  • rotate3D - Rotates gradient objects within a Pulseq block using a provided rotation matrix or quaternion. N...

S

  • SeqPlot - This function generates a plot visualizing different aspects of a Pulseq sequence. It displays t...
  • Sequence - This function is a constructor for the Sequence object in the Pulseq toolbox. It initializes a se...
  • scaleGrad - Scales a gradient waveform by a given scalar value. It handles both trapezoidal and arbitrary wa...
  • setBlock - This function adds or replaces a block of events within a Pulseq sequence. It accepts events in u...
  • setDefinition - This function modifies or creates a custom definition within a Pulseq sequence object. It allows...
  • simRf - Simulates the effect of an RF pulse on nuclear magnetization using a quaternion-based rotation fo...
  • sound - Plays the sequence waveforms through the system speaker. It processes the waveforms from the Pul...
  • splitGradient - This function decomposes a trapezoidal gradient into its constituent parts: slew-up, flat-top, an...
  • splitGradientAt - Splits a trapezoidal or arbitrary gradient into two parts at a specified time point. The functio...

T

  • TransformFOV - This function transforms the field of view (FOV) of a Pulseq sequence by applying rotation, trans...
  • testReport - Analyzes a Pulseq sequence object and generates a text report summarizing key sequence parameters...
  • toRotMat - This function converts a normalized quaternion into its corresponding 3x3 rotation matrix. The q...
  • traj2grad - Converts a k-space trajectory into gradient waveforms using finite differences. The input trajec...
  • transform - Creates a transformed copy of a Pulseq sequence by applying a rotation, translation, or a 4x4 hom...

V

  • version - Returns the version information for the Pulseq Matlab package. The specific version information ...

W

  • waveforms_and_times - This function extracts and organizes waveform data from a Pulseq sequence object. It decompresses...
  • write - Writes a Pulseq sequence object to a file in the Pulseq open file format. This function serializ...
  • writeBinary - Writes a Pulseq sequence object to a file in binary format, using the Pulseq open file format spe...
  • write_v141 - Writes a Pulseq sequence object to a file in version 1.4.1 format. This function takes a Pulseq ...