seung-lab / euclidean-distance-transform-3d

Euclidean distance & signed distance transform for multi-label 3D anisotropic images using marching parabolas.
GNU General Public License v3.0
234 stars 37 forks source link

TypeError: 'module' object is not callable #53

Open gj21kr opened 4 months ago

gj21kr commented 4 months ago

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 4 months ago

Hi Jung-Eun, I think I need to see your import statement. It should be simply import edt.