Skip to content

Conversation

@chris-rapson-formus
Copy link
Contributor

I believe the typing here should be Optional[List[int]], to match VectorUInt32_Size in the signature for ResampleImageFilter_SetSize.

My IDE has been giving me typing warnings when I provide a List[Int], but the function works as expected. int is actually incorrect:

image = sitk.GetImageFromArray(np.random.random([5, 6, 7]))
resampled_image = sitk.Resample(image, size=[2, 2, 2])  # returns a valid image
resampled_image = sitk.Resample(image, size=[2])  # error
resampled_image = sitk.Resample(image, size=2)  # error

@blowekamp blowekamp requested review from blowekamp and zivy June 16, 2025 12:37
Copy link
Member

@blowekamp blowekamp left a comment

Choose a reason for hiding this comment

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

The change looks good. Thank you for your contribution.

@blowekamp blowekamp merged commit 95149c8 into SimpleITK:master Jun 16, 2025
8 checks passed
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.

3 participants