m3resp.pixel_breath_events#

m3resp.pixel_breath_events(pixel_breaths, row, column)[source]#

Return the breaths of one pixel as BreathEvent objects.

eit.pixel_breaths stores, for each global breath, a grid of each pixel’s breath start, middle and end time. This function picks one pixel from that grid and turns its breaths into BreathEvent objects, so analyses written for global breaths (durations, timing checks, linking) can run on one pixel too.

Parameters:
  • pixel_breaths (IntervalData) – The IntervalData written by eit.pixel_breaths (name 'pixel_breaths' by default): one (row, column, 3) grid of start, middle and end times in seconds per global breath.

  • row (int) – Row of the pixel, counted from 0.

  • column (int) – Column of the pixel, counted from 0.

Returns:

One breath per global breath in which the pixel

has a breath, in time order. start_time and end_time are the pixel’s own breath start and end, extremum_time is its middle time (end of inspiration), all in seconds. A global breath where the pixel has no breath (NaN) gives no entry. metadata holds row, column and global_breath_id, the id of the global breath it belongs to.

Return type:

list[BreathEvent]

Raises:

ValueError – If the grids are not (row, column, 3), or row or column is outside the grid.