cellprofiler-library-nightly 5.0.0.dev475__tar.gz → 5.0.0.dev478__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.dev475 → cellprofiler_library_nightly-5.0.0.dev478}/PKG-INFO +1 -1
- {cellprofiler_library_nightly-5.0.0.dev475 → cellprofiler_library_nightly-5.0.0.dev478}/cellprofiler_library/_version.py +3 -3
- {cellprofiler_library_nightly-5.0.0.dev475 → cellprofiler_library_nightly-5.0.0.dev478}/cellprofiler_library/functions/image_processing.py +43 -0
- cellprofiler_library_nightly-5.0.0.dev478/cellprofiler_library/modules/_smooth.py +44 -0
- cellprofiler_library_nightly-5.0.0.dev478/cellprofiler_library/opts/smooth.py +9 -0
- {cellprofiler_library_nightly-5.0.0.dev475 → cellprofiler_library_nightly-5.0.0.dev478}/cellprofiler_library_nightly.egg-info/PKG-INFO +1 -1
- {cellprofiler_library_nightly-5.0.0.dev475 → cellprofiler_library_nightly-5.0.0.dev478}/cellprofiler_library_nightly.egg-info/SOURCES.txt +2 -0
- {cellprofiler_library_nightly-5.0.0.dev475 → cellprofiler_library_nightly-5.0.0.dev478}/LICENSE +0 -0
- {cellprofiler_library_nightly-5.0.0.dev475 → cellprofiler_library_nightly-5.0.0.dev478}/README.md +0 -0
- {cellprofiler_library_nightly-5.0.0.dev475 → cellprofiler_library_nightly-5.0.0.dev478}/cellprofiler_library/__init__.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev475 → cellprofiler_library_nightly-5.0.0.dev478}/cellprofiler_library/functions/__init__.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev475 → cellprofiler_library_nightly-5.0.0.dev478}/cellprofiler_library/functions/file_processing.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev475 → cellprofiler_library_nightly-5.0.0.dev478}/cellprofiler_library/functions/measurement.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev475 → cellprofiler_library_nightly-5.0.0.dev478}/cellprofiler_library/functions/object_processing.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev475 → cellprofiler_library_nightly-5.0.0.dev478}/cellprofiler_library/functions/segmentation.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev475 → cellprofiler_library_nightly-5.0.0.dev478}/cellprofiler_library/modules/__init__.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev475 → cellprofiler_library_nightly-5.0.0.dev478}/cellprofiler_library/modules/_closing.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev475 → cellprofiler_library_nightly-5.0.0.dev478}/cellprofiler_library/modules/_colortogray.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev475 → cellprofiler_library_nightly-5.0.0.dev478}/cellprofiler_library/modules/_combineobjects.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev475 → cellprofiler_library_nightly-5.0.0.dev478}/cellprofiler_library/modules/_convertimagetoobjects.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev475 → cellprofiler_library_nightly-5.0.0.dev478}/cellprofiler_library/modules/_convertobjectstoimage.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev475 → cellprofiler_library_nightly-5.0.0.dev478}/cellprofiler_library/modules/_correctilluminationapply.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev475 → cellprofiler_library_nightly-5.0.0.dev478}/cellprofiler_library/modules/_crop.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev475 → cellprofiler_library_nightly-5.0.0.dev478}/cellprofiler_library/modules/_dilateimage.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev475 → cellprofiler_library_nightly-5.0.0.dev478}/cellprofiler_library/modules/_dilateobjects.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev475 → cellprofiler_library_nightly-5.0.0.dev478}/cellprofiler_library/modules/_enhanceedges.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev475 → cellprofiler_library_nightly-5.0.0.dev478}/cellprofiler_library/modules/_enhanceorsuppressfeatures.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev475 → cellprofiler_library_nightly-5.0.0.dev478}/cellprofiler_library/modules/_erodeimage.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev475 → cellprofiler_library_nightly-5.0.0.dev478}/cellprofiler_library/modules/_erodeobjects.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev475 → cellprofiler_library_nightly-5.0.0.dev478}/cellprofiler_library/modules/_expandorshrinkobjects.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev475 → cellprofiler_library_nightly-5.0.0.dev478}/cellprofiler_library/modules/_fillobjects.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev475 → cellprofiler_library_nightly-5.0.0.dev478}/cellprofiler_library/modules/_flipandrotate.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev475 → cellprofiler_library_nightly-5.0.0.dev478}/cellprofiler_library/modules/_gaussianfilter.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev475 → cellprofiler_library_nightly-5.0.0.dev478}/cellprofiler_library/modules/_graytocolor.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev475 → cellprofiler_library_nightly-5.0.0.dev478}/cellprofiler_library/modules/_identifyprimaryobjects.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev475 → cellprofiler_library_nightly-5.0.0.dev478}/cellprofiler_library/modules/_identifysecondaryobjects.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev475 → cellprofiler_library_nightly-5.0.0.dev478}/cellprofiler_library/modules/_identifytertiaryobjects.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev475 → cellprofiler_library_nightly-5.0.0.dev478}/cellprofiler_library/modules/_imagemath.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev475 → cellprofiler_library_nightly-5.0.0.dev478}/cellprofiler_library/modules/_measureimageoverlap.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev475 → cellprofiler_library_nightly-5.0.0.dev478}/cellprofiler_library/modules/_measureobjectsizeshape.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev475 → cellprofiler_library_nightly-5.0.0.dev478}/cellprofiler_library/modules/_medialaxis.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev475 → cellprofiler_library_nightly-5.0.0.dev478}/cellprofiler_library/modules/_medianfilter.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev475 → cellprofiler_library_nightly-5.0.0.dev478}/cellprofiler_library/modules/_morph.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev475 → cellprofiler_library_nightly-5.0.0.dev478}/cellprofiler_library/modules/_morphologicalskeleton.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev475 → cellprofiler_library_nightly-5.0.0.dev478}/cellprofiler_library/modules/_opening.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev475 → cellprofiler_library_nightly-5.0.0.dev478}/cellprofiler_library/modules/_overlayobjects.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev475 → cellprofiler_library_nightly-5.0.0.dev478}/cellprofiler_library/modules/_overlayoutlines.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev475 → cellprofiler_library_nightly-5.0.0.dev478}/cellprofiler_library/modules/_reducenoise.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev475 → cellprofiler_library_nightly-5.0.0.dev478}/cellprofiler_library/modules/_removeholes.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev475 → cellprofiler_library_nightly-5.0.0.dev478}/cellprofiler_library/modules/_resize.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev475 → cellprofiler_library_nightly-5.0.0.dev478}/cellprofiler_library/modules/_savecroppedobjects.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev475 → cellprofiler_library_nightly-5.0.0.dev478}/cellprofiler_library/modules/_shrinktoobjectcenters.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev475 → cellprofiler_library_nightly-5.0.0.dev478}/cellprofiler_library/modules/_threshold.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev475 → cellprofiler_library_nightly-5.0.0.dev478}/cellprofiler_library/modules/_watershed.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev475 → cellprofiler_library_nightly-5.0.0.dev478}/cellprofiler_library/opts/__init__.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev475 → cellprofiler_library_nightly-5.0.0.dev478}/cellprofiler_library/opts/colortogray.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev475 → cellprofiler_library_nightly-5.0.0.dev478}/cellprofiler_library/opts/convertimagetoobjects.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev475 → cellprofiler_library_nightly-5.0.0.dev478}/cellprofiler_library/opts/convertobjectstoimage.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev475 → cellprofiler_library_nightly-5.0.0.dev478}/cellprofiler_library/opts/correctilluminationapply.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev475 → cellprofiler_library_nightly-5.0.0.dev478}/cellprofiler_library/opts/crop.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev475 → cellprofiler_library_nightly-5.0.0.dev478}/cellprofiler_library/opts/dilateimage.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev475 → cellprofiler_library_nightly-5.0.0.dev478}/cellprofiler_library/opts/dilateobjects.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev475 → cellprofiler_library_nightly-5.0.0.dev478}/cellprofiler_library/opts/enhanceedges.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev475 → cellprofiler_library_nightly-5.0.0.dev478}/cellprofiler_library/opts/enhanceorsuppressfeatures.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev475 → cellprofiler_library_nightly-5.0.0.dev478}/cellprofiler_library/opts/erodeimage.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev475 → cellprofiler_library_nightly-5.0.0.dev478}/cellprofiler_library/opts/erodeobjects.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev475 → cellprofiler_library_nightly-5.0.0.dev478}/cellprofiler_library/opts/flipandrotate.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev475 → cellprofiler_library_nightly-5.0.0.dev478}/cellprofiler_library/opts/graytocolor.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev475 → cellprofiler_library_nightly-5.0.0.dev478}/cellprofiler_library/opts/identifyprimaryobjects.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev475 → cellprofiler_library_nightly-5.0.0.dev478}/cellprofiler_library/opts/identifysecondaryobjects.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev475 → cellprofiler_library_nightly-5.0.0.dev478}/cellprofiler_library/opts/identifytertiaryobjects.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev475 → cellprofiler_library_nightly-5.0.0.dev478}/cellprofiler_library/opts/imagemath.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev475 → cellprofiler_library_nightly-5.0.0.dev478}/cellprofiler_library/opts/measureimageoverlap.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev475 → cellprofiler_library_nightly-5.0.0.dev478}/cellprofiler_library/opts/morph.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev475 → cellprofiler_library_nightly-5.0.0.dev478}/cellprofiler_library/opts/objectsizeshapefeatures.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev475 → cellprofiler_library_nightly-5.0.0.dev478}/cellprofiler_library/opts/overlayoutlines.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev475 → cellprofiler_library_nightly-5.0.0.dev478}/cellprofiler_library/opts/removeholes.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev475 → cellprofiler_library_nightly-5.0.0.dev478}/cellprofiler_library/opts/resize.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev475 → cellprofiler_library_nightly-5.0.0.dev478}/cellprofiler_library/opts/shrinktoobjectcenters.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev475 → cellprofiler_library_nightly-5.0.0.dev478}/cellprofiler_library/opts/structuring_elements.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev475 → cellprofiler_library_nightly-5.0.0.dev478}/cellprofiler_library/opts/threshold.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev475 → cellprofiler_library_nightly-5.0.0.dev478}/cellprofiler_library/py.typed +0 -0
- {cellprofiler_library_nightly-5.0.0.dev475 → cellprofiler_library_nightly-5.0.0.dev478}/cellprofiler_library/types.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev475 → cellprofiler_library_nightly-5.0.0.dev478}/cellprofiler_library_nightly.egg-info/dependency_links.txt +0 -0
- {cellprofiler_library_nightly-5.0.0.dev475 → cellprofiler_library_nightly-5.0.0.dev478}/cellprofiler_library_nightly.egg-info/requires.txt +0 -0
- {cellprofiler_library_nightly-5.0.0.dev475 → cellprofiler_library_nightly-5.0.0.dev478}/cellprofiler_library_nightly.egg-info/top_level.txt +0 -0
- {cellprofiler_library_nightly-5.0.0.dev475 → cellprofiler_library_nightly-5.0.0.dev478}/environment.yml +0 -0
- {cellprofiler_library_nightly-5.0.0.dev475 → cellprofiler_library_nightly-5.0.0.dev478}/pyproject.toml +0 -0
- {cellprofiler_library_nightly-5.0.0.dev475 → cellprofiler_library_nightly-5.0.0.dev478}/setup.cfg +0 -0
{cellprofiler_library_nightly-5.0.0.dev475 → cellprofiler_library_nightly-5.0.0.dev478}/PKG-INFO
RENAMED
|
@@ -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.dev478
|
|
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.dev478'
|
|
32
|
+
__version_tuple__ = version_tuple = (5, 0, 0, 'dev478')
|
|
33
33
|
|
|
34
|
-
__commit_id__ = commit_id = '
|
|
34
|
+
__commit_id__ = commit_id = 'g030288a08'
|
|
@@ -17,6 +17,7 @@ import matplotlib
|
|
|
17
17
|
import math
|
|
18
18
|
from typing import Any, Optional, Tuple, Callable, Union, List, cast, Dict, TypeVar
|
|
19
19
|
from numpy.typing import NDArray
|
|
20
|
+
from skimage.restoration import denoise_bilateral
|
|
20
21
|
from cellprofiler_library.types import ImageGrayscale, ImageGrayscaleMask, Image2DColor, Image2DGrayscale, Image2DGrayscaleMask, ImageAny, ImageAnyMask, ObjectSegmentation, Image2D, Image2DMask, StructuringElement, ObjectLabelSet, ImageColor, ImageBinaryMask
|
|
21
22
|
from cellprofiler_library.opts import threshold as Threshold
|
|
22
23
|
from cellprofiler_library.opts.enhanceorsuppressfeatures import SpeckleAccuracy, NeuriteMethod
|
|
@@ -27,6 +28,7 @@ from cellprofiler_library.opts.resize import ResizingMethod, DimensionMethod, In
|
|
|
27
28
|
from cellprofiler_library.opts.imagemath import Operator
|
|
28
29
|
from cellprofiler_library.opts.flipandrotate import RotationCoordinateAlignmnet
|
|
29
30
|
from cellprofiler_library.opts.enhanceedges import EdgeDirection
|
|
31
|
+
|
|
30
32
|
invert = cast(Callable[[ImageAny], ImageAny], _invert)
|
|
31
33
|
isscalar = cast(Callable[[Optional[ImageAny]], bool], _isscalar)
|
|
32
34
|
|
|
@@ -2068,3 +2070,44 @@ def rotate_image_coordinates(pixel_data: Image2D, mask: Image2DMask, rotate_poin
|
|
|
2068
2070
|
"Unknown axis: %s" % rotate_coordinate_alignment.value
|
|
2069
2071
|
)
|
|
2070
2072
|
return angle
|
|
2073
|
+
|
|
2074
|
+
|
|
2075
|
+
###############################################################################
|
|
2076
|
+
# Smoothing
|
|
2077
|
+
###############################################################################
|
|
2078
|
+
|
|
2079
|
+
def smoothing_gaussian(pixel_data: Image2D, mask: Optional[Image2DMask], sigma: float) -> Image2D:
|
|
2080
|
+
def fn(image: Image2D) -> Image2D:
|
|
2081
|
+
return scipy.ndimage.gaussian_filter(
|
|
2082
|
+
image, sigma, mode="constant", cval=0
|
|
2083
|
+
)
|
|
2084
|
+
return centrosome.smooth.smooth_with_function_and_mask(pixel_data, fn, mask)
|
|
2085
|
+
|
|
2086
|
+
|
|
2087
|
+
def smoothing_median(pixel_data: Image2D, mask: Optional[Image2DMask], obj_size: float) -> Image2D:
|
|
2088
|
+
return centrosome.filter.median_filter(pixel_data, mask, obj_size / 2 + 1)
|
|
2089
|
+
|
|
2090
|
+
|
|
2091
|
+
def smoothing_keeping_edges(pixel_data: Image2D, multichannel: bool, sigma_range: float, sigma: float) -> Image2D:
|
|
2092
|
+
assert sigma_range is not None, "sigma_range must be provided for smooth_keeping_edges"
|
|
2093
|
+
return denoise_bilateral(
|
|
2094
|
+
image=pixel_data.astype(float),
|
|
2095
|
+
channel_axis=2 if multichannel else None,
|
|
2096
|
+
sigma_color=sigma_range,
|
|
2097
|
+
sigma_spatial=sigma,
|
|
2098
|
+
)
|
|
2099
|
+
|
|
2100
|
+
|
|
2101
|
+
def smoothing_fit_polynomial(pixel_data: Image2D, mask: Optional[Image2DMask], clip: bool) -> Image2D:
|
|
2102
|
+
return centrosome.smooth.fit_polynomial(pixel_data, mask, clip)
|
|
2103
|
+
|
|
2104
|
+
|
|
2105
|
+
def smoothing_circular_average(pixel_data: Image2D, mask: Optional[Image2DMask], obj_size: float) -> Image2D:
|
|
2106
|
+
return centrosome.filter.circular_average_filter(pixel_data, obj_size / 2 + 1, mask)
|
|
2107
|
+
|
|
2108
|
+
def smoothing_smooth_to_average(pixel_data: Image2D, mask: Optional[Image2DMask]) -> Image2D:
|
|
2109
|
+
if mask is not None:
|
|
2110
|
+
mean = numpy.mean(pixel_data[mask])
|
|
2111
|
+
else:
|
|
2112
|
+
mean = numpy.mean(pixel_data)
|
|
2113
|
+
return numpy.ones(pixel_data.shape, pixel_data.dtype) * mean
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import numpy
|
|
2
|
+
from typing import Annotated, Optional
|
|
3
|
+
from pydantic import Field, validate_call, ConfigDict
|
|
4
|
+
|
|
5
|
+
from cellprofiler_library.functions.image_processing import smoothing_gaussian, smoothing_median, smoothing_keeping_edges, smoothing_fit_polynomial, smoothing_circular_average, smoothing_smooth_to_average
|
|
6
|
+
from cellprofiler_library.opts.smooth import SmoothingMethod
|
|
7
|
+
from cellprofiler_library.types import Image2D, Image2DMask
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
@validate_call(config=ConfigDict(arbitrary_types_allowed=True))
|
|
11
|
+
def smooth(
|
|
12
|
+
pixel_data: Annotated[Image2D, Field(description="Pixel data of image to be smoothed")],
|
|
13
|
+
mask: Annotated[Optional[Image2DMask], Field(description="Mask of the pixel data")],
|
|
14
|
+
multichannel: Annotated[bool, Field(description="Set to true if image is multichannel")],
|
|
15
|
+
object_size: Annotated[Optional[float], Field(description="Object size")],
|
|
16
|
+
smoothing_method: Annotated[SmoothingMethod, Field(description="Smoothing method")],
|
|
17
|
+
sigma_range: Annotated[Optional[float], Field(description="Sigma range")],
|
|
18
|
+
clip: Annotated[Optional[bool], Field(description="Clip intensities to 0 and 1")] = True,
|
|
19
|
+
) -> Image2D:
|
|
20
|
+
if object_size is not None:
|
|
21
|
+
obj_size = float(object_size)
|
|
22
|
+
else:
|
|
23
|
+
obj_size = float(min(30, max(1, numpy.mean(pixel_data.shape) / 40)))
|
|
24
|
+
sigma = obj_size / 2.35
|
|
25
|
+
|
|
26
|
+
if smoothing_method == SmoothingMethod.GAUSSIAN_FILTER:
|
|
27
|
+
output_pixels = smoothing_gaussian(pixel_data, mask, sigma)
|
|
28
|
+
elif smoothing_method == SmoothingMethod.MEDIAN_FILTER:
|
|
29
|
+
output_pixels = smoothing_median(pixel_data, mask, obj_size)
|
|
30
|
+
elif smoothing_method == SmoothingMethod.SMOOTH_KEEPING_EDGES:
|
|
31
|
+
assert sigma_range is not None, "sigma_range must be provided for smooth_keeping_edges"
|
|
32
|
+
output_pixels = smoothing_keeping_edges(pixel_data, multichannel, sigma_range, sigma)
|
|
33
|
+
elif smoothing_method == SmoothingMethod.FIT_POLYNOMIAL:
|
|
34
|
+
assert clip is not None, "clip must be provided for fit_polynomial"
|
|
35
|
+
output_pixels = smoothing_fit_polynomial(pixel_data, mask, clip)
|
|
36
|
+
elif smoothing_method == SmoothingMethod.CIRCULAR_AVERAGE_FILTER:
|
|
37
|
+
output_pixels = smoothing_circular_average(pixel_data, mask, obj_size)
|
|
38
|
+
elif smoothing_method == SmoothingMethod.SM_TO_AVERAGE:
|
|
39
|
+
output_pixels = smoothing_smooth_to_average(pixel_data, mask)
|
|
40
|
+
else:
|
|
41
|
+
raise ValueError(
|
|
42
|
+
"Unsupported smoothing method: %s" % smoothing_method
|
|
43
|
+
)
|
|
44
|
+
return output_pixels
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
from enum import Enum
|
|
2
|
+
|
|
3
|
+
class SmoothingMethod(str, Enum):
|
|
4
|
+
FIT_POLYNOMIAL = "Fit Polynomial"
|
|
5
|
+
MEDIAN_FILTER = "Median Filter"
|
|
6
|
+
GAUSSIAN_FILTER = "Gaussian Filter"
|
|
7
|
+
SMOOTH_KEEPING_EDGES = "Smooth Keeping Edges"
|
|
8
|
+
CIRCULAR_AVERAGE_FILTER = "Circular Average Filter"
|
|
9
|
+
SM_TO_AVERAGE = "Smooth to Average"
|
|
@@ -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.dev478
|
|
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>
|
|
@@ -49,6 +49,7 @@ cellprofiler_library/modules/_removeholes.py
|
|
|
49
49
|
cellprofiler_library/modules/_resize.py
|
|
50
50
|
cellprofiler_library/modules/_savecroppedobjects.py
|
|
51
51
|
cellprofiler_library/modules/_shrinktoobjectcenters.py
|
|
52
|
+
cellprofiler_library/modules/_smooth.py
|
|
52
53
|
cellprofiler_library/modules/_threshold.py
|
|
53
54
|
cellprofiler_library/modules/_watershed.py
|
|
54
55
|
cellprofiler_library/opts/__init__.py
|
|
@@ -76,6 +77,7 @@ cellprofiler_library/opts/overlayoutlines.py
|
|
|
76
77
|
cellprofiler_library/opts/removeholes.py
|
|
77
78
|
cellprofiler_library/opts/resize.py
|
|
78
79
|
cellprofiler_library/opts/shrinktoobjectcenters.py
|
|
80
|
+
cellprofiler_library/opts/smooth.py
|
|
79
81
|
cellprofiler_library/opts/structuring_elements.py
|
|
80
82
|
cellprofiler_library/opts/threshold.py
|
|
81
83
|
cellprofiler_library_nightly.egg-info/PKG-INFO
|
{cellprofiler_library_nightly-5.0.0.dev475 → cellprofiler_library_nightly-5.0.0.dev478}/LICENSE
RENAMED
|
File without changes
|
{cellprofiler_library_nightly-5.0.0.dev475 → cellprofiler_library_nightly-5.0.0.dev478}/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
|
{cellprofiler_library_nightly-5.0.0.dev475 → cellprofiler_library_nightly-5.0.0.dev478}/setup.cfg
RENAMED
|
File without changes
|