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

STYLE: Reorganize wrapping files to ease PA3DSCI migration to ITK core #233

Closed
wants to merge 1 commit into from

Conversation

dzenanz
Copy link
Member

@dzenanz dzenanz commented Jul 6, 2023

This is a follow-up to #232.

@dzenanz
Copy link
Member Author

dzenanz commented Jul 6, 2023

Moving PA3DSCI into ITK core produces:

212>------ Build started: Project: itk-stub-files, Configuration: RelWithDebInfo x64 ------
212>Generating .pyi files for Python wrapper interface
212>Traceback (most recent call last):
212>  File "C:\Dev\ITK-git\Wrapping\Generators\Python\itk\pyi_generator.py", line 609, in <module>
212>    class_name = unpack(class_files, options.pyi_dir)
212>                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
212>  File "C:\Dev\ITK-git\Wrapping\Generators\Python\itk\pyi_generator.py", line 391, in unpack
212>    base = merge(class_definitions)
212>           ^^^^^^^^^^^^^^^^^^^^^^^^
212>  File "C:\Dev\ITK-git\Wrapping\Generators\Python\itk\pyi_generator.py", line 450, in merge
212>    raise AssertionError(
212>AssertionError: The basic values of two associated classes do not match.
212>Item 1: class `itkImageFileReader::ImageFileReader` has_new_method: `True` typed: `True` is_abstract: `False` is_enum: `False` has_superclass: `False`Item 2: class `itkPhasedArray3DSpecialCoordinatesImageFilters::ImageFileReader` has_new_method: `True` typed: `True` is_abstract: `False` is_enum: `False` has_superclass: `True`
212>C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(248,5): error MSB8066: Custom build for 'C:\Dev\ITK-py11\CMakeFiles\5111c4c6071a90c7f914b45552b82377\itk-stub-files.rule' exited with code 1.
212>Done building project "itk-stub-files.vcxproj" -- FAILED.

which made me change itk_wrap_class("itk::ImageFileReader" POINTER_WITH_SUPERCLASS) into itk_wrap_class("itk::ImageFileReader" POINTER). Should we make the similar changes for other filters in Ultrasound, such as CurvilinearArraySpecialCoordinatesImage, CastImageFilter, RescaleIntensityImageFilter etc?

@tbirdso
Copy link
Contributor

tbirdso commented Jul 6, 2023

Moving PA3DSCI into ITK core produces: ...
which made me change itk_wrap_class("itk::ImageFileReader" POINTER_WITH_SUPERCLASS) into itk_wrap_class("itk::ImageFileReader" POINTER). Should we make the similar changes for other filters in Ultrasound, such as CurvilinearArraySpecialCoordinatesImage, CastImageFilter, RescaleIntensityImageFilter etc?

@dzenanz Perhaps I'm not understanding what changed if we previously were not seeing compilation issues in ITKUltrasound wrapping. Does the new error occur in ITKUltrasound or in ITK? Could you point to your ITK branch or draft PR where those changes are taking place?

@dzenanz
Copy link
Member Author

dzenanz commented Jul 6, 2023

I just pushed my current state to my fork's master. This includes the change to avoid the above error.

@dzenanz
Copy link
Member Author

dzenanz commented Jul 6, 2023

I think the reason for not seeing this error earlier, is that now both of those wrappings are part of the same translation unit (or better to say, wrapping unit).

@dzenanz
Copy link
Member Author

dzenanz commented Jul 6, 2023

So maybe these differences don't matter, unless both definitions are part of the same "wrapping unit". It would be quite a bit of effort to harmonize them all, and if we miss some we would not get any warnings. So my question is: does it matter? @thewtex could pitch in too.

@tbirdso
Copy link
Contributor

tbirdso commented Jul 6, 2023

I think the reason for not seeing this error earlier, is that now both of those wrappings are part of the same translation unit (or better to say, wrapping unit).

Ah, good point. Yes, in general I agree that the wrapping specification (POINTER, POINTER_WITH_SUPERCLASS, etc) in ITKUltrasound should match the base class in ITK.

EDIT: I am not fully aware of what impact there might be from a mismatch in each specification between ITKUltrasound and ITK.

@dzenanz
Copy link
Member Author

dzenanz commented Jul 6, 2023

I just created a draft PR InsightSoftwareConsortium/ITK#4099. We should split the discussion between this PR and that one, as appropriate.

@dzenanz dzenanz closed this Jul 7, 2023
@dzenanz
Copy link
Member Author

dzenanz commented Jul 7, 2023

Closed in favor of #234.

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.

2 participants