cellprofiler-library-nightly 5.0.0.dev669__tar.gz → 5.0.0.dev684__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.dev669/cellprofiler_library_nightly.egg-info → cellprofiler_library_nightly-5.0.0.dev684}/PKG-INFO +1 -1
- {cellprofiler_library_nightly-5.0.0.dev669 → cellprofiler_library_nightly-5.0.0.dev684}/cellprofiler_library/_version.py +3 -3
- {cellprofiler_library_nightly-5.0.0.dev669 → cellprofiler_library_nightly-5.0.0.dev684}/cellprofiler_library/functions/image_processing.py +32 -0
- cellprofiler_library_nightly-5.0.0.dev684/cellprofiler_library/modules/_findmaxima.py +31 -0
- cellprofiler_library_nightly-5.0.0.dev684/cellprofiler_library/modules/_makeprojection.py +424 -0
- cellprofiler_library_nightly-5.0.0.dev684/cellprofiler_library/opts/findmaxima.py +7 -0
- cellprofiler_library_nightly-5.0.0.dev684/cellprofiler_library/opts/makeprojection.py +22 -0
- {cellprofiler_library_nightly-5.0.0.dev669 → cellprofiler_library_nightly-5.0.0.dev684/cellprofiler_library_nightly.egg-info}/PKG-INFO +1 -1
- {cellprofiler_library_nightly-5.0.0.dev669 → cellprofiler_library_nightly-5.0.0.dev684}/cellprofiler_library_nightly.egg-info/SOURCES.txt +4 -0
- {cellprofiler_library_nightly-5.0.0.dev669 → cellprofiler_library_nightly-5.0.0.dev684}/cellprofiler_library_nightly.egg-info/scm_file_list.json +4 -0
- cellprofiler_library_nightly-5.0.0.dev684/cellprofiler_library_nightly.egg-info/scm_version.json +8 -0
- cellprofiler_library_nightly-5.0.0.dev669/cellprofiler_library_nightly.egg-info/scm_version.json +0 -8
- {cellprofiler_library_nightly-5.0.0.dev669 → cellprofiler_library_nightly-5.0.0.dev684}/LICENSE +0 -0
- {cellprofiler_library_nightly-5.0.0.dev669 → cellprofiler_library_nightly-5.0.0.dev684}/README.md +0 -0
- {cellprofiler_library_nightly-5.0.0.dev669 → cellprofiler_library_nightly-5.0.0.dev684}/cellprofiler_library/__init__.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev669 → cellprofiler_library_nightly-5.0.0.dev684}/cellprofiler_library/functions/__init__.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev669 → cellprofiler_library_nightly-5.0.0.dev684}/cellprofiler_library/functions/file_processing.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev669 → cellprofiler_library_nightly-5.0.0.dev684}/cellprofiler_library/functions/measurement.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev669 → cellprofiler_library_nightly-5.0.0.dev684}/cellprofiler_library/functions/object_processing.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev669 → cellprofiler_library_nightly-5.0.0.dev684}/cellprofiler_library/functions/segmentation.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev669 → cellprofiler_library_nightly-5.0.0.dev684}/cellprofiler_library/measurement_model.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev669 → cellprofiler_library_nightly-5.0.0.dev684}/cellprofiler_library/modules/__init__.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev669 → cellprofiler_library_nightly-5.0.0.dev684}/cellprofiler_library/modules/_align.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev669 → cellprofiler_library_nightly-5.0.0.dev684}/cellprofiler_library/modules/_closing.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev669 → cellprofiler_library_nightly-5.0.0.dev684}/cellprofiler_library/modules/_colortogray.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev669 → cellprofiler_library_nightly-5.0.0.dev684}/cellprofiler_library/modules/_combineobjects.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev669 → cellprofiler_library_nightly-5.0.0.dev684}/cellprofiler_library/modules/_convertimagetoobjects.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev669 → cellprofiler_library_nightly-5.0.0.dev684}/cellprofiler_library/modules/_convertobjectstoimage.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev669 → cellprofiler_library_nightly-5.0.0.dev684}/cellprofiler_library/modules/_correctilluminationapply.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev669 → cellprofiler_library_nightly-5.0.0.dev684}/cellprofiler_library/modules/_crop.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev669 → cellprofiler_library_nightly-5.0.0.dev684}/cellprofiler_library/modules/_dilateimage.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev669 → cellprofiler_library_nightly-5.0.0.dev684}/cellprofiler_library/modules/_dilateobjects.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev669 → cellprofiler_library_nightly-5.0.0.dev684}/cellprofiler_library/modules/_enhanceedges.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev669 → cellprofiler_library_nightly-5.0.0.dev684}/cellprofiler_library/modules/_enhanceorsuppressfeatures.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev669 → cellprofiler_library_nightly-5.0.0.dev684}/cellprofiler_library/modules/_erodeimage.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev669 → cellprofiler_library_nightly-5.0.0.dev684}/cellprofiler_library/modules/_erodeobjects.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev669 → cellprofiler_library_nightly-5.0.0.dev684}/cellprofiler_library/modules/_expandorshrinkobjects.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev669 → cellprofiler_library_nightly-5.0.0.dev684}/cellprofiler_library/modules/_fillobjects.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev669 → cellprofiler_library_nightly-5.0.0.dev684}/cellprofiler_library/modules/_filterobjects.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev669 → cellprofiler_library_nightly-5.0.0.dev684}/cellprofiler_library/modules/_flipandrotate.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev669 → cellprofiler_library_nightly-5.0.0.dev684}/cellprofiler_library/modules/_gaussianfilter.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev669 → cellprofiler_library_nightly-5.0.0.dev684}/cellprofiler_library/modules/_graytocolor.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev669 → cellprofiler_library_nightly-5.0.0.dev684}/cellprofiler_library/modules/_identifydeadworms.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev669 → cellprofiler_library_nightly-5.0.0.dev684}/cellprofiler_library/modules/_identifyprimaryobjects.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev669 → cellprofiler_library_nightly-5.0.0.dev684}/cellprofiler_library/modules/_identifysecondaryobjects.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev669 → cellprofiler_library_nightly-5.0.0.dev684}/cellprofiler_library/modules/_identifytertiaryobjects.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev669 → cellprofiler_library_nightly-5.0.0.dev684}/cellprofiler_library/modules/_imagemath.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev669 → cellprofiler_library_nightly-5.0.0.dev684}/cellprofiler_library/modules/_measurecolocalization.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev669 → cellprofiler_library_nightly-5.0.0.dev684}/cellprofiler_library/modules/_measuregranularity.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev669 → cellprofiler_library_nightly-5.0.0.dev684}/cellprofiler_library/modules/_measureimageareaoccupied.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev669 → cellprofiler_library_nightly-5.0.0.dev684}/cellprofiler_library/modules/_measureimageintensity.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev669 → cellprofiler_library_nightly-5.0.0.dev684}/cellprofiler_library/modules/_measureimageoverlap.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev669 → cellprofiler_library_nightly-5.0.0.dev684}/cellprofiler_library/modules/_measureimagequality.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev669 → cellprofiler_library_nightly-5.0.0.dev684}/cellprofiler_library/modules/_measureimageskeleton.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev669 → cellprofiler_library_nightly-5.0.0.dev684}/cellprofiler_library/modules/_measureobjectintensity.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev669 → cellprofiler_library_nightly-5.0.0.dev684}/cellprofiler_library/modules/_measureobjectintensitydistribution.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev669 → cellprofiler_library_nightly-5.0.0.dev684}/cellprofiler_library/modules/_measureobjectneighbors.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev669 → cellprofiler_library_nightly-5.0.0.dev684}/cellprofiler_library/modules/_measureobjectoverlap.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev669 → cellprofiler_library_nightly-5.0.0.dev684}/cellprofiler_library/modules/_measureobjectsizeshape.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev669 → cellprofiler_library_nightly-5.0.0.dev684}/cellprofiler_library/modules/_measureobjectskeleton.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev669 → cellprofiler_library_nightly-5.0.0.dev684}/cellprofiler_library/modules/_measuretexture.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev669 → cellprofiler_library_nightly-5.0.0.dev684}/cellprofiler_library/modules/_medialaxis.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev669 → cellprofiler_library_nightly-5.0.0.dev684}/cellprofiler_library/modules/_medianfilter.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev669 → cellprofiler_library_nightly-5.0.0.dev684}/cellprofiler_library/modules/_morph.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev669 → cellprofiler_library_nightly-5.0.0.dev684}/cellprofiler_library/modules/_morphologicalskeleton.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev669 → cellprofiler_library_nightly-5.0.0.dev684}/cellprofiler_library/modules/_opening.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev669 → cellprofiler_library_nightly-5.0.0.dev684}/cellprofiler_library/modules/_overlayobjects.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev669 → cellprofiler_library_nightly-5.0.0.dev684}/cellprofiler_library/modules/_overlayoutlines.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev669 → cellprofiler_library_nightly-5.0.0.dev684}/cellprofiler_library/modules/_reducenoise.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev669 → cellprofiler_library_nightly-5.0.0.dev684}/cellprofiler_library/modules/_removeholes.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev669 → cellprofiler_library_nightly-5.0.0.dev684}/cellprofiler_library/modules/_rescaleintensity.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev669 → cellprofiler_library_nightly-5.0.0.dev684}/cellprofiler_library/modules/_resize.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev669 → cellprofiler_library_nightly-5.0.0.dev684}/cellprofiler_library/modules/_savecroppedobjects.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev669 → cellprofiler_library_nightly-5.0.0.dev684}/cellprofiler_library/modules/_shrinktoobjectcenters.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev669 → cellprofiler_library_nightly-5.0.0.dev684}/cellprofiler_library/modules/_smooth.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev669 → cellprofiler_library_nightly-5.0.0.dev684}/cellprofiler_library/modules/_threshold.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev669 → cellprofiler_library_nightly-5.0.0.dev684}/cellprofiler_library/modules/_watershed.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev669 → cellprofiler_library_nightly-5.0.0.dev684}/cellprofiler_library/opts/__init__.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev669 → cellprofiler_library_nightly-5.0.0.dev684}/cellprofiler_library/opts/align.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev669 → cellprofiler_library_nightly-5.0.0.dev684}/cellprofiler_library/opts/colortogray.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev669 → cellprofiler_library_nightly-5.0.0.dev684}/cellprofiler_library/opts/convertimagetoobjects.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev669 → cellprofiler_library_nightly-5.0.0.dev684}/cellprofiler_library/opts/convertobjectstoimage.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev669 → cellprofiler_library_nightly-5.0.0.dev684}/cellprofiler_library/opts/correctilluminationapply.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev669 → cellprofiler_library_nightly-5.0.0.dev684}/cellprofiler_library/opts/crop.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev669 → cellprofiler_library_nightly-5.0.0.dev684}/cellprofiler_library/opts/dilateimage.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev669 → cellprofiler_library_nightly-5.0.0.dev684}/cellprofiler_library/opts/dilateobjects.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev669 → cellprofiler_library_nightly-5.0.0.dev684}/cellprofiler_library/opts/enhanceedges.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev669 → cellprofiler_library_nightly-5.0.0.dev684}/cellprofiler_library/opts/enhanceorsuppressfeatures.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev669 → cellprofiler_library_nightly-5.0.0.dev684}/cellprofiler_library/opts/erodeimage.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev669 → cellprofiler_library_nightly-5.0.0.dev684}/cellprofiler_library/opts/erodeobjects.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev669 → cellprofiler_library_nightly-5.0.0.dev684}/cellprofiler_library/opts/filterobjects.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev669 → cellprofiler_library_nightly-5.0.0.dev684}/cellprofiler_library/opts/flipandrotate.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev669 → cellprofiler_library_nightly-5.0.0.dev684}/cellprofiler_library/opts/graytocolor.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev669 → cellprofiler_library_nightly-5.0.0.dev684}/cellprofiler_library/opts/identifydeadworms.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev669 → cellprofiler_library_nightly-5.0.0.dev684}/cellprofiler_library/opts/identifyprimaryobjects.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev669 → cellprofiler_library_nightly-5.0.0.dev684}/cellprofiler_library/opts/identifysecondaryobjects.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev669 → cellprofiler_library_nightly-5.0.0.dev684}/cellprofiler_library/opts/identifytertiaryobjects.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev669 → cellprofiler_library_nightly-5.0.0.dev684}/cellprofiler_library/opts/imagemath.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev669 → cellprofiler_library_nightly-5.0.0.dev684}/cellprofiler_library/opts/measurecolocalization.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev669 → cellprofiler_library_nightly-5.0.0.dev684}/cellprofiler_library/opts/measuregranularity.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev669 → cellprofiler_library_nightly-5.0.0.dev684}/cellprofiler_library/opts/measureimageareaoccupied.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev669 → cellprofiler_library_nightly-5.0.0.dev684}/cellprofiler_library/opts/measureimageintensity.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev669 → cellprofiler_library_nightly-5.0.0.dev684}/cellprofiler_library/opts/measureimageoverlap.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev669 → cellprofiler_library_nightly-5.0.0.dev684}/cellprofiler_library/opts/measureimagequality.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev669 → cellprofiler_library_nightly-5.0.0.dev684}/cellprofiler_library/opts/measureimageskeleton.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev669 → cellprofiler_library_nightly-5.0.0.dev684}/cellprofiler_library/opts/measureobjectintensity.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev669 → cellprofiler_library_nightly-5.0.0.dev684}/cellprofiler_library/opts/measureobjectintensitydistribution.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev669 → cellprofiler_library_nightly-5.0.0.dev684}/cellprofiler_library/opts/measureobjectneighbors.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev669 → cellprofiler_library_nightly-5.0.0.dev684}/cellprofiler_library/opts/measureobjectoverlap.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev669 → cellprofiler_library_nightly-5.0.0.dev684}/cellprofiler_library/opts/measureobjectskeleton.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev669 → cellprofiler_library_nightly-5.0.0.dev684}/cellprofiler_library/opts/measuretexture.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev669 → cellprofiler_library_nightly-5.0.0.dev684}/cellprofiler_library/opts/morph.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev669 → cellprofiler_library_nightly-5.0.0.dev684}/cellprofiler_library/opts/objectsizeshapefeatures.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev669 → cellprofiler_library_nightly-5.0.0.dev684}/cellprofiler_library/opts/overlayoutlines.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev669 → cellprofiler_library_nightly-5.0.0.dev684}/cellprofiler_library/opts/removeholes.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev669 → cellprofiler_library_nightly-5.0.0.dev684}/cellprofiler_library/opts/rescaleintensity.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev669 → cellprofiler_library_nightly-5.0.0.dev684}/cellprofiler_library/opts/resize.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev669 → cellprofiler_library_nightly-5.0.0.dev684}/cellprofiler_library/opts/shrinktoobjectcenters.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev669 → cellprofiler_library_nightly-5.0.0.dev684}/cellprofiler_library/opts/smooth.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev669 → cellprofiler_library_nightly-5.0.0.dev684}/cellprofiler_library/opts/structuring_elements.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev669 → cellprofiler_library_nightly-5.0.0.dev684}/cellprofiler_library/opts/threshold.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev669 → cellprofiler_library_nightly-5.0.0.dev684}/cellprofiler_library/py.typed +0 -0
- {cellprofiler_library_nightly-5.0.0.dev669 → cellprofiler_library_nightly-5.0.0.dev684}/cellprofiler_library/types.py +0 -0
- {cellprofiler_library_nightly-5.0.0.dev669 → cellprofiler_library_nightly-5.0.0.dev684}/cellprofiler_library_nightly.egg-info/dependency_links.txt +0 -0
- {cellprofiler_library_nightly-5.0.0.dev669 → cellprofiler_library_nightly-5.0.0.dev684}/cellprofiler_library_nightly.egg-info/requires.txt +0 -0
- {cellprofiler_library_nightly-5.0.0.dev669 → cellprofiler_library_nightly-5.0.0.dev684}/cellprofiler_library_nightly.egg-info/top_level.txt +0 -0
- {cellprofiler_library_nightly-5.0.0.dev669 → cellprofiler_library_nightly-5.0.0.dev684}/environment.yml +0 -0
- {cellprofiler_library_nightly-5.0.0.dev669 → cellprofiler_library_nightly-5.0.0.dev684}/pyproject.toml +0 -0
- {cellprofiler_library_nightly-5.0.0.dev669 → cellprofiler_library_nightly-5.0.0.dev684}/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.dev684
|
|
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>
|
|
@@ -18,7 +18,7 @@ version_tuple: tuple[int | str, ...]
|
|
|
18
18
|
commit_id: str | None
|
|
19
19
|
__commit_id__: str | None
|
|
20
20
|
|
|
21
|
-
__version__ = version = '5.0.0.
|
|
22
|
-
__version_tuple__ = version_tuple = (5, 0, 0, '
|
|
21
|
+
__version__ = version = '5.0.0.dev684'
|
|
22
|
+
__version_tuple__ = version_tuple = (5, 0, 0, 'dev684')
|
|
23
23
|
|
|
24
|
-
__commit_id__ = commit_id = '
|
|
24
|
+
__commit_id__ = commit_id = 'gf422c7454'
|
|
@@ -24,6 +24,7 @@ from skimage.restoration import denoise_bilateral
|
|
|
24
24
|
from centrosome.cpmorphology import get_line_pts, all_connected_components
|
|
25
25
|
from scipy.ndimage import binary_erosion, binary_fill_holes
|
|
26
26
|
from scipy.ndimage import mean as mean_of_labels
|
|
27
|
+
from skimage.feature import peak_local_max
|
|
27
28
|
from scipy.fftpack import fft2, ifft2
|
|
28
29
|
from cellprofiler_library.types import (
|
|
29
30
|
ImageGrayscale, ImageGrayscaleMask,
|
|
@@ -3073,3 +3074,34 @@ def get_source_range(
|
|
|
3073
3074
|
src_max = source_high
|
|
3074
3075
|
|
|
3075
3076
|
return src_min, src_max
|
|
3077
|
+
|
|
3078
|
+
################################################################################
|
|
3079
|
+
# FindMaxima
|
|
3080
|
+
################################################################################
|
|
3081
|
+
|
|
3082
|
+
def find_maxima_in_data(
|
|
3083
|
+
x_data: ImageAny,
|
|
3084
|
+
min_distance_value: int,
|
|
3085
|
+
label_maxima: bool,
|
|
3086
|
+
th_abs: Optional[float]=None
|
|
3087
|
+
) -> Union[ImageBinary, ObjectSegmentation]:
|
|
3088
|
+
maxima_coords = peak_local_max(
|
|
3089
|
+
x_data,
|
|
3090
|
+
min_distance=min_distance_value,
|
|
3091
|
+
threshold_abs=th_abs,
|
|
3092
|
+
)
|
|
3093
|
+
y_data = numpy.zeros(x_data.shape, dtype=bool)
|
|
3094
|
+
y_data[tuple(maxima_coords.T)] = True
|
|
3095
|
+
|
|
3096
|
+
if label_maxima:
|
|
3097
|
+
y_data = scipy.ndimage.label(y_data)[0]
|
|
3098
|
+
return y_data
|
|
3099
|
+
|
|
3100
|
+
def find_maxima_threshold(x_data: ImageAny) -> ImageAny:
|
|
3101
|
+
"""Identity function, just returns the input"""
|
|
3102
|
+
return x_data
|
|
3103
|
+
|
|
3104
|
+
def apply_target_mask(x_data: ImageAny, masking_image: Union[ImageAny,ObjectSegmentation]) -> ImageAny:
|
|
3105
|
+
mask = masking_image.astype(bool)
|
|
3106
|
+
x_data[~mask] = 0
|
|
3107
|
+
return x_data
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import scipy.ndimage
|
|
2
|
+
from typing import Optional, Annotated, Union
|
|
3
|
+
from pydantic import validate_call, ConfigDict, Field
|
|
4
|
+
from cellprofiler_library.types import ImageAny, ObjectSegmentation, ImageBinary
|
|
5
|
+
from cellprofiler_library.opts.findmaxima import BackgroundExclusionMode
|
|
6
|
+
from cellprofiler_library.functions.image_processing import find_maxima_in_data, find_maxima_threshold, apply_target_mask
|
|
7
|
+
|
|
8
|
+
@validate_call(config=ConfigDict(arbitrary_types_allowed=True))
|
|
9
|
+
def find_maxima(
|
|
10
|
+
x_data: Annotated[ImageAny, Field(description="Input image to search for maxima")],
|
|
11
|
+
exclude_mode: Annotated[BackgroundExclusionMode, Field(description="Method for excluding background")],
|
|
12
|
+
min_distance_value: Annotated[int, Field(description="Minimum distance between maxima")], #Minimum distance between maxima
|
|
13
|
+
label_maxima: Annotated[bool, Field(description="Individually label maxima?")],
|
|
14
|
+
min_intensity_value: Annotated[Optional[float], Field(description="Specify the minimum intensity of a peak")],
|
|
15
|
+
target_mask: Annotated[Optional[Union[ImageAny,ObjectSegmentation]], Field(description="The image or objects to search within")],
|
|
16
|
+
) -> Union[ImageBinary, ObjectSegmentation]:
|
|
17
|
+
th_abs = min_intensity_value
|
|
18
|
+
|
|
19
|
+
if exclude_mode.value == BackgroundExclusionMode.THRESHOLD.value:
|
|
20
|
+
x_data = find_maxima_threshold(x_data)
|
|
21
|
+
elif exclude_mode.value == BackgroundExclusionMode.MASK.value:
|
|
22
|
+
assert target_mask is not None, "Mask image is required for mask mode"
|
|
23
|
+
x_data = apply_target_mask(x_data, target_mask)
|
|
24
|
+
elif exclude_mode.value == BackgroundExclusionMode.OBJECTS.value:
|
|
25
|
+
assert target_mask is not None, "Objects are required for within objects mode"
|
|
26
|
+
x_data = apply_target_mask(x_data, target_mask)
|
|
27
|
+
else:
|
|
28
|
+
raise NotImplementedError("Invalid background method choice")
|
|
29
|
+
|
|
30
|
+
return find_maxima_in_data(x_data, min_distance_value, label_maxima, th_abs)
|
|
31
|
+
|
|
@@ -0,0 +1,424 @@
|
|
|
1
|
+
from functools import partial
|
|
2
|
+
from collections.abc import Callable
|
|
3
|
+
from typing import Any, Tuple, Optional, Annotated, Union, cast
|
|
4
|
+
from typing_extensions import TypeAlias
|
|
5
|
+
from numpy.typing import NDArray
|
|
6
|
+
from pydantic import validate_call, ConfigDict, Field, BaseModel
|
|
7
|
+
import numpy as np
|
|
8
|
+
from cellprofiler_library.types import Image2D, Image2DMask
|
|
9
|
+
from ..opts.makeprojection import ProjectionType
|
|
10
|
+
|
|
11
|
+
STATE_NOT_INITIALIZED = "Invalid state key. Please initialize the state dictionary with a call to set_projection before calling this function"
|
|
12
|
+
NORM_IS_ZERO = "Norm is zero. Please check your input images"
|
|
13
|
+
REQ_IMG = "Image is required"
|
|
14
|
+
AGG_IMG_MISSING = "Aggregate image missing"
|
|
15
|
+
AGG_VSUM_MISSING = "Aggregate vsum missing"
|
|
16
|
+
AGG_VSQUARED_MISSING = "Aggregate vsquared missing"
|
|
17
|
+
AGG_POWER_MASK_MISSING = "Aggregate power mask missing"
|
|
18
|
+
AGG_POWER_IMAGE_MISSING = "Aggregate power image missing"
|
|
19
|
+
AGG_STACK_NUMBER_MISSING = "Aggregate stack number missing"
|
|
20
|
+
AGG_BRIGHT_MAX_MISSING = "Aggregate bright max mssing"
|
|
21
|
+
AGG_BRIGHT_MIN_MISSING = "Aggregate bright min mssing"
|
|
22
|
+
NORM0_MISSING = "Aggregate norm0 missing"
|
|
23
|
+
POWER_FREQUENCY_NOT_PROVIDED = "Frequency must be provided for Power projection"
|
|
24
|
+
AGG_IMG_MISTYPE = "Aggregate image must be bool mask"
|
|
25
|
+
|
|
26
|
+
T_PROJECTION_METHOD_INVALID = "Unknown projection method: %s"
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
ProjectionAccumulator: TypeAlias = Callable[
|
|
30
|
+
[
|
|
31
|
+
Image2D, # image
|
|
32
|
+
Optional[Image2DMask], # mask
|
|
33
|
+
],
|
|
34
|
+
"MakeProjectionAccumulator"
|
|
35
|
+
]
|
|
36
|
+
ProjectionFinalizer: TypeAlias = Callable[
|
|
37
|
+
[],
|
|
38
|
+
Tuple[Image2D, Image2DMask]
|
|
39
|
+
]
|
|
40
|
+
class MakeProjectionAccumulator(BaseModel):
|
|
41
|
+
model_config = ConfigDict(
|
|
42
|
+
arbitrary_types_allowed=True,
|
|
43
|
+
populate_by_name=True
|
|
44
|
+
)
|
|
45
|
+
|
|
46
|
+
accumulate: ProjectionAccumulator
|
|
47
|
+
finalize: ProjectionFinalizer
|
|
48
|
+
|
|
49
|
+
@validate_call(config=ConfigDict(arbitrary_types_allowed=True))
|
|
50
|
+
def makeprojection(
|
|
51
|
+
# set_projection
|
|
52
|
+
method: Annotated[ProjectionType, Field(description="The projection method")],
|
|
53
|
+
# set_projection, accumulate_projection
|
|
54
|
+
image: Annotated[Image2D, Field(description="The pixel data of the image to accumulate")],
|
|
55
|
+
mask: Annotated[Optional[Image2DMask], Field(description="The mask of the image (True = valid). If None, all pixels are valid")] = None,
|
|
56
|
+
frequency: Annotated[float, Field(description="Frequency parameter for Power projection")] = 6.0,
|
|
57
|
+
) -> MakeProjectionAccumulator:
|
|
58
|
+
has_mask = mask is not None
|
|
59
|
+
if not has_mask:
|
|
60
|
+
mask = np.ones(image.shape[:2], dtype=bool)
|
|
61
|
+
agg_image_count = mask.astype(int)
|
|
62
|
+
|
|
63
|
+
agg_vsum, agg_vsquared, agg_power_mask, agg_power_image, agg_stack_number, agg_bright_max, agg_bright_min, norm0, agg_image = (None,)*9
|
|
64
|
+
if method == ProjectionType.VARIANCE:
|
|
65
|
+
agg_vsum = image.copy()
|
|
66
|
+
agg_vsum[~mask] = 0
|
|
67
|
+
agg_vsquared = agg_vsum.astype(np.float64) ** 2.0
|
|
68
|
+
|
|
69
|
+
elif method == ProjectionType.POWER:
|
|
70
|
+
agg_vsum = image.copy()
|
|
71
|
+
agg_vsum[~mask] = 0
|
|
72
|
+
#
|
|
73
|
+
# e**0 = 1 so the first image is always in the real plane
|
|
74
|
+
#
|
|
75
|
+
agg_power_mask = agg_image_count.astype(np.complex128).copy()
|
|
76
|
+
agg_power_image = image.astype(np.complex128).copy()
|
|
77
|
+
agg_stack_number = np.array(1.)
|
|
78
|
+
|
|
79
|
+
elif method == ProjectionType.BRIGHTFIELD:
|
|
80
|
+
agg_bright_max = image.copy()
|
|
81
|
+
agg_bright_min = image.copy()
|
|
82
|
+
norm0 = np.mean(image)
|
|
83
|
+
|
|
84
|
+
elif method == ProjectionType.MASK:
|
|
85
|
+
agg_image = mask
|
|
86
|
+
|
|
87
|
+
elif method in (ProjectionType.AVERAGE, ProjectionType.SUM, ProjectionType.MAXIMUM, ProjectionType.MINIMUM):
|
|
88
|
+
agg_image = image.copy()
|
|
89
|
+
if has_mask:
|
|
90
|
+
nan_value = 1 if method == ProjectionType.MINIMUM else 0
|
|
91
|
+
agg_image[~mask] = nan_value
|
|
92
|
+
|
|
93
|
+
else:
|
|
94
|
+
raise ValueError(T_PROJECTION_METHOD_INVALID % method)
|
|
95
|
+
|
|
96
|
+
return MakeProjectionAccumulator(
|
|
97
|
+
accumulate = partial(
|
|
98
|
+
accumulate_projection,
|
|
99
|
+
method=method,
|
|
100
|
+
agg_image_count=agg_image_count,
|
|
101
|
+
agg_vsum=agg_vsum,
|
|
102
|
+
agg_vsquared=agg_vsquared,
|
|
103
|
+
agg_power_mask=agg_power_mask,
|
|
104
|
+
agg_power_image=agg_power_image,
|
|
105
|
+
frequency=frequency,
|
|
106
|
+
agg_stack_number=agg_stack_number,
|
|
107
|
+
agg_bright_max=agg_bright_max,
|
|
108
|
+
agg_bright_min=agg_bright_min,
|
|
109
|
+
norm0=norm0,
|
|
110
|
+
agg_image=agg_image,
|
|
111
|
+
),
|
|
112
|
+
finalize = partial(
|
|
113
|
+
calculate_final_projection,
|
|
114
|
+
method=method,
|
|
115
|
+
agg_image_count=agg_image_count,
|
|
116
|
+
agg_vsum=agg_vsum,
|
|
117
|
+
agg_vsquared=agg_vsquared,
|
|
118
|
+
agg_power_image=agg_power_image,
|
|
119
|
+
agg_power_mask=agg_power_mask,
|
|
120
|
+
agg_bright_max=agg_bright_max,
|
|
121
|
+
agg_bright_min=agg_bright_min,
|
|
122
|
+
agg_image=agg_image,
|
|
123
|
+
)
|
|
124
|
+
)
|
|
125
|
+
|
|
126
|
+
def accumulate_projection(
|
|
127
|
+
image: Annotated[Image2D, Field(description="The pixel data of the image to accumulate")],
|
|
128
|
+
mask: Annotated[Optional[Image2DMask], Field(description="The mask of the image (True = valid). If None, all pixels are valid")],
|
|
129
|
+
*,
|
|
130
|
+
method: Annotated[ProjectionType, Field(description="The projection method")],
|
|
131
|
+
agg_image_count: Annotated[NDArray[np.int_], Field(description="Aggregation of image count")],
|
|
132
|
+
agg_vsum: Annotated[Optional[Image2D], Field(description="Aggregation of variance (for methods variance, power)")],
|
|
133
|
+
agg_vsquared: Annotated[Optional[NDArray[np.float64]], Field(description="Aggregation of squared variance (for method variance)")],
|
|
134
|
+
agg_power_mask: Annotated[Optional[NDArray[np.complex128]], Field(description="Aggregation of power mask (for method power)")],
|
|
135
|
+
agg_power_image: Annotated[Optional[NDArray[np.complex128]], Field(description="Aggregation of power image (for method power)")],
|
|
136
|
+
frequency: Annotated[float, Field(description="Frequency parameter for Power projection")],
|
|
137
|
+
agg_stack_number: Annotated[Optional[NDArray[np.float64]], Field(description="Aggregation of stack number (for method power; zero dimensional)")],
|
|
138
|
+
agg_bright_max: Annotated[Optional[Image2D], Field(description="Aggregation of max brightfield vals (for method brightfield)")],
|
|
139
|
+
agg_bright_min: Annotated[Optional[Image2D], Field(description="Aggregation of min brightfield vals (for method brightfield)")],
|
|
140
|
+
norm0: Annotated[Optional[np.floating[Any]], Field(description="Normalization val (for method brightfield)")],
|
|
141
|
+
agg_image: Annotated[Optional[Union[Image2DMask, Image2D]], Field(description="Aggregation of image or mask (for methods mask, average, sum, maximum, minimum)")],
|
|
142
|
+
) -> MakeProjectionAccumulator:
|
|
143
|
+
"""
|
|
144
|
+
Accumulate an image into the projection state.
|
|
145
|
+
|
|
146
|
+
Args:
|
|
147
|
+
image: The pixel data of the image to accumulate.
|
|
148
|
+
mask: The mask of the image (True = valid). If None, all pixels are valid.
|
|
149
|
+
state: The current accumulation state. Empty dict for first image.
|
|
150
|
+
method: The projection method.
|
|
151
|
+
frequency: Frequency parameter for Power projection.
|
|
152
|
+
|
|
153
|
+
Returns:
|
|
154
|
+
Updated state dictionary.
|
|
155
|
+
"""
|
|
156
|
+
has_mask = mask is not None
|
|
157
|
+
if has_mask:
|
|
158
|
+
agg_image_count += mask.astype(int)
|
|
159
|
+
else:
|
|
160
|
+
agg_image_count += 1
|
|
161
|
+
# Ensure mask exists
|
|
162
|
+
if mask is None:
|
|
163
|
+
mask = np.ones(image.shape[:2], dtype=bool)
|
|
164
|
+
|
|
165
|
+
# Initialize if empty
|
|
166
|
+
|
|
167
|
+
if method == ProjectionType.AVERAGE or method == ProjectionType.SUM:
|
|
168
|
+
assert agg_image is not None, AGG_IMG_MISSING
|
|
169
|
+
_mut_accumulate_sum(image, mask, agg_image)
|
|
170
|
+
elif method == ProjectionType.MAXIMUM:
|
|
171
|
+
assert agg_image is not None, AGG_IMG_MISSING
|
|
172
|
+
_mut_accumulate_maximum(image, mask, agg_image)
|
|
173
|
+
elif method == ProjectionType.MINIMUM:
|
|
174
|
+
assert agg_image is not None, AGG_IMG_MISSING
|
|
175
|
+
_mut_accumulate_minimum(image, mask, agg_image)
|
|
176
|
+
elif method == ProjectionType.VARIANCE:
|
|
177
|
+
assert agg_vsum is not None, AGG_VSUM_MISSING
|
|
178
|
+
assert agg_vsquared is not None, AGG_VSQUARED_MISSING
|
|
179
|
+
_mut_accumulate_variance(image, mask, agg_vsum, agg_vsquared)
|
|
180
|
+
elif method == ProjectionType.POWER:
|
|
181
|
+
assert frequency is not None, POWER_FREQUENCY_NOT_PROVIDED
|
|
182
|
+
assert agg_vsum is not None, AGG_VSUM_MISSING
|
|
183
|
+
assert agg_power_mask is not None, AGG_POWER_MASK_MISSING
|
|
184
|
+
assert agg_power_image is not None, AGG_POWER_IMAGE_MISSING
|
|
185
|
+
assert agg_stack_number is not None, AGG_STACK_NUMBER_MISSING
|
|
186
|
+
_mut_accumulate_power(image, mask, frequency, agg_vsum, agg_power_mask, agg_power_image, agg_stack_number)
|
|
187
|
+
elif method == ProjectionType.BRIGHTFIELD:
|
|
188
|
+
assert agg_bright_max is not None, AGG_BRIGHT_MAX_MISSING
|
|
189
|
+
assert agg_bright_min is not None, AGG_BRIGHT_MIN_MISSING
|
|
190
|
+
assert norm0 is not None, NORM0_MISSING
|
|
191
|
+
_mut_accumulate_brightfield(image, mask, norm0, agg_bright_max, agg_bright_min)
|
|
192
|
+
elif method == ProjectionType.MASK:
|
|
193
|
+
assert agg_image is not None, AGG_IMG_MISSING
|
|
194
|
+
assert agg_image.dtype == np.bool_, AGG_IMG_MISTYPE
|
|
195
|
+
_mut_accumulate_mask(mask, cast(Image2DMask, agg_image))
|
|
196
|
+
else:
|
|
197
|
+
raise ValueError(T_PROJECTION_METHOD_INVALID % method)
|
|
198
|
+
|
|
199
|
+
return MakeProjectionAccumulator(
|
|
200
|
+
accumulate = partial(
|
|
201
|
+
accumulate_projection,
|
|
202
|
+
method=method,
|
|
203
|
+
agg_image_count=agg_image_count,
|
|
204
|
+
agg_vsum=agg_vsum,
|
|
205
|
+
agg_vsquared=agg_vsquared,
|
|
206
|
+
agg_power_mask=agg_power_mask,
|
|
207
|
+
agg_power_image=agg_power_image,
|
|
208
|
+
frequency=frequency,
|
|
209
|
+
agg_stack_number=agg_stack_number,
|
|
210
|
+
agg_bright_max=agg_bright_max,
|
|
211
|
+
agg_bright_min=agg_bright_min,
|
|
212
|
+
norm0=norm0,
|
|
213
|
+
agg_image=agg_image,
|
|
214
|
+
),
|
|
215
|
+
finalize = partial(
|
|
216
|
+
calculate_final_projection,
|
|
217
|
+
method=method,
|
|
218
|
+
agg_image_count=agg_image_count,
|
|
219
|
+
agg_vsum=agg_vsum,
|
|
220
|
+
agg_vsquared=agg_vsquared,
|
|
221
|
+
agg_power_image=agg_power_image,
|
|
222
|
+
agg_power_mask=agg_power_mask,
|
|
223
|
+
agg_bright_max=agg_bright_max,
|
|
224
|
+
agg_bright_min=agg_bright_min,
|
|
225
|
+
agg_image=agg_image,
|
|
226
|
+
)
|
|
227
|
+
)
|
|
228
|
+
|
|
229
|
+
def calculate_final_projection(
|
|
230
|
+
*,
|
|
231
|
+
method: Annotated[ProjectionType, Field(description="The projection method.")],
|
|
232
|
+
agg_image_count: Annotated[NDArray[np.int_], Field(description="Aggregation of image count")],
|
|
233
|
+
agg_vsum: Annotated[Optional[Image2D], Field(description="Aggregation of variance (for methods variance, power)")],
|
|
234
|
+
agg_vsquared: Annotated[Optional[NDArray[np.float64]], Field(description="Aggregation of squared variance (for method variance)")],
|
|
235
|
+
agg_power_image: Annotated[Optional[NDArray[np.complex128]], Field(description="Aggregation of power image (for method power)")],
|
|
236
|
+
agg_power_mask: Annotated[Optional[NDArray[np.complex128]], Field(description="Aggregation of power mask (for method power)")],
|
|
237
|
+
agg_bright_max: Annotated[Optional[Image2D], Field(description="Aggregation of max brightfield vals (for method brightfield)")],
|
|
238
|
+
agg_bright_min: Annotated[Optional[Image2D], Field(description="Aggregation of min brightfield vals (for method brightfield)")],
|
|
239
|
+
agg_image: Annotated[Optional[Union[Image2DMask, Image2D]], Field(description="Aggregation of image or mask (for methods mask, average, sum, maximum, minimum)")],
|
|
240
|
+
) -> Tuple[Image2D, Image2DMask]:
|
|
241
|
+
"""
|
|
242
|
+
Calculate the final projection image from the state.
|
|
243
|
+
|
|
244
|
+
Args:
|
|
245
|
+
state: The accumulation state.
|
|
246
|
+
method: The projection method.
|
|
247
|
+
|
|
248
|
+
Returns:
|
|
249
|
+
Tuple of (pixel_data, mask).
|
|
250
|
+
"""
|
|
251
|
+
mask_2d = agg_image_count > 0
|
|
252
|
+
final_projection = None
|
|
253
|
+
if method == ProjectionType.AVERAGE:
|
|
254
|
+
assert agg_image is not None, AGG_IMG_MISSING
|
|
255
|
+
final_projection = _finalize_average(agg_image, agg_image_count)
|
|
256
|
+
elif method == ProjectionType.SUM:
|
|
257
|
+
assert agg_image is not None, AGG_IMG_MISSING
|
|
258
|
+
final_projection = _finalize_sum(agg_image, agg_image_count)
|
|
259
|
+
elif method == ProjectionType.MAXIMUM:
|
|
260
|
+
assert agg_image is not None, AGG_IMG_MISSING
|
|
261
|
+
final_projection = _finalize_maximum(agg_image, agg_image_count)
|
|
262
|
+
elif method == ProjectionType.MINIMUM:
|
|
263
|
+
assert agg_image is not None, AGG_IMG_MISSING
|
|
264
|
+
final_projection = _finalize_minimum(agg_image, agg_image_count)
|
|
265
|
+
elif method == ProjectionType.VARIANCE:
|
|
266
|
+
assert agg_vsum is not None, AGG_VSUM_MISSING
|
|
267
|
+
assert agg_vsquared is not None, AGG_VSQUARED_MISSING
|
|
268
|
+
final_projection = _finalize_variance(agg_vsum, agg_vsquared, agg_image_count)
|
|
269
|
+
elif method == ProjectionType.POWER:
|
|
270
|
+
assert agg_vsum is not None, AGG_VSUM_MISSING
|
|
271
|
+
assert agg_power_mask is not None, AGG_POWER_MASK_MISSING
|
|
272
|
+
assert agg_power_image is not None, AGG_POWER_IMAGE_MISSING
|
|
273
|
+
final_projection = _finalize_power(agg_image_count, agg_power_image, agg_power_mask, agg_vsum)
|
|
274
|
+
elif method == ProjectionType.BRIGHTFIELD:
|
|
275
|
+
assert agg_bright_max is not None, AGG_BRIGHT_MAX_MISSING
|
|
276
|
+
assert agg_bright_min is not None, AGG_BRIGHT_MIN_MISSING
|
|
277
|
+
final_projection = _finalize_brightfield(agg_image_count, agg_bright_max, agg_bright_min)
|
|
278
|
+
elif method == ProjectionType.MASK:
|
|
279
|
+
assert agg_image is not None, AGG_IMG_MISSING
|
|
280
|
+
final_projection = _finalize_mask(agg_image)
|
|
281
|
+
else:
|
|
282
|
+
raise ValueError(T_PROJECTION_METHOD_INVALID % method)
|
|
283
|
+
|
|
284
|
+
return final_projection, mask_2d
|
|
285
|
+
|
|
286
|
+
# --- Helper functions ---
|
|
287
|
+
|
|
288
|
+
# NOTE: _mut prefix means the function mutates input numpy arrays, rather than returning new arrays
|
|
289
|
+
|
|
290
|
+
def _mut_accumulate_sum(image: Image2D, mask: Image2DMask, agg_image: Union[Image2DMask, Image2D]):
|
|
291
|
+
"""This function is called by both sum and average projection methods"""
|
|
292
|
+
agg_image[mask] += image[mask]
|
|
293
|
+
|
|
294
|
+
def _finalize_sum(agg_image: Union[Image2DMask, Image2D], agg_image_count: NDArray[np.int_]) -> Image2D:
|
|
295
|
+
mask = agg_image_count > 0
|
|
296
|
+
|
|
297
|
+
if np.any(~mask):
|
|
298
|
+
cached_image = agg_image.copy()
|
|
299
|
+
cached_image[~mask] = 0
|
|
300
|
+
else:
|
|
301
|
+
cached_image = agg_image
|
|
302
|
+
|
|
303
|
+
return cached_image
|
|
304
|
+
|
|
305
|
+
def _finalize_average(agg_image: Union[Image2DMask, Image2D], agg_image_count: NDArray[np.int_]) -> Image2D:
|
|
306
|
+
# Handle multi-channel image count broadcasting
|
|
307
|
+
if agg_image.ndim == 3 and agg_image_count.ndim == 2:
|
|
308
|
+
agg_image_count = np.dstack([agg_image_count] * agg_image.shape[2])
|
|
309
|
+
|
|
310
|
+
mask = agg_image_count > 0
|
|
311
|
+
|
|
312
|
+
# Avoid divide by zero
|
|
313
|
+
cached_image = np.zeros_like(agg_image)
|
|
314
|
+
valid = agg_image_count > 0
|
|
315
|
+
cached_image[valid] = agg_image[valid] / agg_image_count[valid]
|
|
316
|
+
|
|
317
|
+
if cached_image.ndim == 3 and mask.ndim == 2:
|
|
318
|
+
cached_image[~mask, :] = 0
|
|
319
|
+
else:
|
|
320
|
+
cached_image[~mask] = 0
|
|
321
|
+
|
|
322
|
+
return cached_image
|
|
323
|
+
|
|
324
|
+
def _mut_accumulate_maximum(image: Image2D, mask: Image2DMask, agg_image: Union[Image2DMask, Image2D]):
|
|
325
|
+
agg_image[mask] = np.maximum(agg_image[mask], image[mask])
|
|
326
|
+
|
|
327
|
+
def _finalize_maximum(agg_image: Union[Image2DMask, Image2D], agg_image_count: NDArray[np.int_]) -> Image2D:
|
|
328
|
+
# Same finalization logic as SumProvider except it uses the max accumulated image
|
|
329
|
+
return _finalize_sum(agg_image, agg_image_count)
|
|
330
|
+
|
|
331
|
+
def _mut_accumulate_minimum(image: Image2D, mask: Image2DMask, agg_image: Union[Image2DMask, Image2D]):
|
|
332
|
+
agg_image[mask] = np.minimum(agg_image[mask], image[mask])
|
|
333
|
+
|
|
334
|
+
def _finalize_minimum(agg_image: Union[Image2DMask, Image2D], agg_image_count: NDArray[np.int_]) -> Image2D:
|
|
335
|
+
return _finalize_sum(agg_image, agg_image_count)
|
|
336
|
+
|
|
337
|
+
def _mut_accumulate_variance(image: Image2D, mask: Image2DMask, agg_vsum: Image2D, agg_vsquared: NDArray[np.float64]):
|
|
338
|
+
agg_vsum[mask] += image[mask]
|
|
339
|
+
agg_vsquared[mask] += image[mask].astype(np.float64) ** 2
|
|
340
|
+
|
|
341
|
+
def _finalize_variance(agg_vsum: Image2D, agg_vsquared: NDArray[np.float64], agg_image_count: NDArray[np.int_]) -> Image2D:
|
|
342
|
+
if agg_vsquared.ndim == 3 and agg_image_count.ndim == 2:
|
|
343
|
+
agg_image_count = np.dstack([agg_image_count] * agg_vsquared.shape[2])
|
|
344
|
+
|
|
345
|
+
mask = agg_image_count > 0
|
|
346
|
+
|
|
347
|
+
cached_image = np.zeros(agg_vsquared.shape, np.float32)
|
|
348
|
+
|
|
349
|
+
# Calculate variance: E[x^2] - (E[x])^2
|
|
350
|
+
|
|
351
|
+
valid = mask # logic alias
|
|
352
|
+
cached_image[valid] = agg_vsquared[valid] / agg_image_count[valid]
|
|
353
|
+
cached_image[valid] -= (agg_vsum[valid] ** 2) / (agg_image_count[valid] ** 2)
|
|
354
|
+
|
|
355
|
+
cached_image[~mask] = 0
|
|
356
|
+
|
|
357
|
+
return cached_image
|
|
358
|
+
|
|
359
|
+
def _mut_accumulate_power(
|
|
360
|
+
image: Image2D,
|
|
361
|
+
mask: Image2DMask,
|
|
362
|
+
frequency: float,
|
|
363
|
+
agg_vsum: Image2D,
|
|
364
|
+
agg_power_mask: NDArray[np.complex128],
|
|
365
|
+
agg_power_image: NDArray[np.complex128],
|
|
366
|
+
agg_stack_number: NDArray[np.float64],
|
|
367
|
+
):
|
|
368
|
+
multiplier = np.exp(2j * np.pi * agg_stack_number / frequency)
|
|
369
|
+
agg_stack_number += 1
|
|
370
|
+
|
|
371
|
+
agg_vsum[mask] += image[mask]
|
|
372
|
+
agg_power_image[mask] += multiplier * image[mask]
|
|
373
|
+
agg_power_mask[mask] += multiplier
|
|
374
|
+
|
|
375
|
+
def _finalize_power(
|
|
376
|
+
agg_image_count: NDArray[np.int_],
|
|
377
|
+
agg_power_image: NDArray[np.complex128],
|
|
378
|
+
agg_power_mask: NDArray[np.complex128],
|
|
379
|
+
agg_vsum: Image2D,
|
|
380
|
+
) -> Image2D:
|
|
381
|
+
if agg_power_image.ndim == 3 and agg_image_count.ndim == 2:
|
|
382
|
+
agg_image_count = np.dstack([agg_image_count] * agg_power_image.shape[2])
|
|
383
|
+
|
|
384
|
+
mask = agg_image_count > 0
|
|
385
|
+
|
|
386
|
+
cached_image = np.zeros(agg_image_count.shape, np.complex128)
|
|
387
|
+
cached_image[mask] = agg_power_image[mask]
|
|
388
|
+
cached_image[mask] -= (agg_vsum[mask] * agg_power_mask[mask] / agg_image_count[mask])
|
|
389
|
+
|
|
390
|
+
# |z|^2 = z * conj(z)
|
|
391
|
+
cached_image = (cached_image * np.conj(cached_image)).real.astype(np.float32)
|
|
392
|
+
cached_image[~mask] = 0
|
|
393
|
+
|
|
394
|
+
return cached_image
|
|
395
|
+
|
|
396
|
+
def _mut_accumulate_brightfield(image: Image2D, mask: Image2DMask, norm0: np.floating[Any], agg_bright_max: Image2D, agg_bright_min: Image2D):
|
|
397
|
+
norm = np.mean(image)
|
|
398
|
+
assert norm != 0, NORM_IS_ZERO
|
|
399
|
+
pixel_data = image * norm0 / norm
|
|
400
|
+
|
|
401
|
+
max_mask = (agg_bright_max < pixel_data) & mask
|
|
402
|
+
min_mask = (agg_bright_min > pixel_data) & mask
|
|
403
|
+
|
|
404
|
+
agg_bright_min[min_mask] = pixel_data[min_mask]
|
|
405
|
+
agg_bright_max[max_mask] = pixel_data[max_mask]
|
|
406
|
+
agg_bright_min[max_mask] = agg_bright_max[max_mask]
|
|
407
|
+
|
|
408
|
+
def _finalize_brightfield(agg_image_count: NDArray[np.int_], agg_bright_max: Image2D, agg_bright_min: Image2D) -> Image2D:
|
|
409
|
+
if agg_bright_max.ndim == 3 and agg_image_count.ndim == 2:
|
|
410
|
+
agg_image_count = np.dstack([agg_image_count] * agg_bright_max.shape[2])
|
|
411
|
+
|
|
412
|
+
mask = agg_image_count > 0
|
|
413
|
+
|
|
414
|
+
cached_image = np.zeros(agg_image_count.shape, np.float32)
|
|
415
|
+
cached_image[mask] = agg_bright_max[mask] - agg_bright_min[mask]
|
|
416
|
+
cached_image[~mask] = 0
|
|
417
|
+
|
|
418
|
+
return cached_image
|
|
419
|
+
|
|
420
|
+
def _mut_accumulate_mask(mask: Image2DMask, agg_image: Image2DMask):
|
|
421
|
+
agg_image &= mask
|
|
422
|
+
|
|
423
|
+
def _finalize_mask(agg_image: Union[Image2DMask, Image2D]) -> Image2D:
|
|
424
|
+
return agg_image
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
from enum import Enum
|
|
2
|
+
|
|
3
|
+
class ProjectionType(str, Enum):
|
|
4
|
+
AVERAGE = "Average"
|
|
5
|
+
MAXIMUM = "Maximum"
|
|
6
|
+
MINIMUM = "Minimum"
|
|
7
|
+
SUM = "Sum"
|
|
8
|
+
VARIANCE = "Variance"
|
|
9
|
+
POWER = "Power"
|
|
10
|
+
BRIGHTFIELD = "Brightfield"
|
|
11
|
+
MASK = "Mask"
|
|
12
|
+
|
|
13
|
+
P_ALL = [
|
|
14
|
+
ProjectionType.AVERAGE.value,
|
|
15
|
+
ProjectionType.MAXIMUM.value,
|
|
16
|
+
ProjectionType.MINIMUM.value,
|
|
17
|
+
ProjectionType.SUM.value,
|
|
18
|
+
ProjectionType.VARIANCE.value,
|
|
19
|
+
ProjectionType.POWER.value,
|
|
20
|
+
ProjectionType.BRIGHTFIELD.value,
|
|
21
|
+
ProjectionType.MASK.value,
|
|
22
|
+
]
|
|
@@ -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.dev684
|
|
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>
|
|
@@ -31,6 +31,7 @@ cellprofiler_library/modules/_erodeobjects.py
|
|
|
31
31
|
cellprofiler_library/modules/_expandorshrinkobjects.py
|
|
32
32
|
cellprofiler_library/modules/_fillobjects.py
|
|
33
33
|
cellprofiler_library/modules/_filterobjects.py
|
|
34
|
+
cellprofiler_library/modules/_findmaxima.py
|
|
34
35
|
cellprofiler_library/modules/_flipandrotate.py
|
|
35
36
|
cellprofiler_library/modules/_gaussianfilter.py
|
|
36
37
|
cellprofiler_library/modules/_graytocolor.py
|
|
@@ -39,6 +40,7 @@ cellprofiler_library/modules/_identifyprimaryobjects.py
|
|
|
39
40
|
cellprofiler_library/modules/_identifysecondaryobjects.py
|
|
40
41
|
cellprofiler_library/modules/_identifytertiaryobjects.py
|
|
41
42
|
cellprofiler_library/modules/_imagemath.py
|
|
43
|
+
cellprofiler_library/modules/_makeprojection.py
|
|
42
44
|
cellprofiler_library/modules/_measurecolocalization.py
|
|
43
45
|
cellprofiler_library/modules/_measuregranularity.py
|
|
44
46
|
cellprofiler_library/modules/_measureimageareaoccupied.py
|
|
@@ -83,6 +85,7 @@ cellprofiler_library/opts/enhanceorsuppressfeatures.py
|
|
|
83
85
|
cellprofiler_library/opts/erodeimage.py
|
|
84
86
|
cellprofiler_library/opts/erodeobjects.py
|
|
85
87
|
cellprofiler_library/opts/filterobjects.py
|
|
88
|
+
cellprofiler_library/opts/findmaxima.py
|
|
86
89
|
cellprofiler_library/opts/flipandrotate.py
|
|
87
90
|
cellprofiler_library/opts/graytocolor.py
|
|
88
91
|
cellprofiler_library/opts/identifydeadworms.py
|
|
@@ -90,6 +93,7 @@ cellprofiler_library/opts/identifyprimaryobjects.py
|
|
|
90
93
|
cellprofiler_library/opts/identifysecondaryobjects.py
|
|
91
94
|
cellprofiler_library/opts/identifytertiaryobjects.py
|
|
92
95
|
cellprofiler_library/opts/imagemath.py
|
|
96
|
+
cellprofiler_library/opts/makeprojection.py
|
|
93
97
|
cellprofiler_library/opts/measurecolocalization.py
|
|
94
98
|
cellprofiler_library/opts/measuregranularity.py
|
|
95
99
|
cellprofiler_library/opts/measureimageareaoccupied.py
|
|
@@ -28,6 +28,7 @@
|
|
|
28
28
|
"cellprofiler_library/modules/_expandorshrinkobjects.py",
|
|
29
29
|
"cellprofiler_library/modules/_fillobjects.py",
|
|
30
30
|
"cellprofiler_library/modules/_filterobjects.py",
|
|
31
|
+
"cellprofiler_library/modules/_findmaxima.py",
|
|
31
32
|
"cellprofiler_library/modules/_flipandrotate.py",
|
|
32
33
|
"cellprofiler_library/modules/_gaussianfilter.py",
|
|
33
34
|
"cellprofiler_library/modules/_graytocolor.py",
|
|
@@ -36,6 +37,7 @@
|
|
|
36
37
|
"cellprofiler_library/modules/_identifysecondaryobjects.py",
|
|
37
38
|
"cellprofiler_library/modules/_identifytertiaryobjects.py",
|
|
38
39
|
"cellprofiler_library/modules/_imagemath.py",
|
|
40
|
+
"cellprofiler_library/modules/_makeprojection.py",
|
|
39
41
|
"cellprofiler_library/modules/_measurecolocalization.py",
|
|
40
42
|
"cellprofiler_library/modules/_measuregranularity.py",
|
|
41
43
|
"cellprofiler_library/modules/_measureimageareaoccupied.py",
|
|
@@ -80,6 +82,7 @@
|
|
|
80
82
|
"cellprofiler_library/opts/erodeimage.py",
|
|
81
83
|
"cellprofiler_library/opts/erodeobjects.py",
|
|
82
84
|
"cellprofiler_library/opts/filterobjects.py",
|
|
85
|
+
"cellprofiler_library/opts/findmaxima.py",
|
|
83
86
|
"cellprofiler_library/opts/flipandrotate.py",
|
|
84
87
|
"cellprofiler_library/opts/graytocolor.py",
|
|
85
88
|
"cellprofiler_library/opts/identifydeadworms.py",
|
|
@@ -87,6 +90,7 @@
|
|
|
87
90
|
"cellprofiler_library/opts/identifysecondaryobjects.py",
|
|
88
91
|
"cellprofiler_library/opts/identifytertiaryobjects.py",
|
|
89
92
|
"cellprofiler_library/opts/imagemath.py",
|
|
93
|
+
"cellprofiler_library/opts/makeprojection.py",
|
|
90
94
|
"cellprofiler_library/opts/measurecolocalization.py",
|
|
91
95
|
"cellprofiler_library/opts/measuregranularity.py",
|
|
92
96
|
"cellprofiler_library/opts/measureimageareaoccupied.py",
|
{cellprofiler_library_nightly-5.0.0.dev669 → cellprofiler_library_nightly-5.0.0.dev684}/LICENSE
RENAMED
|
File without changes
|
{cellprofiler_library_nightly-5.0.0.dev669 → cellprofiler_library_nightly-5.0.0.dev684}/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
|
|
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.dev669 → cellprofiler_library_nightly-5.0.0.dev684}/setup.cfg
RENAMED
|
File without changes
|