question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

module 'ants.core.ants_image' has no attribute 'ANTsImage'

See original GitHub issue

Hi, I recently install ANTsPy via

pip install https://github.com/ANTsX/ANTsPy/releases/download/v0.1.4/antspy-0.1.4-cp36-cp36m-linux_x86_64.whl

when I try to convert numpy array to ants image by ants.from_numpy()

I get the following error message:

/lib/python3.6/site-packages/ants/core/ants_image_io.py in _from_numpy(data, origin, spacing, direction, has_components) 125 if not has_components: 126 itk_image = libfn(data, data.shape[::-1]) –> 127 ants_image = iio.ANTsImage(pixeltype=ptype, dimension=ndim, components=1, pointer=itk_image, 128 origin=origin, spacing=spacing, direction=direction) 129 ants_image._ndarr = data AttributeError: module ‘ants.core.ants_image’ has no attribute ‘ANTsImage’

I check the aforementioned ants_image_io.py and there is no attribute called ‘ANTsImage’. It seems to be a bug.

Does anyone know how to fix that? Thanks a lot.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
MustafaArikancommented, Jul 3, 2019

pip install sklearn statsmodels could resolve the issue as well.

2reactions
joellliucommented, Jul 31, 2018

@stnava yes, it works after I compiled and installed antspy from source code. Just think it will be good to let you know there may be a bug. Thanks for you reply.

Read more comments on GitHub >

github_iconTop Results From Across the Web

module 'ants' has no attribute 'from_numpy' - Stack Overflow
I am working in a jupyter notebook, and used pip to install ANTsPy: pip install antspyx.
Read more >
Source code for ants.core.ants_image - ANTsPy documentation
It must have the same shape as the current image data. Returns ------- ANTsImage """ if not isinstance(data, np.ndarray): raise ValueError('data must be...
Read more >
10 minute ANTsPy tutorial - | notebook.community
ANTsPy is a Python wrapper for the ANTs neuroimage processing library, along with other pythonic tools that make it easy and fun to...
Read more >
ANTsPy - Read the Docs
Core. 1.1 Images. 1.1.1 ANTsImage class ants.core.ants_image. ... Create a copy of the given ANTsImage with the same data and info, ...
Read more >
ANTs by stnava
Here is some boilerplate regarding ants image processing: We will analyze multiple modality neuroimaging data with Advanced Normalization Tools (ANTs) version > ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found