cellprofiler-library-nightly 5.0.0.dev548__tar.gz → 5.0.0.dev554__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.dev548/cellprofiler_library_nightly.egg-info → cellprofiler_library_nightly-5.0.0.dev554}/PKG-INFO +1 -1
- {cellprofiler_library_nightly-5.0.0.dev548 → cellprofiler_library_nightly-5.0.0.dev554}/cellprofiler_library/_version.py +3 -3
- {cellprofiler_library_nightly-5.0.0.dev548 → cellprofiler_library_nightly-5.0.0.dev554}/cellprofiler_library/modules/_measurecolocalization.py +29 -19
- {cellprofiler_library_nightly-5.0.0.dev548 → cellprofiler_library_nightly-5.0.0.dev554}/cellprofiler_library/modules/_measuregranularity.py +18 -5
- {cellprofiler_library_nightly-5.0.0.dev548 → cellprofiler_library_nightly-5.0.0.dev554}/cellprofiler_library/modules/_measureimageareaoccupied.py +26 -15
- {cellprofiler_library_nightly-5.0.0.dev548 → cellprofiler_library_nightly-5.0.0.dev554}/cellprofiler_library/modules/_measureimageintensity.py +23 -11
- {cellprofiler_library_nightly-5.0.0.dev548 → cellprofiler_library_nightly-5.0.0.dev554}/cellprofiler_library/modules/_measureimageoverlap.py +14 -3
- {cellprofiler_library_nightly-5.0.0.dev548 → cellprofiler_library_nightly-5.0.0.dev554/cellprofiler_library_nightly.egg-info}/PKG-INFO +1 -1
- {cellprofiler_library_nightly-5.0.0.dev548 → cellprofiler_library_nightly-5.0.0.dev554}/LICENSE +0 -0
- {cellprofiler_library_nightly-5.0.0.dev548 → cellprofiler_library_nightly-5.0.0.dev554}/README.md +0 -0
- {cellprofiler_library_nightly-5.0.0.dev548 → cellprofiler_library_nightly-5.0.0.dev554}/cellprofiler_library/__init__.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev548 → cellprofiler_library_nightly-5.0.0.dev554}/cellprofiler_library/functions/__init__.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev548 → cellprofiler_library_nightly-5.0.0.dev554}/cellprofiler_library/functions/file_processing.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev548 → cellprofiler_library_nightly-5.0.0.dev554}/cellprofiler_library/functions/image_processing.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev548 → cellprofiler_library_nightly-5.0.0.dev554}/cellprofiler_library/functions/measurement.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev548 → cellprofiler_library_nightly-5.0.0.dev554}/cellprofiler_library/functions/object_processing.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev548 → cellprofiler_library_nightly-5.0.0.dev554}/cellprofiler_library/functions/segmentation.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev548 → cellprofiler_library_nightly-5.0.0.dev554}/cellprofiler_library/measurement_model.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev548 → cellprofiler_library_nightly-5.0.0.dev554}/cellprofiler_library/modules/__init__.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev548 → cellprofiler_library_nightly-5.0.0.dev554}/cellprofiler_library/modules/_closing.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev548 → cellprofiler_library_nightly-5.0.0.dev554}/cellprofiler_library/modules/_colortogray.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev548 → cellprofiler_library_nightly-5.0.0.dev554}/cellprofiler_library/modules/_combineobjects.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev548 → cellprofiler_library_nightly-5.0.0.dev554}/cellprofiler_library/modules/_convertimagetoobjects.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev548 → cellprofiler_library_nightly-5.0.0.dev554}/cellprofiler_library/modules/_convertobjectstoimage.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev548 → cellprofiler_library_nightly-5.0.0.dev554}/cellprofiler_library/modules/_correctilluminationapply.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev548 → cellprofiler_library_nightly-5.0.0.dev554}/cellprofiler_library/modules/_crop.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev548 → cellprofiler_library_nightly-5.0.0.dev554}/cellprofiler_library/modules/_dilateimage.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev548 → cellprofiler_library_nightly-5.0.0.dev554}/cellprofiler_library/modules/_dilateobjects.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev548 → cellprofiler_library_nightly-5.0.0.dev554}/cellprofiler_library/modules/_enhanceedges.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev548 → cellprofiler_library_nightly-5.0.0.dev554}/cellprofiler_library/modules/_enhanceorsuppressfeatures.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev548 → cellprofiler_library_nightly-5.0.0.dev554}/cellprofiler_library/modules/_erodeimage.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev548 → cellprofiler_library_nightly-5.0.0.dev554}/cellprofiler_library/modules/_erodeobjects.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev548 → cellprofiler_library_nightly-5.0.0.dev554}/cellprofiler_library/modules/_expandorshrinkobjects.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev548 → cellprofiler_library_nightly-5.0.0.dev554}/cellprofiler_library/modules/_fillobjects.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev548 → cellprofiler_library_nightly-5.0.0.dev554}/cellprofiler_library/modules/_flipandrotate.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev548 → cellprofiler_library_nightly-5.0.0.dev554}/cellprofiler_library/modules/_gaussianfilter.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev548 → cellprofiler_library_nightly-5.0.0.dev554}/cellprofiler_library/modules/_graytocolor.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev548 → cellprofiler_library_nightly-5.0.0.dev554}/cellprofiler_library/modules/_identifyprimaryobjects.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev548 → cellprofiler_library_nightly-5.0.0.dev554}/cellprofiler_library/modules/_identifysecondaryobjects.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev548 → cellprofiler_library_nightly-5.0.0.dev554}/cellprofiler_library/modules/_identifytertiaryobjects.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev548 → cellprofiler_library_nightly-5.0.0.dev554}/cellprofiler_library/modules/_imagemath.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev548 → cellprofiler_library_nightly-5.0.0.dev554}/cellprofiler_library/modules/_measureimageskeleton.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev548 → cellprofiler_library_nightly-5.0.0.dev554}/cellprofiler_library/modules/_measureobjectintensity.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev548 → cellprofiler_library_nightly-5.0.0.dev554}/cellprofiler_library/modules/_measureobjectoverlap.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev548 → cellprofiler_library_nightly-5.0.0.dev554}/cellprofiler_library/modules/_measureobjectsizeshape.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev548 → cellprofiler_library_nightly-5.0.0.dev554}/cellprofiler_library/modules/_medialaxis.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev548 → cellprofiler_library_nightly-5.0.0.dev554}/cellprofiler_library/modules/_medianfilter.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev548 → cellprofiler_library_nightly-5.0.0.dev554}/cellprofiler_library/modules/_morph.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev548 → cellprofiler_library_nightly-5.0.0.dev554}/cellprofiler_library/modules/_morphologicalskeleton.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev548 → cellprofiler_library_nightly-5.0.0.dev554}/cellprofiler_library/modules/_opening.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev548 → cellprofiler_library_nightly-5.0.0.dev554}/cellprofiler_library/modules/_overlayobjects.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev548 → cellprofiler_library_nightly-5.0.0.dev554}/cellprofiler_library/modules/_overlayoutlines.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev548 → cellprofiler_library_nightly-5.0.0.dev554}/cellprofiler_library/modules/_reducenoise.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev548 → cellprofiler_library_nightly-5.0.0.dev554}/cellprofiler_library/modules/_removeholes.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev548 → cellprofiler_library_nightly-5.0.0.dev554}/cellprofiler_library/modules/_resize.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev548 → cellprofiler_library_nightly-5.0.0.dev554}/cellprofiler_library/modules/_savecroppedobjects.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev548 → cellprofiler_library_nightly-5.0.0.dev554}/cellprofiler_library/modules/_shrinktoobjectcenters.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev548 → cellprofiler_library_nightly-5.0.0.dev554}/cellprofiler_library/modules/_smooth.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev548 → cellprofiler_library_nightly-5.0.0.dev554}/cellprofiler_library/modules/_threshold.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev548 → cellprofiler_library_nightly-5.0.0.dev554}/cellprofiler_library/modules/_watershed.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev548 → cellprofiler_library_nightly-5.0.0.dev554}/cellprofiler_library/opts/__init__.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev548 → cellprofiler_library_nightly-5.0.0.dev554}/cellprofiler_library/opts/colortogray.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev548 → cellprofiler_library_nightly-5.0.0.dev554}/cellprofiler_library/opts/convertimagetoobjects.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev548 → cellprofiler_library_nightly-5.0.0.dev554}/cellprofiler_library/opts/convertobjectstoimage.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev548 → cellprofiler_library_nightly-5.0.0.dev554}/cellprofiler_library/opts/correctilluminationapply.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev548 → cellprofiler_library_nightly-5.0.0.dev554}/cellprofiler_library/opts/crop.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev548 → cellprofiler_library_nightly-5.0.0.dev554}/cellprofiler_library/opts/dilateimage.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev548 → cellprofiler_library_nightly-5.0.0.dev554}/cellprofiler_library/opts/dilateobjects.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev548 → cellprofiler_library_nightly-5.0.0.dev554}/cellprofiler_library/opts/enhanceedges.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev548 → cellprofiler_library_nightly-5.0.0.dev554}/cellprofiler_library/opts/enhanceorsuppressfeatures.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev548 → cellprofiler_library_nightly-5.0.0.dev554}/cellprofiler_library/opts/erodeimage.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev548 → cellprofiler_library_nightly-5.0.0.dev554}/cellprofiler_library/opts/erodeobjects.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev548 → cellprofiler_library_nightly-5.0.0.dev554}/cellprofiler_library/opts/flipandrotate.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev548 → cellprofiler_library_nightly-5.0.0.dev554}/cellprofiler_library/opts/graytocolor.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev548 → cellprofiler_library_nightly-5.0.0.dev554}/cellprofiler_library/opts/identifyprimaryobjects.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev548 → cellprofiler_library_nightly-5.0.0.dev554}/cellprofiler_library/opts/identifysecondaryobjects.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev548 → cellprofiler_library_nightly-5.0.0.dev554}/cellprofiler_library/opts/identifytertiaryobjects.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev548 → cellprofiler_library_nightly-5.0.0.dev554}/cellprofiler_library/opts/imagemath.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev548 → cellprofiler_library_nightly-5.0.0.dev554}/cellprofiler_library/opts/measurecolocalization.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev548 → cellprofiler_library_nightly-5.0.0.dev554}/cellprofiler_library/opts/measuregranularity.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev548 → cellprofiler_library_nightly-5.0.0.dev554}/cellprofiler_library/opts/measureimageareaoccupied.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev548 → cellprofiler_library_nightly-5.0.0.dev554}/cellprofiler_library/opts/measureimageintensity.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev548 → cellprofiler_library_nightly-5.0.0.dev554}/cellprofiler_library/opts/measureimageoverlap.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev548 → cellprofiler_library_nightly-5.0.0.dev554}/cellprofiler_library/opts/measureimageskeleton.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev548 → cellprofiler_library_nightly-5.0.0.dev554}/cellprofiler_library/opts/measureobjectintensity.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev548 → cellprofiler_library_nightly-5.0.0.dev554}/cellprofiler_library/opts/measureobjectoverlap.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev548 → cellprofiler_library_nightly-5.0.0.dev554}/cellprofiler_library/opts/morph.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev548 → cellprofiler_library_nightly-5.0.0.dev554}/cellprofiler_library/opts/objectsizeshapefeatures.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev548 → cellprofiler_library_nightly-5.0.0.dev554}/cellprofiler_library/opts/overlayoutlines.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev548 → cellprofiler_library_nightly-5.0.0.dev554}/cellprofiler_library/opts/removeholes.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev548 → cellprofiler_library_nightly-5.0.0.dev554}/cellprofiler_library/opts/resize.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev548 → cellprofiler_library_nightly-5.0.0.dev554}/cellprofiler_library/opts/shrinktoobjectcenters.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev548 → cellprofiler_library_nightly-5.0.0.dev554}/cellprofiler_library/opts/smooth.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev548 → cellprofiler_library_nightly-5.0.0.dev554}/cellprofiler_library/opts/structuring_elements.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev548 → cellprofiler_library_nightly-5.0.0.dev554}/cellprofiler_library/opts/threshold.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev548 → cellprofiler_library_nightly-5.0.0.dev554}/cellprofiler_library/py.typed +0 -0
- {cellprofiler_library_nightly-5.0.0.dev548 → cellprofiler_library_nightly-5.0.0.dev554}/cellprofiler_library/types.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev548 → cellprofiler_library_nightly-5.0.0.dev554}/cellprofiler_library_nightly.egg-info/SOURCES.txt +0 -0
- {cellprofiler_library_nightly-5.0.0.dev548 → cellprofiler_library_nightly-5.0.0.dev554}/cellprofiler_library_nightly.egg-info/dependency_links.txt +0 -0
- {cellprofiler_library_nightly-5.0.0.dev548 → cellprofiler_library_nightly-5.0.0.dev554}/cellprofiler_library_nightly.egg-info/requires.txt +0 -0
- {cellprofiler_library_nightly-5.0.0.dev548 → cellprofiler_library_nightly-5.0.0.dev554}/cellprofiler_library_nightly.egg-info/top_level.txt +0 -0
- {cellprofiler_library_nightly-5.0.0.dev548 → cellprofiler_library_nightly-5.0.0.dev554}/environment.yml +0 -0
- {cellprofiler_library_nightly-5.0.0.dev548 → cellprofiler_library_nightly-5.0.0.dev554}/pyproject.toml +0 -0
- {cellprofiler_library_nightly-5.0.0.dev548 → cellprofiler_library_nightly-5.0.0.dev554}/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.dev554
|
|
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.dev554'
|
|
32
|
+
__version_tuple__ = version_tuple = (5, 0, 0, 'dev554')
|
|
33
33
|
|
|
34
|
-
__commit_id__ = commit_id = '
|
|
34
|
+
__commit_id__ = commit_id = 'g7151f72c8'
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import numpy as np
|
|
2
2
|
from numpy.typing import NDArray
|
|
3
3
|
from typing import List, Tuple, Annotated, Optional, Union
|
|
4
|
-
from pydantic import validate_call, ConfigDict, BeforeValidator, Field
|
|
4
|
+
from pydantic import validate_call, ConfigDict, BeforeValidator, Field, BaseModel
|
|
5
5
|
from cellprofiler_library.functions.measurement import measure_correlation_and_slope_from_objects, measure_manders_coefficient_from_objects, measure_rwc_coefficient_from_objects, measure_overlap_coefficient_from_objects, measure_costes_coefficient_from_objects, get_thresholded_images_and_counts, measure_correlation_and_slope, measure_manders_coefficient, measure_rwc_coefficient, measure_overlap_coefficient, measure_costes_coefficient
|
|
6
6
|
from cellprofiler_library.opts.measurecolocalization import TemplateMeasurementFormat, MeasurementType
|
|
7
7
|
from cellprofiler_library.types import ImageGrayscale, ImageGrayscaleMask, Pixel, ObjectLabel, ObjectSegmentation, ImageAny, ImageAnyMask
|
|
@@ -10,6 +10,7 @@ from cellprofiler_library.measurement_model import LibraryMeasurements
|
|
|
10
10
|
from cellprofiler_library.functions.image_processing import crop_image_similarly
|
|
11
11
|
from cellprofiler_library.functions.object_processing import size_similarly, object_crop_image_similarly
|
|
12
12
|
|
|
13
|
+
|
|
13
14
|
def crop_image_pair_similarly(
|
|
14
15
|
im1_pixel_data: Annotated[ImageGrayscale, Field(description="First image pixel data")],
|
|
15
16
|
im2_pixel_data: Annotated[ImageGrayscale, Field(description="Second image pixel data")],
|
|
@@ -107,6 +108,16 @@ def crop_image_pair_and_object_similarly(
|
|
|
107
108
|
|
|
108
109
|
return im1_pixels, im2_pixels, obj_segmented, mask, im1_costes_pixels, im2_costes_pixels
|
|
109
110
|
|
|
111
|
+
ColocalizationStatistics = List[Tuple[str, str, str, str, str]]
|
|
112
|
+
|
|
113
|
+
class ColocalizationDisplayData(BaseModel):
|
|
114
|
+
model_config = ConfigDict(
|
|
115
|
+
arbitrary_types_allowed=True,
|
|
116
|
+
populate_by_name=True
|
|
117
|
+
)
|
|
118
|
+
|
|
119
|
+
statistics: ColocalizationStatistics
|
|
120
|
+
|
|
110
121
|
@validate_call(config=ConfigDict(arbitrary_types_allowed=True))
|
|
111
122
|
def run_image_pair_images(
|
|
112
123
|
im1_pixel_data: Annotated[ImageGrayscale, Field(description="First image pixel data")],
|
|
@@ -120,16 +131,12 @@ def run_image_pair_images(
|
|
|
120
131
|
im1_scale: Annotated[Optional[float], Field(description="")] = None,
|
|
121
132
|
im2_scale: Annotated[Optional[float], Field(description="")] = None,
|
|
122
133
|
costes_method: Annotated[Optional[CostesMethod], Field(description="")] = CostesMethod.FAST,
|
|
123
|
-
)
|
|
124
|
-
|
|
125
|
-
LibraryMeasurements,
|
|
126
|
-
List[Tuple[str, str, str, str, str]]
|
|
127
|
-
], Field(description="List of measurement results and a dictionary of measurements with precise values")]:
|
|
134
|
+
return_visualization_data: Annotated[bool, Field(description="Return data for display")] = False,
|
|
135
|
+
) -> Union[LibraryMeasurements, Tuple[LibraryMeasurements, ColocalizationDisplayData]]:
|
|
128
136
|
"""Calculate the correlation between the pixels of two images"""
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
summary: List[Tuple[str, str, str, str, str]] = []
|
|
132
137
|
measurements = LibraryMeasurements()
|
|
138
|
+
summary: ColocalizationStatistics = []
|
|
139
|
+
|
|
133
140
|
corr = np.float64(np.NaN)
|
|
134
141
|
slope = np.float64(np.NaN)
|
|
135
142
|
C1 = np.float64(np.NaN)
|
|
@@ -141,6 +148,7 @@ def run_image_pair_images(
|
|
|
141
148
|
overlap = np.float64(np.NaN)
|
|
142
149
|
K1 = np.float64(np.NaN)
|
|
143
150
|
K2 = np.float64(np.NaN)
|
|
151
|
+
|
|
144
152
|
if mask is not None and np.any(mask):
|
|
145
153
|
im1_pixels = im1_pixel_data[mask]
|
|
146
154
|
im2_pixels = im2_pixel_data[mask]
|
|
@@ -228,11 +236,13 @@ def run_image_pair_images(
|
|
|
228
236
|
measurements.add_image_measurement(costes_measurement_1, C1)
|
|
229
237
|
measurements.add_image_measurement(costes_measurement_2, C2)
|
|
230
238
|
|
|
231
|
-
|
|
239
|
+
if return_visualization_data:
|
|
240
|
+
return measurements, ColocalizationDisplayData(statistics=summary)
|
|
241
|
+
return measurements
|
|
232
242
|
|
|
233
243
|
|
|
234
|
-
def __get_object_result_array(col_order_list: Tuple[str, str, str], measurement_name: str, measurement_array: NDArray[np.float64]) ->
|
|
235
|
-
summary:
|
|
244
|
+
def __get_object_result_array(col_order_list: Tuple[str, str, str], measurement_name: str, measurement_array: NDArray[np.float64]) -> ColocalizationStatistics:
|
|
245
|
+
summary: ColocalizationStatistics = []
|
|
236
246
|
summary += [
|
|
237
247
|
(*col_order_list, f"Mean {measurement_name}", "%.3f" % np.mean(measurement_array)),
|
|
238
248
|
(*col_order_list, f"Median {measurement_name}", "%.3f" % np.median(measurement_array)),
|
|
@@ -258,15 +268,13 @@ def run_image_pair_objects(
|
|
|
258
268
|
measurement_types: Annotated[List[MeasurementType], Field(description="List of measurement types to be calculated")]=[MeasurementType.CORRELATION, MeasurementType.MANDERS, MeasurementType.RWC, MeasurementType.OVERLAP, MeasurementType.COSTES],
|
|
259
269
|
im1_scale: Annotated[Optional[Union[float, int]], Field(description="First image scale for costes thresholding")]=None,
|
|
260
270
|
im2_scale: Annotated[Optional[Union[float, int]], Field(description="Second image scale for costes thresholding")]=None,
|
|
261
|
-
costes_method: Annotated[Optional[CostesMethod], Field(description="Costes method for costes thresholding")]=CostesMethod.FAST
|
|
262
|
-
)
|
|
263
|
-
|
|
264
|
-
List[Tuple[str, str, str, str, str]]
|
|
265
|
-
]:
|
|
271
|
+
costes_method: Annotated[Optional[CostesMethod], Field(description="Costes method for costes thresholding")]=CostesMethod.FAST,
|
|
272
|
+
return_visualization_data: Annotated[bool, Field(description="Return data for display")] = False,
|
|
273
|
+
) -> Union[LibraryMeasurements, Tuple[LibraryMeasurements, ColocalizationDisplayData]]:
|
|
266
274
|
if MeasurementType.COSTES in measurement_types:
|
|
267
275
|
assert costes_method is not None, "Costes requires a costes method"
|
|
268
276
|
"""Calculate per-object correlations between intensities in two images"""
|
|
269
|
-
summary = []
|
|
277
|
+
summary: ColocalizationStatistics = []
|
|
270
278
|
|
|
271
279
|
n_objects = object_count
|
|
272
280
|
# Handle case when both images for the correlation are completely masked out
|
|
@@ -389,4 +397,6 @@ def run_image_pair_objects(
|
|
|
389
397
|
(*col_order_1, "Max correlation", "-"),
|
|
390
398
|
]
|
|
391
399
|
|
|
392
|
-
|
|
400
|
+
if return_visualization_data:
|
|
401
|
+
return measurements, ColocalizationDisplayData(statistics=summary)
|
|
402
|
+
return measurements
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
from pydantic import validate_call, ConfigDict, Field
|
|
2
|
-
from typing import Annotated, List,
|
|
1
|
+
from pydantic import validate_call, ConfigDict, Field, BaseModel
|
|
2
|
+
from typing import Annotated, List, Tuple, Union
|
|
3
3
|
from enum import Enum
|
|
4
4
|
import numpy as np
|
|
5
5
|
|
|
@@ -11,6 +11,16 @@ from cellprofiler_library.types import ImageGrayscale, ImageGrayscaleMask
|
|
|
11
11
|
class GranularityMeasurementFormat(str, Enum):
|
|
12
12
|
GRANULARITY = "Granularity_%d_%s"
|
|
13
13
|
|
|
14
|
+
GranularityStatistics = List[str]
|
|
15
|
+
|
|
16
|
+
class GranularityDisplayData(BaseModel):
|
|
17
|
+
model_config = ConfigDict(
|
|
18
|
+
arbitrary_types_allowed=True,
|
|
19
|
+
populate_by_name=True
|
|
20
|
+
)
|
|
21
|
+
|
|
22
|
+
statistics: GranularityStatistics
|
|
23
|
+
|
|
14
24
|
@validate_call(config=ConfigDict(arbitrary_types_allowed=True))
|
|
15
25
|
def measure_granularity(
|
|
16
26
|
image_name: Annotated[str, Field(description="Name of the image")],
|
|
@@ -22,7 +32,8 @@ def measure_granularity(
|
|
|
22
32
|
object_records: Annotated[List[ObjectRecord], Field(description="Object records")],
|
|
23
33
|
granular_spectrum_length: Annotated[int, Field(description="Range of the granular spectrum")],
|
|
24
34
|
dimensions: Annotated[int, Field(description="Dimensionality of the image")] = 2,
|
|
25
|
-
|
|
35
|
+
return_visualization_data: Annotated[bool, Field(description="Return data for display")] = False,
|
|
36
|
+
) -> Union[LibraryMeasurements, Tuple[LibraryMeasurements, GranularityDisplayData]]:
|
|
26
37
|
#
|
|
27
38
|
# Downsample the image and mask
|
|
28
39
|
#
|
|
@@ -75,6 +86,8 @@ def measure_granularity(
|
|
|
75
86
|
measurements.add_image_measurement(f"StDev_{stat_name_base}", np.std(obj_gss) if len(obj_gss) > 0 else 0.0)
|
|
76
87
|
|
|
77
88
|
# Summary for UI display
|
|
78
|
-
summary = [image_name] + stats_strings
|
|
89
|
+
summary: GranularityStatistics = [image_name] + stats_strings
|
|
79
90
|
|
|
80
|
-
|
|
91
|
+
if return_visualization_data:
|
|
92
|
+
return measurements, GranularityDisplayData(statistics=summary)
|
|
93
|
+
return measurements
|
|
@@ -1,12 +1,22 @@
|
|
|
1
1
|
import skimage.measure
|
|
2
2
|
import numpy as np
|
|
3
|
-
from typing import Annotated, Optional, Tuple, List
|
|
4
|
-
from pydantic import Field, validate_call, ConfigDict
|
|
3
|
+
from typing import Annotated, Optional, Tuple, List, Union
|
|
4
|
+
from pydantic import Field, validate_call, ConfigDict, BaseModel
|
|
5
5
|
from cellprofiler_library.types import ImageBinary, ObjectSegmentation, ImageAnyMask
|
|
6
6
|
from cellprofiler_library.functions.measurement import measure_area_occupied, measure_total_area, measure_perimeter, measure_object_perimeter, measure_objects_area_occupied, measure_objects_total_area
|
|
7
7
|
from cellprofiler_library.measurement_model import LibraryMeasurements
|
|
8
8
|
from cellprofiler_library.opts.measureimageareaoccupied import TemplateMeasurementFormat
|
|
9
9
|
|
|
10
|
+
ImageAreaOccupiedStatistics = List[List[str]]
|
|
11
|
+
|
|
12
|
+
class ImageAreaOccupiedDisplayData(BaseModel):
|
|
13
|
+
model_config = ConfigDict(
|
|
14
|
+
arbitrary_types_allowed=True,
|
|
15
|
+
populate_by_name=True
|
|
16
|
+
)
|
|
17
|
+
|
|
18
|
+
statistics: ImageAreaOccupiedStatistics
|
|
19
|
+
|
|
10
20
|
|
|
11
21
|
@validate_call(config=ConfigDict(arbitrary_types_allowed=True))
|
|
12
22
|
def measure_image_area_perimeter(
|
|
@@ -14,12 +24,9 @@ def measure_image_area_perimeter(
|
|
|
14
24
|
image_name: Annotated[str, Field(description="Name of the image")],
|
|
15
25
|
im_volumetric: Annotated[bool, Field(description="Image is volumetric")],
|
|
16
26
|
im_spacing: Annotated[Optional[Tuple[float, ...]], Field(description="Image spacing")] = None,
|
|
17
|
-
pipeline_volumetric: Annotated[bool, Field(description="Pipeline is volumetric")] = False
|
|
18
|
-
)
|
|
19
|
-
|
|
20
|
-
List[List[str]]
|
|
21
|
-
]:
|
|
22
|
-
|
|
27
|
+
pipeline_volumetric: Annotated[bool, Field(description="Pipeline is volumetric")] = False,
|
|
28
|
+
return_visualization_data: Annotated[bool, Field(description="Return data for display")] = False,
|
|
29
|
+
) -> Union[LibraryMeasurements, Tuple[LibraryMeasurements, ImageAreaOccupiedDisplayData]]:
|
|
23
30
|
area_occupied = measure_area_occupied(im_pixel_data)
|
|
24
31
|
perimeter = measure_perimeter(im_pixel_data, im_volumetric, im_spacing) if area_occupied > 0 else np.float64(0.0)
|
|
25
32
|
total_area = measure_total_area(im_pixel_data)
|
|
@@ -34,7 +41,10 @@ def measure_image_area_perimeter(
|
|
|
34
41
|
measurements.add_image_measurement(perimeter_format % image_name, perimeter)
|
|
35
42
|
measurements.add_image_measurement(total_area_format % image_name, total_area)
|
|
36
43
|
|
|
37
|
-
|
|
44
|
+
if return_visualization_data:
|
|
45
|
+
summary: ImageAreaOccupiedStatistics = [[image_name, str(area_occupied), str(perimeter), str(total_area),]]
|
|
46
|
+
return measurements, ImageAreaOccupiedDisplayData(statistics=summary)
|
|
47
|
+
return measurements
|
|
38
48
|
|
|
39
49
|
|
|
40
50
|
@validate_call(config=ConfigDict(arbitrary_types_allowed=True))
|
|
@@ -44,11 +54,9 @@ def measure_objects_area_perimeter(
|
|
|
44
54
|
mask: Annotated[Optional[ImageAnyMask], Field(description="Mask of the image")] = None,
|
|
45
55
|
volumetric: Annotated[bool, Field(description="True if the objects are volumetric")] = False,
|
|
46
56
|
spacing: Annotated[Optional[Tuple[float, ...]], Field(description="Image spacing")] = None,
|
|
47
|
-
pipeline_volumetric: Annotated[bool, Field(description="Pipeline is volumetric")] = False
|
|
48
|
-
)
|
|
49
|
-
|
|
50
|
-
List[List[str]]
|
|
51
|
-
]:
|
|
57
|
+
pipeline_volumetric: Annotated[bool, Field(description="Pipeline is volumetric")] = False,
|
|
58
|
+
return_visualization_data: Annotated[bool, Field(description="Return data for display")] = False,
|
|
59
|
+
) -> Union[LibraryMeasurements, Tuple[LibraryMeasurements, ImageAreaOccupiedDisplayData]]:
|
|
52
60
|
if mask is not None:
|
|
53
61
|
label_image[~mask] = 0
|
|
54
62
|
regionprops = skimage.measure.regionprops(label_image)
|
|
@@ -67,4 +75,7 @@ def measure_objects_area_perimeter(
|
|
|
67
75
|
measurements.add_image_measurement(perimeter_format % object_name, perimeter)
|
|
68
76
|
measurements.add_image_measurement(total_area_format % object_name,total_area)
|
|
69
77
|
|
|
70
|
-
|
|
78
|
+
if return_visualization_data:
|
|
79
|
+
summary: ImageAreaOccupiedStatistics = [[object_name, str(area_occupied), str(perimeter), str(total_area),]]
|
|
80
|
+
return measurements, ImageAreaOccupiedDisplayData(statistics=summary)
|
|
81
|
+
return measurements
|
|
@@ -1,12 +1,20 @@
|
|
|
1
1
|
import numpy as np
|
|
2
2
|
from numpy.typing import NDArray
|
|
3
3
|
from typing import List, Annotated, Optional, Tuple, Union
|
|
4
|
-
from pydantic import Field, validate_call, ConfigDict
|
|
4
|
+
from pydantic import Field, validate_call, ConfigDict, BaseModel
|
|
5
5
|
from cellprofiler_library.functions.measurement import measure_image_intensities
|
|
6
6
|
from cellprofiler_library.opts.measureimageintensity import TemplateMeasurementFormat, Feature, FORMATED_FEATURE_NAMES, FORMATED_PERCENTILE_TEMPLATE
|
|
7
7
|
from cellprofiler_library.measurement_model import LibraryMeasurements
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
ImageIntensityStatistics = List[Union[List[str], Tuple[str,float]]]
|
|
10
|
+
|
|
11
|
+
class ImageIntensityDisplayData(BaseModel):
|
|
12
|
+
model_config = ConfigDict(
|
|
13
|
+
arbitrary_types_allowed=True,
|
|
14
|
+
populate_by_name=True
|
|
15
|
+
)
|
|
16
|
+
|
|
17
|
+
statistics: ImageIntensityStatistics
|
|
10
18
|
|
|
11
19
|
@validate_call(config=ConfigDict(arbitrary_types_allowed=True))
|
|
12
20
|
def measure_image_intensity(
|
|
@@ -14,7 +22,8 @@ def measure_image_intensity(
|
|
|
14
22
|
image_name: Annotated[str, Field(description="Name of the image")],
|
|
15
23
|
object_name: Annotated[Optional[str], Field(description="Name of the object set (if any)")] = None,
|
|
16
24
|
percentiles: Annotated[Optional[List[int]], Field(description="Percentiles to measure")]=[],
|
|
17
|
-
|
|
25
|
+
return_visualization_data: Annotated[bool, Field(description="Return data for display")] = False,
|
|
26
|
+
) -> Union[LibraryMeasurements, Tuple[LibraryMeasurements, ImageIntensityDisplayData]]:
|
|
18
27
|
|
|
19
28
|
if percentiles is None:
|
|
20
29
|
percentiles = []
|
|
@@ -39,17 +48,18 @@ def measure_image_intensity(
|
|
|
39
48
|
), percentile_measures = measure_image_intensities(pixels, percentiles)
|
|
40
49
|
|
|
41
50
|
measurements = LibraryMeasurements()
|
|
42
|
-
statistics:
|
|
51
|
+
statistics: ImageIntensityStatistics = []
|
|
43
52
|
|
|
44
53
|
def add_measurement(feature_name: str, fmt_template: str, feature_value: Union[int, float]):
|
|
45
54
|
measurements.add_image_measurement(fmt_template % measurement_name, feature_value)
|
|
46
55
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
56
|
+
if return_visualization_data:
|
|
57
|
+
statistics.append([
|
|
58
|
+
image_name,
|
|
59
|
+
object_name if object_name else "",
|
|
60
|
+
feature_name,
|
|
61
|
+
str(feature_value),
|
|
62
|
+
])
|
|
53
63
|
|
|
54
64
|
# Add measurements
|
|
55
65
|
add_measurement(FORMATED_FEATURE_NAMES[Feature.TOTAL_INTENSITY.value], TemplateMeasurementFormat.TOTAL_INTENSITY, pixel_sum)
|
|
@@ -73,4 +83,6 @@ def measure_image_intensity(
|
|
|
73
83
|
percentile_stats.sort(key = lambda p: p[0])
|
|
74
84
|
statistics += [(FORMATED_PERCENTILE_TEMPLATE % p[0], p[1]) for p in percentile_stats]
|
|
75
85
|
|
|
76
|
-
|
|
86
|
+
if return_visualization_data:
|
|
87
|
+
return measurements, ImageIntensityDisplayData(statistics=statistics)
|
|
88
|
+
return measurements
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import numpy
|
|
2
2
|
from typing import Annotated, Optional, List, Tuple, Union
|
|
3
|
-
from pydantic import Field, validate_call, ConfigDict
|
|
3
|
+
from pydantic import Field, validate_call, ConfigDict, BaseModel
|
|
4
4
|
from cellprofiler_library.opts.measureimageoverlap import ALL_FEATURES, DM, C_IMAGE_OVERLAP, Feature
|
|
5
5
|
from cellprofiler_library.functions.measurement import (
|
|
6
6
|
measure_image_overlap_statistics,
|
|
@@ -11,6 +11,14 @@ from cellprofiler_library.measurement_model import LibraryMeasurements
|
|
|
11
11
|
|
|
12
12
|
ImageOverlapStatistics = List[Tuple[str, Union[int, float, numpy.float_, numpy.int_]]]
|
|
13
13
|
|
|
14
|
+
class ImageOverlapDisplayData(BaseModel):
|
|
15
|
+
model_config = ConfigDict(
|
|
16
|
+
arbitrary_types_allowed=True,
|
|
17
|
+
populate_by_name=True
|
|
18
|
+
)
|
|
19
|
+
|
|
20
|
+
statistics: ImageOverlapStatistics
|
|
21
|
+
|
|
14
22
|
@validate_call(config=ConfigDict(arbitrary_types_allowed=True))
|
|
15
23
|
def measureimageoverlap(
|
|
16
24
|
ground_truth_image: Annotated[ImageBinary, Field(description="Ground truth binary image")],
|
|
@@ -22,7 +30,8 @@ def measureimageoverlap(
|
|
|
22
30
|
penalize_missing: Annotated[bool, Field(description="Penalize missing points")] = False,
|
|
23
31
|
decimation_method: Annotated[DM, Field(description="Decimation method")] = DM.KMEANS,
|
|
24
32
|
max_points: Annotated[int, Field(description="Maximum number of points")] = 250,
|
|
25
|
-
|
|
33
|
+
return_visualization_data: Annotated[bool, Field(description="Return data for display")] = False,
|
|
34
|
+
) -> Union[LibraryMeasurements, Tuple[LibraryMeasurements, ImageOverlapDisplayData]]:
|
|
26
35
|
|
|
27
36
|
all_features = list(ALL_FEATURES)
|
|
28
37
|
|
|
@@ -57,4 +66,6 @@ def measureimageoverlap(
|
|
|
57
66
|
# Display data (arrays)
|
|
58
67
|
measurements.image[key] = value
|
|
59
68
|
|
|
60
|
-
|
|
69
|
+
if return_visualization_data:
|
|
70
|
+
return measurements, ImageOverlapDisplayData(statistics=stats)
|
|
71
|
+
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.dev554
|
|
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>
|
{cellprofiler_library_nightly-5.0.0.dev548 → cellprofiler_library_nightly-5.0.0.dev554}/LICENSE
RENAMED
|
File without changes
|
{cellprofiler_library_nightly-5.0.0.dev548 → cellprofiler_library_nightly-5.0.0.dev554}/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
|
{cellprofiler_library_nightly-5.0.0.dev548 → cellprofiler_library_nightly-5.0.0.dev554}/setup.cfg
RENAMED
|
File without changes
|