Closed rueberger closed 1 month ago
Thanks, yes we are working on this. The issue is with having to import the underlying ITK / ANTs compiled libraries and also with an inefficient way of mapping functions to the ANTsImage class (see below). The first part is being solved by improving the wrapping and the second part is something I am also working on.
I don't think using import *
has any effect on the import time. If you've ever used the itk python library then you'll see that there also there is a very long import time.
glad to hear that!
Hi @rueberger, with the new C++ wrapping we just pushed the import time for me is ~1.7 seconds after a very initial import time of ~20 seconds. This is about as fast as it can be and is much much faster than ITK (5+ seconds import and then 3+ more seconds every time you use a function from a new module) and also pytorch, tensorflow, etc.
I will close this issue but still going to look into the idea of not importing everything at the start eventually. Thanks!
import ants
can take several seconds, which is annoying. especially when ants is imported many times in a row as part of test suite.consider moving away from star imports in
__init__.py
....here is some profiling of the import: