PyOPIA 2.16.5__tar.gz → 2.16.6__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.
- {pyopia-2.16.5 → pyopia-2.16.6}/PKG-INFO +1 -1
- pyopia-2.16.6/pyopia/__init__.py +1 -0
- {pyopia-2.16.5 → pyopia-2.16.6}/pyopia/instrument/holo.py +23 -11
- {pyopia-2.16.5 → pyopia-2.16.6}/pyopia/instrument/silcam.py +17 -6
- pyopia-2.16.5/pyopia/__init__.py +0 -1
- {pyopia-2.16.5 → pyopia-2.16.6}/.gitignore +0 -0
- {pyopia-2.16.5 → pyopia-2.16.6}/LICENSE +0 -0
- {pyopia-2.16.5 → pyopia-2.16.6}/README.md +0 -0
- {pyopia-2.16.5 → pyopia-2.16.6}/pyopia/auxillarydata.py +0 -0
- {pyopia-2.16.5 → pyopia-2.16.6}/pyopia/background.py +0 -0
- {pyopia-2.16.5 → pyopia-2.16.6}/pyopia/cf_metadata.json +0 -0
- {pyopia-2.16.5 → pyopia-2.16.6}/pyopia/classify.py +0 -0
- {pyopia-2.16.5 → pyopia-2.16.6}/pyopia/classify_torch.py +0 -0
- {pyopia-2.16.5 → pyopia-2.16.6}/pyopia/cli.py +0 -0
- {pyopia-2.16.5 → pyopia-2.16.6}/pyopia/dataexport/__init__.py +0 -0
- {pyopia-2.16.5 → pyopia-2.16.6}/pyopia/dataexport/ecotaxa.py +0 -0
- {pyopia-2.16.5 → pyopia-2.16.6}/pyopia/exampledata.py +0 -0
- {pyopia-2.16.5 → pyopia-2.16.6}/pyopia/instrument/__init__.py +0 -0
- {pyopia-2.16.5 → pyopia-2.16.6}/pyopia/instrument/common.py +0 -0
- {pyopia-2.16.5 → pyopia-2.16.6}/pyopia/instrument/uvp.py +0 -0
- {pyopia-2.16.5 → pyopia-2.16.6}/pyopia/io.py +0 -0
- {pyopia-2.16.5 → pyopia-2.16.6}/pyopia/metadata.py +0 -0
- {pyopia-2.16.5 → pyopia-2.16.6}/pyopia/pipeline.py +0 -0
- {pyopia-2.16.5 → pyopia-2.16.6}/pyopia/plotting.py +0 -0
- {pyopia-2.16.5 → pyopia-2.16.6}/pyopia/process.py +0 -0
- {pyopia-2.16.5 → pyopia-2.16.6}/pyopia/realtime.py +0 -0
- {pyopia-2.16.5 → pyopia-2.16.6}/pyopia/simulator/__init__.py +0 -0
- {pyopia-2.16.5 → pyopia-2.16.6}/pyopia/simulator/silcam.py +0 -0
- {pyopia-2.16.5 → pyopia-2.16.6}/pyopia/statistics.py +0 -0
- {pyopia-2.16.5 → pyopia-2.16.6}/pyopia/tests/__init__.py +0 -0
- {pyopia-2.16.5 → pyopia-2.16.6}/pyopia/tests/test_auxillarydata.py +0 -0
- {pyopia-2.16.5 → pyopia-2.16.6}/pyopia/tests/test_classify.py +0 -0
- {pyopia-2.16.5 → pyopia-2.16.6}/pyopia/tests/test_io.py +0 -0
- {pyopia-2.16.5 → pyopia-2.16.6}/pyopia/tests/test_notebooks.py +0 -0
- {pyopia-2.16.5 → pyopia-2.16.6}/pyopia/tests/test_pipeline.py +0 -0
- {pyopia-2.16.5 → pyopia-2.16.6}/pyopia/tests/test_process.py +0 -0
- {pyopia-2.16.5 → pyopia-2.16.6}/pyopia/tests/test_realtime.py +0 -0
- {pyopia-2.16.5 → pyopia-2.16.6}/pyproject.toml +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "2.16.6"
|
|
@@ -21,7 +21,7 @@ from skimage.filters import sobel
|
|
|
21
21
|
from skimage.morphology import disk, erosion, dilation
|
|
22
22
|
import pyopia.process
|
|
23
23
|
import struct
|
|
24
|
-
from datetime import timedelta
|
|
24
|
+
from datetime import timedelta
|
|
25
25
|
from glob import glob
|
|
26
26
|
|
|
27
27
|
import logging
|
|
@@ -69,10 +69,10 @@ class Initial():
|
|
|
69
69
|
self.filename = raw_files[0]
|
|
70
70
|
imtmp = load_image(self.filename)
|
|
71
71
|
self.pixel_size = data['settings']['general']['pixel_size']
|
|
72
|
-
logger.info('Build kernel with pixel_size =
|
|
72
|
+
logger.info(f'Build kernel with pixel_size = {self.pixel_size} um')
|
|
73
73
|
kern = create_kernel(imtmp, self.pixel_size, self.wavelength, self.n, self.offset, self.minZ, self.maxZ, self.stepZ)
|
|
74
74
|
im_stack = np.zeros(np.shape(kern)).astype(np.float64)
|
|
75
|
-
logger.info('HoloInitial done'
|
|
75
|
+
logger.info('HoloInitial done')
|
|
76
76
|
data['kern'] = kern
|
|
77
77
|
data['im_stack'] = im_stack
|
|
78
78
|
return data
|
|
@@ -103,24 +103,27 @@ class Load():
|
|
|
103
103
|
filename : string
|
|
104
104
|
hologram filename (.pgm)
|
|
105
105
|
|
|
106
|
+
prefix_chars : int, optional
|
|
107
|
+
number of characters to ignore at start of filename when parsing timestamp,
|
|
108
|
+
by default 1 (e.g. to ignore 'D' in 'D20221101T120000.pgm')
|
|
109
|
+
|
|
106
110
|
Returns
|
|
107
111
|
-------
|
|
108
|
-
timestamp :
|
|
109
|
-
timestamp
|
|
110
|
-
imraw : np.
|
|
112
|
+
timestamp : pandas.Timestamp
|
|
113
|
+
timestamp from filename
|
|
114
|
+
imraw : np.array
|
|
111
115
|
hologram
|
|
112
116
|
'''
|
|
113
117
|
|
|
114
|
-
def __init__(self):
|
|
115
|
-
|
|
118
|
+
def __init__(self, prefix_chars=1):
|
|
119
|
+
self.prefix_chars = prefix_chars
|
|
116
120
|
|
|
117
121
|
def __call__(self, data):
|
|
118
122
|
logger.info(data['filename'])
|
|
119
123
|
try:
|
|
120
124
|
timestamp = read_lisst_holo_info(data['filename'])
|
|
121
125
|
except ValueError:
|
|
122
|
-
timestamp = pd.to_datetime(os.path.splitext(os.path.basename(data['filename']))[0][
|
|
123
|
-
logger.info(timestamp)
|
|
126
|
+
timestamp = pd.to_datetime(os.path.splitext(os.path.basename(data['filename']))[0][self.prefix_chars:])
|
|
124
127
|
im = load_image(data['filename'])
|
|
125
128
|
data['timestamp'] = timestamp
|
|
126
129
|
data['imraw'] = im
|
|
@@ -559,6 +562,16 @@ class MergeStats():
|
|
|
559
562
|
stack_rp = data['stack_rp']
|
|
560
563
|
stack_ifocus = data['stack_ifocus']
|
|
561
564
|
|
|
565
|
+
# If there are no particles in the image, then stats has one row of nans
|
|
566
|
+
# This means that variables created here just need allocating and returning
|
|
567
|
+
if len(stack_ifocus) == 0:
|
|
568
|
+
logger.debug(f"stack_ifocus is empty. Allocating nan to ifocus and z. Filename: {data['filename']}")
|
|
569
|
+
stats['ifocus'] = np.nan
|
|
570
|
+
stats['z'] = np.nan
|
|
571
|
+
stats['holo_filename'] = data['filename']
|
|
572
|
+
data['stats'] = stats
|
|
573
|
+
return data
|
|
574
|
+
|
|
562
575
|
bbox = np.empty((0, 4), int)
|
|
563
576
|
for rp in stack_rp:
|
|
564
577
|
bbox = np.append(bbox, [rp.bbox], axis=0)
|
|
@@ -603,7 +616,6 @@ def read_lisst_holo_info(filename):
|
|
|
603
616
|
filenum = int(filenum.rsplit('.', 1)[0])
|
|
604
617
|
timestamp = timestamp + timedelta(microseconds=filenum)
|
|
605
618
|
timestamp = timestamp[0]
|
|
606
|
-
logger.info(timestamp.strftime('D%Y%m%dT%H%M%S.%f'))
|
|
607
619
|
f.close()
|
|
608
620
|
|
|
609
621
|
return timestamp
|
|
@@ -14,21 +14,26 @@ from skimage.exposure import rescale_intensity
|
|
|
14
14
|
import skimage.io
|
|
15
15
|
|
|
16
16
|
|
|
17
|
-
def timestamp_from_filename(filename):
|
|
17
|
+
def timestamp_from_filename(filename, prefix_chars=1):
|
|
18
18
|
'''get a pandas timestamp from a silcam filename
|
|
19
19
|
|
|
20
20
|
Parameters
|
|
21
21
|
----------
|
|
22
|
-
filename
|
|
22
|
+
filename : string
|
|
23
|
+
silcam filename (.silc)
|
|
24
|
+
|
|
25
|
+
prefix_chars : int, optional
|
|
26
|
+
number of characters to ignore at start of filename when parsing timestamp,
|
|
27
|
+
by default 1 (e.g. to ignore 'D' in 'D20221101T120000.silc')
|
|
23
28
|
|
|
24
29
|
Returns
|
|
25
30
|
-------
|
|
26
|
-
timestamp:
|
|
31
|
+
timestamp : pandas.Timestamp
|
|
27
32
|
timestamp from pandas.to_datetime()
|
|
28
33
|
'''
|
|
29
34
|
|
|
30
35
|
# get the timestamp of the image (in this case from the filename)
|
|
31
|
-
timestamp = pd.to_datetime(os.path.splitext(os.path.basename(filename))[0][
|
|
36
|
+
timestamp = pd.to_datetime(os.path.splitext(os.path.basename(filename))[0][prefix_chars:])
|
|
32
37
|
return timestamp
|
|
33
38
|
|
|
34
39
|
|
|
@@ -222,6 +227,10 @@ class SilCamLoad():
|
|
|
222
227
|
image_format : str, optional
|
|
223
228
|
Image file format. Can be either 'infer', 'rgb8', 'bayer_rg8' or 'mono8', by default 'infer'.
|
|
224
229
|
|
|
230
|
+
prefix_chars : int, optional
|
|
231
|
+
number of characters to ignore at start of filename when parsing timestamp,
|
|
232
|
+
by default 1 (e.g. to ignore 'D' in 'D20221101T120000.silc')
|
|
233
|
+
|
|
225
234
|
Note
|
|
226
235
|
----
|
|
227
236
|
'infer' uses the file extension to determine the image format using the following convention:
|
|
@@ -240,7 +249,8 @@ class SilCamLoad():
|
|
|
240
249
|
:attr:`pyopia.pipeline.Data.img`
|
|
241
250
|
'''
|
|
242
251
|
|
|
243
|
-
def __init__(self, image_format='infer'):
|
|
252
|
+
def __init__(self, image_format='infer', prefix_chars=1):
|
|
253
|
+
self.prefix_chars = prefix_chars
|
|
244
254
|
self.image_format = image_format
|
|
245
255
|
self.extension_load = {'.silc': load_rgb8,
|
|
246
256
|
'.msilc': load_mono8,
|
|
@@ -250,7 +260,8 @@ class SilCamLoad():
|
|
|
250
260
|
'MONO8': load_mono8, 'BAYER_RG8': load_bayer_rgb8}
|
|
251
261
|
|
|
252
262
|
def __call__(self, data):
|
|
253
|
-
data['timestamp'] = timestamp_from_filename(data['filename']
|
|
263
|
+
data['timestamp'] = timestamp_from_filename(data['filename'],
|
|
264
|
+
prefix_chars=self.prefix_chars)
|
|
254
265
|
data['imraw'] = self.load_image(data['filename'])
|
|
255
266
|
return data
|
|
256
267
|
|
pyopia-2.16.5/pyopia/__init__.py
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = "2.16.5"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|