CellProfiler-nightly 5.0.0.dev306__py3-none-any.whl → 5.0.0.dev318__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/convertimagetoobjects.py +7 -17
- cellprofiler/modules/correctilluminationapply.py +20 -32
- {cellprofiler_nightly-5.0.0.dev306.dist-info → cellprofiler_nightly-5.0.0.dev318.dist-info}/METADATA +1 -1
- {cellprofiler_nightly-5.0.0.dev306.dist-info → cellprofiler_nightly-5.0.0.dev318.dist-info}/RECORD +9 -9
- {cellprofiler_nightly-5.0.0.dev306.dist-info → cellprofiler_nightly-5.0.0.dev318.dist-info}/WHEEL +0 -0
- {cellprofiler_nightly-5.0.0.dev306.dist-info → cellprofiler_nightly-5.0.0.dev318.dist-info}/entry_points.txt +0 -0
- {cellprofiler_nightly-5.0.0.dev306.dist-info → cellprofiler_nightly-5.0.0.dev318.dist-info}/licenses/LICENSE +0 -0
- {cellprofiler_nightly-5.0.0.dev306.dist-info → cellprofiler_nightly-5.0.0.dev318.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.dev318'
|
|
32
|
+
__version_tuple__ = version_tuple = (5, 0, 0, 'dev318')
|
|
33
33
|
|
|
34
34
|
__commit_id__ = commit_id = None
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import skimage
|
|
2
|
-
import skimage.measure
|
|
3
1
|
from cellprofiler_core.module.image_segmentation import ImageSegmentation
|
|
4
2
|
from cellprofiler_core.setting import Binary
|
|
5
3
|
from cellprofiler_core.setting.text import Integer
|
|
4
|
+
from cellprofiler_library.modules._convertimagetoobjects import convert_image_to_objects
|
|
6
5
|
|
|
7
6
|
HELP_BINARY_IMAGE = """\
|
|
8
7
|
This module can also convert a grayscale image to binary before converting it to an object.
|
|
@@ -110,7 +109,12 @@ If set to 0, a full connectivity of the input dimension is used.
|
|
|
110
109
|
return __settings__
|
|
111
110
|
|
|
112
111
|
def run(self, workspace):
|
|
113
|
-
|
|
112
|
+
def _validate_image(img):
|
|
113
|
+
if img.multichannel is not False:
|
|
114
|
+
raise TypeError("Input image should be grayscale")
|
|
115
|
+
|
|
116
|
+
self.validate_image = _validate_image
|
|
117
|
+
self.function = lambda data, cast_to_bool, preserve_label, background, connectivity: convert_image_to_objects(
|
|
114
118
|
data, cast_to_bool, preserve_label, background, connectivity
|
|
115
119
|
)
|
|
116
120
|
|
|
@@ -138,17 +142,3 @@ If set to 0, a full connectivity of the input dimension is used.
|
|
|
138
142
|
x=1,
|
|
139
143
|
y=0,
|
|
140
144
|
)
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
def convert_to_objects(data, cast_to_bool, preserve_label, background, connectivity):
|
|
144
|
-
# Compatibility with skimage
|
|
145
|
-
connectivity = None if connectivity == 0 else connectivity
|
|
146
|
-
|
|
147
|
-
caster = skimage.img_as_bool if cast_to_bool else skimage.img_as_uint
|
|
148
|
-
data = caster(data)
|
|
149
|
-
|
|
150
|
-
# If preservation is desired, just return the original labels
|
|
151
|
-
if preserve_label and not cast_to_bool:
|
|
152
|
-
return data
|
|
153
|
-
|
|
154
|
-
return skimage.measure.label(data, background=background, connectivity=connectivity)
|
|
@@ -25,7 +25,6 @@ See also
|
|
|
25
25
|
|
|
26
26
|
See also **CorrectIlluminationCalculate**.
|
|
27
27
|
"""
|
|
28
|
-
|
|
29
28
|
import numpy
|
|
30
29
|
from cellprofiler_core.image import Image
|
|
31
30
|
from cellprofiler_core.module import Module
|
|
@@ -37,9 +36,8 @@ from cellprofiler_core.setting.do_something import DoSomething
|
|
|
37
36
|
from cellprofiler_core.setting.do_something import RemoveSettingButton
|
|
38
37
|
from cellprofiler_core.setting.subscriber import ImageSubscriber
|
|
39
38
|
from cellprofiler_core.setting.text import ImageName
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
DOS_SUBTRACT = "Subtract"
|
|
39
|
+
from cellprofiler_library.opts.correctilluminationapply import Method
|
|
40
|
+
from cellprofiler_library.modules._correctilluminationapply import correct_illumination_apply
|
|
43
41
|
|
|
44
42
|
######################################
|
|
45
43
|
#
|
|
@@ -58,7 +56,6 @@ RE_MATCH = "Match maximums"
|
|
|
58
56
|
|
|
59
57
|
SETTINGS_PER_IMAGE = 4
|
|
60
58
|
|
|
61
|
-
|
|
62
59
|
class CorrectIlluminationApply(Module):
|
|
63
60
|
category = "Image Processing"
|
|
64
61
|
variable_revision_number = 5
|
|
@@ -116,22 +113,22 @@ a future version of CellProfiler. You can export .mat format images as
|
|
|
116
113
|
|
|
117
114
|
divide_or_subtract = Choice(
|
|
118
115
|
"Select how the illumination function is applied",
|
|
119
|
-
[
|
|
120
|
-
doc="""\
|
|
116
|
+
[Method.DIVIDE.value, Method.SUBTRACT.value],
|
|
117
|
+
doc=f"""\
|
|
121
118
|
This choice depends on how the illumination function was calculated and
|
|
122
119
|
on your physical model of the way illumination variation affects the
|
|
123
120
|
background of images relative to the objects in images; it is also
|
|
124
121
|
somewhat empirical.
|
|
125
122
|
|
|
126
|
-
-
|
|
123
|
+
- *{Method.SUBTRACT.value}:* Use this option if the background signal is
|
|
127
124
|
significant relative to the real signal coming from the cells. If you
|
|
128
125
|
created the illumination correction function using
|
|
129
126
|
*Background*, then you will want to choose
|
|
130
|
-
|
|
131
|
-
-
|
|
127
|
+
*{Method.SUBTRACT.value}* here.
|
|
128
|
+
- *{Method.DIVIDE.value}:* Choose this option if the signal to background
|
|
132
129
|
ratio is high (the cells are stained very strongly). If you created
|
|
133
130
|
the illumination correction function using *Regular*, then
|
|
134
|
-
you will want to choose
|
|
131
|
+
you will want to choose *{Method.DIVIDE.value}* here.
|
|
135
132
|
"""
|
|
136
133
|
% globals(),
|
|
137
134
|
)
|
|
@@ -248,6 +245,9 @@ somewhat empirical.
|
|
|
248
245
|
orig_image = workspace.image_set.get_image(image_name)
|
|
249
246
|
illum_function = workspace.image_set.get_image(illum_correct_name)
|
|
250
247
|
illum_function_pixel_data = illum_function.pixel_data
|
|
248
|
+
#
|
|
249
|
+
# Validate the illumination function
|
|
250
|
+
#
|
|
251
251
|
if orig_image.pixel_data.ndim == 2:
|
|
252
252
|
illum_function = workspace.image_set.get_image(
|
|
253
253
|
illum_correct_name, must_be_grayscale=True
|
|
@@ -257,7 +257,6 @@ somewhat empirical.
|
|
|
257
257
|
illum_function_pixel_data = illum_function_pixel_data[
|
|
258
258
|
:, :, numpy.newaxis
|
|
259
259
|
]
|
|
260
|
-
# Throw an error if image and illum data are incompatible
|
|
261
260
|
if orig_image.pixel_data.shape[:2] != illum_function_pixel_data.shape[:2]:
|
|
262
261
|
raise ValueError(
|
|
263
262
|
"This module requires that the image and illumination function have equal dimensions.\n"
|
|
@@ -271,27 +270,16 @@ somewhat empirical.
|
|
|
271
270
|
)
|
|
272
271
|
)
|
|
273
272
|
#
|
|
274
|
-
#
|
|
273
|
+
# Apply the illumination function
|
|
275
274
|
#
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
% image.divide_or_subtract.value
|
|
285
|
-
)
|
|
286
|
-
|
|
287
|
-
#
|
|
288
|
-
# Optionally, clip high and low values
|
|
289
|
-
#
|
|
290
|
-
if self.truncate_low.value:
|
|
291
|
-
output_pixels = numpy.where(output_pixels < 0, 0, output_pixels)
|
|
292
|
-
if self.truncate_high.value:
|
|
293
|
-
output_pixels = numpy.where(output_pixels > 1, 1, output_pixels)
|
|
294
|
-
|
|
275
|
+
output_pixels = correct_illumination_apply(
|
|
276
|
+
orig_image.pixel_data,
|
|
277
|
+
illum_function_pixel_data,
|
|
278
|
+
image.divide_or_subtract.value,
|
|
279
|
+
truncate_low=self.truncate_low.value,
|
|
280
|
+
truncate_high=self.truncate_high.value,
|
|
281
|
+
)
|
|
282
|
+
|
|
295
283
|
#
|
|
296
284
|
# Save the output image in the image set and have it inherit
|
|
297
285
|
# mask & cropping from the original image.
|
{cellprofiler_nightly-5.0.0.dev306.dist-info → cellprofiler_nightly-5.0.0.dev318.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.dev318
|
|
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.dev306.dist-info → cellprofiler_nightly-5.0.0.dev318.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=VKwI68zHVxr7qKLpGyfYE5ws8C3HO1sHftyVZcFWLQk,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
|
|
@@ -285,9 +285,9 @@ cellprofiler/modules/classifyobjects.py,sha256=wlQ5IqVEhCChFTtFY2GadUL1pAMB78DUS
|
|
|
285
285
|
cellprofiler/modules/closing.py,sha256=62ug-EgtRYqJn6e0_jF1z8JE2EZqJu8H2Uc57JAiDSA,1879
|
|
286
286
|
cellprofiler/modules/colortogray.py,sha256=RlFGmNxai_7vqtxprIceb0XILfdpm89c-DVBpuX2Cv4,24129
|
|
287
287
|
cellprofiler/modules/combineobjects.py,sha256=N5cFbqAsGM11VuXdAlfr6L0AbnK0fxqB_Vb04C7ltOg,11043
|
|
288
|
-
cellprofiler/modules/convertimagetoobjects.py,sha256=
|
|
288
|
+
cellprofiler/modules/convertimagetoobjects.py,sha256=qgPb6xNuvELt_GOdkyHsaH2tdSDKtZGVMpNtVcV28sI,4700
|
|
289
289
|
cellprofiler/modules/convertobjectstoimage.py,sha256=zvn2nlnF3-i6g16F0um1yNT-Y03e2j5AIueZtKbfkoc,7113
|
|
290
|
-
cellprofiler/modules/correctilluminationapply.py,sha256=
|
|
290
|
+
cellprofiler/modules/correctilluminationapply.py,sha256=eEcXliF2xNkT36Bo7xkNNh7l2YGbSqkqpss4O7RbwaM,15862
|
|
291
291
|
cellprofiler/modules/correctilluminationcalculate.py,sha256=wJMCy3W9zK-xPI8PUvh25MLtE_JSI3QuVVzdLjuTwD4,54200
|
|
292
292
|
cellprofiler/modules/createbatchfiles.py,sha256=a8R5PpbaQYqF8OIvWBuC0uh-yhjzBaU4Uni4m3MRLok,19512
|
|
293
293
|
cellprofiler/modules/crop.py,sha256=Lg1cQCIzO7o8wcwEgRlsccdt8mgiiugowcNEe44vT0k,36039
|
|
@@ -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.dev318.dist-info/licenses/LICENSE,sha256=QLWaBS7kAioYx7PmJNXAMJaY8NODcFAag60YlUWuyz0,2276
|
|
378
|
+
cellprofiler_nightly-5.0.0.dev318.dist-info/METADATA,sha256=x_cH5kn90YFPhDW1njHHwH4IHwMxcUKR5bfXgxSIKvQ,6063
|
|
379
|
+
cellprofiler_nightly-5.0.0.dev318.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
380
|
+
cellprofiler_nightly-5.0.0.dev318.dist-info/entry_points.txt,sha256=MNDCjguFW3dKiS5Pcdu1NfWo4I0HHI3DekJLUJ4AKkY,60
|
|
381
|
+
cellprofiler_nightly-5.0.0.dev318.dist-info/top_level.txt,sha256=bK7AacDeSj9qAmW8MGlO5wA79hDj6-ACt_mENUNKSIk,13
|
|
382
|
+
cellprofiler_nightly-5.0.0.dev318.dist-info/RECORD,,
|
{cellprofiler_nightly-5.0.0.dev306.dist-info → cellprofiler_nightly-5.0.0.dev318.dist-info}/WHEEL
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|