ANTsX / ANTsPyNet

Pre-trained models and utilities for deep learning on medical images in Python
https://antspynet.readthedocs.io
Apache License 2.0
182 stars 28 forks source link

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

Open GayanSamuditha opened 1 week ago

GayanSamuditha commented 1 week ago

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.

ncullen93 commented 4 days ago

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.