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

Generate SWIG prior factory #709

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

robbietuk
Copy link
Collaborator

@robbietuk robbietuk commented Oct 9, 2020

Adds downcasting via a swig factory for priors.

This should address #662 and #707

This isn't working...
@robbietuk robbietuk changed the title Generate prior factory Generate SWIG prior factory Oct 9, 2020
@KrisThielemans KrisThielemans linked an issue Oct 9, 2020 that may be closed by this pull request
tell SWIG about the prior hierarchy such that get_prior() returns instances of the actual prior (not just the base class)
@KrisThielemans KrisThielemans added this to the v5.0 milestone Oct 18, 2020
@robbietuk
Copy link
Collaborator Author

Sorry force pushed to stop travis.

I took a look at your changes and it doesnt seem to have resolved the issue.

>> QP = self.recon.get_objective_function().get_prior()
Exception ignored in: '_wrap_delete_QuadraticPrior3DFloat'
TypeError: in method 'delete_QuadraticPrior3DFloat', argument 1 of type 'stir::QuadraticPrior< float > *'

@KrisThielemans
Copy link
Collaborator

ah. it generates the code, but then something goes wrong later with the SWIG type mechanisms. Of course, it's quite weird it's calling a delete as well... sigh

@KrisThielemans KrisThielemans modified the milestones: v5.0, v5.1 Mar 18, 2022
@KrisThielemans KrisThielemans modified the milestones: v5.2, v6.0 Sep 20, 2023
@KrisThielemans KrisThielemans modified the milestones: v6.0, v7.0 Jan 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

SWIG: add downcasting
2 participants