Skip to content

ENH: Adding python sample for ConvolveImageWithKernel #376

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

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

PranjalSahu
Copy link
Collaborator

No description provided.

@github-actions github-actions bot added area:Filtering Issues affecting the Filtering module language:Python Changes to Python examples type:Enhancement Improvement of existing methods or implementation labels May 20, 2022
Comment on lines 29 to 31
import matplotlib.pyplot as plt
plt.imshow(filteredImage)
plt.show()
Copy link
Contributor

Choose a reason for hiding this comment

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

Per discussion, could you please add 1) output with itk.imwrite for baseline comparison against the C++ example, and 2) perhaps a screenshot of matplotlib output?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Added matplotlib visualization screenshot.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I will build it locally to see how it renders.

@PranjalSahu PranjalSahu force-pushed the ConvolveImageWithKernel branch from a4027f2 to 9150fc9 Compare May 21, 2022 20:07
@github-actions github-actions bot added area:Documentation Issues affecting the Documentation module type:Data Changes to example data (usually displayed images) labels May 21, 2022
@PranjalSahu PranjalSahu force-pushed the ConvolveImageWithKernel branch from 9150fc9 to e7bfc2b Compare May 21, 2022 21:28
@github-actions github-actions bot added the type:Infrastructure Infrastructure/ecosystem related changes, such as CMake or buildbots label May 21, 2022
@PranjalSahu PranjalSahu marked this pull request as draft May 21, 2022 22:10
@PranjalSahu PranjalSahu force-pushed the ConvolveImageWithKernel branch from e7bfc2b to 96e1773 Compare May 21, 2022 22:21
@thewtex
Copy link
Member

thewtex commented May 23, 2022

Hi @PranjalSahu , Could you please rebase on master -- there were package improvements unrelated to your patch that may be causing issues in CI.

@PranjalSahu PranjalSahu force-pushed the ConvolveImageWithKernel branch from 96e1773 to 8a39cea Compare May 23, 2022 17:18
@PranjalSahu
Copy link
Collaborator Author

It is failing due to automatically generated test for baseline comparison between C++ and Python
ConvolveImageWithKernelTestBaselineComparisonPython.

@tbirdso
Copy link
Contributor

tbirdso commented May 23, 2022

Ah right, I've also run into issues with C++/Python baseline comparisons before. The ITKSphinxExamples macros were set up with the assumption that C++ and Python script output should always be the same and therefore use the same baseline image; as you've demonstrated here, there are exceptions to this rule.

Some possible paths forward:

  1. Explicitly port the C++ sample to Python, using the exact same data and image pipeline, so that the result is the same
  2. Disable the baseline comparison for now
  3. Move the Python sample to a new example with a PYTHON_ONLY baseline check
  4. Modify the CMake baseline macro so that different baselines can be explicitly provided for C++ and Python examples at the user's discretion

@PranjalSahu PranjalSahu force-pushed the ConvolveImageWithKernel branch from 8a39cea to 45adbcb Compare June 6, 2022 06:45
@PranjalSahu PranjalSahu force-pushed the ConvolveImageWithKernel branch from 45adbcb to 94a3211 Compare June 6, 2022 06:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:Documentation Issues affecting the Documentation module area:Filtering Issues affecting the Filtering module language:Python Changes to Python examples type:Data Changes to example data (usually displayed images) type:Enhancement Improvement of existing methods or implementation type:Infrastructure Infrastructure/ecosystem related changes, such as CMake or buildbots
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants