[Neuroimaging] Nibabel error

Anders Eklund anders.eklund at liu.se
Tue Mar 31 17:16:55 EDT 2020


That seems to work, thanks!
________________________________
From: Neuroimaging <neuroimaging-bounces+anders.eklund=liu.se at python.org> on behalf of Sulantha Sanjeewa <sulantha.s at gmail.com>
Sent: Tuesday, March 31, 2020 11:03 PM
To: Neuroimaging analysis in Python <neuroimaging at python.org>
Subject: Re: [Neuroimaging] Nibabel error

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<mailto: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<mailto: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/59ab2a3a/attachment.html>


More information about the Neuroimaging mailing list