ANTsPyNet icon indicating copy to clipboard operation
ANTsPyNet copied to clipboard

Error: AttributeError: module 'ants' has no attribute 'image_read'

Open GayanSamuditha opened this issue 1 year ago • 1 comments

Hello,

@cookpa @ntustison

I'm currently trying this code snip to execute -


import ants 
import antspynet

t1_file = "/path to image file/image01.nii" 
t1 = ants.image_read(t1_file)

atropos = antspynet.deep_atropos(t1, do_preprocessing=True, verbose=True)

It shows this error code - **2 import antspynet 4 t1_file = "/..../image01.nii" ----> 5 t1 = ants.image_read(t1_file) 7 # Atropos six-tissue segmentation 9 atropos = antspynet.deep_atropos(t1, do_preprocessing=True, verbose=True)

AttributeError: module 'ants' has no attribute 'image_read'**

I used this same codebase previously but not it showing module 'ants' doesn't have an attribute to read the image. I'm running ANTsPyNet on a separate conda environment and I also upgraded my conda environment - pip install antspynet --upgrade.

GayanSamuditha avatar Jul 01 '24 16:07 GayanSamuditha

Sorry this isn't really enough information to provide help. It looks like an issue with installing ants... try to install ants as well in your environment just in case antspynet does not do it automatically.

ncullen93 avatar Jul 05 '24 08:07 ncullen93