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
Dataset cannot be copied if masker comes from a gzipped file #399
Comments
As a temporary solution, we could incorporate a check into the |
@tyarkoni Based on some testing in #400 and the original cosanlab issue, it looks like the bug is eliminated by not having Do you have any thoughts on what we should do? Add |
I don't feel I know enough about the packages in question to have an informed opinion, so I'll defer to your judgment on this. |
@rmarkello shared the following trick that we can use: import gzip
import nibabel as nib
nib.openers.HAVE_INDEXED_GZIP = False
nib.openers.IndexedGzipFile = gzip.GzipFile At the moment, it might be sufficient to place this in |
It looks like the original issue is resolved in
It looks like, now that from copy import deepcopy
from nilearn.input_data import NiftiMasker
masker1 = NiftiMasker('nifti.nii').fit()
deepcopy(masker1) # no error
masker2 = NiftiMasker('nifti.nii.gz').fit()
deepcopy(masker2) # error |
Back to |
This should be fixed in |
When I try to use the
ale_2mm
target (e.g., when loading a Sleuth dataset), the resulting Dataset cannot be copied due to the following error:After digging a bit, if I just uncompress the associated mask file, everything works fine. I believe it's an issue I came across a while ago with
nibabel
(see cosanlab/nltools#281). I thought the issue was resolved in the newest versions ofnibabel
, but I may have just misunderstood what was causing it. In any case, I think we need to either enforce uncompressed files for our masks or find some safer way of loading them in our masker objects.BTW, converting to a masker with
utils.get_masker()
doesn't help.The text was updated successfully, but these errors were encountered: