CellProfiler-nightly 5.0.0.dev332__py3-none-any.whl → 5.0.0.dev337__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.
- cellprofiler/_version.py +2 -2
- cellprofiler/modules/enhanceorsuppressfeatures.py +58 -280
- {cellprofiler_nightly-5.0.0.dev332.dist-info → cellprofiler_nightly-5.0.0.dev337.dist-info}/METADATA +1 -1
- {cellprofiler_nightly-5.0.0.dev332.dist-info → cellprofiler_nightly-5.0.0.dev337.dist-info}/RECORD +8 -8
- {cellprofiler_nightly-5.0.0.dev332.dist-info → cellprofiler_nightly-5.0.0.dev337.dist-info}/WHEEL +0 -0
- {cellprofiler_nightly-5.0.0.dev332.dist-info → cellprofiler_nightly-5.0.0.dev337.dist-info}/entry_points.txt +0 -0
- {cellprofiler_nightly-5.0.0.dev332.dist-info → cellprofiler_nightly-5.0.0.dev337.dist-info}/licenses/LICENSE +0 -0
- {cellprofiler_nightly-5.0.0.dev332.dist-info → cellprofiler_nightly-5.0.0.dev337.dist-info}/top_level.txt +0 -0
cellprofiler/_version.py
CHANGED
|
@@ -28,7 +28,7 @@ version_tuple: VERSION_TUPLE
|
|
|
28
28
|
commit_id: COMMIT_ID
|
|
29
29
|
__commit_id__: COMMIT_ID
|
|
30
30
|
|
|
31
|
-
__version__ = version = '5.0.0.
|
|
32
|
-
__version_tuple__ = version_tuple = (5, 0, 0, '
|
|
31
|
+
__version__ = version = '5.0.0.dev337'
|
|
32
|
+
__version_tuple__ = version_tuple = (5, 0, 0, 'dev337')
|
|
33
33
|
|
|
34
34
|
__commit_id__ = commit_id = None
|
|
@@ -20,13 +20,6 @@ YES YES YES
|
|
|
20
20
|
============ ============ ===============
|
|
21
21
|
"""
|
|
22
22
|
|
|
23
|
-
import centrosome.filter
|
|
24
|
-
import numpy
|
|
25
|
-
import scipy.ndimage
|
|
26
|
-
import skimage.exposure
|
|
27
|
-
import skimage.filters
|
|
28
|
-
import skimage.morphology
|
|
29
|
-
import skimage.transform
|
|
30
23
|
from cellprofiler_core.image import Image
|
|
31
24
|
from cellprofiler_core.module import ImageProcessing
|
|
32
25
|
from cellprofiler_core.setting import Binary
|
|
@@ -36,23 +29,8 @@ from cellprofiler_core.setting.text import Float
|
|
|
36
29
|
from cellprofiler_core.setting.text import Integer
|
|
37
30
|
|
|
38
31
|
from cellprofiler.modules import _help
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
SUPPRESS = "Suppress"
|
|
42
|
-
|
|
43
|
-
E_SPECKLES = "Speckles"
|
|
44
|
-
E_NEURITES = "Neurites"
|
|
45
|
-
E_DARK_HOLES = "Dark holes"
|
|
46
|
-
E_CIRCLES = "Circles"
|
|
47
|
-
E_TEXTURE = "Texture"
|
|
48
|
-
E_DIC = "DIC"
|
|
49
|
-
|
|
50
|
-
S_FAST = "Fast"
|
|
51
|
-
S_SLOW = "Slow"
|
|
52
|
-
|
|
53
|
-
N_GRADIENT = "Line structures"
|
|
54
|
-
N_TUBENESS = "Tubeness"
|
|
55
|
-
|
|
32
|
+
from cellprofiler_library.modules._enhanceorsuppressfeatures import enhance_or_suppress_features
|
|
33
|
+
from cellprofiler_library.opts.enhanceorsuppressfeatures import OperationMethod, EnhanceMethod, SpeckleAccuracy, NeuriteMethod
|
|
56
34
|
|
|
57
35
|
class EnhanceOrSuppressFeatures(ImageProcessing):
|
|
58
36
|
module_name = "EnhanceOrSuppressFeatures"
|
|
@@ -64,7 +42,7 @@ class EnhanceOrSuppressFeatures(ImageProcessing):
|
|
|
64
42
|
|
|
65
43
|
self.method = Choice(
|
|
66
44
|
"Select the operation",
|
|
67
|
-
[ENHANCE, SUPPRESS],
|
|
45
|
+
[OperationMethod.ENHANCE.value, OperationMethod.SUPPRESS.value],
|
|
68
46
|
doc="""\
|
|
69
47
|
Select whether you want to enhance or suppress the features you
|
|
70
48
|
designate.
|
|
@@ -73,13 +51,13 @@ designate.
|
|
|
73
51
|
of the features of interest.
|
|
74
52
|
- *{SUPPRESS}:* Produce an image with the features largely removed.
|
|
75
53
|
""".format(
|
|
76
|
-
**{"ENHANCE": ENHANCE, "SUPPRESS": SUPPRESS}
|
|
54
|
+
**{"ENHANCE": OperationMethod.ENHANCE.value, "SUPPRESS": OperationMethod.SUPPRESS.value}
|
|
77
55
|
),
|
|
78
56
|
)
|
|
79
57
|
|
|
80
58
|
self.enhance_method = Choice(
|
|
81
59
|
"Feature type",
|
|
82
|
-
[
|
|
60
|
+
[EnhanceMethod.SPECKLES.value, EnhanceMethod.NEURITES.value, EnhanceMethod.DARK_HOLES.value, EnhanceMethod.CIRCLES.value, EnhanceMethod.TEXTURE.value, EnhanceMethod.DIC.value],
|
|
83
61
|
doc="""\
|
|
84
62
|
*(Used only if "{ENHANCE}" is selected)*
|
|
85
63
|
|
|
@@ -129,15 +107,15 @@ This module can enhance several kinds of image features:
|
|
|
129
107
|
|
|
130
108
|
""".format(
|
|
131
109
|
**{
|
|
132
|
-
"E_CIRCLES":
|
|
133
|
-
"E_DARK_HOLES":
|
|
134
|
-
"E_DIC":
|
|
135
|
-
"N_GRADIENT":
|
|
136
|
-
"E_NEURITES":
|
|
137
|
-
"E_SPECKLES":
|
|
138
|
-
"E_TEXTURE":
|
|
139
|
-
"ENHANCE": ENHANCE,
|
|
140
|
-
"N_TUBENESS":
|
|
110
|
+
"E_CIRCLES": EnhanceMethod.CIRCLES.value,
|
|
111
|
+
"E_DARK_HOLES": EnhanceMethod.DARK_HOLES.value,
|
|
112
|
+
"E_DIC": EnhanceMethod.DIC.value,
|
|
113
|
+
"N_GRADIENT": NeuriteMethod.GRADIENT.value,
|
|
114
|
+
"E_NEURITES": EnhanceMethod.NEURITES.value,
|
|
115
|
+
"E_SPECKLES": EnhanceMethod.SPECKLES.value,
|
|
116
|
+
"E_TEXTURE": EnhanceMethod.TEXTURE.value,
|
|
117
|
+
"ENHANCE": OperationMethod.ENHANCE.value,
|
|
118
|
+
"N_TUBENESS": NeuriteMethod.TUBENESS.value,
|
|
141
119
|
}
|
|
142
120
|
),
|
|
143
121
|
)
|
|
@@ -157,9 +135,9 @@ used to calculate an appropriate filter size.
|
|
|
157
135
|
{HELP_ON_MEASURING_DISTANCES}
|
|
158
136
|
""".format(
|
|
159
137
|
**{
|
|
160
|
-
"E_CIRCLES":
|
|
161
|
-
"E_NEURITES":
|
|
162
|
-
"E_SPECKLES":
|
|
138
|
+
"E_CIRCLES": EnhanceMethod.CIRCLES.value,
|
|
139
|
+
"E_NEURITES": EnhanceMethod.NEURITES.value,
|
|
140
|
+
"E_SPECKLES": EnhanceMethod.SPECKLES.value,
|
|
163
141
|
"HELP_ON_MEASURING_DISTANCES": _help.HELP_ON_MEASURING_DISTANCES,
|
|
164
142
|
}
|
|
165
143
|
),
|
|
@@ -175,7 +153,7 @@ used to calculate an appropriate filter size.
|
|
|
175
153
|
The range of hole sizes to be enhanced. The algorithm will identify only
|
|
176
154
|
holes whose diameters fall between these two values.
|
|
177
155
|
""".format(
|
|
178
|
-
**{"E_DARK_HOLES":
|
|
156
|
+
**{"E_DARK_HOLES": EnhanceMethod.DARK_HOLES.value}
|
|
179
157
|
),
|
|
180
158
|
)
|
|
181
159
|
|
|
@@ -207,10 +185,10 @@ this is not recommended.
|
|
|
207
185
|
.. |image0| image:: {PROTIP_AVOID_ICON}
|
|
208
186
|
""".format(
|
|
209
187
|
**{
|
|
210
|
-
"E_DIC":
|
|
211
|
-
"E_NEURITES":
|
|
212
|
-
"E_TEXTURE":
|
|
213
|
-
"N_TUBENESS":
|
|
188
|
+
"E_DIC": EnhanceMethod.DIC.value,
|
|
189
|
+
"E_NEURITES": EnhanceMethod.NEURITES.value,
|
|
190
|
+
"E_TEXTURE": EnhanceMethod.TEXTURE.value,
|
|
191
|
+
"N_TUBENESS": NeuriteMethod.TUBENESS.value,
|
|
214
192
|
"PROTIP_AVOID_ICON": _help.PROTIP_AVOID_ICON,
|
|
215
193
|
}
|
|
216
194
|
),
|
|
@@ -229,7 +207,7 @@ run diagonally from lower left to upper right and the highlights appear
|
|
|
229
207
|
above the shadows, the shear angle is 45°. If the shadows appear on top,
|
|
230
208
|
the shear angle is 180° + 45° = 225°.
|
|
231
209
|
""".format(
|
|
232
|
-
**{"E_DIC":
|
|
210
|
+
**{"E_DIC": EnhanceMethod.DIC.value}
|
|
233
211
|
),
|
|
234
212
|
)
|
|
235
213
|
|
|
@@ -250,13 +228,13 @@ value, on the order of 1 - 1/diameter of your objects if the intensities
|
|
|
250
228
|
decrease toward the middle. Set the decay to a small value if there
|
|
251
229
|
appears to be a bias in the integration direction.
|
|
252
230
|
""".format(
|
|
253
|
-
**{"E_DIC":
|
|
231
|
+
**{"E_DIC": EnhanceMethod.DIC.value}
|
|
254
232
|
),
|
|
255
233
|
)
|
|
256
234
|
|
|
257
235
|
self.neurite_choice = Choice(
|
|
258
236
|
"Enhancement method",
|
|
259
|
-
[
|
|
237
|
+
[NeuriteMethod.TUBENESS.value, NeuriteMethod.GRADIENT.value],
|
|
260
238
|
doc="""\
|
|
261
239
|
*(Used only for the "{E_NEURITES}" method)*
|
|
262
240
|
|
|
@@ -282,16 +260,16 @@ Two methods can be used to enhance neurites:
|
|
|
282
260
|
.. _ImageJ Tubeness plugin: http://www.longair.net/edinburgh/imagej/tubeness/
|
|
283
261
|
""".format(
|
|
284
262
|
**{
|
|
285
|
-
"E_NEURITES":
|
|
286
|
-
"N_GRADIENT":
|
|
287
|
-
"N_TUBENESS":
|
|
263
|
+
"E_NEURITES": EnhanceMethod.NEURITES.value,
|
|
264
|
+
"N_GRADIENT": NeuriteMethod.GRADIENT.value,
|
|
265
|
+
"N_TUBENESS": NeuriteMethod.TUBENESS.value,
|
|
288
266
|
}
|
|
289
267
|
),
|
|
290
268
|
)
|
|
291
269
|
|
|
292
270
|
self.speckle_accuracy = Choice(
|
|
293
271
|
"Speed and accuracy",
|
|
294
|
-
choices=[
|
|
272
|
+
choices=[SpeckleAccuracy.FAST.value, SpeckleAccuracy.SLOW.value],
|
|
295
273
|
doc="""\
|
|
296
274
|
*(Used only for the "{E_SPECKLES}" method)*
|
|
297
275
|
|
|
@@ -301,7 +279,7 @@ Two methods can be used to enhance neurites:
|
|
|
301
279
|
(greater than 10 pixels) and need not be exactly circular.
|
|
302
280
|
- *{S_SLOW}:* Use for speckles of small radius.
|
|
303
281
|
""".format(
|
|
304
|
-
**{"E_SPECKLES":
|
|
282
|
+
**{"E_SPECKLES": EnhanceMethod.SPECKLES.value, "S_FAST": SpeckleAccuracy.FAST.value, "S_SLOW": SpeckleAccuracy.SLOW.value}
|
|
305
283
|
),
|
|
306
284
|
)
|
|
307
285
|
|
|
@@ -315,7 +293,7 @@ Two methods can be used to enhance neurites:
|
|
|
315
293
|
whole intensity range of the image (0-1). This can make
|
|
316
294
|
the output easier to display.
|
|
317
295
|
""".format(
|
|
318
|
-
**{"E_NEURITES":
|
|
296
|
+
**{"E_NEURITES": EnhanceMethod.NEURITES.value}
|
|
319
297
|
),
|
|
320
298
|
)
|
|
321
299
|
|
|
@@ -337,23 +315,23 @@ the output easier to display.
|
|
|
337
315
|
def visible_settings(self):
|
|
338
316
|
__settings__ = super(EnhanceOrSuppressFeatures, self).visible_settings()
|
|
339
317
|
__settings__ += [self.method]
|
|
340
|
-
if self.method == ENHANCE:
|
|
318
|
+
if self.method == OperationMethod.ENHANCE.value:
|
|
341
319
|
__settings__ += [self.enhance_method]
|
|
342
320
|
self.object_size.min_value = 2
|
|
343
|
-
if self.enhance_method ==
|
|
321
|
+
if self.enhance_method == EnhanceMethod.DARK_HOLES.value:
|
|
344
322
|
__settings__ += [self.hole_size]
|
|
345
|
-
elif self.enhance_method ==
|
|
323
|
+
elif self.enhance_method == EnhanceMethod.TEXTURE.value:
|
|
346
324
|
__settings__ += [self.smoothing]
|
|
347
|
-
elif self.enhance_method ==
|
|
325
|
+
elif self.enhance_method == EnhanceMethod.DIC.value:
|
|
348
326
|
__settings__ += [self.smoothing, self.angle, self.decay]
|
|
349
|
-
elif self.enhance_method ==
|
|
327
|
+
elif self.enhance_method == EnhanceMethod.NEURITES.value:
|
|
350
328
|
__settings__ += [self.neurite_choice]
|
|
351
|
-
if self.neurite_choice ==
|
|
329
|
+
if self.neurite_choice == NeuriteMethod.GRADIENT.value:
|
|
352
330
|
__settings__ += [self.object_size]
|
|
353
331
|
else:
|
|
354
332
|
__settings__ += [self.smoothing]
|
|
355
333
|
__settings__ += [self.wants_rescale]
|
|
356
|
-
elif self.enhance_method ==
|
|
334
|
+
elif self.enhance_method == EnhanceMethod.SPECKLES.value:
|
|
357
335
|
__settings__ += [self.object_size, self.speckle_accuracy]
|
|
358
336
|
self.object_size.min_value = 3
|
|
359
337
|
else:
|
|
@@ -361,43 +339,29 @@ the output easier to display.
|
|
|
361
339
|
else:
|
|
362
340
|
__settings__ += [self.object_size]
|
|
363
341
|
return __settings__
|
|
342
|
+
|
|
364
343
|
|
|
365
344
|
def run(self, workspace):
|
|
366
345
|
image = workspace.image_set.get_image(self.x_name.value, must_be_grayscale=True)
|
|
367
346
|
|
|
368
347
|
radius = self.object_size.value / 2
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
result = self.enhance_circles(image, radius)
|
|
387
|
-
elif self.enhance_method == E_TEXTURE:
|
|
388
|
-
result = self.enhance_texture(image, self.smoothing.value)
|
|
389
|
-
elif self.enhance_method == E_DIC:
|
|
390
|
-
result = self.enhance_dic(
|
|
391
|
-
image, self.angle.value, self.decay.value, self.smoothing.value
|
|
392
|
-
)
|
|
393
|
-
else:
|
|
394
|
-
raise NotImplementedError(
|
|
395
|
-
"Unimplemented enhance method: %s" % self.enhance_method.value
|
|
396
|
-
)
|
|
397
|
-
elif self.method == SUPPRESS:
|
|
398
|
-
result = self.suppress(image, radius)
|
|
399
|
-
else:
|
|
400
|
-
raise ValueError("Unknown filtering method: %s" % self.method)
|
|
348
|
+
im_pixel_data = image.pixel_data
|
|
349
|
+
im_mask = image.mask
|
|
350
|
+
im_volumetric = image.volumetric
|
|
351
|
+
im_spacing = image.spacing
|
|
352
|
+
method = self.method.value
|
|
353
|
+
enhance_method = self.enhance_method.value
|
|
354
|
+
speckle_accuracy = self.speckle_accuracy.value
|
|
355
|
+
neurite_choice = self.neurite_choice.value
|
|
356
|
+
neurite_rescale = self.wants_rescale.value
|
|
357
|
+
dark_hole_radius_min = self.hole_size.min
|
|
358
|
+
dark_hole_radius_max = self.hole_size.max
|
|
359
|
+
smoothing_value = self.smoothing.value
|
|
360
|
+
dic_angle = self.angle.value
|
|
361
|
+
dic_decay = self.decay.value
|
|
362
|
+
|
|
363
|
+
result = enhance_or_suppress_features(im_pixel_data, im_mask, im_volumetric, im_spacing, radius, method, enhance_method, speckle_accuracy, neurite_choice, neurite_rescale, dark_hole_radius_min, dark_hole_radius_max, smoothing_value, dic_angle, dic_decay)
|
|
364
|
+
|
|
401
365
|
|
|
402
366
|
result_image = Image(result, parent_image=image, dimensions=image.dimensions)
|
|
403
367
|
|
|
@@ -410,192 +374,6 @@ the output easier to display.
|
|
|
410
374
|
|
|
411
375
|
workspace.display_data.dimensions = image.dimensions
|
|
412
376
|
|
|
413
|
-
def __mask(self, pixel_data, mask):
|
|
414
|
-
data = numpy.zeros_like(pixel_data)
|
|
415
|
-
|
|
416
|
-
data[mask] = pixel_data[mask]
|
|
417
|
-
|
|
418
|
-
return data
|
|
419
|
-
|
|
420
|
-
def __unmask(self, data, pixel_data, mask):
|
|
421
|
-
data[~mask] = pixel_data[~mask]
|
|
422
|
-
|
|
423
|
-
return data
|
|
424
|
-
|
|
425
|
-
def __structuring_element(self, radius, volumetric):
|
|
426
|
-
if volumetric:
|
|
427
|
-
return skimage.morphology.ball(radius)
|
|
428
|
-
|
|
429
|
-
return skimage.morphology.disk(radius)
|
|
430
|
-
|
|
431
|
-
def enhance_speckles(self, image, radius, accuracy):
|
|
432
|
-
data = self.__mask(image.pixel_data, image.mask)
|
|
433
|
-
|
|
434
|
-
footprint = self.__structuring_element(radius, image.volumetric)
|
|
435
|
-
|
|
436
|
-
if accuracy == "Slow" or radius <= 3:
|
|
437
|
-
result = skimage.morphology.white_tophat(data, footprint=footprint)
|
|
438
|
-
else:
|
|
439
|
-
#
|
|
440
|
-
# white_tophat = img - opening
|
|
441
|
-
# = img - dilate(erode)
|
|
442
|
-
# = img - maximum_filter(minimum_filter)
|
|
443
|
-
minimum = scipy.ndimage.filters.minimum_filter(data, footprint=footprint)
|
|
444
|
-
|
|
445
|
-
maximum = scipy.ndimage.filters.maximum_filter(minimum, footprint=footprint)
|
|
446
|
-
|
|
447
|
-
result = data - maximum
|
|
448
|
-
|
|
449
|
-
return self.__unmask(result, image.pixel_data, image.mask)
|
|
450
|
-
|
|
451
|
-
def enhance_neurites(self, image, radius, method):
|
|
452
|
-
data = self.__mask(image.pixel_data, image.mask)
|
|
453
|
-
|
|
454
|
-
if method == N_GRADIENT:
|
|
455
|
-
# desired effect = img + white_tophat - black_tophat
|
|
456
|
-
footprint = self.__structuring_element(radius, image.volumetric)
|
|
457
|
-
|
|
458
|
-
white = skimage.morphology.white_tophat(data, footprint=footprint)
|
|
459
|
-
|
|
460
|
-
black = skimage.morphology.black_tophat(data, footprint=footprint)
|
|
461
|
-
|
|
462
|
-
result = data + white - black
|
|
463
|
-
|
|
464
|
-
result[result > 1] = 1
|
|
465
|
-
|
|
466
|
-
result[result < 0] = 0
|
|
467
|
-
else:
|
|
468
|
-
sigma = self.smoothing.value
|
|
469
|
-
|
|
470
|
-
smoothed = scipy.ndimage.gaussian_filter(
|
|
471
|
-
data, numpy.divide(sigma, image.spacing)
|
|
472
|
-
)
|
|
473
|
-
|
|
474
|
-
if image.volumetric:
|
|
475
|
-
result = numpy.zeros_like(smoothed)
|
|
476
|
-
|
|
477
|
-
for index, plane in enumerate(smoothed):
|
|
478
|
-
hessian = centrosome.filter.hessian(
|
|
479
|
-
plane, return_hessian=False, return_eigenvectors=False
|
|
480
|
-
)
|
|
481
|
-
|
|
482
|
-
result[index] = (
|
|
483
|
-
-hessian[:, :, 0] * (hessian[:, :, 0] < 0) * (sigma ** 2)
|
|
484
|
-
)
|
|
485
|
-
else:
|
|
486
|
-
hessian = centrosome.filter.hessian(
|
|
487
|
-
smoothed, return_hessian=False, return_eigenvectors=False
|
|
488
|
-
)
|
|
489
|
-
|
|
490
|
-
#
|
|
491
|
-
# The positive values are darker pixels with lighter
|
|
492
|
-
# neighbors. The original ImageJ code scales the result
|
|
493
|
-
# by sigma squared - I have a feeling this might be
|
|
494
|
-
# a first-order correction for e**(-2*sigma), possibly
|
|
495
|
-
# because the hessian is taken from one pixel away
|
|
496
|
-
# and the gradient is less as sigma gets larger.
|
|
497
|
-
result = -hessian[:, :, 0] * (hessian[:, :, 0] < 0) * (sigma ** 2)
|
|
498
|
-
|
|
499
|
-
return self.__unmask(result, image.pixel_data, image.mask)
|
|
500
|
-
|
|
501
|
-
def enhance_circles(self, image, radius):
|
|
502
|
-
data = self.__mask(image.pixel_data, image.mask)
|
|
503
|
-
|
|
504
|
-
if image.volumetric:
|
|
505
|
-
result = numpy.zeros_like(data)
|
|
506
|
-
|
|
507
|
-
for index, plane in enumerate(data):
|
|
508
|
-
result[index] = skimage.transform.hough_circle(plane, radius)[0]
|
|
509
|
-
else:
|
|
510
|
-
result = skimage.transform.hough_circle(data, radius)[0]
|
|
511
|
-
|
|
512
|
-
return self.__unmask(result, image.pixel_data, image.mask)
|
|
513
|
-
|
|
514
|
-
def enhance_texture(self, image, sigma):
|
|
515
|
-
mask = image.mask
|
|
516
|
-
|
|
517
|
-
data = self.__mask(image.pixel_data, mask)
|
|
518
|
-
|
|
519
|
-
gmask = skimage.filters.gaussian(
|
|
520
|
-
mask.astype(float), sigma, mode="constant"
|
|
521
|
-
)
|
|
522
|
-
|
|
523
|
-
img_mean = (
|
|
524
|
-
skimage.filters.gaussian(data, sigma, mode="constant")
|
|
525
|
-
/ gmask
|
|
526
|
-
)
|
|
527
|
-
|
|
528
|
-
img_squared = (
|
|
529
|
-
skimage.filters.gaussian(
|
|
530
|
-
data ** 2, sigma, mode="constant"
|
|
531
|
-
)
|
|
532
|
-
/ gmask
|
|
533
|
-
)
|
|
534
|
-
|
|
535
|
-
result = img_squared - img_mean ** 2
|
|
536
|
-
|
|
537
|
-
return self.__unmask(result, image.pixel_data, mask)
|
|
538
|
-
|
|
539
|
-
def enhance_dark_holes(self, image, min_radius, max_radius):
|
|
540
|
-
pixel_data = image.pixel_data
|
|
541
|
-
|
|
542
|
-
mask = image.mask if image.has_mask else None
|
|
543
|
-
|
|
544
|
-
se = self.__structuring_element(1, image.volumetric)
|
|
545
|
-
|
|
546
|
-
inverted_image = pixel_data.max() - pixel_data
|
|
547
|
-
|
|
548
|
-
previous_reconstructed_image = inverted_image
|
|
549
|
-
|
|
550
|
-
eroded_image = inverted_image
|
|
551
|
-
|
|
552
|
-
smoothed_image = numpy.zeros(pixel_data.shape)
|
|
553
|
-
|
|
554
|
-
for i in range(max_radius + 1):
|
|
555
|
-
eroded_image = skimage.morphology.erosion(eroded_image, se)
|
|
556
|
-
|
|
557
|
-
if mask is not None:
|
|
558
|
-
eroded_image *= mask
|
|
559
|
-
|
|
560
|
-
reconstructed_image = skimage.morphology.reconstruction(
|
|
561
|
-
eroded_image, inverted_image, "dilation", se
|
|
562
|
-
)
|
|
563
|
-
|
|
564
|
-
output_image = previous_reconstructed_image - reconstructed_image
|
|
565
|
-
|
|
566
|
-
if i >= min_radius:
|
|
567
|
-
smoothed_image = numpy.maximum(smoothed_image, output_image)
|
|
568
|
-
|
|
569
|
-
previous_reconstructed_image = reconstructed_image
|
|
570
|
-
|
|
571
|
-
return smoothed_image
|
|
572
|
-
|
|
573
|
-
def enhance_dic(self, image, angle, decay, smoothing):
|
|
574
|
-
pixel_data = image.pixel_data
|
|
575
|
-
|
|
576
|
-
if image.volumetric:
|
|
577
|
-
result = numpy.zeros_like(pixel_data)
|
|
578
|
-
|
|
579
|
-
for index, plane in enumerate(pixel_data):
|
|
580
|
-
result[index] = centrosome.filter.line_integration(
|
|
581
|
-
plane, angle, decay, smoothing
|
|
582
|
-
)
|
|
583
|
-
|
|
584
|
-
return result
|
|
585
|
-
|
|
586
|
-
if smoothing == 0:
|
|
587
|
-
smoothing = numpy.finfo(float).eps
|
|
588
|
-
|
|
589
|
-
return centrosome.filter.line_integration(pixel_data, angle, decay, smoothing)
|
|
590
|
-
|
|
591
|
-
def suppress(self, image, radius):
|
|
592
|
-
data = self.__mask(image.pixel_data, image.mask)
|
|
593
|
-
|
|
594
|
-
footprint = self.__structuring_element(radius, image.volumetric)
|
|
595
|
-
|
|
596
|
-
result = skimage.morphology.opening(data, footprint)
|
|
597
|
-
|
|
598
|
-
return self.__unmask(result, image.pixel_data, image.mask)
|
|
599
377
|
|
|
600
378
|
def upgrade_settings(self, setting_values, variable_revision_number, module_name):
|
|
601
379
|
"""Adjust setting values if they came from a previous revision
|
|
@@ -614,7 +392,7 @@ the output easier to display.
|
|
|
614
392
|
#
|
|
615
393
|
# V1 -> V2, added enhance method and hole size
|
|
616
394
|
#
|
|
617
|
-
setting_values = setting_values + [
|
|
395
|
+
setting_values = setting_values + [EnhanceMethod.SPECKLES.value, "1,10"]
|
|
618
396
|
variable_revision_number = 2
|
|
619
397
|
if variable_revision_number == 2:
|
|
620
398
|
#
|
|
@@ -623,7 +401,7 @@ the output easier to display.
|
|
|
623
401
|
setting_values = setting_values + ["2.0", "0", ".95"]
|
|
624
402
|
variable_revision_number = 3
|
|
625
403
|
if variable_revision_number == 3:
|
|
626
|
-
setting_values = setting_values + [
|
|
404
|
+
setting_values = setting_values + [NeuriteMethod.GRADIENT.value]
|
|
627
405
|
variable_revision_number = 4
|
|
628
406
|
if variable_revision_number == 4:
|
|
629
407
|
setting_values = setting_values + ["Slow / circular"]
|
{cellprofiler_nightly-5.0.0.dev332.dist-info → cellprofiler_nightly-5.0.0.dev337.dist-info}/METADATA
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: CellProfiler-nightly
|
|
3
|
-
Version: 5.0.0.
|
|
3
|
+
Version: 5.0.0.dev337
|
|
4
4
|
Summary: CellProfiler is a free open-source software designed to enable biologists without training in computer vision or programming to quantitatively measure phenotypes from thousands of images automatically.
|
|
5
5
|
Author: Anne Carpenter, Thouis (Ray) Jones, Lee Kamentsky, Vebjorn Ljosa, David Logan, Mark Bray, Madison Swain-Bowden, Allen Goodman, Claire McQuinn, Alice Lucas, Callum Tromans-Coia
|
|
6
6
|
Author-email: Beth Cimini <bcimini@broadinstitute.org>, David Stirling <dstirling@glencoesoftware.com>, Nodar Gogoberidze <ngogober@broadinstitute.org>
|
{cellprofiler_nightly-5.0.0.dev332.dist-info → cellprofiler_nightly-5.0.0.dev337.dist-info}/RECORD
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
cellprofiler/__init__.py,sha256=AL2XeOBhIeYkBRyDd0QRgJan7j0DKjT1GD-RdzKvMUY,46
|
|
2
2
|
cellprofiler/__main__.py,sha256=uy78oz5c6NBGRwDZkZ2Gl4HfhbJZQH6K1n54Qfl2OFc,38075
|
|
3
|
-
cellprofiler/_version.py,sha256=
|
|
3
|
+
cellprofiler/_version.py,sha256=uqhbZqMaLWPM_eN5M1IR2mS3YSSFhvbkhyhU3mlT590,721
|
|
4
4
|
cellprofiler/knime_bridge.py,sha256=T6Op-KO79oULx92nGXRQ6lHsEcTutx1Uep1L4ZOKJgc,27767
|
|
5
5
|
cellprofiler/misc.py,sha256=yqv873lP_mquxxkKcLgE_ZU4Hrc1trtuQ-NXLK2qQVc,553
|
|
6
6
|
cellprofiler/data/examples/ExampleFly/ExampleFly.cppipe,sha256=JGZK9IZuYlOHOI4hi6a3DK36IahY69cfeLEd7eJ_rO0,15409
|
|
@@ -301,7 +301,7 @@ cellprofiler/modules/displayplatemap.py,sha256=TcSWk4nsNiTkz2ZG2ENy0HK-8_1KYpgEX
|
|
|
301
301
|
cellprofiler/modules/displayscatterplot.py,sha256=sgB5Uf03mtUFMy3X6GqNNImhlKBWfZHsJx_pBOpXGOs,10680
|
|
302
302
|
cellprofiler/modules/editobjectsmanually.py,sha256=fkTFMTlrTfIiHNhhPzYsfFvZBSBDEIJgM7pZ7gDrMNA,21527
|
|
303
303
|
cellprofiler/modules/enhanceedges.py,sha256=bivBs2OMNYvNnJ7tYrs9yheJP9JGIkgJDQfB2u837HE,11398
|
|
304
|
-
cellprofiler/modules/enhanceorsuppressfeatures.py,sha256=
|
|
304
|
+
cellprofiler/modules/enhanceorsuppressfeatures.py,sha256=yaO88Fq3sUtDNHhsz3YsEMA7a1XvIepfQORGycFnuO0,18026
|
|
305
305
|
cellprofiler/modules/erodeimage.py,sha256=GGO6EjgA_6A0pjrsATxcfs1a_QmZ1rS5Lec7Kkb21hw,1402
|
|
306
306
|
cellprofiler/modules/erodeobjects.py,sha256=vajQ5ikn0i6hw8PkqAGcuIjJCDdzHYv0AtP_A5TV_-U,3792
|
|
307
307
|
cellprofiler/modules/expandorshrinkobjects.py,sha256=fiFf4q2BplR4u6Cym-jdlOOdOKc6oZVtEkZE-O-Ansg,13911
|
|
@@ -374,9 +374,9 @@ cellprofiler/modules/plugins/segmentationtemplatewithdependencies.py,sha256=Sh76
|
|
|
374
374
|
cellprofiler/utilities/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
375
375
|
cellprofiler/utilities/morphology.py,sha256=8-81TrP8AmE3ETXIvQUKFD1vmKNBy2lfbc1QnM1eGIM,2685
|
|
376
376
|
cellprofiler/utilities/rules.py,sha256=NoIHwFTA37zGvIP7vcB-aYeys0MDYVYxspfhLJe00OU,8790
|
|
377
|
-
cellprofiler_nightly-5.0.0.
|
|
378
|
-
cellprofiler_nightly-5.0.0.
|
|
379
|
-
cellprofiler_nightly-5.0.0.
|
|
380
|
-
cellprofiler_nightly-5.0.0.
|
|
381
|
-
cellprofiler_nightly-5.0.0.
|
|
382
|
-
cellprofiler_nightly-5.0.0.
|
|
377
|
+
cellprofiler_nightly-5.0.0.dev337.dist-info/licenses/LICENSE,sha256=QLWaBS7kAioYx7PmJNXAMJaY8NODcFAag60YlUWuyz0,2276
|
|
378
|
+
cellprofiler_nightly-5.0.0.dev337.dist-info/METADATA,sha256=Kn7XKC3qbbQgIb228vCtIq3hyuBj-qfP3RlLNIoMNkc,6063
|
|
379
|
+
cellprofiler_nightly-5.0.0.dev337.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
380
|
+
cellprofiler_nightly-5.0.0.dev337.dist-info/entry_points.txt,sha256=MNDCjguFW3dKiS5Pcdu1NfWo4I0HHI3DekJLUJ4AKkY,60
|
|
381
|
+
cellprofiler_nightly-5.0.0.dev337.dist-info/top_level.txt,sha256=bK7AacDeSj9qAmW8MGlO5wA79hDj6-ACt_mENUNKSIk,13
|
|
382
|
+
cellprofiler_nightly-5.0.0.dev337.dist-info/RECORD,,
|
{cellprofiler_nightly-5.0.0.dev332.dist-info → cellprofiler_nightly-5.0.0.dev337.dist-info}/WHEEL
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|