JEMRIS 2.9.1
open-source MRI simulations
No Matches
List of all members | Classes | Public Member Functions | Private Member Functions | Private Attributes
OutputSequenceData Class Reference

Maintain libraries of hardware events and write sequence file. More...

#include <OutputSequenceData.h>


struct  CompressedShape
 Compressed shape object. More...

Public Member Functions

 OutputSequenceData ()
 Default constructor.
 ~OutputSequenceData ()
 Default destructor.
void AddEvents (std::vector< Event * > &events, double duration=0.0)
 Add events to a new sequence block. More...
void SetRotationMatrix (double alpha, double theta, double phi)
 Set rotation matrix. More...
void SetDefinitions (std::map< std::string, std::string > &defs)
 Set custom scan definitions.
void WriteFiles (const std::string &outDir, const std::string &outFile)
 Write the sequence data to file.
template<typename T >
int SearchLibrary (vector< T > &library, T &obj)

Private Member Functions

template<typename T >
int SearchLibrary (std::vector< T > &library, T &obj)
 Search library for match.
void CompressShape (std::vector< double > &shape, CompressedShape *out)
 Compress a shape.

Private Attributes

double m_rot_matrix [3][3]
 Rotation matrix.
double m_duration
 Total duration of sequence blocks.
std::map< std::string, std::string > m_definitions
 Custom definitions for user-specific purposes to be output in file.
std::vector< SeqBlockm_blocks
 List of sequence blocks.
std::vector< DelayEventm_delay_library
 Library of delay events.
std::vector< RFEventm_rf_library
 Library of RF events.
std::vector< GradEventm_grad_library
 Library of gradient events.
std::vector< ADCEventm_adc_library
 Library of ADC events.
std::vector< CompressedShapem_shape_library
 Library of compressed shapes (referenced by events)

Detailed Description

Maintain libraries of hardware events and write sequence file.

This class maintains a list of compressed sequence events suitable for execution on hardware. A sequence file can be generated for execution on real MR hardware according to the open file format as part of the Pulseq project (

The hierarchical sequence description contains the following elements:

This hierarchy is maintained automatically by the class. The calling code simply adds uncompressed hardware events.

See also
AddEvents(), WriteFiles()

Member Function Documentation

◆ AddEvents()

void OutputSequenceData::AddEvents ( std::vector< Event * > &  events,
double  duration = 0.0 

Add events to a new sequence block.

Creates a new block based on the vector of event pointers. The event data is copied by this function, so pointers can safely be deleted afterwards.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SetRotationMatrix()

void OutputSequenceData::SetRotationMatrix ( double  alpha,
double  theta,
double  phi 

Set rotation matrix.

Calculate the rotation matrix from the axis/angle representation used internally.

alphaRotation angle
thetaInclination from z-axis
phiAzimutal phase from x-axis
+ Here is the caller graph for this function:

The documentation for this class was generated from the following files:

-- last change 03.10.2023 | Tony Stoecker | Imprint | Data Protection --