skinoptics 0.0.1b1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,894 @@
1
+ '''
2
+ | SkinOptics
3
+ | Copyright (C) 2024 Victor Lima
4
+
5
+ | This program is free software: you can redistribute it and/or modify
6
+ | it under the terms of the GNU General Public License as published by
7
+ | the Free Software Foundation, either version 3 of the License, or
8
+ | (at your option) any later version.
9
+
10
+ | This program is distributed in the hope that it will be useful,
11
+ | but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
+ | GNU General Public License for more details.
14
+
15
+ | You should have received a copy of the GNU General Public License
16
+ | along with this program. If not, see <https://www.gnu.org/licenses/>.
17
+
18
+ | Victor Lima
19
+ | victorporto\@ifsc.usp.br
20
+ | victor.lima\@ufscar.br
21
+
22
+ | Release Date:
23
+ | October 2024
24
+ | Last Modification:
25
+ | October 2024
26
+
27
+ | References:
28
+
29
+ | [HQ73] Hale & Querry 1973.
30
+ | Optical Constants of Water in the 200-nm to 200-μm Wavelength Region.
31
+ | https://doi.org/10.1364/AO.12.000555
32
+
33
+ | [S81] Segelstein 1981.
34
+ | The complex refractive index of water.
35
+ | https://mospace.umsystem.edu/xmlui/handle/10355/11599
36
+
37
+ | [AF90] Agati & Fusi 1990.
38
+ | New trends in photobiology recent advances in bilirubin photophysics.
39
+ | https://doi.org/10.1016/1011-1344(90)85138-M
40
+
41
+ | [B90] Billett 1990.
42
+ | Hemoglobin and Hematocrit.
43
+ | https://www.ncbi.nlm.nih.gov/books/NBK259/
44
+
45
+ | [v*05] van Veen, Sterenborg, Pifferi, Torricelli, Chikoidze & Cubeddu 2005.
46
+ | Determination of visible near-IR absorption coefficients of mammalian fat using time- and spatially resolved
47
+ | diffuse reflectance and transmission spectroscopy.
48
+ | https://doi.org/10.1117/1.2085149
49
+
50
+ | [H02] Hecht 2002.
51
+ | Optics. (4th Edition)
52
+
53
+ | [S*06] Salomatina, Jiang, Novak & Yaroslavsky 2006.
54
+ | Optical properties of normal and cancerous human skin in the visible and near-infrared spectral range.
55
+ | https://doi.org/10.1117/1.2398928
56
+
57
+ | [SS06] Sarna & Swartz 2006.
58
+ | The Physical Properties of Melanins.
59
+ | https://doi.org/10.1002/9780470987100.ch16
60
+
61
+ | [DJV11] Delgado Atencio, Jacques & Vázquez y Montiel 2011.
62
+ | Monte Carlo Modeling of Light Propagation in Neonatal Skin.
63
+ | https://doi.org/10.5772/15853
64
+
65
+ | [J13] Jacques 2013.
66
+ | Optical properties of biological tissues: a review.
67
+ | https://doi.org/10.1088/0031-9155/58/14/5007
68
+
69
+ | [B*14] Bosschaart, Edelman, Aalders, van Leeuwen & Faber 2014.
70
+ | A literature review and novel theoretical approach on the optical properties of whole blood.
71
+ | https://doi.org/10.1007/s10103-013-1446-7
72
+
73
+ | [G17] Griffiths 2017.
74
+ | Introduction to Electrodynamics. (4th Edition)
75
+ | https://doi.org/10.1017/9781108333511
76
+
77
+ | [TL23] Taniguchi & Lindsey 2023.
78
+ | Absorption and fluorescence spectra of open-chain tetrapyrrole pigments – bilirubins, biliverdins, phycobilins, and synthetic analogues.
79
+ | https://doi.org/10.1016/j.jphotochemrev.2023.100585
80
+
81
+ | [S*23] Sá, Bacal, Gomes, Silva, Gonçalves & Malta 2023.
82
+ | Blood count reference intervals for the Brazilian adult population: National Health Survey.
83
+ | https://doi.org/10.1590/1980-549720230004.supl.1
84
+ '''
85
+
86
+ import numpy as np
87
+ from scipy.interpolate import interp1d
88
+
89
+ from skinoptics.utils import *
90
+ from skinoptics.dataframes import *
91
+
92
+
93
+ def Cmass_from_Cmolar(Cmolar, molar_mass):
94
+ r'''
95
+ Calculate the mass concentration from the molar concentration and the molar mass.
96
+
97
+ :math:`C_{mass} = M \mbox{ } C_{molar}`
98
+
99
+ :param Cmolar: molar concentration [M]
100
+ :type Cmolar: float or np.ndarray
101
+
102
+ :param molar_mass: molar mass [g mol^-1]
103
+ :type molar_mass: float
104
+
105
+ :return: - **Cmass** (*float or np.ndarray*) – mass concentration [g L^-1]
106
+ '''
107
+
108
+ return Cmolar*molar_mass
109
+
110
+ def Cmolar_from_Cmass(Cmass, molar_mass):
111
+ r'''
112
+ Calculate the molar concentration from the mass concentration and the molar mass.
113
+
114
+ :math:`C_{molar} = \frac{C_{mass}}{M}`
115
+
116
+ :param Cmass: mass concentration [g L^-1]
117
+ :type Cmass: float or np.ndarray
118
+
119
+ :param molar_mass: molar mass [g mol^-1]
120
+ :type molar_mass: float
121
+
122
+ :return: - **Cmolar** (*float or np.ndarray*) – molar concentration [M]
123
+ '''
124
+
125
+ return Cmass/molar_mass
126
+
127
+ def ext_from_Abs_and_Cmass(Abs, Cmass, pathlength):
128
+ r'''
129
+ | Calculate the extinction coefficient from the absorbance, the mass concentration
130
+ | and the pathlength.
131
+
132
+ :math:`\varepsilon_{mass}(\lambda) = \frac{Abs(\lambda)}{L \mbox{ } C_{mass}}`
133
+
134
+ :param Abs: absorbance [-]
135
+ :type Abs: float or np.ndarray
136
+
137
+ :param Cmass: mass concentration [g L^-1]
138
+ :type Cmass: float
139
+
140
+ :param pathlength: pathlength [cm]
141
+ :type pathlength: float
142
+
143
+ :return: - **ext** (*float or np.ndarray*) – extinction coefficient [cm^-1 mL mg^-1]
144
+ '''
145
+
146
+ return Abs/Cmass/pathlength
147
+
148
+ def molarext_from_Abs_and_Cmolar(Abs, Cmolar, pathlength):
149
+ r'''
150
+ | Calculate the molar extinction coefficient from the absorbance, the molar concentration
151
+ | and the pathlength.
152
+
153
+ :math:`\varepsilon_{molar}(\lambda) = \frac{Abs(\lambda)}{L \mbox{ } C_{molar}}`
154
+
155
+ :param Abs: absorbance [-]
156
+ :type Abs: float or np.ndarray
157
+
158
+ :param Cmolar: molar concentration [g L^-1]
159
+ :type Cmolar: float
160
+
161
+ :param pathlength: pathlength [cm]
162
+ :type pathlength: float
163
+
164
+ :return: - **molarext** (*float or np.ndarray*) – molar extinction coefficient [cm^-1 M^-1]
165
+ '''
166
+
167
+ return Abs/Cmolar/pathlength
168
+
169
+ def ext_from_molarext(molarext, molar_mass):
170
+ r'''
171
+ | Calculate the extinction coefficient from the molar extinction coefficient
172
+ | and the molar mass.
173
+
174
+ :math:`\varepsilon_{mass}(\lambda) = \frac{\varepsilon_{molar}(\lambda)}{M}`
175
+
176
+ :param molarext: molar extinction coefficient [cm^-1 M^-1]
177
+ :type molarext: float or np.ndarray
178
+
179
+ :param molar_mass: molar mass [g mol^-1]
180
+ :type molar_mass: float
181
+
182
+ :return: - **ext** (*float or np.ndarray*) – extinction coefficient [cm^-1 mL mg^-1]
183
+ '''
184
+
185
+ return molarext/molar_mass
186
+
187
+ def molarext_from_ext(ext, molar_mass):
188
+ r'''
189
+ | Calculate the molar extinction coefficient from the extinction coefficient
190
+ | and the molar mass.
191
+
192
+ :math:`\varepsilon_{molar}(\lambda) = M \mbox{ } \varepsilon_{mass}(\lambda)`
193
+
194
+ :param ext: extinction coefficient [cm^-1 mL mg^-1]
195
+ :type ext: float or np.ndarray
196
+
197
+ :param molar_mass: molar mass [g mol^-1]
198
+ :type molar_mass: float
199
+
200
+ :return: - **molarext** (*float or np.ndarray*) – molar extinction coefficient [cm^-1 M^-1]
201
+ '''
202
+
203
+ return ext*molar_mass
204
+
205
+ def mua_from_ext_and_Cmass(ext, Cmass):
206
+ r'''
207
+ | Calculate the absorption coefficient from the extinction coefficient and the mass concentration.
208
+ | For details please check Jacques 2013 [J13].
209
+
210
+ :math:`\mu_a(\lambda) = \mbox{ln}(10) \mbox{ } C_{mass} \mbox{ } \varepsilon_{mass}(\lambda)`
211
+
212
+ :param ext: extinction coefficient [cm^-1 mL mg^-1]
213
+ :type ext: float or np.ndarray
214
+
215
+ :param Cmass: mass concentration [g L^-1]
216
+ :type Cmass: float
217
+
218
+ :return: - **mua** (*float or np.ndarray*) – absorption coefficient [mm^-1]
219
+ '''
220
+
221
+ return np.log(10)*ext*Cmass/10
222
+
223
+ def mua_from_molarext_and_Cmolar(molarext, Cmolar):
224
+ r'''
225
+ | Calculate the absorption coefficient from the molar extinction coefficient
226
+ | and the molar concentration.
227
+ | For details please check Jacques 2013 [J13].
228
+
229
+ :math:`\mu_a(\lambda) = \mbox{ln}(10) \mbox{ } C_{molar} \mbox{ } \varepsilon_{molar}(\lambda)`
230
+
231
+ :param molarext: molar extinction coefficient [cm^-1 M^-1]
232
+ :type molarext: float or np.ndarray
233
+
234
+ :param Cmolar: molar concentration [M]
235
+ :type Cmolar: float
236
+
237
+ :return: - **mua** (*float or np.ndarray*) – absorption coefficient [mm^-1]
238
+ '''
239
+
240
+ return np.log(10)*molarext*Cmolar/10
241
+
242
+ def ext_from_mua_and_Cmass(mua, Cmass):
243
+ r'''
244
+ | Calculate the extinction coefficient from the absorption coefficient
245
+ | and the mass concentration.
246
+ | For details please check Jacques 2013 [J13].
247
+
248
+ :math:`\varepsilon_{mass}(\lambda) = \frac{1}{\mbox{ln}(10)}\frac{\mu_a(\lambda)}{C_{mass}}`
249
+
250
+ :param mua: absorption coefficient [mm^-1]
251
+ :type mua: float or np.ndarray
252
+
253
+ :param Cmass: mass concentration [g L^-1]
254
+ :type Cmass: float
255
+
256
+ :return: - **ext** (*float or np.ndarray*) – extinction coefficient [cm^-1 mL mg^-1]
257
+ '''
258
+
259
+ return 10*mua/np.log(10)/Cmass
260
+
261
+ def molarext_from_mua_Cmolar(mua, Cmolar):
262
+ r'''
263
+ | Calculate the molar extinction coefficient from the absorption coefficient
264
+ | and the molar concentration.
265
+ | For details please check Jacques 2013 [J13].
266
+
267
+ :math:`\varepsilon_{molar}(\lambda) = \frac{1}{\mbox{ln}(10)}\frac{\mu_a(\lambda)}{C_{molar}}`
268
+
269
+ :param mua: absorption coefficient [mm^-1]
270
+ :type mua: float or np.ndarray
271
+
272
+ :param Cmolar: molar concentration [M]
273
+ :type Cmolar: float
274
+
275
+ :return: - **molarext** (*float or np.ndarray*) – molar extinction coefficient [cm^-1 M^-1]
276
+ '''
277
+
278
+ return 10*mua/np.log(10)/Cmolar
279
+
280
+ def mua_from_k(k, lambda0):
281
+ r'''
282
+ | Calculate the absorption coefficient from the imaginary part of the complex refractive index
283
+ | and the wavelength.
284
+ | For details please check Hecht 2002 [H02], Jacques 2013 [J13] and Griffiths 2017 [G17].
285
+
286
+ :math:`\mu_a(\lambda) = 4\pi \frac{k(\lambda)}{\lambda}`
287
+
288
+ :param k: imaginary part of the complex refractive index [-]
289
+ :type k: float or np.ndarray
290
+
291
+ :param lambda0: wavelength [nm]
292
+ :type lambda0: float or np.ndarray
293
+
294
+ :return: - **mua** (*float or np.ndarray*) – absorption coefficient [mm^-1]
295
+ '''
296
+
297
+ return 4*np.pi*k/lambda0/1E-6
298
+
299
+ def k_from_mua(mua, lambda0):
300
+ r'''
301
+ | Calculate the imaginary part of the complex refractive index from the absorption coefficient
302
+ | and the wavelength.
303
+ | For details please check Hecht 2002 [H02], Jacques 2013 [J13] and Griffiths 2017 [G17].
304
+
305
+ :math:`k(\lambda) = \frac{\mu_a(\lambda)}{4\pi}\lambda`
306
+
307
+ :param mua: absorption coefficient [mm^-1]
308
+ :type mua: float or np.ndarray
309
+
310
+ :param lambda0: wavelength [nm]
311
+ :type lambda0: float or np.ndarray
312
+
313
+ :return: - **k** (*float or np.ndarray*) – imaginary part of the complex refractive index [-]
314
+ '''
315
+ return mua*lambda0*1E-6/4/np.pi
316
+
317
+ def k_wat_Hale(lambda0):
318
+ r'''
319
+ | The imaginary part of the complex refractive index of WATER as a function of wavelength.
320
+ | Linear interpolation of data from Hale & Querry 1973 [HQ73] (see their Table I).
321
+
322
+ | wavelength range: [200 nm, 200 μm]
323
+ | temperature: 25 ºC
324
+
325
+ :param lambda0: wavelength [nm]
326
+ :type lambda0: float or np.ndarray
327
+
328
+ :return: - **k** (*float or np.ndarray*) – imaginary part of the complex refractive index [-]
329
+ '''
330
+
331
+ return interp1d(np.array(n_and_k_wat_Hale_dataframe)[:,0],
332
+ np.array(n_and_k_wat_Hale_dataframe)[:,1],
333
+ bounds_error = False,
334
+ fill_value = (np.array(n_and_k_wat_Hale_dataframe)[0,1],
335
+ np.array(n_and_k_wat_Hale_dataframe)[-1,1]))(lambda0)
336
+
337
+ def k_wat_Segelstein(lambda0):
338
+ r'''
339
+ | The imaginary part of the complex refractive index of WATER as a function of wavelength.
340
+ | Linear interpolation of data from D. J. Segelstein's M.S. Thesis 1981 [S81] collected
341
+ | by S. Prahl and publicly available at <https://omlc.org/spectra/water/abs/index.html>.
342
+
343
+ | wavelength range: [10 nm, 10 m]
344
+
345
+ :param lambda0: wavelength [nm]
346
+ :type lambda0: float or np.ndarray
347
+
348
+ :return: - **k** (*float or np.ndarray*) – imaginary part of the complex refractive index [-]
349
+ '''
350
+
351
+ return interp1d(np.array(n_and_k_wat_Segelstein_dataframe)[:,0]*1E3,
352
+ np.array(n_and_k_wat_Segelstein_dataframe)[:,2],
353
+ bounds_error = False,
354
+ fill_value = (np.array(n_and_k_wat_Segelstein_dataframe)[0,2],
355
+ np.array(n_and_k_wat_Segelstein_dataframe)[-1,2]))(lambda0)
356
+
357
+ def ext_eum_Sarna(lambda0):
358
+ r'''
359
+ | The extinction coefficient of EUMELANIN in phosphate buffer as a function of wavelength.
360
+ | Linear interpolation of data from Sarna & Swartz 2006 [SS06] (see their Fig. 16.3-a)
361
+ | graphically deduced by Jacques and publicly available at
362
+ | <https://omlc.org/spectra/melanin/extcoeff.html>.
363
+
364
+ | wavelength range: [210 nm, 820 nm]
365
+
366
+ :param lambda0: wavelength [nm]
367
+ :type lambda0: float or np.ndarray
368
+
369
+ :return: - **ext** (*float or np.ndarray*) – extinction coefficient [cm^-1 mL mg^-1]
370
+ '''
371
+
372
+ return interp1d(np.array(ext_and_molarext_eum_Sarna_dataframe)[:,0],
373
+ np.array(ext_and_molarext_eum_Sarna_dataframe)[:,1],
374
+ bounds_error = False,
375
+ fill_value = (np.array(ext_and_molarext_eum_Sarna_dataframe)[0,1],
376
+ np.array(ext_and_molarext_eum_Sarna_dataframe)[-1,1]))(lambda0)
377
+
378
+ def molarext_eum_Sarna(lambda0):
379
+ r'''
380
+ | The molar extinction coefficient of EUMELANIN in phosphate buffer as a function of wavelength.
381
+ | Linear interpolation of data from Sarna & Swartz 2006 [SS06] (see their Fig. 16.3-a)
382
+ | graphically deduced by Jacques and publicly available at
383
+ | <https://omlc.org/spectra/melanin/extcoeff.html>.
384
+
385
+ | wavelength range: [210 nm, 820 nm]
386
+
387
+ :param lambda0: wavelength [nm]
388
+ :type lambda0: float or np.ndarray
389
+
390
+ :return: - **molarext** (*float or np.ndarray*) – molar extinction coefficient [cm^-1 M^-1]
391
+ '''
392
+
393
+ return interp1d(np.array(ext_and_molarext_eum_Sarna_dataframe)[:,0],
394
+ np.array(ext_and_molarext_eum_Sarna_dataframe)[:,2],
395
+ bounds_error = False,
396
+ fill_value = (np.array(ext_and_molarext_eum_Sarna_dataframe)[0,2],
397
+ np.array(ext_and_molarext_eum_Sarna_dataframe)[-1,2]))(lambda0)
398
+
399
+ def ext_phe_Sarna(lambda0):
400
+ r'''
401
+ | The extinction coefficient of PHEOMELANIN in phosphate buffer as a function of wavelength.
402
+ | Linear interpolation of data from Sarna & Swartz 2006 [SS06] (see their Fig. 16.3-a)
403
+ | graphically deduced by Jacques and publicly available at
404
+ | <https://omlc.org/spectra/melanin/extcoeff.html>.
405
+
406
+ | wavelength range: [210 nm, 820 nm]
407
+
408
+ :param lambda0: wavelength [nm]
409
+ :type lambda0: float or np.ndarray
410
+
411
+ :return: - **ext** (*float or np.ndarray*) – extinction coefficient [cm^-1 mL mg^-1]
412
+ '''
413
+
414
+ return interp1d(np.array(ext_and_molarext_phe_Sarna_dataframe)[:,0],
415
+ np.array(ext_and_molarext_phe_Sarna_dataframe)[:,1],
416
+ bounds_error = False,
417
+ fill_value = (np.array(ext_and_molarext_phe_Sarna_dataframe)[0,1],
418
+ np.array(ext_and_molarext_phe_Sarna_dataframe)[-1,1]))(lambda0)
419
+
420
+ def molarext_phe_Sarna(lambda0):
421
+ r'''
422
+ | The molar extinction coefficient of PHEOMELANIN in phosphate buffer as a function of wavelength.
423
+ | Linear interpolation of data from Sarna & Swartz 2006 [SS06] (see their Fig. 16.3-a)
424
+ | graphically deduced by Jacques and publicly available at
425
+ | <https://omlc.org/spectra/melanin/extcoeff.html>.
426
+
427
+ | wavelength range: [210 nm, 820 nm]
428
+
429
+ :param lambda0: wavelength [nm]
430
+ :type lambda0: float or np.ndarray
431
+
432
+ :return: - **molarext** (*float or np.ndarray*) – molar extinction coefficient [cm^-1 M^-1]
433
+ '''
434
+
435
+ return interp1d(np.array(ext_and_molarext_phe_Sarna_dataframe)[:,0],
436
+ np.array(ext_and_molarext_phe_Sarna_dataframe)[:,2],
437
+ bounds_error = False,
438
+ fill_value = (np.array(ext_and_molarext_phe_Sarna_dataframe)[0,2],
439
+ np.array(ext_and_molarext_phe_Sarna_dataframe)[-1,2]))(lambda0)
440
+
441
+ def molarext_oxy_Prahl(lambda0):
442
+ r'''
443
+ | The molar extinction coefficient of OXYHEMOGLOBIN in water as a function of wavelength.
444
+ | Linear interpolation of data from various sources compiled by S. Prahl and publicly
445
+ | available at <https://omlc.org/spectra/hemoglobin/>.
446
+
447
+ | wavelength range: [250 nm, 1000 nm]
448
+
449
+ :param lambda0: wavelength [nm]
450
+ :type lambda0: float or np.ndarray
451
+
452
+ :return: - **molarext** (*float or np.ndarray*) – molar extinction coefficient [cm^-1 M^-1]
453
+ '''
454
+
455
+ return interp1d(np.array(ext_and_molarext_oxy_and_deo_Prahl_dataframe)[:,0],
456
+ np.array(ext_and_molarext_oxy_and_deo_Prahl_dataframe)[:,1],
457
+ bounds_error = False,
458
+ fill_value = (np.array(ext_and_molarext_oxy_and_deo_Prahl_dataframe)[0,1],
459
+ np.array(ext_and_molarext_oxy_and_deo_Prahl_dataframe)[-1,1]))(lambda0)
460
+
461
+ def molarext_deo_Prahl(lambda0):
462
+ r'''
463
+ | The molar extinction coefficient for DEOXYHEMOGLOBIN in water as a function of wavelength.
464
+ | Linear interpolation of data from various sources compiled by S. Prahl and publicly
465
+ | available at <https://omlc.org/spectra/hemoglobin/>.
466
+
467
+ | wavelength range: [250 nm, 1000 nm]
468
+
469
+ :param lambda0: wavelength [nm]
470
+ :type lambda0: float or np.ndarray
471
+
472
+ :return: - **molarext** (*float or np.ndarray*) – molar extinction coefficient [cm^-1 M^-1]
473
+ '''
474
+
475
+ return interp1d(np.array(ext_and_molarext_oxy_and_deo_Prahl_dataframe)[:,0],
476
+ np.array(ext_and_molarext_oxy_and_deo_Prahl_dataframe)[:,2],
477
+ bounds_error = False,
478
+ fill_value = (np.array(ext_and_molarext_oxy_and_deo_Prahl_dataframe)[0,2],
479
+ np.array(ext_and_molarext_oxy_and_deo_Prahl_dataframe)[-1,2]))(lambda0)
480
+
481
+ def molarext_bil_Li(lambda0):
482
+ r'''
483
+ | The molar extinction coefficient of BILIRUBIN in chloroform as a function of wavelength.
484
+ | Linear interpolation of experimental data obtained with a Cary 3 by J. Li on 1997,
485
+ | scaled to match 55,000 cm^-1 M^-1 at 450.8 nm [AF90] and publicly available by S. Jacques and
486
+ | S. Prahl at <https://omlc.org/spectra/PhotochemCAD/html/119.html>.
487
+ | The data is also available at PhotochemCAD [TL23]
488
+ | <https://www.photochemcad.com/databases/common-compounds/oligopyrroles/bilirubin>.
489
+
490
+ | wavelength range: [239.75 nm, 700 nm]
491
+
492
+ :param lambda0: wavelength [nm]
493
+ :type lambda0: float or np.ndarray
494
+
495
+ :return: - **molarext** (*float or np.ndarray*) – molar extinction coefficient [cm^-1 M^-1]
496
+ '''
497
+
498
+ return interp1d(np.array(molarext_bil_Li_dataframe)[:,0],
499
+ np.array(molarext_bil_Li_dataframe)[:,1],
500
+ bounds_error = False,
501
+ fill_value = (np.array(molarext_bil_Li_dataframe)[0,1],
502
+ np.array(molarext_bil_Li_dataframe)[-1,1]))(lambda0)
503
+
504
+ def mua_baseline(lambda0):
505
+ r'''
506
+ | The baseline absorption coefficient as a function of wavelength.
507
+ | Equation proposed by S. Jacques based on data for bloodless rat skin.
508
+ | For details please check <https://omlc.org/news/jan98/skinoptics.html>.
509
+
510
+ :math:`\mu_a^{bas}(\lambda) = 0.0244 + 8.53\mbox{ exp}(-(\lambda-154)/66.2)`
511
+
512
+ | wavelength range: [350 nm, 1100 nm]
513
+
514
+ :param lambda0: wavelength [nm]
515
+ :type lambda0: float or np.ndarray
516
+
517
+ :return: - **mua** (*float or np.ndarray*) – absorption coefficient [mm^-1]
518
+ '''
519
+ return (0.244 + 85.3*np.exp(-(lambda0 - 154.)/66.2))/10
520
+
521
+ def mua_baseline2(lambda0):
522
+ r'''
523
+ | The baseline absorption coefficient as a function of wavelength.
524
+ | Equation based on data for neonatal skin.
525
+ | For details please check <https://omlc.org/news/jan98/skinoptics.html>.
526
+
527
+ :math:`\mu_a^{bas}(\lambda) = 7.84 \times 10^7 \times \lambda^{-3.255}`
528
+
529
+ | wavelength range: [450 nm, 750 nm]
530
+
531
+ :param lambda0: wavelength [nm]
532
+ :type lambda0: float or np.ndarray
533
+
534
+ :return: - **mua** (*float or np.ndarray*) – absorption coefficient [mm^-1]
535
+ '''
536
+ return 7.84E7*lambda0**(-3.255)
537
+
538
+ def mua_wat_Hale(lambda0):
539
+ r'''
540
+ | The absorption coefficient of WATER as a function of wavelength.
541
+ | Linear interpolation of data from Hale & Querry 1973 [HQ73] collected and processed
542
+ | by S. Jacques and S. Prahl and publicly available at
543
+ | <https://omlc.org/spectra/water/abs/index.html>.
544
+
545
+ wavelength range: [200 nm, 200 μm]
546
+
547
+ :param lambda0: wavelength [nm]
548
+ :type lambda0: float or np.ndarray
549
+
550
+ :return: - **mua** (*float or np.ndarray*) – absorption coefficient [mm^-1]
551
+ '''
552
+
553
+ return interp1d(np.array(mua_wat_Hale_dataframe)[:,0],
554
+ np.array(mua_wat_Hale_dataframe)[:,1]/10,
555
+ bounds_error = False,
556
+ fill_value = (np.array(mua_wat_Hale_dataframe)[0,1]/10,
557
+ np.array(mua_wat_Hale_dataframe)[-1,1]/10))(lambda0)
558
+
559
+ def mua_wat_Segelstein(lambda0):
560
+ r'''
561
+ | The absorption coefficient of WATER as a function of wavelength.
562
+ | Linear interpolation of data from D. J. Segelstein's M.S. Thesis 1981 [S81],
563
+ | collected by S. Jacques and S. Prahl and publicly available at
564
+ | <https://omlc.org/spectra/water/abs/index.html>.
565
+
566
+ | wavelength range: [10 nm, 10 m].
567
+
568
+ :param lambda0: wavelength [nm]
569
+ :type lambda0: float or np.ndarray
570
+
571
+ :return: - **mua** (*float or np.ndarray*) – absorption coefficient [mm^-1]
572
+ '''
573
+
574
+ return interp1d(np.array(mua_wat_Segelstein_dataframe)[:,0],
575
+ np.array(mua_wat_Segelstein_dataframe)[:,1]/10,
576
+ bounds_error = False,
577
+ fill_value = (np.array(mua_wat_Segelstein_dataframe)[0,1]/10,
578
+ np.array(mua_wat_Segelstein_dataframe)[-1,1]/10))(lambda0)
579
+
580
+ def mua_mel_Jacques(lambda0):
581
+ r'''
582
+ | The absoption coefficient of a MELANOSOME as a function of wavelength.
583
+ | Equation proposed by S. Jacques based on data from various sources.
584
+ | For details please check <https://omlc.org/news/jan98/skinoptics.html>.
585
+
586
+ :math:`\mu_a^{mel} (\lambda) = 6.6 \times 10^{10} \times \lambda^{-3.33}`
587
+
588
+ :param lambda0: wavelength [nm]
589
+ :type lambda0: float or np.ndarray
590
+
591
+ :return: - **mua** (*float or np.ndarray*) – absorption coefficient [mm^-1]
592
+ '''
593
+
594
+ return 6.6E10*lambda0**(-3.33)
595
+
596
+ def mua_oxy_Prahl(lambda0, Cmass_oxy = 150, molar_mass_oxy = 64500):
597
+ r'''
598
+ | The absorption coefficient of OXYHEMOGLOBIN in water as a function of wavelength.
599
+ | Calculated from :meth:`skinoptics.absorption_coefficient.molarext_oxy_Prahl` for a specific
600
+ | oxyhemoglobin mass concentration.
601
+
602
+ | wavelength range: [250 nm, 1000 nm]
603
+
604
+ :param lambda0: wavelength [nm]
605
+ :type lambda0: float or np.ndarray
606
+
607
+ :param Cmass_oxy: oxyhemoglobin mass concentration [g/L] (default to 150. [S*23])
608
+ :type Cmass_oxy: float
609
+
610
+ :param molar_mass_oxy: molar mass of oxyhemoglobin [g/mol] (default to 64500. [B90])
611
+ :type molar_mass_oxy: float
612
+
613
+ :return: - **mua** (*float or np.ndarray*) – absorption coefficient [mm^-1]
614
+ '''
615
+
616
+ return mua_from_molarext_and_Cmolar(molarext_oxy_Prahl(lambda0),
617
+ Cmolar = Cmolar_from_Cmass(Cmass = Cmass_oxy, molar_mass = molar_mass_oxy))
618
+
619
+ def mua_deo_Prahl(lambda0, Cmass_deo = 150, molar_mass_deo = 64500):
620
+ r'''
621
+ | The absorption coefficient of DEOXYHEMOGLOBIN in water as a function of wavelength.
622
+ | Calculated from :meth:`skinoptics.absorption_coefficient.molarext_deo_Prahl` for a specific
623
+ | deoxyhemoglobin mass concentration.
624
+
625
+ | wavelength range: [250 nm, 1000 nm]
626
+
627
+ :param lambda0: wavelength [nm]
628
+ :type lambda0: float or np.ndarray.
629
+
630
+ :param Cmass_oxy: deoxyhemoglobin mass concentration [g/L] (default to 150. [S*23])
631
+ :type Cmass_oxy: float
632
+
633
+ :param molar_mass_deo: molar mass of deoxyhemoglobin [g/mol] (default to 64500. [B90])
634
+ :type molar_mass_deo: float
635
+
636
+ :return: - **mua** (*float or np.ndarray*) – absorption coefficient [mm^-1]
637
+ '''
638
+
639
+ return mua_from_molarext_and_Cmolar(molarext_deo_Prahl(lambda0),
640
+ Cmolar = Cmolar_from_Cmass(Cmass = Cmass_deo, molar_mass = molar_mass_deo))
641
+
642
+ def mua_oxy_Bosschaart(lambda0):
643
+ r'''
644
+ | The absorption coefficient of OXYGENIZED BLOOD (saturation > 98%) as a function of wavelength.
645
+ | Linear interpolation of data from Bosschaart et. al. 2014 [B*14].
646
+
647
+ | wavelength range: [251 nm, 1995 nm]
648
+
649
+ :param lambda0: wavelength [nm]
650
+ :type lambda0: float or np.ndarray
651
+
652
+ :return: - **mua** (*float or np.ndarray*) – absorption coefficient [mm^-1]
653
+ '''
654
+ return interp1d(np.array(oxy_and_deo_Bosschaart_dataframe)[:,0],
655
+ np.array(oxy_and_deo_Bosschaart_dataframe)[:,1],
656
+ bounds_error = False,
657
+ fill_value = (np.array(oxy_and_deo_Bosschaart_dataframe)[0,1],
658
+ np.array(oxy_and_deo_Bosschaart_dataframe)[-1,1]))(lambda0)
659
+
660
+ def mua_deo_Bosschaart(lambda0):
661
+ r'''
662
+ | The absorption coefficient of DEOXIGENIZED BLOOD (saturation = 0%) as a function of wavelength.
663
+ | Linear interpolation of data from Bosschaart et. al. 2014 [B*14].
664
+
665
+ | wavelength range: [251 nm, 1995 nm]
666
+
667
+ :param lambda0: wavelength [nm]
668
+ :type lambda0: float or np.ndarray
669
+
670
+ :return: - **mua** (*float or np.ndarray*) – absorption coefficient [mm^-1]
671
+ '''
672
+ return interp1d(np.array(oxy_and_deo_Bosschaart_dataframe)[:,0],
673
+ np.array(oxy_and_deo_Bosschaart_dataframe)[:,2],
674
+ bounds_error = False,
675
+ fill_value = (np.array(oxy_and_deo_Bosschaart_dataframe)[0,2],
676
+ np.array(oxy_and_deo_Bosschaart_dataframe)[-1,2]))(lambda0)
677
+
678
+ def mua_bil_Li(lambda0, Cmass_bil, molar_mass_bil = 585):
679
+ r'''
680
+ | The absorption coefficient of BILIRUBIN in chloroform as a function of wavelength.
681
+ | Calculated from :meth:`skinoptics.absorption_coefficient.molarext_bil_Li` for a specific
682
+ | bilirubin mass concentration.
683
+
684
+ | wavelength range: [239.75 nm, 700 nm]
685
+
686
+ :param lambda0: wavelength [nm]
687
+ :type lambda0: float or np.ndarray
688
+
689
+ :param Cmass_bil: bilirubin mass concentration [g/L]
690
+ :type Cmass_bil: float
691
+
692
+ :param molarmass_bil: molar mass of bilirubin [g/mol] (default to 585. [DJV11])
693
+ :type molarmass_bil: float
694
+
695
+ :return: - **mua** (*float or np.ndarray*) – absorption coefficient [mm^-1]
696
+ '''
697
+ return mua_from_molarext_and_Cmolar(molarext_bil_Li(lambda0),
698
+ Cmolar = Cmolar_from_Cmass(Cmass = Cmass_bil, molar_mass = molar_mass_bil))
699
+
700
+ def mua_fat_vanVeen(lambda0):
701
+ r'''
702
+ | The absorption coefficient of (pig lard) FAT as a function of wavelength.
703
+ | Linear interpolation of data from van Veen et al. 2005 [v*05] collected and processed
704
+ | by S. Prahl and publicly available at <https://omlc.org/spectra/fat/>.
705
+
706
+ | wavelength range: [429 nm, 1098 nm]
707
+
708
+ :param lambda0: wavelength [nm]
709
+ :type lambda0: float or np.ndarray
710
+
711
+ :return: - **mua** (*float or np.ndarray*) – absorption coefficient [mm^-1]
712
+ '''
713
+ return interp1d(np.array(mua_fat_vanVeen_dataframe)[:,0],
714
+ np.array(mua_fat_vanVeen_dataframe)[:,1]/1E3,
715
+ bounds_error = False,
716
+ fill_value = (np.array(mua_fat_vanVeen_dataframe)[0,1]/1E3,
717
+ np.array(mua_fat_vanVeen_dataframe)[-1,1]/1E3))(lambda0)
718
+
719
+ def mua_EP_Salomatina(lambda0):
720
+ r'''
721
+ | The absoption coefficient of human EPIDERMIS as a function of wavelength.
722
+ | Linear interpolation of experimental data from Salomatina et al. 2006 [S*06],
723
+ | publicly available at <https://sites.uml.edu/abl/optical-properties-2/>.
724
+
725
+ | wavelength range: [370 nm, 1600 nm]
726
+
727
+ :param lambda0: wavelength [nm]
728
+ :type lambda0: float or np.ndarray
729
+
730
+ :return: - **mua** (*float or np.ndarray*) – absorption coefficient [mm^-1]
731
+ '''
732
+
733
+ return interp1d(np.array(EP_Salomatina_dataframe)[:,0],
734
+ np.array(EP_Salomatina_dataframe)[:,1],
735
+ bounds_error = False,
736
+ fill_value = (np.array(EP_Salomatina_dataframe)[0,1],
737
+ np.array(EP_Salomatina_dataframe)[-1,1]))(lambda0)
738
+
739
+ def mua_DE_Salomatina(lambda0):
740
+ r'''
741
+ | The absoption coefficient of human DERMIS as a function of wavelength.
742
+ | Linear interpolation of experimental data from Salomatina et al. 2006 [S*06],
743
+ | publicly available at <https://sites.uml.edu/abl/optical-properties-2/>.
744
+
745
+ | wavelength range: [370 nm, 1600 nm]
746
+
747
+ :param lambda0: wavelength [nm]
748
+ :type lambda0: float or np.ndarray
749
+
750
+ :return: - **mua** (*float or np.ndarray*) – absorption coefficient [mm^-1]
751
+ '''
752
+ return interp1d(np.array(DE_Salomatina_dataframe)[:,0],
753
+ np.array(DE_Salomatina_dataframe)[:,1],
754
+ bounds_error = False,
755
+ fill_value = (np.array(DE_Salomatina_dataframe)[0,1],
756
+ np.array(DE_Salomatina_dataframe)[-1,1]))(lambda0)
757
+
758
+ def mua_HY_Salomatina(lambda0):
759
+ r'''
760
+ | The absoption coefficient of human HYPODERMIS as a function of wavelength.
761
+ | Linear interpolation of experimental data from Salomatina et al. 2006 [S*06],
762
+ | publicly available at <https://sites.uml.edu/abl/optical-properties-2/>.
763
+
764
+ | wavelength range: [374 nm, 1600 nm]
765
+
766
+ :param lambda0: wavelength [nm]
767
+ :type lambda0: float or np.ndarray
768
+
769
+ :return: - **mua** (*float or np.ndarray*) – absorption coefficient [mm^-1]
770
+ '''
771
+ return interp1d(np.array(HY_Salomatina_dataframe)[:,0],
772
+ np.array(HY_Salomatina_dataframe)[:,1],
773
+ bounds_error = False,
774
+ fill_value = (np.array(HY_Salomatina_dataframe)[0,1],
775
+ np.array(HY_Salomatina_dataframe)[-1,1]))(lambda0)
776
+
777
+ def mua_iBCC_Salomatina(lambda0):
778
+ r'''
779
+ | The absoption coefficient of INFILTRATIVE BASAL CELL CARCINOMA as a function of wavelength.
780
+ | Linear interpolation of experimental data from Salomatina et al. 2006 [S*06],
781
+ | publicly available at <https://sites.uml.edu/abl/optical-properties-2/>.
782
+
783
+ | wavelength range: [370 nm, 1600 nm]
784
+
785
+ :param lambda0: wavelength [nm]
786
+ :type lambda0: float or np.ndarray
787
+
788
+ :return: - **mua** (*float or np.ndarray*) – absorption coefficient [mm^-1]
789
+ '''
790
+ return interp1d(np.array(iBCC_Salomatina_dataframe)[:,0],
791
+ np.array(iBCC_Salomatina_dataframe)[:,1],
792
+ bounds_error = False,
793
+ fill_value = (np.array(iBCC_Salomatina_dataframe)[0,1],
794
+ np.array(iBCC_Salomatina_dataframe)[-1,1]))(lambda0)
795
+
796
+ def mua_nBCC_Salomatina(lambda0):
797
+ r'''
798
+ | The absoption coefficient of NODULAR BASAL CELL CARCINOMA as a function of wavelength.
799
+ | Linear interpolation of experimental data from Salomatina et al. 2006 [S*06],
800
+ | publicly available at <https://sites.uml.edu/abl/optical-properties-2/>.
801
+
802
+ | wavelength range: [370 nm, 1600 nm]
803
+
804
+ :param lambda0: wavelength [nm]
805
+ :type lambda0: float or np.ndarray
806
+
807
+ :return: - **mua** (*float or np.ndarray*) – absorption coefficient [mm^-1]
808
+ '''
809
+
810
+ return interp1d(np.array(nBCC_Salomatina_dataframe)[:,0],
811
+ np.array(nBCC_Salomatina_dataframe)[:,1],
812
+ bounds_error = False,
813
+ fill_value = (np.array(nBCC_Salomatina_dataframe)[0,1],
814
+ np.array(nBCC_Salomatina_dataframe)[-1,1]))(lambda0)
815
+
816
+ def mua_SCC_Salomatina(lambda0):
817
+ r'''
818
+ | The absoption coefficient of SQUAMOUS CELL CARCINOMA as a function of wavelength.
819
+ | Linear interpolation of experimental data from Salomatina et al. 2006 [S*06],
820
+ | publicly available at <https://sites.uml.edu/abl/optical-properties-2/>.
821
+
822
+ | wavelength range: [370 nm, 1600 nm]
823
+
824
+ :param lambda0: wavelength [nm]
825
+ :type lambda0: float or np.ndarray
826
+
827
+ :return: - **mua** (*float or np.ndarray*) – absorption coefficient [mm^-1]
828
+ '''
829
+
830
+ return interp1d(np.array(SCC_Salomatina_dataframe)[:,0],
831
+ np.array(SCC_Salomatina_dataframe)[:,1],
832
+ bounds_error = False,
833
+ fill_value = (np.array(SCC_Salomatina_dataframe)[0,1],
834
+ np.array(SCC_Salomatina_dataframe)[-1,1]))(lambda0)
835
+
836
+ def std_mua_EP_Salomatina(lambda0):
837
+ r'''
838
+ | The standard deviation respective to :meth:`skinoptics.absorption_coefficient.mua_EP_Salomatina`.
839
+ | Linear interpolation of experimental data from Salomatina et al. 2006 [S*06],
840
+ | publicly available at <https://sites.uml.edu/abl/optical-properties-2/>.
841
+
842
+ | wavelength range: [370 nm, 1600 nm]
843
+
844
+ :param lambda0: wavelength [nm]
845
+ :type lambda0: float or np.ndarray
846
+
847
+ :return: - **std_mua** (*float or np.ndarray*) – standard deviation of the absorption coefficient [mm^-1]
848
+ '''
849
+
850
+ return interp1d(np.array(EP_Salomatina_dataframe)[:,0],
851
+ np.array(EP_Salomatina_dataframe)[:,2],
852
+ bounds_error = False,
853
+ fill_value = (np.array(EP_Salomatina_dataframe)[0,2],
854
+ np.array(EP_Salomatina_dataframe)[-1,2]))(lambda0)
855
+
856
+ def std_mua_DE_Salomatina(lambda0):
857
+ r'''
858
+ | The standard deviation respective to :meth:`skinoptics.absorption_coefficient.mua_DE_Salomatina`.
859
+ | Linear interpolation of experimental data from Salomatina et al. 2006 [S*06],
860
+ | publicly available at <https://sites.uml.edu/abl/optical-properties-2/>.
861
+
862
+ | wavelength range: [370 nm, 1600 nm]
863
+
864
+ :param lambda0: wavelength [nm]
865
+ :type lambda0: float or np.ndarray
866
+
867
+ :return: - **std_mua** (*float or np.ndarray*) – standard deviation of the absorption coefficient [mm^-1]
868
+ '''
869
+
870
+ return interp1d(np.array(DE_Salomatina_dataframe)[:,0],
871
+ np.array(DE_Salomatina_dataframe)[:,2],
872
+ bounds_error = False,
873
+ fill_value = (np.array(DE_Salomatina_dataframe)[0,2],
874
+ np.array(DE_Salomatina_dataframe)[-1,2]))(lambda0)
875
+
876
+ def std_mua_HY_Salomatina(lambda0):
877
+ r'''
878
+ | The standard deviation respective to :meth:`skinoptics.absorption_coefficient.mua_HY_Salomatina`.
879
+ | Linear interpolation of experimental data from Salomatina et al. 2006 [S*06],
880
+ | publicly available at <https://sites.uml.edu/abl/optical-properties-2/>.
881
+
882
+ | wavelength range: [370 nm, 1600 nm]
883
+
884
+ :param lambda0: wavelength [nm]
885
+ :type lambda0: float or np.ndarray
886
+
887
+ :return: - **std_mua** (*float or np.ndarray*) – standard deviation of the absorption coefficient [mm^-1]
888
+ '''
889
+
890
+ return interp1d(np.array(HY_Salomatina_dataframe)[:,0],
891
+ np.array(HY_Salomatina_dataframe)[:,2],
892
+ bounds_error = False,
893
+ fill_value = (np.array(HY_Salomatina_dataframe)[0,2],
894
+ np.array(HY_Salomatina_dataframe)[-1,2]))(lambda0)