JEMRIS 2.9.2
open-source MRI simulations
Loading...
Searching...
No Matches
List of all members | Public Member Functions | Protected Member Functions | Protected Attributes
TrapGradPulse Class Reference

Prototype of a trapezoidal gradient pulse (e.g. for cartesian k-space imaging) More...

#include <TrapGradPulse.h>

+ Inheritance diagram for TrapGradPulse:
+ Collaboration diagram for TrapGradPulse:

Public Member Functions

 TrapGradPulse ()
 
 TrapGradPulse (const TrapGradPulse &)
 
 ~TrapGradPulse ()
 
TrapGradPulseClone () const
 
virtual bool Prepare (PrepareMode mode)
 
virtual double GetGradient (double const time)
 
bool SetShape (bool verbose=false)
 Set the shape of the trapezoidal gradient.
 
void SetTrapezoid ()
 Set the shape of the trapezoid in minimal possible time.
 
virtual void SetTPOIs ()
 
virtual void GenerateEvents (std::vector< Event * > &events)
 
- Public Member Functions inherited from GradPulse
 GradPulse ()
 
virtual ~GradPulse ()
 
 GradPulse (const GradPulse &)
 
virtual void GetValue (double *dAllVal, double const time)
 Get the value of this element.
 
virtual bool PrepareNLGfield (PrepareMode mode)
 Preparation of Nonlinear Gradient fields.
 
virtual bool PrepareEddyCurrents (PrepareMode mode, int steps=5000)
 Calculate Eddy Currents of this Gradient.
 
double GetAreaNumeric (int steps)
 get the area of this gradient pulse by numerical integration.
 
void SetArea (double val)
 Set the area of this gradient pulse.
 
void SetNonLinGradField (double const time)
 Set the nonlinear gradient field term World::NonLinGradField.
 
bool HasNonLinGrad ()
 Check, whether this gradient is nonlinear.
 
- Public Member Functions inherited from Pulse
 Pulse ()
 Construct and initialise some values.
 
virtual ~Pulse ()
 Default destructor.
 
 Pulse (const Pulse &)
 Copy constructor.
 
virtual void GetValue (double *dAllVal, double const time) const
 
void SetDuration (double val)
 Set the duration of this pulse.
 
double GetDuration ()
 
void SetAxis (const PulseAxis eAxis)
 Set the Axis of propagation of this pulse.
 
PulseAxis GetAxis () const
 Get the Axis of propagation of this pulse.
 
int GetNADC ()
 
void SetNADC (int nadc)
 Set number of ADCs.
 
int GetADCFlag ()
 
void SetADCFlag (int adcflag)
 Set ADC flag.
 
double GetInitialDelay ()
 Get delay in respect of the AtomicSequence holding this pulse.
 
- Public Member Functions inherited from Module
 Module ()
 Constructor.
 
virtual ~Module ()
 Destructor.
 
 Module (const Module &)
 Copy constructor.
 
void Initialize (DOMNode *node)
 Initialize this module.
 
ModuleGetParent ()
 Get Parent.
 
virtual int GetNumOfTPOIs ()
 Get the Number of TPOIs of this module.
 
vector< Module * > GetChildren () const
 Get Children.
 
vector< Module * > GetChildrenDynamic () const
 Get Children dynamic (old non-cached version for dynamic events such as eddy currents)
 
ModuleGetChild (unsigned int position) const
 Get Child.
 
int GetNumberOfChildren () const
 Get number of Children.
 
bool InsertChild (const string &name)
 Insert Child.
 
virtual ModuleGetPrototypeByAttributeValue (string name, string attrib)
 Get a Prototype by value of an attribute.
 
bool AddDOMattribute (const string attribute, const string value)
 Add attribute and value to the DOM node of this module.
 
void AddAllDOMattributes (bool show_hidden=true)
 
virtual TPOIGetTPOIs ()
 get the TPOIs of this module
 
void DumpTree (const string &file="", Module *mod=NULL, int ichild=0, int level=0)
 Dump the sequence tree.
 
int GetDepth (int depth=0)
 Return tree depth from this module (including depth of Containers)
 
int GetHardwareMode ()
 Return the hardware mode of this module.
 
bool WriteStaticXML (const string &xml_file)
 Rewrite XML-tree where all expressions are evaluated (for IDEA)
 
bool StaticDOM (DOMDocument *doc, DOMNode *node, bool append=true)
 Create a DOM tree where all expressions are evaluated (for IDEA)
 
void SetSeqTree (SequenceTree *pST)
 
SequenceTreeGetSeqTree ()
 
- Public Member Functions inherited from Prototype
 Prototype ()
 Constructor.
 
virtual ~Prototype ()
 Default destructor.
 
 Prototype (const Prototype &)
 Default copy constructor.
 
bool IsPrepared ()
 Check if the Prototype is prepared.
 
void SetName (string name)
 Set the name of this module.
 
DOMNode * GetNode ()
 Get the DOMNode of this module.
 
void SetNode (DOMNode *node)
 Set the DOMNode of this module.
 
string GetClassType ()
 Get the class type of this prototype.
 
Type GetType ()
 Get the module type of this module.
 
string GetDOMattribute (const string attribute)
 Get attribute value from the DOMNode.
 
bool HasDOMattribute (const string attribute)
 Check, if attribute exists in DOM node of this module.
 
AttributeGetAttribute (string name)
 Get an Attribute.
 
void CopyObservers (Attribute *a1, Attribute *a2)
 Copy observers from one attribute to another.
 
bool HasAttribute (string name)
 Check if an attribute exist.
 
void HideAttribute (string attrib, bool observable=true)
 Hide an attribute.
 
string GetName ()
 Get the name of this module.
 
bool Observe (Attribute *attrib, string prot_name, string attrib_name, bool verbose)
 Set up the list of observations.
 
bool Observe (Attribute *attrib, string prot_name, string attrib_name, string attrib_keyword, bool verbose)
 
template<typename T >
bool Notify (const T &val)
 Notify all observers of an attribute.
 
template<typename T >
bool NewState (const T &val)
 Check the state of an attribute.
 
vector< double > * GetVector ()
 Each Prototype has a double vector as a private member, which values can be filled through XML and accessed from attributes within the same Prototype.
 
- Public Member Functions inherited from TxRxPhase
 TxRxPhase ()
 Constructor.
 
virtual ~TxRxPhase ()
 Default destructor.
 
void SetInitialPhase (double val)
 Get phase of this pulse.
 
bool GetPhaseLock ()
 Get phase lock of this pulse.
 
void SetPhaseLock (bool bval)
 Set phase lock of this pulse.
 
double GetInitialPhase ()
 Get initial phase of this pulse.
 
double GetFrequency ()
 Get constant frequency for linear phase terms.
 
void SetFrequency (double val)
 Set constant frequency for linear phase terms.
 

Protected Member Functions

virtual string GetInfo ()
 

Protected Attributes

double m_flat_top_area
 
double m_flat_top_time
 
double m_asym_sr
 
bool m_has_flat_top_time
 
bool m_has_flat_top_area
 
bool m_has_duration
 
bool m_has_area
 
bool m_has_rise_time
 
double m_ft
 
double m_fa
 
double m_du
 
double m_ar
 
double m_amplitude
 
double m_ramp_up_time
 
double m_ramp_dn_time
 
double m_slope_up
 
double m_slope_dn
 
double m_time_to_ramp_dn
 
- Protected Attributes inherited from GradPulse
double m_slew_rate
 The slewrate of this gradient pulse.
 
double m_max_ampl
 The maximum amplitude of this gradient pulse.
 
double m_rise_time
 The constant rise time of this gradient pulse.
 
double m_area
 The area of the gradient pulse.
 
bool m_non_lin_grad
 A flag for nonlinear gradients.
 
double m_nlg_field
 Nonlinear gradient field (NLG)
 
double m_nlg_px
 x-position to compute the NLG field
 
double m_nlg_py
 y-position to compute the NLG field
 
double m_nlg_pz
 z-position to compute the NLG field
 
double m_nlg_val
 gradient value to compute the NLG field
 
bool m_eddy_currents
 A flag for nonlinear gradients.
 
double m_eddy_time
 time of eddy current
 
double m_eddy_val
 value of eddy current
 
double m_ec_area
 area of eddy current
 
int m_ec_length
 convolution length of eddy current
 
EddyPulsem_eddy_pulse
 pulse for eddy currents
 
bool m_hide
 Hide this gradient (not played out, but its ECs!)

 
- Protected Attributes inherited from Pulse
PulseAxis m_axis
 
int m_adc
 
int m_adc_flag
 
double m_initial_delay
 
- Protected Attributes inherited from Module
SequenceTreem_seq_tree
 Reference to the sequence tree.
 
Parametersm_parameters
 Pointer to the sole instance of the Parameters.
 
TPOI m_tpoi
 Time points of interest are stored the referred repository.
 
string m_info
 Information string for this module.
 
double m_duration
 The duration of this module.
 
int m_calls
 Number of calls of this module.
 
int m_hardware_mode
 Hardware mode (-1: simulation only; 0: both; 1: hardware only)
 
- Protected Attributes inherited from Prototype
bool m_aux
 auxiliary helper variable for debugging purposes
 
bool m_prepared
 True, after the first call to Prepare.
 
string m_name
 Name of this Prototype.
 
DOMNode * m_node
 The node configuring this Module.
 
Type m_type
 The type of the module: one of MOD_PULSE, MOD_ATOM, MOD_CONCAT.
 
vector< double > m_vector
 A vector which elements are accessible through loop counters.
 
map< string, Attribute * > m_attributes
 Map to connect a keyword with an Attribute.
 
vector< Attribute * > m_obs_attribs
 Vector of observed Attributes.
 
vector< string > m_obs_attrib_keyword
 Vector of user-defined Attribute names.
 
- Protected Attributes inherited from TxRxPhase
double m_initial_phase
 Initial Phase of this phase event.
 
bool m_phase_lock
 Phase lock of this phase event.
 
double m_frequency
 A constant frequency to set linear phase terms.
 

Additional Inherited Members

- Static Public Member Functions inherited from Prototype
static bool ReplaceString (string &str, const string &s1, const string &s2)
 A global sub-string replacer.
 
static bool ReplaceSymbolString (string &str, const string &s1, const string &s2)
 A global sub-string replacer which replaces only complete symbol strings.
 
static vector< string > Tokenize (const string &str, const string &delimiters=",")
 A global string tokenizer.
 
- Static Public Member Functions inherited from TxRxPhase
static double getLinearPhase (Module *mod, double time)
 A general purpose linear additive phase term.
 

Detailed Description

Prototype of a trapezoidal gradient pulse (e.g. for cartesian k-space imaging)

Constructor & Destructor Documentation

◆ TrapGradPulse() [1/2]

TrapGradPulse::TrapGradPulse ( )

Constructor

+ Here is the caller graph for this function:

◆ TrapGradPulse() [2/2]

TrapGradPulse::TrapGradPulse ( const TrapGradPulse & hrfp)

Copy constructor.

◆ ~TrapGradPulse()

TrapGradPulse::~TrapGradPulse ( )

Destructor.

Member Function Documentation

◆ Clone()

TrapGradPulse * TrapGradPulse::Clone ( ) const
virtual

See Module::clone

Implements Module.

+ Here is the call graph for this function:

◆ GenerateEvents()

void TrapGradPulse::GenerateEvents ( std::vector< Event * > & events)
inlinevirtual
See also
Pulse::GenerateEvents()

Reimplemented from GradPulse.

+ Here is the call graph for this function:

◆ GetGradient()

double TrapGradPulse::GetGradient ( double const time)
inlinevirtual

◆ GetInfo()

string TrapGradPulse::GetInfo ( )
protectedvirtual

Get informations on this trapezoidal gradient

Returns
GradPulse::GetInfo plus info on the flat top (if set)

Reimplemented from GradPulse.

+ Here is the call graph for this function:

◆ Prepare()

bool TrapGradPulse::Prepare ( PrepareMode mode)
virtual

Prepare the trapezoidal gradient pulse.

See Module::Prepare

Reimplemented from GradPulse.

+ Here is the call graph for this function:

◆ SetShape()

bool TrapGradPulse::SetShape ( bool verbose = false)
inline

Set the shape of the trapezoidal gradient.

The method checks for various inputs from XML and prepares the trapezoidal shape accordingly by calling TrapGradPulse::SetTrapezoid

Parameters
verboseShout error in preparation, if true.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SetTPOIs()

void TrapGradPulse::SetTPOIs ( )
inlinevirtual

See Pulse::SetTPOIs

Reimplemented from Pulse.

+ Here is the call graph for this function:

Member Data Documentation

◆ m_amplitude

double TrapGradPulse::m_amplitude
protected

My amplitude

◆ m_ar

double TrapGradPulse::m_ar
protected

internal area

◆ m_asym_sr

double TrapGradPulse::m_asym_sr
protected

Factor for asymmetric slew rate set from XML. Should be in [-1,1]

◆ m_du

double TrapGradPulse::m_du
protected

internal duration

◆ m_fa

double TrapGradPulse::m_fa
protected

internal flat_top area

◆ m_flat_top_area

double TrapGradPulse::m_flat_top_area
protected

Area beyond the Flat Top set from XML

◆ m_flat_top_time

double TrapGradPulse::m_flat_top_time
protected

Duration of the Flat Top set from XML

◆ m_ft

double TrapGradPulse::m_ft
protected

internal flat_top time

◆ m_has_area

bool TrapGradPulse::m_has_area
protected

true, if corresponding double attribute was set in XML

◆ m_has_duration

bool TrapGradPulse::m_has_duration
protected

true, if corresponding double attribute was set in XML

◆ m_has_flat_top_area

bool TrapGradPulse::m_has_flat_top_area
protected

true, if corresponding double attribute was set in XML

◆ m_has_flat_top_time

bool TrapGradPulse::m_has_flat_top_time
protected

true, if corresponding double attribute was set in XML

◆ m_has_rise_time

bool TrapGradPulse::m_has_rise_time
protected

true, if corresponding double attribute was set in XML

◆ m_ramp_dn_time

double TrapGradPulse::m_ramp_dn_time
protected

My ramp down time

◆ m_ramp_up_time

double TrapGradPulse::m_ramp_up_time
protected

My ramp up time

◆ m_slope_dn

double TrapGradPulse::m_slope_dn
protected

My slope down

◆ m_slope_up

double TrapGradPulse::m_slope_up
protected

My slope up

◆ m_time_to_ramp_dn

double TrapGradPulse::m_time_to_ramp_dn
protected

My time to the end of the flat top


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

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