Skip to content

ENH: Added LaplacianRecursiveGaussianImageFilter Python script #297

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

Conversation

kian-weimer
Copy link
Contributor

Created a Python LaplacianRecursiveGaussianImageFilter example based off of the existing C++ example.

import sys
import itk

if len(sys.argv) != 3:
Copy link
Member

Choose a reason for hiding this comment

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

Since you are creating many new examples, maybe you could use CreateNewExample.py (which appears in the build directory) to start new examples, so they use the argument parser from the template:

parser = argparse.ArgumentParser(description="{{ cookiecutter.example_title }}.")
parser.add_argument("input_image")
parser.add_argument("output_image")
args = parser.parse_args()

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure, I'm just adding Python versions of existing examples, but I can follow that portion of the template. I can change the remaining PRs to fit this. The example that is created seems to be missing an import for argparse. Is this indirectly imported or should I be adding an import?
I noticed that the cookie cutter example had the Python Doc after the C++. It is preferred to have the Python code show up before the C++ in the documentation correct?

Copy link
Member

Choose a reason for hiding this comment

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

change the remaining PRs

Please do! You can also update some existing examples to this style in a separate PR.

adding an import

If it is needed, yes 😄

It is preferred to have the Python code show up before the C++ in the documentation

Correct.

@thewtex thewtex merged commit 3be7e4c into InsightSoftwareConsortium:master Jun 8, 2021
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.

3 participants