Open Raman Processing Library
Project description
ORPL
ORPL (read orpel) is the Open Raman Processing Library. It provides tools for the processing of Raman spectrum, including;
- System calibration (x-axis and system response)
- Cosmic Ray removal
- Baseline removal (autofluorescence)
- Spectrum analysis (peak finding, ...)
- Synthetic spectrum generation (for testing and benchmarking)
As of v1.0.0, ORPL also provides a Graphical User Interface. See demo below ;)
Table of content
ORPL GUI in action
Installation
At its core, ORPL is designed to be a processing library to use in your own processing workflow. Nevertheless, I also wrote a GUI to go with it if programming is not your jam. In either case, installation is made through pip.
Already familiar with python and pip?
I recommend you create a virtual environment with venv. Otherwise, just install orplib with pip.
pip install orplib
Using Anaconda?... dont... Jokes aside, if people ask me about this, I might write a guide for this. Otherwise, use pip.
I'm new to python and this 'pip' thing
I made a video going through everything on a clean Windows 11 VM. Here is the video so you can follow step-by-step. PLEASE, make certain you follow the steps EXACTLY for the python installation. Otherwise, you'll get a bunch of error in your terminal and might get lost.
The steps for Windows are:
- Check if python is already installed
- Open a terminal
- run
python
- If you get something like
Python 3.X.X (tag)... Type "help", "copyright", ...
, then you already have a python version installed. Check if it is compatible with ORPL. If so, move to Step 2.7 - If a Microsoft Store window opens, or you get a message along the line of
... is not recognized as an internal or external command...
, then python is not installed. Proceed with Step 2.1
- If you get something like
- Install python (I test with python 3.8.10, but other versions might work perfectly fine)
- DO NOT!!! use "Install Now" or default setting, it almost certainly won't work, and you'll have to start over again.
- Make sure you check all boxes on the first page.
- Use "Customize installation".
- Make sure you check EVERYTHING, I mean ALL checkboxes as you keep going through the pages.
- Once the installation is finished, you'll see a last page with "Setup was successful" if it worked. You might see a
Disable path length limit...
option. If so, click it and accept. - Check if Python was correctly installed by running
python
in a terminal (see Step 2.2) - Check if pip was installed and added to your Path by running
pip
in a new terminal.- If you see a long stream of text starting with
Usage: pip <command> [options]
, then you are good! - Otherwise, something went wrong...
- If you see a long stream of text starting with
- Install orplib (https://pypi.org/project/orplib/) with pip
- Run pip command for installation:
- If your user has admin rights, run
pip install orplib
in terminal - Otherwise, run
pip install orplib --user
in terminal
- If your user has admin rights, run
- Check that ORPL installed correctly by running
python -m orpl
in terminal.- If you get an error message, something went wrong...
- Otherwise, it will take a few seconds the first time you launch it. Please, be patient.
- Run pip command for installation:
- (optional) create a script file to launch ORPL - GUI
- Create a new text file on the Desktop (I suggest calling it
orpl GUI.txt
) - Open the text file with notepad
- Write the content below inside that file
- Save the file and close it
- Change the extension name of the file to
.bat
- Create a new text file on the Desktop (I suggest calling it
Content of the orpl GUI.txt
file
python -m orpl
pause
Updating ORPL to the latest version
If you want to update to the latest version of ORPL, run the following pip command,
If you have admin rights
pip install --upgrade orplib
If you do not have admin rights
pip install --upgrade --user orplib
Building from source
This is the command you need to run if you want to build the .whl from the source code yourself (make sure you run it from orpl's project root directory):
python -m build
and to update the build on pypi (this is a reminder for me, it won't do anything if you do this),
python -m twine upload --repository pypi --skip-existing dist/*
Baseline removal
BubbleFill
Bubblefill is a morphological processing algorithm designed for the removal of baselines in spectroscopic signal. It was created and optimized specifically to remove autofluorescence baselines in Raman spectra measured on biological samples.
The tuning parameter of Bubblefill is the size of the smallest bubble allowed to grow. In general, the smallest bubble width should be chosen to be larger than the widest Raman peak present in the signal. Otherwise, the baseline fit will grow inside the peaks and the output Raman signal will have under expressed peaks.
Note : Bubbles can become arbitrarily small if they are growing along the leftmost or rightmost edge of the signal.
Different smallest bubble widths can be specified for different regions of the spectrum. This enables nearly infinite tuning of the algorithm and can be used to remove peaks that are known artifacts (for instance). In this example, the smallest bubble width for detector pixels 400 to 650 was set to 1 and to 100 for the rest of the x-axis.
How to cite this work
Guillaume Sheehy, Fabien Picot, Frédérick Dallaire, Katherine Ember, Tien Nguyen, Kevin Petrecca, Dominique Trudel, and Frédéric Leblond "Open-sourced Raman spectroscopy data processing package implementing a baseline removal algorithm validated from multiple datasets acquired in human tissue and biofluids," Journal of Biomedical Optics 28(2), 025002 (21 February 2023). https://doi.org/10.1117/1.JBO.28.2.025002
BibTex (.bib)
@article{10.1117/1.JBO.28.2.025002,
author = {Guillaume Sheehy and Fabien Picot and Fr{\'e}d{\'e}rick Dallaire and Katherine Ember and Tien Nguyen and Kevin Petrecca and Dominique Trudel and Fr{\'e}d{\'e}ric Leblond},
title = {{Open-sourced Raman spectroscopy data processing package implementing a baseline removal algorithm validated from multiple datasets acquired in human tissue and biofluids}},
volume = {28},
journal = {Journal of Biomedical Optics},
number = {2},
publisher = {SPIE},
pages = {025002},
keywords = {Raman spectroscopy, fluorescence, tissue optics, open-sourced software, machine learning, optics, Raman spectroscopy, Data processing, Bubbles, Equipment, Tissues, Biological samples, Raman scattering, Fluorescence, Aluminum, Spectroscopy},
year = {2023},
doi = {10.1117/1.JBO.28.2.025002},
URL = {https://doi.org/10.1117/1.JBO.28.2.025002}
}
EndNote (.enw)
%0 Journal Article
%A Sheehy, Guillaume
%A Picot, Fabien
%A Dallaire, Frédérick
%A Ember, Katherine
%A Nguyen, Tien
%A Petrecca, Kevin
%A Trudel, Dominique
%A Leblond, Frédéric
%T Open-sourced Raman spectroscopy data processing package implementing a baseline removal algorithm validated from multiple datasets acquired in human tissue and biofluids
%V 28
%J Journal of Biomedical Optics
%N 2
%P 025002
%D 2023
%U https://doi.org/10.1117/1.JBO.28.2.025002
%DOI 10.1117/1.JBO.28.2.025002
%I SPIE
Contributors
- Guillaume Sheehy | guillaume.sheehy@polymtl.ca
- Frédérick Dallaire
- Fabien Picot
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file orplib-1.0.3.tar.gz
.
File metadata
- Download URL: orplib-1.0.3.tar.gz
- Upload date:
- Size: 54.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.8.16
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 384c8089fb1d1002e799cdff3c004728f82286dbe2d3df856780f79d252e5e02 |
|
MD5 | 83f385dae6fdae230d6a7d5d750a6b0c |
|
BLAKE2b-256 | fd9489ab79fcda610c3f243aa35d2de61aea7a5a8c94bb06dac0bd46129012a2 |
File details
Details for the file orplib-1.0.3-py3-none-any.whl
.
File metadata
- Download URL: orplib-1.0.3-py3-none-any.whl
- Upload date:
- Size: 54.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.8.16
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 49bf8aaf767d8cf8de32d7608199a36eed1da73570bda83fa8a0e9b8d0b4b1db |
|
MD5 | c0bf0213b49b175a01848505f4cdfb7a |
|
BLAKE2b-256 | d0f60f5299784cb07be13c4faa7caf84ebfeabb82f784f7d66ffb57c73ca5f1b |