Skip to content
This repository was archived by the owner on Jan 27, 2025. It is now read-only.

Conversation

teresamg
Copy link
Contributor

No description provided.

@teresamg
Copy link
Contributor Author

Hey @oesteban, do you know what this error is?


AttributeError Traceback (most recent call last)
Input In [44], in <cell line: 1>()
----> 1 transformed_nii = (~xfms).apply(nii)
File ~/miniconda3/envs/eddymotion/lib/python3.8/site-packages/nitransforms/linear.py:440, in LinearTransformsMapping.apply(self, spatialimage, reference, order, mode, cval, prefilter, output_dtype)
437 data = np.squeeze(np.asanyarray(spatialimage.dataobj))
438 output_dtype = output_dtype or data.dtype
--> 440 ycoords = self.map(_ref.ndcoords.T)
441 targets = ImageGrid(spatialimage).index( # data should be an image
442 _as_homogeneous(np.vstack(ycoords), dim=_ref.ndim)
443 )
445 if data.ndim == 4:
AttributeError: 'NoneType' object has no attribute 'ndcoords'

@oesteban
Copy link
Member

Yup, you need to set a reference image for the transform

@teresamg teresamg changed the title WIP: Data utils Data utils Jan 19, 2023
@teresamg teresamg marked this pull request as ready for review January 19, 2023 22:23
@teresamg
Copy link
Contributor Author

@oesteban The tests seem to be passing now, any thoughts or is this ready to merge?

@arokem
Copy link
Collaborator

arokem commented Jan 23, 2023

Looks like the test failure is unrelated to this PR. Just one of those intermittent/random failures of the registration.

@arokem arokem merged commit 3e66f54 into nipreps:main Mar 2, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants