Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: 'module' object is not callable #53

Open
gj21kr opened this issue May 13, 2024 · 1 comment
Open

TypeError: 'module' object is not callable #53

gj21kr opened this issue May 13, 2024 · 1 comment
Labels
question Further information is requested

Comments

@gj21kr
Copy link

gj21kr commented May 13, 2024

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
Copy link
Contributor

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

@william-silversmith william-silversmith added the question Further information is requested label May 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants