cellprofiler-library-nightly 5.0.0.dev544__tar.gz → 5.0.0.dev548__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.
- {cellprofiler_library_nightly-5.0.0.dev544/cellprofiler_library_nightly.egg-info → cellprofiler_library_nightly-5.0.0.dev548}/PKG-INFO +1 -1
- {cellprofiler_library_nightly-5.0.0.dev544 → cellprofiler_library_nightly-5.0.0.dev548}/cellprofiler_library/_version.py +3 -3
- {cellprofiler_library_nightly-5.0.0.dev544 → cellprofiler_library_nightly-5.0.0.dev548}/cellprofiler_library/functions/measurement.py +55 -0
- cellprofiler_library_nightly-5.0.0.dev548/cellprofiler_library/modules/_measureimageskeleton.py +60 -0
- cellprofiler_library_nightly-5.0.0.dev548/cellprofiler_library/opts/measureimageskeleton.py +3 -0
- {cellprofiler_library_nightly-5.0.0.dev544 → cellprofiler_library_nightly-5.0.0.dev548/cellprofiler_library_nightly.egg-info}/PKG-INFO +1 -1
- {cellprofiler_library_nightly-5.0.0.dev544 → cellprofiler_library_nightly-5.0.0.dev548}/cellprofiler_library_nightly.egg-info/SOURCES.txt +2 -0
- {cellprofiler_library_nightly-5.0.0.dev544 → cellprofiler_library_nightly-5.0.0.dev548}/LICENSE +0 -0
- {cellprofiler_library_nightly-5.0.0.dev544 → cellprofiler_library_nightly-5.0.0.dev548}/README.md +0 -0
- {cellprofiler_library_nightly-5.0.0.dev544 → cellprofiler_library_nightly-5.0.0.dev548}/cellprofiler_library/__init__.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev544 → cellprofiler_library_nightly-5.0.0.dev548}/cellprofiler_library/functions/__init__.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev544 → cellprofiler_library_nightly-5.0.0.dev548}/cellprofiler_library/functions/file_processing.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev544 → cellprofiler_library_nightly-5.0.0.dev548}/cellprofiler_library/functions/image_processing.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev544 → cellprofiler_library_nightly-5.0.0.dev548}/cellprofiler_library/functions/object_processing.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev544 → cellprofiler_library_nightly-5.0.0.dev548}/cellprofiler_library/functions/segmentation.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev544 → cellprofiler_library_nightly-5.0.0.dev548}/cellprofiler_library/measurement_model.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev544 → cellprofiler_library_nightly-5.0.0.dev548}/cellprofiler_library/modules/__init__.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev544 → cellprofiler_library_nightly-5.0.0.dev548}/cellprofiler_library/modules/_closing.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev544 → cellprofiler_library_nightly-5.0.0.dev548}/cellprofiler_library/modules/_colortogray.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev544 → cellprofiler_library_nightly-5.0.0.dev548}/cellprofiler_library/modules/_combineobjects.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev544 → cellprofiler_library_nightly-5.0.0.dev548}/cellprofiler_library/modules/_convertimagetoobjects.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev544 → cellprofiler_library_nightly-5.0.0.dev548}/cellprofiler_library/modules/_convertobjectstoimage.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev544 → cellprofiler_library_nightly-5.0.0.dev548}/cellprofiler_library/modules/_correctilluminationapply.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev544 → cellprofiler_library_nightly-5.0.0.dev548}/cellprofiler_library/modules/_crop.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev544 → cellprofiler_library_nightly-5.0.0.dev548}/cellprofiler_library/modules/_dilateimage.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev544 → cellprofiler_library_nightly-5.0.0.dev548}/cellprofiler_library/modules/_dilateobjects.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev544 → cellprofiler_library_nightly-5.0.0.dev548}/cellprofiler_library/modules/_enhanceedges.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev544 → cellprofiler_library_nightly-5.0.0.dev548}/cellprofiler_library/modules/_enhanceorsuppressfeatures.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev544 → cellprofiler_library_nightly-5.0.0.dev548}/cellprofiler_library/modules/_erodeimage.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev544 → cellprofiler_library_nightly-5.0.0.dev548}/cellprofiler_library/modules/_erodeobjects.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev544 → cellprofiler_library_nightly-5.0.0.dev548}/cellprofiler_library/modules/_expandorshrinkobjects.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev544 → cellprofiler_library_nightly-5.0.0.dev548}/cellprofiler_library/modules/_fillobjects.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev544 → cellprofiler_library_nightly-5.0.0.dev548}/cellprofiler_library/modules/_flipandrotate.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev544 → cellprofiler_library_nightly-5.0.0.dev548}/cellprofiler_library/modules/_gaussianfilter.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev544 → cellprofiler_library_nightly-5.0.0.dev548}/cellprofiler_library/modules/_graytocolor.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev544 → cellprofiler_library_nightly-5.0.0.dev548}/cellprofiler_library/modules/_identifyprimaryobjects.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev544 → cellprofiler_library_nightly-5.0.0.dev548}/cellprofiler_library/modules/_identifysecondaryobjects.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev544 → cellprofiler_library_nightly-5.0.0.dev548}/cellprofiler_library/modules/_identifytertiaryobjects.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev544 → cellprofiler_library_nightly-5.0.0.dev548}/cellprofiler_library/modules/_imagemath.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev544 → cellprofiler_library_nightly-5.0.0.dev548}/cellprofiler_library/modules/_measurecolocalization.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev544 → cellprofiler_library_nightly-5.0.0.dev548}/cellprofiler_library/modules/_measuregranularity.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev544 → cellprofiler_library_nightly-5.0.0.dev548}/cellprofiler_library/modules/_measureimageareaoccupied.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev544 → cellprofiler_library_nightly-5.0.0.dev548}/cellprofiler_library/modules/_measureimageintensity.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev544 → cellprofiler_library_nightly-5.0.0.dev548}/cellprofiler_library/modules/_measureimageoverlap.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev544 → cellprofiler_library_nightly-5.0.0.dev548}/cellprofiler_library/modules/_measureobjectintensity.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev544 → cellprofiler_library_nightly-5.0.0.dev548}/cellprofiler_library/modules/_measureobjectoverlap.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev544 → cellprofiler_library_nightly-5.0.0.dev548}/cellprofiler_library/modules/_measureobjectsizeshape.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev544 → cellprofiler_library_nightly-5.0.0.dev548}/cellprofiler_library/modules/_medialaxis.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev544 → cellprofiler_library_nightly-5.0.0.dev548}/cellprofiler_library/modules/_medianfilter.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev544 → cellprofiler_library_nightly-5.0.0.dev548}/cellprofiler_library/modules/_morph.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev544 → cellprofiler_library_nightly-5.0.0.dev548}/cellprofiler_library/modules/_morphologicalskeleton.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev544 → cellprofiler_library_nightly-5.0.0.dev548}/cellprofiler_library/modules/_opening.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev544 → cellprofiler_library_nightly-5.0.0.dev548}/cellprofiler_library/modules/_overlayobjects.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev544 → cellprofiler_library_nightly-5.0.0.dev548}/cellprofiler_library/modules/_overlayoutlines.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev544 → cellprofiler_library_nightly-5.0.0.dev548}/cellprofiler_library/modules/_reducenoise.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev544 → cellprofiler_library_nightly-5.0.0.dev548}/cellprofiler_library/modules/_removeholes.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev544 → cellprofiler_library_nightly-5.0.0.dev548}/cellprofiler_library/modules/_resize.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev544 → cellprofiler_library_nightly-5.0.0.dev548}/cellprofiler_library/modules/_savecroppedobjects.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev544 → cellprofiler_library_nightly-5.0.0.dev548}/cellprofiler_library/modules/_shrinktoobjectcenters.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev544 → cellprofiler_library_nightly-5.0.0.dev548}/cellprofiler_library/modules/_smooth.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev544 → cellprofiler_library_nightly-5.0.0.dev548}/cellprofiler_library/modules/_threshold.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev544 → cellprofiler_library_nightly-5.0.0.dev548}/cellprofiler_library/modules/_watershed.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev544 → cellprofiler_library_nightly-5.0.0.dev548}/cellprofiler_library/opts/__init__.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev544 → cellprofiler_library_nightly-5.0.0.dev548}/cellprofiler_library/opts/colortogray.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev544 → cellprofiler_library_nightly-5.0.0.dev548}/cellprofiler_library/opts/convertimagetoobjects.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev544 → cellprofiler_library_nightly-5.0.0.dev548}/cellprofiler_library/opts/convertobjectstoimage.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev544 → cellprofiler_library_nightly-5.0.0.dev548}/cellprofiler_library/opts/correctilluminationapply.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev544 → cellprofiler_library_nightly-5.0.0.dev548}/cellprofiler_library/opts/crop.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev544 → cellprofiler_library_nightly-5.0.0.dev548}/cellprofiler_library/opts/dilateimage.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev544 → cellprofiler_library_nightly-5.0.0.dev548}/cellprofiler_library/opts/dilateobjects.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev544 → cellprofiler_library_nightly-5.0.0.dev548}/cellprofiler_library/opts/enhanceedges.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev544 → cellprofiler_library_nightly-5.0.0.dev548}/cellprofiler_library/opts/enhanceorsuppressfeatures.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev544 → cellprofiler_library_nightly-5.0.0.dev548}/cellprofiler_library/opts/erodeimage.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev544 → cellprofiler_library_nightly-5.0.0.dev548}/cellprofiler_library/opts/erodeobjects.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev544 → cellprofiler_library_nightly-5.0.0.dev548}/cellprofiler_library/opts/flipandrotate.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev544 → cellprofiler_library_nightly-5.0.0.dev548}/cellprofiler_library/opts/graytocolor.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev544 → cellprofiler_library_nightly-5.0.0.dev548}/cellprofiler_library/opts/identifyprimaryobjects.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev544 → cellprofiler_library_nightly-5.0.0.dev548}/cellprofiler_library/opts/identifysecondaryobjects.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev544 → cellprofiler_library_nightly-5.0.0.dev548}/cellprofiler_library/opts/identifytertiaryobjects.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev544 → cellprofiler_library_nightly-5.0.0.dev548}/cellprofiler_library/opts/imagemath.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev544 → cellprofiler_library_nightly-5.0.0.dev548}/cellprofiler_library/opts/measurecolocalization.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev544 → cellprofiler_library_nightly-5.0.0.dev548}/cellprofiler_library/opts/measuregranularity.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev544 → cellprofiler_library_nightly-5.0.0.dev548}/cellprofiler_library/opts/measureimageareaoccupied.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev544 → cellprofiler_library_nightly-5.0.0.dev548}/cellprofiler_library/opts/measureimageintensity.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev544 → cellprofiler_library_nightly-5.0.0.dev548}/cellprofiler_library/opts/measureimageoverlap.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev544 → cellprofiler_library_nightly-5.0.0.dev548}/cellprofiler_library/opts/measureobjectintensity.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev544 → cellprofiler_library_nightly-5.0.0.dev548}/cellprofiler_library/opts/measureobjectoverlap.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev544 → cellprofiler_library_nightly-5.0.0.dev548}/cellprofiler_library/opts/morph.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev544 → cellprofiler_library_nightly-5.0.0.dev548}/cellprofiler_library/opts/objectsizeshapefeatures.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev544 → cellprofiler_library_nightly-5.0.0.dev548}/cellprofiler_library/opts/overlayoutlines.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev544 → cellprofiler_library_nightly-5.0.0.dev548}/cellprofiler_library/opts/removeholes.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev544 → cellprofiler_library_nightly-5.0.0.dev548}/cellprofiler_library/opts/resize.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev544 → cellprofiler_library_nightly-5.0.0.dev548}/cellprofiler_library/opts/shrinktoobjectcenters.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev544 → cellprofiler_library_nightly-5.0.0.dev548}/cellprofiler_library/opts/smooth.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev544 → cellprofiler_library_nightly-5.0.0.dev548}/cellprofiler_library/opts/structuring_elements.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev544 → cellprofiler_library_nightly-5.0.0.dev548}/cellprofiler_library/opts/threshold.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev544 → cellprofiler_library_nightly-5.0.0.dev548}/cellprofiler_library/py.typed +0 -0
- {cellprofiler_library_nightly-5.0.0.dev544 → cellprofiler_library_nightly-5.0.0.dev548}/cellprofiler_library/types.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev544 → cellprofiler_library_nightly-5.0.0.dev548}/cellprofiler_library_nightly.egg-info/dependency_links.txt +0 -0
- {cellprofiler_library_nightly-5.0.0.dev544 → cellprofiler_library_nightly-5.0.0.dev548}/cellprofiler_library_nightly.egg-info/requires.txt +0 -0
- {cellprofiler_library_nightly-5.0.0.dev544 → cellprofiler_library_nightly-5.0.0.dev548}/cellprofiler_library_nightly.egg-info/top_level.txt +0 -0
- {cellprofiler_library_nightly-5.0.0.dev544 → cellprofiler_library_nightly-5.0.0.dev548}/environment.yml +0 -0
- {cellprofiler_library_nightly-5.0.0.dev544 → cellprofiler_library_nightly-5.0.0.dev548}/pyproject.toml +0 -0
- {cellprofiler_library_nightly-5.0.0.dev544 → cellprofiler_library_nightly-5.0.0.dev548}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: cellprofiler-library-nightly
|
|
3
|
-
Version: 5.0.0.
|
|
3
|
+
Version: 5.0.0.dev548
|
|
4
4
|
Summary: cellprofiler-library implements CellProfiler's image processing and mathematical code, and is usable as a standalone library
|
|
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>
|
|
@@ -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.dev548'
|
|
32
|
+
__version_tuple__ = version_tuple = (5, 0, 0, 'dev548')
|
|
33
33
|
|
|
34
|
-
__commit_id__ = commit_id = '
|
|
34
|
+
__commit_id__ = commit_id = 'g206f9390a'
|
|
@@ -2198,3 +2198,58 @@ def compute_earth_movers_distance_objects(
|
|
|
2198
2198
|
extra_mass_penalty=extra_mass_penalty,
|
|
2199
2199
|
)
|
|
2200
2200
|
return emd
|
|
2201
|
+
|
|
2202
|
+
|
|
2203
|
+
###############################################################################
|
|
2204
|
+
# Measure Image Skeleton
|
|
2205
|
+
###############################################################################
|
|
2206
|
+
|
|
2207
|
+
|
|
2208
|
+
def neighbors(image: ImageBinary):
|
|
2209
|
+
"""
|
|
2210
|
+
|
|
2211
|
+
Counts the neighbor pixels for each pixel of an image:
|
|
2212
|
+
|
|
2213
|
+
x = [
|
|
2214
|
+
[0, 1, 0],
|
|
2215
|
+
[1, 1, 1],
|
|
2216
|
+
[0, 1, 0]
|
|
2217
|
+
]
|
|
2218
|
+
|
|
2219
|
+
_neighbors(x)
|
|
2220
|
+
|
|
2221
|
+
[
|
|
2222
|
+
[0, 3, 0],
|
|
2223
|
+
[3, 4, 3],
|
|
2224
|
+
[0, 3, 0]
|
|
2225
|
+
]
|
|
2226
|
+
|
|
2227
|
+
:type image: numpy.ndarray
|
|
2228
|
+
|
|
2229
|
+
:param image: A two-or-three dimensional image
|
|
2230
|
+
|
|
2231
|
+
:return: neighbor pixels for each pixel of an image
|
|
2232
|
+
|
|
2233
|
+
"""
|
|
2234
|
+
padding = numpy.pad(image, 1, "constant")
|
|
2235
|
+
mask = padding > 0
|
|
2236
|
+
|
|
2237
|
+
padding = padding.astype(float)
|
|
2238
|
+
|
|
2239
|
+
if image.ndim == 2:
|
|
2240
|
+
response = 3 ** 2 * scipy.ndimage.uniform_filter(padding) - 1
|
|
2241
|
+
labels = (response * mask)[1:-1, 1:-1]
|
|
2242
|
+
|
|
2243
|
+
return labels.astype(numpy.uint16)
|
|
2244
|
+
elif image.ndim == 3:
|
|
2245
|
+
response = 3 ** 3 * scipy.ndimage.uniform_filter(padding) - 1
|
|
2246
|
+
labels = (response * mask)[1:-1, 1:-1, 1:-1]
|
|
2247
|
+
|
|
2248
|
+
return labels.astype(numpy.uint16)
|
|
2249
|
+
else:
|
|
2250
|
+
raise ValueError("Only 2D and 3D images are supported")
|
|
2251
|
+
|
|
2252
|
+
def branches(image: ImageBinary):
|
|
2253
|
+
return neighbors(image) > 2
|
|
2254
|
+
def endpoints(image: ImageBinary):
|
|
2255
|
+
return neighbors(image) == 1
|
cellprofiler_library_nightly-5.0.0.dev548/cellprofiler_library/modules/_measureimageskeleton.py
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import numpy
|
|
2
|
+
from numpy.typing import NDArray
|
|
3
|
+
import skimage.segmentation
|
|
4
|
+
from typing import Annotated, Tuple, Union, List, Any
|
|
5
|
+
from pydantic import Field, validate_call, ConfigDict, BaseModel
|
|
6
|
+
from cellprofiler_library.types import ImageGrayscale
|
|
7
|
+
from cellprofiler_library.opts.measureimageskeleton import TemplateMeasurementFormat
|
|
8
|
+
from cellprofiler_library.functions.measurement import branches, endpoints
|
|
9
|
+
from cellprofiler_library.measurement_model import LibraryMeasurements
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
ImageSkeletonStatistics = List[Tuple[int, int]]
|
|
13
|
+
|
|
14
|
+
class ImageSkeletonDisplayData(BaseModel):
|
|
15
|
+
model_config = ConfigDict(
|
|
16
|
+
arbitrary_types_allowed=True,
|
|
17
|
+
populate_by_name=True
|
|
18
|
+
)
|
|
19
|
+
|
|
20
|
+
statistics: ImageSkeletonStatistics
|
|
21
|
+
nodes: NDArray[Any]
|
|
22
|
+
|
|
23
|
+
@validate_call(config=ConfigDict(arbitrary_types_allowed=True))
|
|
24
|
+
def measure_image_skeleton(
|
|
25
|
+
im_pixel_data: Annotated[ImageGrayscale, Field(description="Input image")],
|
|
26
|
+
im_name: Annotated[str, Field(description="Input image name")]="Image1",
|
|
27
|
+
return_visualization_data: Annotated[bool, Field(description="Return data for display")] = False,
|
|
28
|
+
) -> Union[LibraryMeasurements, Tuple[LibraryMeasurements, ImageSkeletonDisplayData]]:
|
|
29
|
+
pixels = im_pixel_data > 0
|
|
30
|
+
branch_nodes = branches(pixels)
|
|
31
|
+
endpoint_nodes = endpoints(pixels)
|
|
32
|
+
num_branches = numpy.count_nonzero(branch_nodes)
|
|
33
|
+
num_endpoints = numpy.count_nonzero(endpoint_nodes)
|
|
34
|
+
|
|
35
|
+
measurements = LibraryMeasurements()
|
|
36
|
+
|
|
37
|
+
measurements.add_image_measurement(
|
|
38
|
+
TemplateMeasurementFormat.BRANCHES % im_name,
|
|
39
|
+
num_branches
|
|
40
|
+
)
|
|
41
|
+
measurements.add_image_measurement(
|
|
42
|
+
TemplateMeasurementFormat.ENDPOINTS % im_name,
|
|
43
|
+
num_endpoints
|
|
44
|
+
)
|
|
45
|
+
|
|
46
|
+
if return_visualization_data:
|
|
47
|
+
a = numpy.copy(branch_nodes).astype(numpy.uint16)
|
|
48
|
+
b = numpy.copy(endpoint_nodes).astype(numpy.uint16)
|
|
49
|
+
|
|
50
|
+
a[a == 1] = 1
|
|
51
|
+
b[b == 1] = 2
|
|
52
|
+
|
|
53
|
+
nodes: NDArray[Any] = skimage.segmentation.join_segmentations(a, b)
|
|
54
|
+
|
|
55
|
+
return measurements, ImageSkeletonDisplayData(
|
|
56
|
+
statistics=[(num_branches, num_endpoints)],
|
|
57
|
+
nodes=nodes
|
|
58
|
+
)
|
|
59
|
+
|
|
60
|
+
return measurements
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: cellprofiler-library-nightly
|
|
3
|
-
Version: 5.0.0.
|
|
3
|
+
Version: 5.0.0.dev548
|
|
4
4
|
Summary: cellprofiler-library implements CellProfiler's image processing and mathematical code, and is usable as a standalone library
|
|
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>
|
|
@@ -41,6 +41,7 @@ cellprofiler_library/modules/_measuregranularity.py
|
|
|
41
41
|
cellprofiler_library/modules/_measureimageareaoccupied.py
|
|
42
42
|
cellprofiler_library/modules/_measureimageintensity.py
|
|
43
43
|
cellprofiler_library/modules/_measureimageoverlap.py
|
|
44
|
+
cellprofiler_library/modules/_measureimageskeleton.py
|
|
44
45
|
cellprofiler_library/modules/_measureobjectintensity.py
|
|
45
46
|
cellprofiler_library/modules/_measureobjectoverlap.py
|
|
46
47
|
cellprofiler_library/modules/_measureobjectsizeshape.py
|
|
@@ -82,6 +83,7 @@ cellprofiler_library/opts/measuregranularity.py
|
|
|
82
83
|
cellprofiler_library/opts/measureimageareaoccupied.py
|
|
83
84
|
cellprofiler_library/opts/measureimageintensity.py
|
|
84
85
|
cellprofiler_library/opts/measureimageoverlap.py
|
|
86
|
+
cellprofiler_library/opts/measureimageskeleton.py
|
|
85
87
|
cellprofiler_library/opts/measureobjectintensity.py
|
|
86
88
|
cellprofiler_library/opts/measureobjectoverlap.py
|
|
87
89
|
cellprofiler_library/opts/morph.py
|
{cellprofiler_library_nightly-5.0.0.dev544 → cellprofiler_library_nightly-5.0.0.dev548}/LICENSE
RENAMED
|
File without changes
|
{cellprofiler_library_nightly-5.0.0.dev544 → cellprofiler_library_nightly-5.0.0.dev548}/README.md
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
|
|
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
|
|
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
|
|
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
|
{cellprofiler_library_nightly-5.0.0.dev544 → cellprofiler_library_nightly-5.0.0.dev548}/setup.cfg
RENAMED
|
File without changes
|