https://github.com/pkeilbach/pylsci
Python Package for Laser Speckle Contrast Imaging
Science Score: 23.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
○codemeta.json file
-
○.zenodo.json file
-
✓DOI references
Found 9 DOI reference(s) in README -
✓Academic publication links
Links to: researchgate.net -
○Committers with academic emails
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (11.6%) to scientific vocabulary
Repository
Python Package for Laser Speckle Contrast Imaging
Basic Info
- Host: GitHub
- Owner: pkeilbach
- License: mit
- Language: Jupyter Notebook
- Default Branch: main
- Size: 5.61 MB
Statistics
- Stars: 19
- Watchers: 1
- Forks: 7
- Open Issues: 7
- Releases: 3
Metadata Files
README.md
PyLSCI
A Python package for Laser Speckle Contrast Imaging.
It converts raw laser speckle data (as 2D or 3D NumPy arrays) to laser speckle contrast images (a 2D NumPy array).

Check out the demo notebook at mybinder.org
The code for this package was developed for my thesis on Fingerprint Presentation Attack Detection using Laser Speckle Contrast Imaging:
- Keilbach, P., Kolberg, J., Gomez-Barrero, M., Busch, C., & Langweg, H. (2018). Fingerprint Presentation Attack Detection using Laser Speckle Contrast Imaging. International Conference of the Biometrics Special Interest Group (BIOSIG), Darmstadt, 2018, pp. 1-6, doi: https://10.23919/BIOSIG.2018.8552931.
Quickstart
To work with this package, you need to have you laser speckle images available as 2D or 3D NumPy arrays:
- For spatial contrast calculation, PyLSCI expects ayour raw laser speckle data as 2D NumPy Arrays.
- For temporal or spatio-temporal contrast calculation, PyLSCI expects your raw laser speckle data a time series raw laser speckle data as a 3D NumPy Array, where the first dimension is the temporal domain.
The process of converting the raw laser speckle images to NumPy arrays is out of scope of the PyLSCI, since this process is highly dependent on a particular LSCI setup. So you may need a custom helper module to do that job for you.
For a more detailed documentation, please see the Jupyter Notebook
demo.ipynbthat is provided in this GitHub project.
0. Preparation
sh
pip install pylsci
1. Preparation
PyLSCI assumes you have your raw laser speckle data available as NumPy arrays.
Depending on your sensor setup, you may need to convert your raw laser speckle data to NumPy arrays.
You would usually have that functionality encapsulated in a custom utils module, as indicated here with my_utils.
```python from myutils import convertspeckletonumpy
spatial laser speckle images are expected to be a 2D NumPy array.
speckleimg = convertspeckletonumpy('img/spatial.tif')
temporal laser specke image series are expected to be 3D NumPy arrays,
where the first dimension is the temporal domain
speckleimgsequence = convertspeckletonumpy('img/temporal.png', temporalseries=True) ```
2. Create an Lsci Object
Values for spatial and temporal neighborhoos arguments are optional.
They default to nbh_s=3 and nbh_t=25.
Note that nbhs needs to be an odd value, but there is no constraint for nbht.
```python from pylsci import Lsci
lsci = Lsci(nbhs=5, nbht=40) ```
3. Calculate the Laser Speckle Contrast Images
3.1 Spatial Contrast Calculation
The spatial contrast calculation requires a single laser speckle image as a NumPy 2D array and returns a single laser speckle contrast image as a 2D NumPy array.
python
s_lsci = lsci.spatial_contrast(speckle_img)
3.2 Temporal Contrast Calculation
The temporal and spatio-temporal contrast calculation require a 3D NumPy array (time series of laser speckle images) and will return a single (averaged) laser speckle contrast image as a 2D NumPy array.
```python
temporal contrast calculation
tlsci = lsci.temporalcontrast(speckleimgsequence)
spatio-temporal contrast calculation
stlsci = lsci.spatiotemporalcontrast(speckleimg_sequence) ```
Dependencies
The PyLSCI packages depends on NumPy, which is is used to do all the array related calculations.
Implementation Details
Note that the window iterations of the 2D arrays are not (yet) optimized.
The temporal_contrast() method performs quite well, since NumPy allows to calculate the standard deviation and mean along the temporal axis for the whole array.
This is not the case for the spatial_contrast() and spatio_temporal_contrast() methods,
where the implementations rely on inefficient, nested loops.
Please be aware of this as calculating the contrast with the spatial_contrast() and spatio_temporal_contrast() methods may take a long time.
Further Reading
To understand the theory and concepts of LSCI, the following papers are recommended:
- Boas, D. A., & Dunn, A. K. (2010). Laser speckle contrast imaging in biomedical optics. Journal of biomedical optics, 15(1), 011109. https://doi.org/10.1117/1.3285504
- Briers, D., Duncan, D. D., Hirst, E., Kirkpatrick, S. J., Larsson, M., Steenbergen, W., Stromberg, T., & Thompson, O. B. (2013). Laser speckle contrast imaging: theoretical and practical limitations. Journal of biomedical optics, 18(6), 066018. https://doi.org/10.1117/1.JBO.18.6.066018
- Senarathna, J., Rege, A., Li, N., & Thakor, N. V. (2013). Laser Speckle Contrast Imaging: theory, instrumentation and applications. IEEE reviews in biomedical engineering, 6, 99–110. https://doi.org/10.1109/RBME.2013.2243140
- Vaz, P. G., Humeau-Heurtier, A., Figueiras, E., Correia, C., & Cardoso, J. (2016). Laser Speckle Imaging to Monitor Microvascular Blood Flow: A Review. IEEE reviews in biomedical engineering, 9, 106–120. https://doi.org/10.1109/RBME.2016.2532598
Owner
- Login: pkeilbach
- Kind: user
- Repositories: 3
- Profile: https://github.com/pkeilbach
GitHub Events
Total
- Watch event: 2
Last Year
- Watch event: 2
Committers
Last synced: about 2 years ago
Top Committers
| Name | Commits | |
|---|---|---|
| Pascal Keilbach | p****h@c****e | 51 |
| pkeilbach | 2****h | 10 |
| Pascal Keilbach | p****h@s****m | 6 |
| pa241kei | p****h@g****m | 3 |
| pkeilbach | d****v@p****g | 2 |
Committer Domains (Top 20 + Academic)
Issues and Pull Requests
Last synced: about 1 year ago
All Time
- Total issues: 19
- Total pull requests: 14
- Average time to close issues: about 1 month
- Average time to close pull requests: 3 minutes
- Total issue authors: 2
- Total pull request authors: 1
- Average comments per issue: 1.0
- Average comments per pull request: 0.0
- Merged pull requests: 14
- Bot issues: 0
- Bot pull requests: 0
Past Year
- Issues: 0
- Pull requests: 0
- Average time to close issues: N/A
- Average time to close pull requests: N/A
- Issue authors: 0
- Pull request authors: 0
- Average comments per issue: 0
- Average comments per pull request: 0
- Merged pull requests: 0
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
- pkeilbach (18)
- brigetellen (1)
Pull Request Authors
- pkeilbach (14)
Top Labels
Issue Labels
Pull Request Labels
Packages
- Total packages: 1
-
Total downloads:
- pypi 19 last-month
- Total dependent packages: 0
- Total dependent repositories: 1
- Total versions: 5
- Total maintainers: 1
pypi.org: pylsci
Python Package for Laser Speckle Contrast Imaging
- Homepage: https://github.com/pkeilbach/pylsci
- Documentation: https://pylsci.readthedocs.io/
- License: MIT License Copyright (c) 2021 Pascal Keilbach Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
Latest release: 1.1.1
published almost 4 years ago
Rankings
Maintainers (1)
Dependencies
- matplotlib *
- pylsci *
- numpy ~=1.23.1