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

ENH: Reduce BSplineFieldmap memory usage #1609

Merged
merged 1 commit into from
May 6, 2019

Conversation

effigies
Copy link
Member

@effigies effigies commented May 5, 2019

Changes proposed in this pull request

Was looking at the maths.pyx thing to see about splitting it out into its own package. Noticed some get_data() uses in BSplineFieldmap. get_data() is supposed to be being deprecated any day now... and the two calls to it are sub-optimal.

The first can just be replaced by the image shape, which is just read from the header and doesn't require loading the data.

The second can use get_fdata, and if we use caching='unchanged', then it won't store a copy of the array internally, so it can get garbage-collected after filling _data.

I don't expect this is going to have a significant effect, but just while I was there.

Documentation that should be reviewed

@oesteban
Copy link
Member

oesteban commented May 5, 2019

When I revise the implementation of fieldmaps I'll rid fmriprep of Cython and this buggy implementation. I know there is a pure python implementation on scipy that fits the needs. Meanwhile, this is a great idea.

@oesteban oesteban added this to the 1.4.0 milestone May 5, 2019
@oesteban oesteban merged commit 811f24e into nipreps:master May 6, 2019
@effigies effigies deleted the enh/bspline_memory branch May 6, 2019 16:31
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.

None yet

2 participants