ENH: make ApplyToImageMetadata available in Python wrapping - #6804
ENH: make ApplyToImageMetadata available in Python wrapping#6804dzenanz wants to merge 1 commit into
Conversation
93007ab to
74ae5e0
Compare
This comment was marked as resolved.
This comment was marked as resolved.
| this->ApplyToImageMetadataInternal(image.GetPointer()); | ||
| } | ||
| void | ||
| ApplyToImageMetadata(ImageBase<VInputDimension> * image) const |
There was a problem hiding this comment.
Previously the function would be missing when not available, not is will always compile and produce a runtime error.
Perhaps this new method should have #ifdef SWIG || CASTXML or something similar so it's only available in an wrapped interface.
There was a problem hiding this comment.
Thanks for inspiration. I was ready to abandon this.
There was a problem hiding this comment.
Maybe I missed it, but what about Bradley's suggestion to use #ifdef SWIG || CASTXML?
There was a problem hiding this comment.
The ITK_WRAPPING_PARSER preprocessor macro may be helpful here.
There was a problem hiding this comment.
I solved that compile error by using if constexpr (VInputDimension == VOutputDimension).
There was a problem hiding this comment.
I think a compile time error is preferred over a runtime error when the dimensions don't match when use by C++. It appears this was the behavior before.
To restore this behavior, while still allowing this ApplyToImageMetadata method to compile for wrapping. Add the ifdef ITK_WRAPPING_PARSER guard around it.
There was a problem hiding this comment.
@dzenanz can you please respond to the ITK_WRAPPING_PARSER suggestion?
There was a problem hiding this comment.
Ah, I misunderstood the point. I will implement the suggestion.
|
Actions update split out into #6806. |
74ae5e0 to
32b44f6
Compare
|
cc5694f to
7ebba67
Compare
|
This is ready for review. CI is green. |
7ebba67 to
be7dae2
Compare
|
The force-push introduces compile error in Python wrapping locally: |
PR Checklist