.. _apiref: Sequence ######## .. py:class:: Sequence .. py:method:: __init__(self, name, version='', author='', author_email='', license='', description='', long_description='') :param str name: sequence name :param str version: version name :param str author: author name :param str author_email: mail address :param str license: licence :param str description: short description of the sequence :param str long_description: detailed description of the sequence Main #### .. py:function:: Main() It can only be used within the “with syntax” of the Sequence class. Used with the “with syntax” to implement the main loop of the Sequence. :rtype: Loop Test #### .. py:function:: Test() It can only be used within the “with syntax” of the Sequence class. Used with the “with syntax” to implement the test loop of the Sequence. :rtype: Loop Loop #### .. py:class:: Loop .. py:method:: __init__(self, id, loop_size) :param str id: loop identifier :param int loop_size: loop size .. py:method:: __init__(self, id, loop_size, begin, end, step=1) :param str id: loop identifier :param int loop_size: loop size :param int begin: loop start index :param int end: loop final index :param int step: increment of the loop index BlockRef ######## .. py:function:: BlockRef(id) It can only be used within the “with syntax” of the Loop class. Arrange the contents of the Block by referring to the Block defined in Sequence :param str id: Identifier of the Block to refer WaitFor ####### .. py:function:: WaitFor(duration) It can only be used within the “with syntax” of the Loop class. :param duration: duration time[microsecond] :type duration: float or tuple(list[float], list[str]) WaitUntil ######### .. py:function:: WaitUntil(time) It can only be used within the “with syntax” of the Loop class. :param time: relative time in the Loop[microsecond] :type time: float or tuple(list[float], list[str]) Block ##### .. py:class:: Block Used with the with syntax in the Sequence class's with syntax, and used for Block declaration and implementation .. py:method:: __init__(self, id, duration) :param str id: identifier of the Block :param duration: duration time[microsecond] :type duration: float or tuple(list[float], list[str]) Grad #### .. py:class:: Grad Class for defining the axis of gradient magnetic field and generating gradient magnetic field events .. py:method:: __init__(self, id, gx_factor, gy_factor, gz_factor) :param str id: identifier of Grad :param float gx_factor: coefficient of Gx[0-1] :param float gy_factor: coefficient of Gy[0-1] :param float gz_factor: coefficient of Gz[0-1] .. py:method:: __call__(self, time, value, risetime=0.0) It can only be used within the “with syntax” of the Block class. :param time: start time[microsecond] :param value: final value[mT/m] :param risetime: rise (or fall) time[microsecond] :type time: float or tuple(list[float], list[str]) :type value: float or tuple(list[float], list[str]) :type risetime: float or tuple(list[float], list[str]) .. py:method:: waveform(self, time, waveform, pitch, risetime=0.0) :param time: start time[microsecond] :param waveform: waveform[mT/m] :param pitch: dwell time[microsecond] :param risetime: rise (or fall) time[us] :type time: float or tuple(lsit[float], list[str]) :type waveform: list[float] or tuple(list[list[float]], list[str]) :type pitch: list[float] or tuple(list[float], list[str]) :type risetime: float or tuple(list[float], list[str]) GX ## .. py:data:: GX=Grad('Gx', 1.0, 0.0, 0.0) Predefined Grad objects. Used for event generation of Gx gradient magnetic field. GY ## .. py:data:: GY=Grad('Gy', 0.0, 1.0, 0.0) Predefined Grad objects. Used for event generation of Gy gradient magnetic field. GZ ## .. py:data:: GZ=Grad('Gz', 0.0, 0.0, 1.0) Predefined Grad objects. Used for event generation of Gz gradient magnetic field. RF ## .. py:function:: RF(time, waveform, pitch, factor=1.0, gain=0.0, phase=0.0, frequency=0.0, channels=None) It can only be used within the “with syntax” of the Block class. Generate an event of radio frequency magnetic field :param time: start time[microsecond] :param waveform: waveform[micro Tesla] :param pitch: dwell time[microsecond] :param factor: amplitude factor for the waveform :param gain: transmitter gain[dB] :param phase: transmission phase[rad] :param frequency: relative frequency[kHz] :param Optional[List[int]] channels: channel for control. In case of None, all channels are controlled. :type time: float or tuple(list[float], list[str]) :type waveform: list[float], list[complex], tuple(list[list[float]], list[str]) or tuple(list[list[complex]], list[str]) :type pitch: float or tuple(list[float], list[str]) :type factor: float or tuple(list[float], list[str]) :type gain: float or tuple(list[float], list[str]) :type phase: float or tuple(list[float], list[str]) :type frequency: float or tuple(list[float], list[str]) :type channels: list[int] or None AD ## .. py:function:: AD(time, points, pitch, factor=1.0, gain=0.0, phase=0.0, frequency=0.0, channels=None) It can only be used within the “with syntax” of the Block class. Generate a signal sampling event. :param time: start time[microsecond] :param points: number of sampling points :param pitch: dwell time[microsecond] :param factor: amplitude factor for the signal :param gain: receiver gain[dB] :param phase: receiver phase[rad] :param frequency: offset frequency[kHz] :param channels: channel for control. In case of None, all channels are controlled. :type time: float or tuple(list[float], list[str]) :type points: int or tuple(list[int], list[str]) :type pitch: float or tuple(list[float], list[str]) :type factor: float or tuple(list[float], list[str]) :type gain: float or tuple(list[float], list[str]) :type phase: float or tuple(list[float], list[str]) :type frequency: float or tuple(list[float], list[str]) :type channels: list[int] or None