ITKContourInterpolation icon indicating copy to clipboard operation
ITKContourInterpolation copied to clipboard

Last pip package doesn't work with itk>5.3

Open bootsma opened this issue 10 months ago • 1 comments

If you install pip itk package with itk>5.3 and install itk-morphologicalcontourinterpolation 1.1.0 then your python code will exit without completing or any exception thrown when the itk.morphological_contour_interpolator function is called.

Can be tested using a virtual environment with (I've only tested with python==3.10): pip install itk==5.4 pip install itk-morphologicalcontourinterpolation When running the code below the program will exit at line:

itk_interp = itk.morphological_contour_interpolator(itk_im)

and print('finished') will not be reached, if you revert to itk==5.3 it works.

Example python code:

import numpy as np
import itk

def create_np_test_image():

    im_array = np.zeros([30,30,30],dtype=np.uint8)
    pad = 4
    for i in range(pad,im_array.shape[0]-pad):
        if i%2:
            im_array[i,+i:-i,+i:-i] = 1
    itk_im = itk.image_from_array(im_array  )
    return itk_im

if __name__ == '__main__':
    itk_im = create_np_test_image()
    i_np = itk.array_from_image(itk_im)
    try:
        itk_interp = itk.morphological_contour_interpolator(itk_im)
        itk_interp_np = itk.array_from_image(itk_interp)
    except Exception as e:
        print(f'Exception {e}')
    print('finished')

bootsma avatar Feb 21 '25 19:02 bootsma

Hi, package bump in progress in:

https://github.com/KitwareMedical/ITKContourInterpolation/pull/128

thewtex avatar Feb 21 '25 21:02 thewtex

I see the changes have been merged for https://github.com/KitwareMedical/ITKContourInterpolation/pull/128. Any idea when a new ITK package will be released?

bootsma avatar Feb 28 '25 18:02 bootsma

I just created a new tag. If this CI run is successful, the packages should appear on PyPI.

dzenanz avatar Feb 28 '25 19:02 dzenanz