Skip to content

chrisD91/anesthPlot

Repository files navigation

anesthRecord : a set of python functions to read, display and analyse anesthesia data

I developed it essentially for teaching purposes The scripts were used to build visualisation of physiological cardiovascular & respiratory parameters recorded during equine anesthesia (heart rate, arterial pressure, capnometry, ...) Generated plots include trends & wave, as pictures or videos

input files

Input files should be (.csv) recordings obtained during clinical by the use of

settings

  1. you need a python >3 ditribution

    some additional packages can be required

    pip install pyyaml
    conda install -c conda-forge pyperclip
  2. download the repository

  3. build a configuration .yaml file trough the buildRecordRC.py

  • navigate to the repository
  • run > "python buildRecordRC.py" inside the repository) (it will define a paths directory for the data locations (data) and the folder to save the plots if required (sFig, ...) ie should create 'recordRC.yaml' in the same folder as 'recordMain.py) NB (install the missing packages if necessary)

using the code as a module

to be able to manipulate the data (trends & waves)

# move to anesthPlot
$ ipython

import anesplot.record_main as rec

trends = rec.MonitorTrend()
trends.show_graphs()
...
wavename = rec.trendname_to_wavename(trends.filename)
waves = rec.MonitorWave(wavename)
waves.plot_wave()
...
  • the MonitorTrend and MonitorWave methods allow to visualize most of the data recorded
  • the TaphTrend object can be used the same way to manipulate the Taphonius trends data ('SD....csv' files)
  • other visualizations and analysis can be performed by relating the objects data and the methods located in the anesplot.treatrec package

using the code from terminal

to obtain a rapid view of the data for visualisation or to save the plots

  1. run anesplot as a module : open a terminal

    • either navigate to anesthPlot folder and run
    $ python -m anesplot
    • or run from any location (make an alias un the .bashrc)
    alias record='PYTHONPATH=<pathToAnesthPlot> python -m anesplot
  • choose the file you want to load
  • select the kind of file
  • (nb for Taphonius recordings, you will be prompted to choose a second file that correspond to the patient data)
  1. pictures will be generated:
    1. for trend data a. description of the case (text entered during the setup of the recording) b. general analysis of the procedure (histogram of heart rate & arterial pressure) (histogram of etco2 & isoflurane used) c. display of the trends parameters (scale can be adjusted and pictures can be saved)
    2. for the wave data a. you will be prompted to choose a wave to be displayed

example of pictures generated

About

load, plot and analyse anaesthesia records

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published