Skip to content

Fill out implementation#3

Open
HastingsGreer wants to merge 10 commits intomasterfrom
implementation
Open

Fill out implementation#3
HastingsGreer wants to merge 10 commits intomasterfrom
implementation

Conversation

@HastingsGreer
Copy link
Collaborator

No description provided.

@HastingsGreer HastingsGreer changed the title WIP: fill out implementation Fill out implementation Apr 8, 2022

def itk_transform_bridge(image_fixed: "itk.Image", image_moving:"itk.Image", network_shape: "[int]", **kwargs)->"(torch.Tensor, torch.Tensor, Callable[[torch.Tensor], itk.Transform])":
# Convert images to tensors
def itk_transform_bridge(image_fixed: "itk.Image", image_moving:"itk.Image", network_shape: "[int]", phi_type="displacement_field", range=(-1, 1))->"(torch.Tensor, torch.Tensor, Callable[[torch.Tensor], itk.Transform])":
Copy link
Member

Choose a reason for hiding this comment

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

This may work for the types, but a cool best practice is to use for forward type declarations like this:

 import itk.support.types as itkt

[...]

def itk_transform_bridge(image_fixed: "itkt.Image", [...]

Examples:

https://github.com/InsightSoftwareConsortium/ITK/blob/c49d6379c575332e88de858cc2cf9529a40be625/Wrapping/Generators/Python/itk/support/extras.py#L1416-L1417

https://github.com/InsightSoftwareConsortium/ITK/blob/c49d6379c575332e88de858cc2cf9529a40be625/Wrapping/Generators/Python/itk/support/extras.py#L1183-L1188

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