phasorpy 0.6__cp313-cp313-win_arm64.whl → 0.7__cp313-cp313-win_arm64.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.
- phasorpy/__init__.py +1 -1
- phasorpy/_phasorpy.cp313-win_arm64.pyd +0 -0
- phasorpy/_phasorpy.pyx +281 -9
- phasorpy/_utils.py +101 -28
- phasorpy/cli.py +19 -1
- phasorpy/cluster.py +10 -16
- phasorpy/color.py +11 -7
- phasorpy/{components.py → component.py} +255 -32
- phasorpy/{cursors.py → cursor.py} +31 -33
- phasorpy/datasets.py +117 -7
- phasorpy/experimental.py +8 -10
- phasorpy/io/__init__.py +1 -0
- phasorpy/io/_flimlabs.py +20 -10
- phasorpy/io/_leica.py +3 -1
- phasorpy/io/_ometiff.py +2 -3
- phasorpy/io/_other.py +115 -7
- phasorpy/io/_simfcs.py +41 -16
- phasorpy/lifetime.py +2058 -0
- phasorpy/phasor.py +71 -1947
- phasorpy/plot/_functions.py +8 -2
- phasorpy/plot/_lifetime_plots.py +33 -23
- phasorpy/plot/_phasorplot.py +547 -159
- phasorpy/plot/_phasorplot_fret.py +11 -9
- phasorpy/utils.py +21 -10
- {phasorpy-0.6.dist-info → phasorpy-0.7.dist-info}/METADATA +2 -2
- phasorpy-0.7.dist-info/RECORD +35 -0
- phasorpy-0.6.dist-info/RECORD +0 -34
- {phasorpy-0.6.dist-info → phasorpy-0.7.dist-info}/WHEEL +0 -0
- {phasorpy-0.6.dist-info → phasorpy-0.7.dist-info}/entry_points.txt +0 -0
- {phasorpy-0.6.dist-info → phasorpy-0.7.dist-info}/licenses/LICENSE.txt +0 -0
- {phasorpy-0.6.dist-info → phasorpy-0.7.dist-info}/top_level.txt +0 -0
@@ -1,8 +1,8 @@
|
|
1
1
|
"""Select regions of interest (cursors) from phasor coordinates.
|
2
2
|
|
3
|
-
The ``phasorpy.
|
3
|
+
The ``phasorpy.cursor`` module provides functions to:
|
4
4
|
|
5
|
-
- create masks for regions of
|
5
|
+
- create masks for regions of interest in the phasor space:
|
6
6
|
|
7
7
|
- :py:func:`mask_from_circular_cursor`
|
8
8
|
- :py:func:`mask_from_elliptic_cursor`
|
@@ -26,10 +26,7 @@ __all__ = [
|
|
26
26
|
from typing import TYPE_CHECKING
|
27
27
|
|
28
28
|
if TYPE_CHECKING:
|
29
|
-
from ._typing import
|
30
|
-
ArrayLike,
|
31
|
-
NDArray,
|
32
|
-
)
|
29
|
+
from ._typing import ArrayLike, Literal, NDArray
|
33
30
|
|
34
31
|
import numpy
|
35
32
|
|
@@ -80,12 +77,12 @@ def mask_from_circular_cursor(
|
|
80
77
|
------
|
81
78
|
ValueError
|
82
79
|
The array shapes of `real` and `imag` do not match.
|
83
|
-
The array shapes of `
|
84
|
-
one dimension.
|
80
|
+
The array shapes of `center_real`, `center_imag`, or `radius` have
|
81
|
+
more than one dimension.
|
85
82
|
|
86
83
|
See Also
|
87
84
|
--------
|
88
|
-
:ref:`
|
85
|
+
:ref:`sphx_glr_tutorials_api_phasorpy_cursor.py`
|
89
86
|
|
90
87
|
Examples
|
91
88
|
--------
|
@@ -139,8 +136,7 @@ def mask_from_elliptic_cursor(
|
|
139
136
|
*,
|
140
137
|
radius: ArrayLike = 0.05,
|
141
138
|
radius_minor: ArrayLike | None = None,
|
142
|
-
angle: ArrayLike | None = None,
|
143
|
-
align_semicircle: bool = False,
|
139
|
+
angle: ArrayLike | Literal['phase', 'semicircle'] | str | None = None,
|
144
140
|
) -> NDArray[numpy.bool_]:
|
145
141
|
"""Return masks for elliptic cursors of phasor coordinates.
|
146
142
|
|
@@ -159,21 +155,18 @@ def mask_from_elliptic_cursor(
|
|
159
155
|
radius_minor : array_like, optional, shape (n,)
|
160
156
|
Radii of ellipses along semi-minor axis.
|
161
157
|
By default, the ellipses are circular.
|
162
|
-
angle : array_like,
|
163
|
-
Rotation
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
Determines orientation of ellipses if `angle` is not provided.
|
168
|
-
If true, align the minor axes of the ellipses with the closest tangent
|
169
|
-
on the universal semicircle, else the unit circle (default).
|
158
|
+
angle : array_like or {'phase', 'semicircle'}, optional
|
159
|
+
Rotation angle of semi-major axis of elliptic cursors in radians.
|
160
|
+
If None or 'phase', align the minor axes of the ellipses with
|
161
|
+
the closest tangent on the unit circle.
|
162
|
+
If 'semicircle', align the ellipses with the universal semicircle.
|
170
163
|
|
171
164
|
Returns
|
172
165
|
-------
|
173
166
|
masks : ndarray
|
174
167
|
Boolean array of shape `(n, *real.shape)`.
|
175
|
-
The first dimension is omitted if `
|
176
|
-
are scalars.
|
168
|
+
The first dimension is omitted if `center_real`, `center_imag`,
|
169
|
+
`radius`, `radius_minor`, and `angle` are scalars.
|
177
170
|
Values are True if phasor coordinates are inside elliptic cursor,
|
178
171
|
else False.
|
179
172
|
|
@@ -181,12 +174,12 @@ def mask_from_elliptic_cursor(
|
|
181
174
|
------
|
182
175
|
ValueError
|
183
176
|
The array shapes of `real` and `imag` do not match.
|
184
|
-
The array shapes of `
|
185
|
-
one dimension.
|
177
|
+
The array shapes of `center_real`, `center_imag`, `radius`,
|
178
|
+
`radius_minor`, or `angle` have more than one dimension.
|
186
179
|
|
187
180
|
See Also
|
188
181
|
--------
|
189
|
-
:ref:`
|
182
|
+
:ref:`sphx_glr_tutorials_api_phasorpy_cursor.py`
|
190
183
|
|
191
184
|
Examples
|
192
185
|
--------
|
@@ -220,12 +213,17 @@ def mask_from_elliptic_cursor(
|
|
220
213
|
angle = 0.0
|
221
214
|
else:
|
222
215
|
radius_b = numpy.asarray(radius_minor)
|
216
|
+
|
223
217
|
if angle is None:
|
224
|
-
|
225
|
-
|
218
|
+
angle = numpy.arctan2(center_imag, center_real)
|
219
|
+
elif isinstance(angle, str):
|
220
|
+
# TODO: vectorize str type
|
221
|
+
if angle == 'phase':
|
222
|
+
angle = numpy.arctan2(center_imag, center_real)
|
223
|
+
elif angle == 'semicircle':
|
226
224
|
angle = numpy.arctan2(center_imag, center_real - 0.5)
|
227
225
|
else:
|
228
|
-
|
226
|
+
raise ValueError(f'invalid {angle=}')
|
229
227
|
|
230
228
|
angle_sin = numpy.sin(angle)
|
231
229
|
angle_cos = numpy.cos(angle)
|
@@ -320,10 +318,10 @@ def mask_from_polar_cursor(
|
|
320
318
|
|
321
319
|
See Also
|
322
320
|
--------
|
323
|
-
:ref:`
|
321
|
+
:ref:`sphx_glr_tutorials_api_phasorpy_cursor.py`
|
324
322
|
|
325
|
-
|
326
|
-
|
323
|
+
Examples
|
324
|
+
--------
|
327
325
|
Create mask from a single polar cursor:
|
328
326
|
|
329
327
|
>>> mask_from_polar_cursor([0.2, 0.5], [0.4, 0.5], 1.1, 1.2, 0.4, 0.5)
|
@@ -423,10 +421,10 @@ def pseudo_color(
|
|
423
421
|
|
424
422
|
See Also
|
425
423
|
--------
|
426
|
-
:ref:`
|
424
|
+
:ref:`sphx_glr_tutorials_api_phasorpy_cursor.py`
|
427
425
|
|
428
|
-
|
429
|
-
|
426
|
+
Examples
|
427
|
+
--------
|
430
428
|
Create pseudo-color image from single mask:
|
431
429
|
|
432
430
|
>>> pseudo_color([True, False, True]) # doctest: +NUMBER
|
phasorpy/datasets.py
CHANGED
@@ -2,14 +2,13 @@
|
|
2
2
|
|
3
3
|
The ``phasorpy.datasets`` module provides a :py:func:`fetch` function to
|
4
4
|
download data files from remote repositories and cache them in a local
|
5
|
-
directory.
|
6
|
-
``PHASORPY_DATA_DIR`` environment variable.
|
5
|
+
directory.
|
7
6
|
|
8
7
|
Datasets from the following repositories are available:
|
9
8
|
|
10
|
-
- `PhasorPy tests <https://zenodo.org/
|
11
|
-
- `LFD Workshop <https://zenodo.org/
|
12
|
-
- `FLUTE <https://zenodo.org/
|
9
|
+
- `PhasorPy tests <https://zenodo.org/records/8417894>`_
|
10
|
+
- `LFD Workshop <https://zenodo.org/records/8411056>`_
|
11
|
+
- `FLUTE <https://zenodo.org/records/8046636>`_
|
13
12
|
- `napari-flim-phasor-plotter
|
14
13
|
<https://github.com/zoccoler/napari-flim-phasor-plotter/tree/0.0.6/src/napari_flim_phasor_plotter/data>`_
|
15
14
|
- `Phasor-based multi-harmonic unmixing for in-vivo hyperspectral imaging
|
@@ -19,10 +18,18 @@ Datasets from the following repositories are available:
|
|
19
18
|
<https://zenodo.org/records/14026720>`_
|
20
19
|
- `Convallaria FLIM dataset in FLIM LABS JSON format
|
21
20
|
<https://zenodo.org/records/15007900>`_
|
21
|
+
- `FLIM and spectral dataset for GSLab
|
22
|
+
<https://figshare.com/articles/dataset/FLIM_dataset_for_GSLab/28067108>`_
|
23
|
+
- `Hyperspectral and FLIM dataset of LAURDAN-stained NIH-3T3 cells
|
24
|
+
<https://zenodo.org/records/16894639>`_
|
22
25
|
|
23
26
|
The implementation is based on the `Pooch <https://www.fatiando.org/pooch>`_
|
24
27
|
library.
|
25
28
|
|
29
|
+
The default cache location is determined by the Pooch library, but can be
|
30
|
+
overridden by setting the ``PHASORPY_DATA_DIR`` environment variable to
|
31
|
+
a custom directory path.
|
32
|
+
|
26
33
|
"""
|
27
34
|
|
28
35
|
from __future__ import annotations
|
@@ -397,6 +404,60 @@ FLIMLABS = pooch.create(
|
|
397
404
|
},
|
398
405
|
)
|
399
406
|
|
407
|
+
FIGSHARE_28067108 = pooch.create(
|
408
|
+
path=pooch.os_cache('phasorpy'),
|
409
|
+
base_url=(
|
410
|
+
'https://github.com/phasorpy/phasorpy-data/raw/main/figshare_28067108'
|
411
|
+
),
|
412
|
+
env=ENV,
|
413
|
+
registry={
|
414
|
+
'38_Hoechst_Golgi_Mito_Lyso_CellMask_mixture.lsm': (
|
415
|
+
'sha256:'
|
416
|
+
'092ac050edf55e26dcda8cba10122408c6f1b81d19accf07214385d6eebfcf3e'
|
417
|
+
),
|
418
|
+
'38_Hoechst_Golgi_Mito_Lyso_CellMask_mixture.lsm.zip': (
|
419
|
+
'sha256:'
|
420
|
+
'19298d12b16a58c1de3f532398c154d89df3f2286a1a6ee38a29f1fbefac78fc'
|
421
|
+
),
|
422
|
+
'40x800fov19LP500p30_4dyes_a1_$CG0T_ch1_h1_h2.R64': (
|
423
|
+
'sha256:'
|
424
|
+
'ad1bae8c3624eecb8927283e333ab5ea3fb864d6c5bb0f155da83c7a8aa40df3'
|
425
|
+
),
|
426
|
+
'40x800fov19LP500p30_AcO_a4_$CG0T_ch1_h1_h2.R64': (
|
427
|
+
'sha256:'
|
428
|
+
'd1de46652fbed0626ae6ad6334c41baafb0a5ae9e0e15e49221eb540a666d7e7'
|
429
|
+
),
|
430
|
+
'40x800fov19LP500p30_EtBr_a5_$CG0T_ch1_h1_h2.R64': (
|
431
|
+
'sha256:'
|
432
|
+
'9f4dd2d328877d2b18e064a3fb20d2a5318c833caa5a3cea15bafbf8df5d588a'
|
433
|
+
),
|
434
|
+
'40x800fov19LP500p30_NucB_a6_$CG0T_ch1_h1_h2.R64': (
|
435
|
+
'sha256:'
|
436
|
+
'74e378ddae84f6532d7ac05f8639feb42541eecb278c842e9a18565c201242f8'
|
437
|
+
),
|
438
|
+
'40x800fov19LP500p30_RoseBx100_a1_$CG0T_ch1_h1_h2.R64': (
|
439
|
+
'sha256:'
|
440
|
+
'898e0e7e96f8b6c2ee83940f94026dd9006e6fc46bb7e56c62dd22855079e279'
|
441
|
+
),
|
442
|
+
'Coumarin6.txt': (
|
443
|
+
'sha256:'
|
444
|
+
'6a3ae0f886b512c26cea8bc4b4cd9027ee8d4b7dd437a1eeb9621947e19c3c88'
|
445
|
+
),
|
446
|
+
'Hoechst_Lyso_Golgi_MitoTracker_CellMask.csv': (
|
447
|
+
'sha256:'
|
448
|
+
'1d000ae6268e6d290ab1cfdf2d31d840f27183cba75b380f116e1049696bb3a4'
|
449
|
+
),
|
450
|
+
'Mosaic04_10x3_FOV600_z95_32A1_t06_uncalibrated.ref': (
|
451
|
+
'sha256:'
|
452
|
+
'3c23ca9a21a3ef762765fc81591dd0cf9bdaf3e77fa4faa3bf60da69e6ab1127'
|
453
|
+
),
|
454
|
+
'Mosaic04_10x3_FOV600_z95_32A1_t06_uncalibrated.ref.zip': (
|
455
|
+
'sha256:'
|
456
|
+
'001a472d81b3d348ac4680c73de877ee809c2f229f882ef015225e208a7273fb'
|
457
|
+
),
|
458
|
+
},
|
459
|
+
)
|
460
|
+
|
400
461
|
FIGSHARE_22336594 = pooch.create(
|
401
462
|
path=pooch.os_cache('phasorpy'),
|
402
463
|
base_url=(
|
@@ -447,6 +508,34 @@ FIGSHARE_22336594_EXPORTED = pooch.create(
|
|
447
508
|
},
|
448
509
|
)
|
449
510
|
|
511
|
+
ZENODO_16894639 = pooch.create(
|
512
|
+
path=pooch.os_cache('phasorpy'),
|
513
|
+
base_url=(
|
514
|
+
'https://github.com/phasorpy/phasorpy-data/raw/main/zenodo_16894639'
|
515
|
+
if DATA_ON_GITHUB
|
516
|
+
else 'doi:10.5281/zenodo.16894639'
|
517
|
+
),
|
518
|
+
env=ENV,
|
519
|
+
registry={
|
520
|
+
'04 NIH3T3LAURDAN8meanspectra.lsm': (
|
521
|
+
'sha256:'
|
522
|
+
'27173be5b57a1a0f40ad6e89df1fd1d6d20bdd1e0a80e469acb47cf0bc103a1c'
|
523
|
+
),
|
524
|
+
'04NIH3T3_LAURDAN_000$CC0Z.fbd': (
|
525
|
+
'sha256:'
|
526
|
+
'9c8e7d79ef6ce4cce7366c843d34f5b4544f4123fe88307b8df5954a1fe4a799'
|
527
|
+
),
|
528
|
+
'cumarinech1_780LAURDAN_000$CC0Z.fbd': (
|
529
|
+
'sha256:'
|
530
|
+
'1b7b513680973c79df697b9cefdf2104f5d32346e24c9071336f76a7b82e9313'
|
531
|
+
),
|
532
|
+
'cumarinech2_780LAURDAN_000$CC0Z.fbd': (
|
533
|
+
'sha256:'
|
534
|
+
'5c9cf9694652cc9c344e67b5650fd49683fa7fdcec39e56ccbf0bdd2f7dadf15'
|
535
|
+
),
|
536
|
+
},
|
537
|
+
)
|
538
|
+
|
450
539
|
MISC = pooch.create(
|
451
540
|
path=pooch.os_cache('phasorpy'),
|
452
541
|
base_url='https://github.com/phasorpy/phasorpy-data/raw/main/misc',
|
@@ -469,11 +558,18 @@ REPOSITORIES: dict[str, pooch.Pooch] = {
|
|
469
558
|
'zenodo-14976703': ZENODO_14976703,
|
470
559
|
'convallaria-fbd': CONVALLARIA_FBD,
|
471
560
|
'flimlabs': FLIMLABS,
|
561
|
+
'figshare_28067108': FIGSHARE_28067108,
|
472
562
|
'figshare_22336594': FIGSHARE_22336594,
|
473
563
|
'figshare_22336594_exported': FIGSHARE_22336594_EXPORTED,
|
564
|
+
'zenodo-16894639': ZENODO_16894639,
|
474
565
|
'misc': MISC,
|
475
566
|
}
|
476
|
-
"""Pooch
|
567
|
+
"""Dictionary mapping repository names to Pooch repository objects.
|
568
|
+
|
569
|
+
Each repository provides access to a specific collection of sample data files
|
570
|
+
that can be fetched using the :py:func:`fetch` function.
|
571
|
+
|
572
|
+
"""
|
477
573
|
|
478
574
|
|
479
575
|
def fetch(
|
@@ -489,8 +585,15 @@ def fetch(
|
|
489
585
|
|
490
586
|
Parameters
|
491
587
|
----------
|
492
|
-
*args : str
|
588
|
+
*args : str, iterable of str, or pooch.Pooch
|
493
589
|
Name(s) of file(s) or repositories to fetch from local storage.
|
590
|
+
Can be:
|
591
|
+
|
592
|
+
- File names (for example, 'simfcs.r64')
|
593
|
+
- Repository names (for example, 'tests', 'flute')
|
594
|
+
- Pooch repository objects
|
595
|
+
- Iterables of the above
|
596
|
+
|
494
597
|
If omitted, return files in all repositories.
|
495
598
|
extract_dir : str or None, optional
|
496
599
|
Path, relative to cache location, where ZIP files will be unpacked.
|
@@ -504,6 +607,13 @@ def fetch(
|
|
504
607
|
-------
|
505
608
|
str or tuple of str
|
506
609
|
Absolute path(s) of file(s) in local storage.
|
610
|
+
Returns a single string if only one file and `return_scalar=True`,
|
611
|
+
otherwise returns a tuple of strings.
|
612
|
+
|
613
|
+
Raises
|
614
|
+
------
|
615
|
+
ValueError
|
616
|
+
If specified file is not found in any repository.
|
507
617
|
|
508
618
|
Examples
|
509
619
|
--------
|
phasorpy/experimental.py
CHANGED
@@ -68,7 +68,6 @@ def anscombe_transform(
|
|
68
68
|
|
69
69
|
References
|
70
70
|
----------
|
71
|
-
|
72
71
|
.. [1] Anscombe FJ.
|
73
72
|
`The transformation of Poisson, binomial and negative-binomial data
|
74
73
|
<https://doi.org/10.2307/2332343>`_.
|
@@ -124,19 +123,18 @@ def anscombe_transform_inverse(
|
|
124
123
|
x = 1/4 \cdot z^2
|
125
124
|
+ 1/4 \cdot \sqrt{3/2} \cdot z^{-1}
|
126
125
|
- 11/8 \cdot z^{-2}
|
127
|
-
+ 5/8 \cdot \sqrt
|
126
|
+
+ 5/8 \cdot \sqrt{3/2} \cdot z^{-3}
|
128
127
|
- 1/8
|
129
128
|
|
130
129
|
References
|
131
130
|
----------
|
132
|
-
|
133
131
|
.. [2] Makitalo M, and Foi A.
|
134
132
|
`A closed-form approximation of the exact unbiased inverse of the
|
135
133
|
Anscombe variance-stabilizing transformation
|
136
134
|
<https://doi.org/10.1109/TIP.2011.2121085>`_.
|
137
|
-
*IEEE Trans Image Process*, 20(9): 2697-8 (2011)
|
135
|
+
*IEEE Trans Image Process*, 20(9): 2697-8 (2011)
|
138
136
|
|
139
|
-
.. [3] Makitalo M, and Foi A
|
137
|
+
.. [3] Makitalo M, and Foi A.
|
140
138
|
`Optimal inversion of the generalized Anscombe transformation for
|
141
139
|
Poisson-Gaussian noise
|
142
140
|
<https://doi.org/10.1109/TIP.2012.2202675>`_,
|
@@ -186,7 +184,7 @@ def spectral_vector_denoise(
|
|
186
184
|
Spectral vector.
|
187
185
|
For example, phasor coordinates, PCA projected phasor coordinates,
|
188
186
|
or Chebyshev coefficients.
|
189
|
-
Must be of same shape as `signal` with `axis` removed and axis
|
187
|
+
Must be of the same shape as `signal` with `axis` removed and an axis
|
190
188
|
containing spectral space appended.
|
191
189
|
If None (default), phasor coordinates are calculated at specified
|
192
190
|
`harmonic`.
|
@@ -204,10 +202,11 @@ def spectral_vector_denoise(
|
|
204
202
|
sigma : float, default: 0.05
|
205
203
|
Width of Gaussian filter in spectral vector space.
|
206
204
|
Weighted averages are calculated using the spectra of signal items
|
207
|
-
within
|
205
|
+
within a spectral vector Euclidean distance of `3 * sigma` and
|
208
206
|
intensity above `vmin`.
|
209
207
|
vmin : float, optional
|
210
|
-
Signal intensity along `axis` below which
|
208
|
+
Signal intensity along `axis` below which spectra are excluded from
|
209
|
+
denoising.
|
211
210
|
dtype : dtype_like, optional
|
212
211
|
Data type of output arrays. Either float32 or float64.
|
213
212
|
The default is float64 unless the `signal` is float32.
|
@@ -225,7 +224,6 @@ def spectral_vector_denoise(
|
|
225
224
|
|
226
225
|
References
|
227
226
|
----------
|
228
|
-
|
229
227
|
.. [4] Harman RC, Lang RT, Kercher EM, Leven P, and Spring BQ.
|
230
228
|
`Denoising multiplexed microscopy images in n-dimensional spectral space
|
231
229
|
<https://doi.org/10.1364/BOE.463979>`_.
|
@@ -306,7 +304,7 @@ def spectral_vector_denoise(
|
|
306
304
|
denoised, integrated, signal, spectral_vector, sigma, vmin, num_threads
|
307
305
|
)
|
308
306
|
|
309
|
-
denoised = denoised.reshape(shape)
|
307
|
+
denoised = denoised.reshape(shape) # type: ignore[assignment]
|
310
308
|
if axis != -1:
|
311
309
|
denoised = numpy.moveaxis(denoised, -1, axis)
|
312
310
|
return denoised
|
phasorpy/io/__init__.py
CHANGED
@@ -8,6 +8,7 @@ The ``phasorpy.io`` module provides functions to:
|
|
8
8
|
- :py:func:`signal_from_lif` - Leica LIF and XLEF
|
9
9
|
- :py:func:`signal_from_lsm` - Zeiss LSM
|
10
10
|
- :py:func:`signal_from_ptu` - PicoQuant PTU
|
11
|
+
- :py:func:`signal_from_pqbin` - PicoQuant BIN
|
11
12
|
- :py:func:`signal_from_sdt` - Becker & Hickl SDT
|
12
13
|
- :py:func:`signal_from_fbd` - FLIMbox FBD
|
13
14
|
- :py:func:`signal_from_flimlabs_json` - FLIM LABS JSON
|
phasorpy/io/_flimlabs.py
CHANGED
@@ -67,10 +67,13 @@ def phasor_from_flimlabs_json(
|
|
67
67
|
|
68
68
|
- ``'dims'`` (tuple of str):
|
69
69
|
:ref:`Axes codes <axes>` for `mean` image dimensions.
|
70
|
-
- ``'
|
71
|
-
|
70
|
+
- ``'samples'`` (int):
|
71
|
+
Number of time bins (always 256).
|
72
|
+
- ``'harmonic'`` (int or list of int):
|
73
|
+
Harmonic(s) of `real` and `imag`.
|
74
|
+
Single int if one harmonic, list if multiple harmonics.
|
72
75
|
- ``'frequency'`` (float):
|
73
|
-
|
76
|
+
Laser repetition frequency in MHz.
|
74
77
|
- ``'flimlabs_header'`` (dict):
|
75
78
|
FLIM LABS file header.
|
76
79
|
|
@@ -231,27 +234,34 @@ def signal_from_flimlabs_json(
|
|
231
234
|
Index of channel to return.
|
232
235
|
By default, return the first channel.
|
233
236
|
If None, return all channels.
|
234
|
-
dtype :
|
237
|
+
dtype : dtype_like, optional, default: uint16
|
235
238
|
Unsigned integer type of TCSPC histogram.
|
236
239
|
Increase the bit-depth for high photon counts.
|
237
240
|
|
238
241
|
Returns
|
239
242
|
-------
|
240
243
|
xarray.DataArray
|
241
|
-
TCSPC histogram with :ref:`axes codes <axes>`
|
242
|
-
|
244
|
+
TCSPC histogram with :ref:`axes codes <axes>` depending on
|
245
|
+
`channel` parameter:
|
246
|
+
|
247
|
+
- Single channel: axes ``'YXH'``
|
248
|
+
- Multiple channels: axes ``'CYXH'``
|
249
|
+
|
250
|
+
Type specified by ``dtype`` parameter.
|
243
251
|
|
244
252
|
- ``coords['H']``: delay-times of histogram bins in ns.
|
253
|
+
- ``coords['C']``: channel indices (if multiple channels).
|
245
254
|
- ``attrs['frequency']``: laser repetition frequency in MHz.
|
246
255
|
- ``attrs['flimlabs_header']``: FLIM LABS file header.
|
247
256
|
|
248
257
|
Raises
|
249
258
|
------
|
250
259
|
ValueError
|
251
|
-
|
252
|
-
|
260
|
+
If file is not a valid JSON file.
|
261
|
+
If file is not a FLIM LABS JSON file containing TCSPC histogram.
|
262
|
+
If `dtype` is not an unsigned integer type.
|
253
263
|
IndexError
|
254
|
-
|
264
|
+
If `channel` is out of range.
|
255
265
|
|
256
266
|
See Also
|
257
267
|
--------
|
@@ -271,7 +281,7 @@ def signal_from_flimlabs_json(
|
|
271
281
|
>>> signal.coords['H'].data
|
272
282
|
array(...)
|
273
283
|
>>> signal.attrs['frequency'] # doctest: +NUMBER
|
274
|
-
40.
|
284
|
+
40.0
|
275
285
|
|
276
286
|
"""
|
277
287
|
with open(filename, 'rb') as fh:
|
phasorpy/io/_leica.py
CHANGED
@@ -140,6 +140,8 @@ def lifetime_from_lif(
|
|
140
140
|
|
141
141
|
Leica image files may contain fluorescence lifetime images and metadata
|
142
142
|
from the analysis of FLIM measurements.
|
143
|
+
The lifetimes are average photon arrival times ("Fast FLIM") according to
|
144
|
+
the LAS X FLIM/FCS documentation.
|
143
145
|
|
144
146
|
Parameters
|
145
147
|
----------
|
@@ -151,7 +153,7 @@ def lifetime_from_lif(
|
|
151
153
|
Returns
|
152
154
|
-------
|
153
155
|
lifetime : ndarray
|
154
|
-
|
156
|
+
Fast FLIM lifetime image in ns.
|
155
157
|
intensity : ndarray
|
156
158
|
Fluorescence intensity image.
|
157
159
|
stddev : ndarray
|
phasorpy/io/_ometiff.py
CHANGED
@@ -81,15 +81,14 @@ def phasor_to_ometiff(
|
|
81
81
|
harmonic : int or sequence of int, optional
|
82
82
|
Harmonics present in the first dimension of `real` and `imag`, if any.
|
83
83
|
Write to image series named 'Phasor harmonic'.
|
84
|
-
|
85
|
-
one.
|
84
|
+
Only needed if harmonics are not starting at and increasing by one.
|
86
85
|
dims : sequence of str, optional
|
87
86
|
Character codes for `mean` image dimensions.
|
88
87
|
By default, the last dimensions are assumed to be 'TZCYX'.
|
89
88
|
If harmonics are present in `real` and `imag`, an "other" (``Q``)
|
90
89
|
dimension is prepended to axes for those arrays.
|
91
90
|
Refer to the OME-TIFF model for allowed axes and their order.
|
92
|
-
dtype :
|
91
|
+
dtype : dtype_like, optional
|
93
92
|
Floating point data type used to store phasor coordinates.
|
94
93
|
The default is ``float32``, which has 6 digits of precision
|
95
94
|
and maximizes compatibility with other software.
|