Skip to content

se_spectrum

se_spectrum

Constructor for spin-echo spectrum sequence.

constructor

constructor(echo_time: float = 0.012, rf_duration: float = 0.0004, num_samples: int = 256, acq_bandwidth: float | int = 20000.0, use_sinc: bool = False, time_bw_product: float = 4, use_fid: bool = True, system: Opts = system) -> Sequence

Construct spin echo spectrum sequence.

Parameters:

  • echo_time (float, default: 0.012 ) –

    Time between center of 90 degree pulse and center of ADC in s

  • rf_duration (float, default: 0.0004 ) –

    Duration of the RF pulses in s

  • num_samples (int, default: 256 ) –

    Number of data points to acquire

  • acq_bandwidth (float | int, default: 20000.0 ) –

    Bandwidth of the acquisition in Hz

  • use_sinc (bool, default: False ) –

    RF pulse type, if true sinc pulse is used, rect otherwise

  • time_bw_product (float, default: 4 ) –

    Time-bandwidth product for the sinc pulse

  • use_fid (bool, default: True ) –

    If true, only acquire FID part of the spin-echo

  • system (Opts, default: system ) –

    Sequence system to be used for sequence construction

Returns:

  • Pypulseq ``Sequence`` instance –

Raises:

Source code in src/console/utilities/sequences/spectrometry/se_spectrum.py
def constructor(
    echo_time: float = 12e-3,
    rf_duration: float = 400e-6,
    num_samples: int = 256,
    acq_bandwidth: float | int = 20e3,
    use_sinc: bool = False,
    time_bw_product: float = 4,
    use_fid: bool = True,
    system: pp.Opts = default_system,
) -> pp.Sequence:
    """Construct spin echo spectrum sequence.

    Parameters
    ----------
    echo_time : float, optional
        Time between center of 90 degree pulse and center of ADC in s
    rf_duration : float, optional
        Duration of the RF pulses in s
    num_samples : int, optional
        Number of data points to acquire
    acq_bandwidth : float | int, optional
        Bandwidth of the acquisition in Hz
    use_sinc : bool, optional
        RF pulse type, if true sinc pulse is used, rect otherwise
    time_bw_product : float, optional
        Time-bandwidth product for the sinc pulse
    use_fid : bool, optional
        If true, only acquire FID part of the spin-echo
    system : pp.Opts, optional
        Sequence system to be used for sequence construction

    Returns
    -------
        Pypulseq ``Sequence`` instance

    Raises
    ------
    ValueError
        Sequence timing check failed
    """
    seq = pp.Sequence(system=system)

    if use_fid:
        seq.set_definition("Name", "se_decay_spectrum")
    else:
        seq.set_definition("Name", "se_spectrum")

    # Define RF pulses for excitation and refocusing
    if use_sinc:
        rf_90 = pp.make_sinc_pulse(
            system=system,
            flip_angle=pi / 2,
            phase_offset=0,
            duration=rf_duration,
            time_bw_product=time_bw_product,
            delay=system.rf_dead_time,
        )
        rf_180 = pp.make_sinc_pulse(
            system=system,
            flip_angle=pi,
            phase_offset=pi / 2,
            duration=rf_duration,
            time_bw_product=time_bw_product,
            delay=system.rf_dead_time,
        )
    else:
        rf_90 = pp.make_block_pulse(
            system=system,
            flip_angle=pi / 2,
            phase_offset=0,
            duration=rf_duration,
            delay=system.rf_dead_time,
        )
        rf_180 = pp.make_block_pulse(
            system=system,
            flip_angle=pi,
            phase_offset=pi / 2,
            duration=rf_duration,
            delay=system.rf_dead_time,
        )
    # Define ADC duration
    adc_duration = raster(val=num_samples / acq_bandwidth, precision=system.adc_raster_time)

    # Define ADC event
    adc = pp.make_adc(
        num_samples=num_samples,
        duration=adc_duration,
        system=system,
    )

    # Calculate delays to achieve desired echo time
    te_delay_1 = raster(
        echo_time / 2 - rf_duration - rf_90.ringdown_time - rf_180.delay,
        system.grad_raster_time,
    )
    if use_fid:
        te_delay_2 = raster(
            echo_time / 2 - rf_duration / 2 - rf_180.ringdown_time - adc.dead_time,
            system.grad_raster_time,
        )
    else:
        te_delay_2 = raster(
            echo_time / 2 - rf_duration / 2 - adc_duration / 2 - rf_180.ringdown_time - adc.dead_time,
            system.grad_raster_time,
        )

    seq.add_block(rf_90)
    seq.add_block(pp.make_delay(te_delay_1))
    seq.add_block(rf_180)
    seq.add_block(pp.make_delay(te_delay_2))
    seq.add_block(adc)

    return seq