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

Transforms should implement an ndim property #196

Closed
oesteban opened this issue Apr 17, 2024 · 1 comment · Fixed by #197
Closed

Transforms should implement an ndim property #196

oesteban opened this issue Apr 17, 2024 · 1 comment · Fixed by #197

Comments

@oesteban
Copy link
Collaborator

oesteban commented Apr 17, 2024

Something like:

>>> from nitransforms import linear
>>> linear.Affine().ndim
3

(only one timepoint)

>>> from nitransforms import linear
>>> linear.LinearTransformsMapping().ndim
4

In the future, we can imagine two more use cases:

>>> from nitransforms import linear
>>> linear.ComplexAffine().ndim
4

(only one timepoint)

>>> from nitransforms import linear
>>> linear.ComplexLinearTransformsMapping().ndim
5

cc/ @jmarabotto

@oesteban
Copy link
Collaborator Author

We just realized they do. So this is going to be changed a little:

  • TransformBase -> should raise a TypeError instead of returning the dimensionality of the reference.
  • Affine -> should overshadow TransformBase's property and return self._matrix.ndim + 1. That will also work for LinearTransformArray without loss of generality.
  • Nonlinear transforms -> for the moment these cannot be 3D so they should redefine the property and return self._reference.ndim.

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

Successfully merging a pull request may close this issue.

1 participant