Refactoring attempt. The idea is to separate the different types of modules a bit better:
core/ -> python or torch utilities that are used everywhere
spatial/ -> functional implementation of everything related to lattices and coordinate systems (interpolation, affine matrices, finite differences, etc.). In the best of worlds, everything should be automatically differentiable and callable from a nn/ object. We're not quite there yet.
nn -> neural networks stuff that relies on pytorch's Module class. In the best of worlds, everything has a differentiable functional implementation somewhere else (core, spatial, vb, ...) and is only wrapped here. We're not quite there yet.
vb/ -> probabilistic stuff. It's still not clear in my head what goes there. Long term, we'll have a lot of low-level probabilistic tools (likelihood, divergences, etc), plus mid-level fitting algorithms. Also, where do we store high-level, medical imaging stuff (say: registration models, or unified segmetnation)?
plots/ -> generic plotting utilities. We probably want to keep very specialized plotters next to their algorithms.
tools/ -> is this where we keep high-level stuff?
@brudfors this is the occasion to adapt your downstream code. The most painful part is that the content of nitorch.mathfun and nitorch.utils has been split up between multiple files in core (pyutils, utils, math, linalg).
Commits on spatial._grid in this pull request should be also applied in MONAI.
Refactoring attempt. The idea is to separate the different types of modules a bit better:
core/
-> python or torch utilities that are used everywherespatial/
-> functional implementation of everything related to lattices and coordinate systems (interpolation, affine matrices, finite differences, etc.). In the best of worlds, everything should be automatically differentiable and callable from ann/
object. We're not quite there yet.nn
-> neural networks stuff that relies on pytorch's Module class. In the best of worlds, everything has a differentiable functional implementation somewhere else (core
,spatial
,vb
, ...) and is only wrapped here. We're not quite there yet.vb/
-> probabilistic stuff. It's still not clear in my head what goes there. Long term, we'll have a lot of low-level probabilistic tools (likelihood, divergences, etc), plus mid-level fitting algorithms. Also, where do we store high-level, medical imaging stuff (say: registration models, or unified segmetnation)?plots/
-> generic plotting utilities. We probably want to keep very specialized plotters next to their algorithms.tools/
-> is this where we keep high-level stuff?@brudfors this is the occasion to adapt your downstream code. The most painful part is that the content of
nitorch.mathfun
andnitorch.utils
has been split up between multiple files incore
(pyutils
,utils
,math
,linalg
).Commits on
spatial._grid
in this pull request should be also applied in MONAI.