abagen icon indicating copy to clipboard operation
abagen copied to clipboard

[Bug] in load_gifti function

Open zihuaihuai opened this issue 4 months ago • 0 comments

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

zihuaihuai avatar Oct 22 '24 22:10 zihuaihuai