Rate Detection
eitprocessing.plotting.rate_detection.RateDetectionPlotting
¶
RateDetectionPlotting(obj: RateDetection)
Utility class to plot the results of the RateDetection algorithm.
This class can be accessed through the plotting
attribute of the RateDetection class.
Example:
>>> rd = RateDetection("adult")
>>> captures = {}
>>> rr, hr = rd.apply(eit_data, captures=captures)
>>> fig = rd.plotting(**captures)
>>> fig.savefig("rate_detection.png") # Save the figure to a file
plot
¶
plot(
*,
frequencies: ndarray,
normalized_total_power: ndarray,
average_normalized_pixel_power: ndarray,
diff_total_averaged_power: ndarray,
estimated_respiratory_rate: float,
estimated_heart_rate: float,
fig: None
) -> Figure
plot(
*,
frequencies: ndarray,
normalized_total_power: ndarray,
average_normalized_pixel_power: ndarray,
diff_total_averaged_power: ndarray,
estimated_respiratory_rate: float,
estimated_heart_rate: float,
fig: Figure | SubFigure | None = None
) -> Figure | SubFigure
Plot the results of the RateDetection algorithm.
This method is intended to be used after running the detect_respiratory_heart_rate
method of the
RateDetection
class. It visualizes the frequency analysis results, including the normalized power
spectrum, average normalized pixel spectrum, and the difference between the two.
NB: Although the frequencies, rate limits and estimated rates are provided in Hz, they are visualized in breaths/beats per minute (bpm).
PARAMETER | DESCRIPTION |
---|---|
frequencies
|
Frequencies used in the analysis, in Hz.
TYPE:
|
normalized_total_power
|
Normalized total power spectrum.
TYPE:
|
average_normalized_pixel_power
|
Average normalized pixel power spectrum.
TYPE:
|
diff_total_averaged_power
|
Difference between the normalized summed power spectra and the normalized total power.
TYPE:
|
estimated_respiratory_rate
|
Estimated respiratory rate in Hz.
TYPE:
|
estimated_heart_rate
|
Estimated heart rate in Hz.
TYPE:
|
fig
|
Optional matplotlib Figure or SubFigure to plot on. If None, a new figure is created.
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
Figure | SubFigure
|
A matplotlib figure or subfigure (if provided) containing the plots of the frequency analysis. |