Creation of Multi channel Urodynamics and tools to interpret them. Initial tracing development, then various pathophysiologic states
import matplotlib.ticker as ticker
Create the final urodynamic tracing with an EMG trend represented by vertical spikes
plt.figure(figsize=(10, 7))
plt.subplot(5, 1, 1)
plt.plot(time, Pves_obstructed, label=“Pves (Intravesical Pressure)”, color=‘blue’)
plt.axvline(x=Qmax_time, color=‘black’, linestyle=‘–’, label=“Pdet @ Qmax”)
plt.ylabel(“Pressure\n(cm H2O)”, fontsize=8)
plt.legend(loc=“upper left”, fontsize=8)
plt.grid()
plt.gca().yaxis.set_major_locator(ticker.MaxNLocator(integer=True))
plt.subplot(5, 1, 2)
plt.plot(time, Pabd_obstructed, label=“Pabd (Abdominal Pressure - Cough Spikes)”, color=‘red’)
plt.axvline(x=Qmax_time, color=‘black’, linestyle=‘–’)
plt.ylabel(“Pressure\n(cm H2O)”, fontsize=8)
plt.legend(loc=“upper left”, fontsize=8)
plt.grid()
plt.gca().yaxis.set_major_locator(ticker.MaxNLocator(integer=True))
plt.subplot(5, 1, 3)
plt.plot(time, Pdet_obstructed, label=“Pdet (Detrusor Pressure)”, color=‘green’)
plt.axvline(x=Qmax_time, color=‘black’, linestyle=‘–’)
plt.ylabel(“Pressure\n(cm H2O)”, fontsize=8)
plt.legend(loc=“upper left”, fontsize=8)
plt.grid()
plt.gca().yaxis.set_major_locator(ticker.MaxNLocator(integer=True))
plt.subplot(5, 1, 4)
plt.plot(time, Qura_obstructed, label=“Qura (Urine Flow Rate)”, color=‘purple’)
plt.axvline(x=Qmax_time, color=‘black’, linestyle=‘–’)
plt.ylabel(“Flow\n(mL/s)”, fontsize=8)
plt.legend(loc=“upper left”, fontsize=8)
plt.grid()
plt.gca().yaxis.set_major_locator(ticker.MaxNLocator(integer=True))
EMG as vertical tracings instead of a continuous line
plt.subplot(5, 1, 5)
for t, emg_value in zip(time, EMG_obstructed):
  plt.vlines(t, ymin=0, ymax=emg_value, color=‘orange’, alpha=0.6) # Vertical EMG spikes
plt.axvline(x=Qmax_time, color=‘black’, linestyle=‘–’)
plt.ylabel(“EMG\nActivity”, fontsize=8)
plt.xlabel(“Time (s)”, fontsize=9)
plt.legend([“EMG Activity”, “Pdet @ Qmax”], loc=“upper left”, fontsize=8)
plt.grid()
plt.suptitle(“Multichannel Urodynamic Tracing - Bladder Outlet Obstruction (EMG Trend & Pdet @ Qmax)”, fontsize=10)
plt.tight_layout()
plt.show()