This PR signifcantly simplifies the import system, adds a clearer method for creating partial image functions (e.g., img.dosomething() instead of ants.dosomething(img)), and organizes the code a bit more into semantic groups.
For imports, all internal functions can now be used by calling import ants at the. top. This works because all functions are imported when ants is imported.
Now, to make a function available as a partial method to the ANTsImage class you can do the following:
That will let you use this function as a chain on ANTsImage instances - e.g., image.myfunc().
Finally, there is a bit more code organization with some additional folders added -- label, math, and ops. The label folder is for anything with label images, the math folder is for any functions that take in an image and calculate some value, and the ops folder is for anything that takes in an image, manipulates it in some way, then returns an image.
All in all, these changes simplify development and help both users and potential contributors to better conceptualize the package. The contributors document will also be updated.
coverage: 81.148% (+0.2%) from 80.917%
when pulling 0a5bf5fec39f10dcc591b4732ceb176d9a416401 on better-imports
into fe4fbbb718effa0a44f4927f662f4896c79a210f on master.
This PR signifcantly simplifies the import system, adds a clearer method for creating partial image functions (e.g.,
img.dosomething()
instead ofants.dosomething(img)
), and organizes the code a bit more into semantic groups.For imports, all internal functions can now be used by calling
import ants
at the. top. This works because all functions are imported when ants is imported.Now, to make a function available as a partial method to the ANTsImage class you can do the following:
That will let you use this function as a chain on ANTsImage instances - e.g.,
image.myfunc()
.Finally, there is a bit more code organization with some additional folders added -- label, math, and ops. The
label
folder is for anything with label images, themath
folder is for any functions that take in an image and calculate some value, and theops
folder is for anything that takes in an image, manipulates it in some way, then returns an image.All in all, these changes simplify development and help both users and potential contributors to better conceptualize the package. The contributors document will also be updated.