ANTsX / ANTsPy

A fast medical imaging analysis library in Python with algorithms for registration, segmentation, and more.
https://antspyx.readthedocs.io
Apache License 2.0
657 stars 164 forks source link

transform_from_displacement_field segfaults #350

Open rueberger opened 2 years ago

rueberger commented 2 years ago

the following cause segfaults:

ants.transform_from_displacement_field(ants.from_numpy(np.random.randn(200, 200, 200)))

ants.transform_from_displacement_field(ants.from_numpy(np.random.randn(200, 200, 200, 3)))

stnava commented 2 years ago

incorrect usage. requires multi-channel input.

    field : ANTsImage
        deformation field as multi-channel ANTsImage

could add a check for this type of bad input or maybe do a conversion internally.

rueberger commented 2 years ago

right, I'm aware of the correct usage, just reporting the segfault