abagen
abagen copied to clipboard
[Bug] in load_gifti function
right now when i passed a already loaded gifti image into this function, this function will still throw error because now the error message is
"argument should be a str or an os.PathLike object where __fspath__ returns a str, not 'GiftiImage'"
while in the logic it checks this
elif (isinstance(err, TypeError) and not str(err) == 'stat: path should be string, bytes, os.' 'PathLike or integer, not GiftiImage'): raise err
meantime i don't think this check is robust why not using logic lie this ?
if isinstance(img, nib.GiftiImage): return img