[Neuroimaging] Nibabel error

Sulantha Sanjeewa sulantha.s at gmail.com
Tue Mar 31 17:03:36 EDT 2020


Can you try 'f' as a string ? Instead of a PosixPath object?



On Tue, Mar 31, 2020, 2:00 PM Anders Eklund <anders.eklund at liu.se> wrote:

> Hello,
>
> I get this error when I'm trying to use nibabel (2.5.1 I think), has
> anyone seen it before?
>
>
> In prepare_3d_tf_record_dataset
>
>     img = nib.load(f)
>
>   File
> "/home/andek67/.local/lib/python3.7/site-packages/nibabel/loadsave.py",
> line 47, in load
>
>     is_valid, sniff = image_klass.path_maybe_image(filename, sniff)
>
>   File
> "/home/andek67/.local/lib/python3.7/site-packages/nibabel/filebasedimages.py",
> line 500, in path_maybe_image
>
>     klass._compressed_suffixes)
>
>   File
> "/home/andek67/.local/lib/python3.7/site-packages/nibabel/filename_parser.py",
> line 265, in splitext_addext
>
>     if endswith(filename, ext):
>
>   File
> "/home/andek67/.local/lib/python3.7/site-packages/nibabel/filename_parser.py",
> line 223, in _iendswith
>
>     return whole.lower().endswith(end.lower())
>
> AttributeError: 'PosixPath' object has no attribute 'lower'
>
> _______________________________________________
> Neuroimaging mailing list
> Neuroimaging at python.org
> https://mail.python.org/mailman/listinfo/neuroimaging
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/neuroimaging/attachments/20200331/77778395/attachment.html>


More information about the Neuroimaging mailing list