gigablochs.flow.integrate_trajectory

gigablochs.flow.integrate_trajectory#

gigablochs.flow.integrate_trajectory(velocity_waveform, dt, position_offset=0, axis=-1)[source]#

Integrate a velocity waveform to obtain a position waveform, or sample bolus trajectory.

The integration is performed using a cumulative sum.

Parameters:
  • velocity_waveform (ndarray) – Array of blood flow velocities in m/s.

  • dt (float) – Time step between consecutive velocity measurements in seconds.

  • initial_position (float, optional) – Initial position of the trajectory in m. Can be specified to offset the entire trajectory. Default is 0.

  • axis (int, optional) – Axis along which to integrate, should correspond to the waveform time axis. Default is -1.

Returns:

trajectory – Array of position in m, corresponding to the integrated trajectory.

Return type:

ndarray