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

Question about antsxnet_cache_directory (string) in antspynet.utilities.brain_extraction. #128

Open
Lucifer201210 opened this issue Aug 21, 2024 · 4 comments

Comments

@Lucifer201210
Copy link

Hi, When I exacted brain using antspynet.utilities.brain_extraction according to AntsPyNet document (https://antsx.github.io/ANTsPyNet/docs/build/html/utilities.html#applications), an error happened.

截图 2024-08-22 00-41-48

According this document, the antsxnet_cache_directory was used to store the downloaded template and model weights. I haved download brainExtractionRobustT1.h5 and S_template3_resampled.nii.gz in a folder. Then I set antsxnet_cache_directory to this folder path. the code was as following:

截图 2024-08-22 00-50-33

截图 2024-08-22 00-50-59

brainExtractionRobustT1.h5 and S_template3_resampled.nii.gz were in /home/wei/DeepLearning/Model_pth/, Since I haved downloaded template and model weights to the folder path which antsxnet_cache_directory was pointed to,why antspynet.utilities.brain_extraction still need to download data from https://ndownloader.figshare.com/files/22597175

Then I copy brainExtractionRobustT1.h5 and S_template3_resampled.nii.gz to ~/.keras/ANTsXNet, and run antspynet.utilities.brain_extraction twice, the same error happed.

截图 2024-08-22 01-04-35

When I copy https://ndownloader.figshare.com/files/22597175 to my google chrome, It automatically download S_template3_resampled.nii.gz . I don't know the reason why error happend.

@cookpa
Copy link
Member

cookpa commented Aug 21, 2024

Code looks correct, always good to verify that the file is accessible before calling brain_extraction

import os
mycachedir = '/home/wei/DeepLearning/Model_pth/'
os.listdir(mycachedir)
os.access(os.path.join(mycachedir, 'brainExtractionRobustT1.h5'), os.R_OK)

@ntustison
Copy link
Member

And, fyi, I would always check with the self-contained, minimal tutorials for antsxnet available here.

@Lucifer201210
Copy link
Author

Code looks correct, always good to verify that the file is accessible before calling brain_extraction

import os
mycachedir = '/home/wei/DeepLearning/Model_pth/'
os.listdir(mycachedir)
os.access(os.path.join(mycachedir, 'brainExtractionRobustT1.h5'), os.R_OK)

Thanks! I tried the code above and the file is accessible.

截图 2024-08-23 14-52-02

The same error happened as before. Is it needed to install any other dependencies or Tensorflow/pytorch before using brain_exaction?

@cookpa
Copy link
Member

cookpa commented Aug 24, 2024

I made #130 in an effort to simplify cache issues like this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants