Skip to content

Releases: vanvalenlab/deepcell-toolbox

0.12.0

20 Dec 21:10
af20912
Compare
Choose a tag to compare

🧰 Maintenance

MAINT: update deprecated code from dependencies and remove warnings filters @rossbar (#131)

The current pytest configuration is suppressing all deprecation warnings, which includes warnings from dependency libraries. This makes it much more likely for code to fall out-of-date, as can be seen in the recent failing CI jobs due to changes in the lastest version of numpy which was just releases (1.24).

This PR addresses the issue in two ways:

  1. Updates code to take into account changes in the underlying libraries, and
  2. Removes the global warnings filter in favor of fine-grained warnings filtering.

The second bullet involves adding explicit checks for warnings raised by deepcell-toolbox itself, to ensure that warnings are being raised correctly in the expected cases.

Add Python3.10 support @rossbar (#128)

Adds support for Python 3.10. No changes to the underlying library but some dependency updates were required, the main ones being:

We can of course re-add code linting using different tooling - I'm happy to do so but would prefer to leave it for a follow-up PR.

0.11.2

17 May 17:13
73e8861
Compare
Choose a tag to compare

🧰 Maintenance

Release numpy upper bound @msschwartz21 (#125)

This PR supports vanvalenlab/deepcell-tf#595 which upgrades tensorflow to 2.8 and allows new versions of numpy.

0.11.1

26 Jan 22:00
89df4b8
Compare
Choose a tag to compare

🐛 Bug Fixes

Correct dice property to return dice statistic @msschwartz21 (#122)

Addresses the bug identified in #121.

🧰 Maintenance

Update copyright to 2022 @msschwartz21 (#123)

Also bump up version for the next release

0.11.0

15 Dec 18:17
62279d4
Compare
Choose a tag to compare

🚀 Features

Remove `correct_drift` to support the new `skimage` release 0.19.0. @willgraf (#119)
  • Use segmentation.watershed instead of morphology.watershed.
  • Remove correct_drift (Fixes #6) and register_translation is removed in 0.19.x.
  • Set array slices with tuples to prevent warnings.
  • Update skimage version requirements to avoid bug in peak_local_max in 0.16.x and 0.17.x.

🐛 Bug Fixes

Pin python-version to 3.8 for PyPI deployment. @willgraf (#120)

numpy restriction for the toolbox requires Python < 3.10

Remove `correct_drift` to support the new `skimage` release 0.19.0. @willgraf (#119)
  • Use segmentation.watershed instead of morphology.watershed.
  • Remove correct_drift (Fixes #6) and register_translation is removed in 0.19.x.
  • Set array slices with tuples to prevent warnings.
  • Update skimage version requirements to avoid bug in peak_local_max in 0.16.x and 0.17.x.
Set Recall, Precision, and SEG to all have same scale. @willgraf (#118)

Precision and SEG were being multiplied by 100 while Recall was not. This removes the 100x casting to make all metrics be in the same range [0, 1].

Additionally, fixes the norecursedirs value in pytest.ini to be space-delimited instead of comma-delimited.

Finally, pins coveralls<3.3.0 to prevent a breaking change in the latest release.

Fixes #117

🧰 Maintenance

Move `compute_overlap_3D` into `compute_overlap.pyx` @willgraf (#116)

No need to have each function in their own files.

0.10.3

15 Dec 18:41
Compare
Choose a tag to compare

🐛 Bug Fixes

Pin `scikit-image` to < 0.19.0. @willgraf (#119)

Resolves a breaking change in the new release causing import issues.

0.10.2

17 Aug 01:17
68659e3
Compare
Choose a tag to compare

🐛 Bug Fixes

Optimize hole filling algorithm @ngreenwald (#114)

This PR closes #113. It replaces the previous hole-filling algorithm with an optimized, regionprops-based version. The remaining bottleneck in the post-processing is now peak finding, so the warning message for large images is now raised when h_maxima is selected for large images instead of peak_local_max

🧰 Maintenance

Bump version to `0.10.2`. @willgraf (#115)
Update name from Deepcell to DeepCell to match other projects. @willgraf (#112)
Cache the entire Python environment to speed up build times. @willgraf (#111)

What

  • Cache the entire Python environment in the testing GitHub Action workflow.

Why

0.10.1

02 Jul 03:02
ac0ef9e
Compare
Choose a tag to compare

🧰 Maintenance

Support Python 3.9 @willgraf (#110)

0.10.0

22 Jun 23:52
1999d22
Compare
Choose a tag to compare

🚀 Features

Combine `deep_watershed` and `deep_watershed_mibi` @willgraf (#108)

This PR combines deep_watershed and deep_watershed_mibi into a single function, deep_watershed.

The following arguments have been deprecated in favor of their deep_watershed_mibi alternatives (due to readability/understandability):

  • min_distance deprecated in favor of radius
  • distance_threshold deprecated in favor of interior_threshold
  • detection_threshold deprecated in favor of maxima_threshold

Additionally, new arguments have been moved over from deep_watershed_mibi:

  • maxima_smooth and interior_smooth to smooth the inputs with a gaussian filter.
  • fill_holes_threshold to fill holes smaller than this many pixels
  • pixel_expansion to expand the interior array
  • maxima_algorithm to switch from h_maxima peak finder to peak_local_max. By default, deep_watershed now uses h_maxima to find the peaks in an image. However, to use the previous algorithm, the user can pass peak_local_max instead. This is found to be less accurate but faster, and may be suitable for unambiguous peaks.

The input to the function is still a list of two numpy arrays, though more can be passed as long as the indices of the maxima and interior arrays are passed with maxima_index and interior_index.

Finally, label_erosion was added as a parameter to enable eroding labels (as performed by deep_watershed by default).


This PR leaves deep_watershed_3D and deep_watershed_mibi as importable functions, but they will just use deep_watershed internally. These will be removed in a future version, along with the deprecated arguments.


Fixes #51

Refactor `deepcell_toolbox.metrics` for better reproducibility and performance. @willgraf (#106)

This PR significantly refactors deepcell_toolbox.metrics.Metrics. Now, a Detection object is created for each combination of overlapping objects in each y_pred and y_true image. The Detections allow for easier calculation of all metrics and error types on the fly. These metrics/error types are now tracked as properties on ObjectMetrics rather than each having an individual attribute that is mutated with each function call. Metrics also now has a summarize_object_metrics_df method to help convert the data frame of every metric into summary statistics. This has greatly cleaned up the existing attributes and their instantiation; the pattern of adding attributes when helper functions are called has been removed entirely.
Extra attention was also given to cases where there may be division by 0 or other NaN issues, which should prevent the spammy warnings that we had seen in previous versions.

The performance has also been greatly improved - from 60 batches/s to 300 batches/s (or from 45s to 9s for my 2880 test batches). This was primarily accomplished through:

  • Creating a single pd.DataFrame using from_records, rather than iteratively creating and appending data frames for each ObjectMetrics calculated.
  • Using count_nonzero instead of sum where possible, which prevents coercing the datatype from boolean to float.

⚠️ Breaking Changes ⚠️

This PR has several breaking changes to deepcell_toolbox.metrics:

  • seg has been deprecated, but not removed (yet). The SEG score is always calculated.
  • stats and output are no longer attributes
  • ObjectAccuracy is now ObjectMetrics
  • stats_pixelbased has been replaced with PixelMetrics
  • all_pixel_stats has been replaced with calc_pixel_stats to be consistent with calc_object_stats.
  • calc_pixel_confusion_matrix has been replaced with PixelMetrics.get_confusion_matrix
  • pixel_df_to_dict has been replaced with df_to_dict
  • save_error_ids, assign_plot_values, and plot_errors have all been removed in favor of ObjectMetrics.plot_errors.
  • to_precision has been removed as it is seemingly redundant to the round built-in.

I hope these breaking changes do not disrupt many downstream processes - I only found the use of Metrics.calc_object_stats, which should be unaffected.


Fixes #26 (Object stats and force_event_links should likely resolve this. If not we can re-open it or make a new issue)
Fixes #68 (Performance has improved by a factor of ~5)

🐛 Bug Fixes

Combine `deep_watershed` and `deep_watershed_3D` \& deprecate `deep_watershed_3D`. @willgraf (#107)

The only difference in these two functions was the dimensionality of the coords found in peak_local_max. Switching to a comprehension allows us to easily use 2D or 3D data with the same function.

deep_watershed_3D is now deprecated (and throws a Deprecation Warning), but is kept for now for backward compatibility.

Import `watershed` from `skimage.segmentation`. @willgraf (#105)

skimage.morphology.watershed is deprecated and removed in skimage v0.19. This PR uses skimage.segmentation.watershed instead, which is supported by at least 0.14+.

This resolves an annoying deprecation warning we get every time we use the post-processing function.

🧰 Maintenance

Bump version to 0.10.0 @willgraf (#109)

0.9.1

02 Jun 20:13
e2f6e9e
Compare
Choose a tag to compare
Add release-drafter to automate release drafts and changelogs. @willgraf (#100)

Adding a template and GitHub workflow for the release-drafter. This should automatically create and update a draft for the next release of the project.

🚀 Features

Cache caluclated windows to avoid unnecessary computation. @willgraf (#99)
Check for divide by zero @ngreenwald (#102)

We currently don't check that there are valid predictions when computing precision, which can lead to divide by zero errors.

0.9.0

02 Mar 20:33
88fa8e5
Compare
Choose a tag to compare

0.9.0

Features

  • Add F1, precision, recall to metrics package. (#95)

Bugfixes

  • Add warning to Metrics when relabeling (#70)
  • Cast inputs to relabel_sequential as ints for scikit-image 0.17+ compatibility. (#92)

Breaking Changes

  • Remove RetinaNet and RetinaMask utility functions. (#94)
  • Remove multiplex_utils.py. (#97)
  • Dropped support for Python 2.7 (#95)