TypeError: 'module' object is not callable
gj21kr opened this issue · 1 comments
gj21kr commented
Hello,
I tried to use edt after installation using pip (pip install edt).
However, with the code below, I got a error message like this :
TypeError: 'module' object is not callable
`
gt = sitk.ReadImage(gt_file)
spacing_raw = gt.GetSpacing()
spacing = [spacing_raw[2], spacing_raw[1],spacing_raw[0]]
gt_array = np.asarray(sitk.GetArrayFromImage(gt)>0).astype(np.uint8)
dt = edt.edt(gt_array, anisotropy=spacing)
dt = sitk.GetImageFromArray(dt)
dt.SetSpacing(gt.GetSpacing())
dt.SetOrigin(gt.GetOrigin())
dt.SetDirection(gt.GetDirection())
sitk.WriteImage(dt, os.path.join(save_folder, 'EDT.nii.gz'))`
How can I use the package?
Best,
Jung-Eun
william-silversmith commented
Hi Jung-Eun, I think I need to see your import statement. It should be simply import edt
.