Skip to content

ENH: Python, wrap utilities free functions intro a struct#145

Merged
phcerdan merged 1 commit into
InsightSoftwareConsortium:masterfrom
phcerdan:wrap_utilities
Jun 29, 2021
Merged

ENH: Python, wrap utilities free functions intro a struct#145
phcerdan merged 1 commit into
InsightSoftwareConsortium:masterfrom
phcerdan:wrap_utilities

Conversation

@phcerdan
Copy link
Copy Markdown
Collaborator

There are no mechanisms with ITK SWIG macros to wrap free functions.

As a workaround, we use a struct with static function members, and
wrap it.

The usage in python is:

import itk
itk.IsotropicWaveletsUtilities.IndexToLevelBandSteerablePyramid(0, 2, 2)

Fix #56

@phcerdan phcerdan requested a review from dzenanz June 29, 2021 13:05
@phcerdan phcerdan force-pushed the wrap_utilities branch 3 times, most recently from 3cbc8c5 to c2236be Compare June 29, 2021 14:13
@phcerdan phcerdan force-pushed the wrap_utilities branch 2 times, most recently from b93de66 to 772a4c3 Compare June 29, 2021 14:28
There are no mechanisms with ITK SWIG macros to wrap free functions.

As a workaround, we use a `struct` with static function members, and
wrap it.

The usage in python is:

```py
import itk
itk.IsotropicWaveletsUtilities.IndexToLevelBandSteerablePyramid(0, 2, 2)
```

Fix InsightSoftwareConsortium#56
Copy link
Copy Markdown
Member

@thewtex thewtex left a comment

Choose a reason for hiding this comment

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

🚀 🎸

@phcerdan phcerdan merged commit da95ef3 into InsightSoftwareConsortium:master Jun 29, 2021
@phcerdan phcerdan deleted the wrap_utilities branch June 29, 2021 19:22
@jhlegarreta
Copy link
Copy Markdown
Member

Awesome @phcerdan !!

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.

Python wrapping for all the classes.

4 participants