dmriprep
dmriprep copied to clipboard
nibabel get_data vs get_fdata
for some odd reason img.get_fdata kills my python kernel, but the deprecated get_data does not. I'm not sure how to debug this because everything just dies!
but we could just use img_data = np.asarray(img.dataobj) in the drop_outliers_fn function
Seems like something the nibabel developers might want to know.
We know :) - when I changed the default, I knew it would be a problem for some people. I'm sure what's happening is that the floating point version of the image is too large to fit into memory along with everything else. get_fdata is meant to be a safe high-level method, in the sense that it's behavior is predictable, but sometimes you'll need to optimize for memory by using workarounds like np.array(img.dataobj).
Thanks Matthew! So np.array(img.dataobj) is prefereable to get_data for long-term?
Yes, get_data will go away eventually. np.array(img.dataobj) also gives the correct impression of being something a bit dark and advanced.