Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New simplelayer SavitzkyGolayFilter() and transform SavitzkyGolaySmooth() #1418

Merged
merged 7 commits into from
Jan 15, 2021

Conversation

crnbaker
Copy link
Contributor

@crnbaker crnbaker commented Jan 7, 2021

Fixes #1155 .

Description

New simplelayer SavitzkyGolayFilter() applies Savitzky Golay filter to a Tensor along a given axis. New array transform SavitzkyGolaySmooth() uses SavitzkyGolayFilter(). Required change to separable_filtering() simplelayer: now has option to use padding modes other than 'zeros' during convolution.

Example: Smoothing a noisy pulse, result compared to SciPy.signal.savgol_filter.
image

Performance compared to SciPy.signal.savgol_filter:
image

Above plots generated using this Google CoLab notebook.

Status

Ready

Types of changes

  • Breaking change (fix or new feature that would cause existing functionality to change).
  • New tests added to cover the changes.
  • Quick tests passed locally by running ./runtests.sh --quick.
  • In-line docstrings updated.
  • Documentation updated, tested make html command in the docs/ folder.

@crnbaker crnbaker marked this pull request as draft January 7, 2021 16:42
@crnbaker crnbaker force-pushed the 1155-savitzky-golay-kernel branch 9 times, most recently from 96a762c to 5b67b01 Compare January 8, 2021 10:03
@crnbaker crnbaker closed this Jan 8, 2021
@crnbaker crnbaker force-pushed the 1155-savitzky-golay-kernel branch from 5b67b01 to a4ef691 Compare January 8, 2021 10:12
@crnbaker crnbaker reopened this Jan 8, 2021
@crnbaker crnbaker force-pushed the 1155-savitzky-golay-kernel branch from 6248e34 to 4e4416a Compare January 8, 2021 10:23
@crnbaker crnbaker force-pushed the 1155-savitzky-golay-kernel branch 8 times, most recently from 7f0f3c5 to cda44a4 Compare January 13, 2021 10:10
@crnbaker crnbaker marked this pull request as ready for review January 13, 2021 16:55
@crnbaker crnbaker changed the title New simplelayer SavitskyGolayFilter() and transform SavitskyGolaySmooth() New simplelayer SavitzkyGolayFilter() and transform SavitzkyGolaySmooth() Jan 13, 2021
Copy link
Contributor

@wyli wyli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thank you! please see some minor comments inline

monai/networks/layers/simplelayers.py Outdated Show resolved Hide resolved
monai/networks/layers/simplelayers.py Outdated Show resolved Hide resolved
monai/networks/layers/simplelayers.py Outdated Show resolved Hide resolved
tests/utils.py Outdated Show resolved Hide resolved
@crnbaker crnbaker force-pushed the 1155-savitzky-golay-kernel branch from 759daf5 to 4b3345b Compare January 15, 2021 12:02
Copy link
Contributor

@wyli wyli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks! would be great to have the benchmarking notebook in https://github.com/Project-MONAI/tutorials

@crnbaker
Copy link
Contributor Author

Cool I will move it there, thanks for approving!

@wyli wyli merged commit ec70d96 into Project-MONAI:master Jan 15, 2021
@crnbaker crnbaker deleted the 1155-savitzky-golay-kernel branch January 15, 2021 14:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Savitzky-Golay kernel for data smoothing
2 participants