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

Data utils #124

Merged
merged 11 commits into from
Mar 2, 2023
Merged

Data utils #124

merged 11 commits into from
Mar 2, 2023

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.

src/eddymotion/data/utils.py Outdated Show resolved Hide resolved
src/eddymotion/data/utils.py Outdated Show resolved Hide resolved
src/eddymotion/data/utils.py Outdated Show resolved Hide resolved
src/eddymotion/data/utils.py Outdated Show resolved Hide resolved
teresamg and others added 5 commits March 1, 2023 14:41
Co-authored-by: Oscar Esteban <code@oscaresteban.es>
Co-authored-by: Oscar Esteban <code@oscaresteban.es>
Co-authored-by: Oscar Esteban <code@oscaresteban.es>
Co-authored-by: Oscar Esteban <code@oscaresteban.es>
@arokem arokem merged commit 3e66f54 into nipreps:main Mar 2, 2023
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 this pull request may close these issues.

3 participants