nanoobjectdetection 2.0.0__tar.gz → 2.1.1__tar.gz
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.
- {nanoobjectdetection-2.0.0 → nanoobjectdetection-2.1.1}/PKG-INFO +1 -1
- {nanoobjectdetection-2.0.0 → nanoobjectdetection-2.1.1}/nanoobjectdetection/localization.py +40 -11
- {nanoobjectdetection-2.0.0 → nanoobjectdetection-2.1.1}/nanoobjectdetection/pipeline.py +5 -1
- {nanoobjectdetection-2.0.0 → nanoobjectdetection-2.1.1}/nanoobjectdetection.egg-info/PKG-INFO +1 -1
- {nanoobjectdetection-2.0.0 → nanoobjectdetection-2.1.1}/nanoobjectdetection.egg-info/SOURCES.txt +1 -2
- nanoobjectdetection-2.1.1/nanoobjectdetection.egg-info/top_level.txt +1 -0
- {nanoobjectdetection-2.0.0 → nanoobjectdetection-2.1.1}/pyproject.toml +1 -1
- nanoobjectdetection-2.0.0/nanoobjectdetection.egg-info/top_level.txt +0 -2
- nanoobjectdetection-2.0.0/nanoobjectdetection_2_0/__init__.py +0 -30
- {nanoobjectdetection-2.0.0 → nanoobjectdetection-2.1.1}/MANIFEST.in +0 -0
- {nanoobjectdetection-2.0.0 → nanoobjectdetection-2.1.1}/README.md +0 -0
- {nanoobjectdetection-2.0.0 → nanoobjectdetection-2.1.1}/nanoobjectdetection/__init__.py +0 -0
- {nanoobjectdetection-2.0.0 → nanoobjectdetection-2.1.1}/nanoobjectdetection/__main__.py +0 -0
- {nanoobjectdetection-2.0.0 → nanoobjectdetection-2.1.1}/nanoobjectdetection/application.py +0 -0
- {nanoobjectdetection-2.0.0 → nanoobjectdetection-2.1.1}/nanoobjectdetection/auto_parameters.py +0 -0
- {nanoobjectdetection-2.0.0 → nanoobjectdetection-2.1.1}/nanoobjectdetection/calibration.py +0 -0
- {nanoobjectdetection-2.0.0 → nanoobjectdetection-2.1.1}/nanoobjectdetection/config.py +0 -0
- {nanoobjectdetection-2.0.0 → nanoobjectdetection-2.1.1}/nanoobjectdetection/drift.py +0 -0
- {nanoobjectdetection-2.0.0 → nanoobjectdetection-2.1.1}/nanoobjectdetection/gpu.py +0 -0
- {nanoobjectdetection-2.0.0 → nanoobjectdetection-2.1.1}/nanoobjectdetection/hindrance.py +0 -0
- {nanoobjectdetection-2.0.0 → nanoobjectdetection-2.1.1}/nanoobjectdetection/legacy_config.py +0 -0
- {nanoobjectdetection-2.0.0 → nanoobjectdetection-2.1.1}/nanoobjectdetection/legacy_outputs.py +0 -0
- {nanoobjectdetection-2.0.0 → nanoobjectdetection-2.1.1}/nanoobjectdetection/msd.py +0 -0
- {nanoobjectdetection-2.0.0 → nanoobjectdetection-2.1.1}/nanoobjectdetection/plotting.py +0 -0
- {nanoobjectdetection-2.0.0 → nanoobjectdetection-2.1.1}/nanoobjectdetection/preprocessing.py +0 -0
- {nanoobjectdetection-2.0.0 → nanoobjectdetection-2.1.1}/nanoobjectdetection/progress.py +0 -0
- {nanoobjectdetection-2.0.0 → nanoobjectdetection-2.1.1}/nanoobjectdetection/quality.py +0 -0
- {nanoobjectdetection-2.0.0 → nanoobjectdetection-2.1.1}/nanoobjectdetection/statistics.py +0 -0
- {nanoobjectdetection-2.0.0 → nanoobjectdetection-2.1.1}/nanoobjectdetection/stitching.py +0 -0
- {nanoobjectdetection-2.0.0 → nanoobjectdetection-2.1.1}/nanoobjectdetection/storage.py +0 -0
- {nanoobjectdetection-2.0.0 → nanoobjectdetection-2.1.1}/nanoobjectdetection/synthetic.py +0 -0
- {nanoobjectdetection-2.0.0 → nanoobjectdetection-2.1.1}/nanoobjectdetection/tracking.py +0 -0
- {nanoobjectdetection-2.0.0 → nanoobjectdetection-2.1.1}/nanoobjectdetection/trajectory_processing.py +0 -0
- {nanoobjectdetection-2.0.0 → nanoobjectdetection-2.1.1}/nanoobjectdetection/ultra_uniform.py +0 -0
- {nanoobjectdetection-2.0.0 → nanoobjectdetection-2.1.1}/nanoobjectdetection.egg-info/dependency_links.txt +0 -0
- {nanoobjectdetection-2.0.0 → nanoobjectdetection-2.1.1}/nanoobjectdetection.egg-info/entry_points.txt +0 -0
- {nanoobjectdetection-2.0.0 → nanoobjectdetection-2.1.1}/nanoobjectdetection.egg-info/requires.txt +0 -0
- {nanoobjectdetection-2.0.0 → nanoobjectdetection-2.1.1}/setup.cfg +0 -0
|
@@ -6,21 +6,41 @@ import pandas as pd
|
|
|
6
6
|
import numpy as np
|
|
7
7
|
import os
|
|
8
8
|
import sys
|
|
9
|
+
import warnings
|
|
9
10
|
from concurrent.futures import ProcessPoolExecutor
|
|
10
11
|
|
|
11
|
-
|
|
12
|
+
|
|
13
|
+
def _locate_frame(args) -> tuple[pd.DataFrame, bool]:
|
|
12
14
|
import trackpy as tp
|
|
13
15
|
|
|
14
16
|
frame, diameter, minmass, separation, percentile, preprocess = args
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
17
|
+
with warnings.catch_warnings(record=True) as caught:
|
|
18
|
+
warnings.simplefilter("always")
|
|
19
|
+
found = tp.locate(
|
|
20
|
+
frame,
|
|
21
|
+
diameter,
|
|
22
|
+
minmass=minmass,
|
|
23
|
+
separation=separation,
|
|
24
|
+
percentile=percentile,
|
|
25
|
+
preprocess=preprocess,
|
|
26
|
+
engine="python",
|
|
27
|
+
)
|
|
28
|
+
|
|
29
|
+
black_image_warning = False
|
|
30
|
+
for warning in caught:
|
|
31
|
+
if (
|
|
32
|
+
warning.category is UserWarning
|
|
33
|
+
and str(warning.message) == "Image is completely black."
|
|
34
|
+
):
|
|
35
|
+
black_image_warning = True
|
|
36
|
+
else:
|
|
37
|
+
warnings.warn_explicit(
|
|
38
|
+
warning.message,
|
|
39
|
+
warning.category,
|
|
40
|
+
warning.filename,
|
|
41
|
+
warning.lineno,
|
|
42
|
+
)
|
|
43
|
+
return found, black_image_warning
|
|
24
44
|
|
|
25
45
|
|
|
26
46
|
def locate(
|
|
@@ -62,8 +82,17 @@ def locate(
|
|
|
62
82
|
results = list(pool.map(_locate_frame, jobs, chunksize=batch))
|
|
63
83
|
else:
|
|
64
84
|
results = [_locate_frame(job) for job in jobs]
|
|
85
|
+
black_frames = sum(is_black for _, is_black in results)
|
|
86
|
+
if black_frames:
|
|
87
|
+
warnings.warn(
|
|
88
|
+
f"Trackpy found {black_frames} completely black image frame(s). "
|
|
89
|
+
"If using 8-bit processing, try switching to 16-bit processing. "
|
|
90
|
+
"The exposure may also have been too low.",
|
|
91
|
+
UserWarning,
|
|
92
|
+
stacklevel=2,
|
|
93
|
+
)
|
|
65
94
|
detections = []
|
|
66
|
-
for frame_number, found in enumerate(results):
|
|
95
|
+
for frame_number, (found, _) in enumerate(results):
|
|
67
96
|
if not found.empty:
|
|
68
97
|
found = found.copy()
|
|
69
98
|
found["frame"] = frame_number
|
|
@@ -546,7 +546,11 @@ class AnalysisPipeline:
|
|
|
546
546
|
)
|
|
547
547
|
maximum = max(maximum, float(np.max(np.maximum(processed, 0.0))))
|
|
548
548
|
if maximum <= 0:
|
|
549
|
-
raise RuntimeError(
|
|
549
|
+
raise RuntimeError(
|
|
550
|
+
"Processed image stack contains no positive intensity; the images "
|
|
551
|
+
"appear completely black. If using 8-bit processing, try switching "
|
|
552
|
+
"to 16-bit processing. The exposure may also have been too low."
|
|
553
|
+
)
|
|
550
554
|
return maximum
|
|
551
555
|
|
|
552
556
|
@property
|
{nanoobjectdetection-2.0.0 → nanoobjectdetection-2.1.1}/nanoobjectdetection.egg-info/SOURCES.txt
RENAMED
|
@@ -31,5 +31,4 @@ nanoobjectdetection.egg-info/SOURCES.txt
|
|
|
31
31
|
nanoobjectdetection.egg-info/dependency_links.txt
|
|
32
32
|
nanoobjectdetection.egg-info/entry_points.txt
|
|
33
33
|
nanoobjectdetection.egg-info/requires.txt
|
|
34
|
-
nanoobjectdetection.egg-info/top_level.txt
|
|
35
|
-
nanoobjectdetection_2_0/__init__.py
|
|
34
|
+
nanoobjectdetection.egg-info/top_level.txt
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
nanoobjectdetection
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
"""Backward-compatibility module forwarding to nanoobjectdetection."""
|
|
2
|
-
|
|
3
|
-
import sys
|
|
4
|
-
import nanoobjectdetection
|
|
5
|
-
|
|
6
|
-
# Forward package attributes
|
|
7
|
-
__all__ = nanoobjectdetection.__all__
|
|
8
|
-
__version__ = nanoobjectdetection.__version__
|
|
9
|
-
|
|
10
|
-
for name in __all__:
|
|
11
|
-
globals()[name] = getattr(nanoobjectdetection, name)
|
|
12
|
-
|
|
13
|
-
# Ensure submodules imported via `from nanoobjectdetection_2_0.submodule import ...` work
|
|
14
|
-
import importlib
|
|
15
|
-
|
|
16
|
-
class _CompatibilityFinder:
|
|
17
|
-
"""Redirects imports from nanoobjectdetection_2_0 to nanoobjectdetection."""
|
|
18
|
-
@classmethod
|
|
19
|
-
def find_spec(cls, fullname, path=None, target=None):
|
|
20
|
-
if fullname.startswith("nanoobjectdetection_2_0."):
|
|
21
|
-
submodule = fullname[len("nanoobjectdetection_2_0."):]
|
|
22
|
-
try:
|
|
23
|
-
real_module = importlib.import_module(f"nanoobjectdetection.{submodule}")
|
|
24
|
-
sys.modules[fullname] = real_module
|
|
25
|
-
return real_module.__spec__
|
|
26
|
-
except ImportError:
|
|
27
|
-
return None
|
|
28
|
-
return None
|
|
29
|
-
|
|
30
|
-
sys.meta_path.insert(0, _CompatibilityFinder)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{nanoobjectdetection-2.0.0 → nanoobjectdetection-2.1.1}/nanoobjectdetection/auto_parameters.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{nanoobjectdetection-2.0.0 → nanoobjectdetection-2.1.1}/nanoobjectdetection/legacy_config.py
RENAMED
|
File without changes
|
{nanoobjectdetection-2.0.0 → nanoobjectdetection-2.1.1}/nanoobjectdetection/legacy_outputs.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{nanoobjectdetection-2.0.0 → nanoobjectdetection-2.1.1}/nanoobjectdetection/preprocessing.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{nanoobjectdetection-2.0.0 → nanoobjectdetection-2.1.1}/nanoobjectdetection/trajectory_processing.py
RENAMED
|
File without changes
|
{nanoobjectdetection-2.0.0 → nanoobjectdetection-2.1.1}/nanoobjectdetection/ultra_uniform.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{nanoobjectdetection-2.0.0 → nanoobjectdetection-2.1.1}/nanoobjectdetection.egg-info/requires.txt
RENAMED
|
File without changes
|
|
File without changes
|