The simple program is a Witleaf handheld pulse oxymeter BIN file format data decoder. It reads BIN-files produced by popular professional pulse oxymeters manufactured by Shenzhen Witleaf Medical Electronics Co., Ltd. (like the WIT-S300 shown in the photo on the right) and produces a CSV-formatted output with the extracted data to stdout (gets printed to the console if not directed otherwise).
All the required R dependancies (plotrix
and Cairo
) should get downloaded and installed automatically.
1) Install DMD according to your OS or system package manager instructions. 2) Compile OxyWitleaf2CSV from the source file:
Open a system shell in the OxyWitleaf2CSV project directory and enter the following command:
./build.sh
Execute the build_win.bat
file.
3) If you want to create plots like the one shown on the picture near the bottom of the page then install R as well.
1) Set up your pulse oxymeter. Don’t forget to set a correct date and time as it will be used as timestamps for the data samples and some patient name as it will name a file you will use later on. 2) Record some data at any sample period you want. 3) Connect the device to your PC using the included MiniUSB <-> USB-A cable (the device will be detected as a general file storage). 4) Copy a BIN-file with the name corresponding to the “patient’s name” set up previously to the directory containing OxyWitleaf2CSV project files. 5) Process the file using OxyWitleaf2CSV:
Open a system shell in the OxyWitleaf2CSV project directory and enter the following command, replacing “patient_name” with your BIN-file name:
./oxywitleaf2csv -H -f patient_name.bin > patient_name.csv
./csv_graph.R patient.csv
Rename the file you just got from the devie to patient.bin
and execute the process.bat
file.
Then open “R Console” and set the current directory to your OxyWitleaf2CSV project directory using the top menu or “setwd()” function.
Enter the following command into the console:
input_file = "patient.csv"
Open the csv_graph.R
file and select “Execute all” from the “Edit” menu.
5) Enjoy :).
You will get a CSV file containing 4 columns:
The field separator used is “;”.
If you have Microsoft Office 2010 or above, then it is recommended to use LibreOffice as it allows you to choose an appropriate field separator and column format.
You will also get a PNG picture for each recording session named “plot1.png” to “plotN.png” where “N” is the number of recordings available in the BIN file. Each picture will look somewhat like this:
If you want smoother graphics with anti-aliasing enabled you can open the “csv_graph.R” file and replace the line use_Cairo = FALSE
with use_Cairo = TRUE
and run the “csv_graph.R” script again to see if the results are more appealing.
The files should be enough to compose your report.