Closed emilljungberg closed 1 week ago
Good idea, I'm working on a fix in the C++ ANTs code that will address this
Actually I'm a little concerned that fixing in ANTs might have side effects over there, so will follow up with that separately.
I think #738 will stop seg faults from ants.image_read
Describe the bug When attempting to open a file that is empty,
image_read
creates a segmentation fault instead of throwing an error. I've had this occurring when trying to open a download that was empty or when there was a fault in saving an image. One could of course expect the user to check that the file they are trying to open is working, but this could be an easy check. This could be the issue occurring in #223To reproduce Example where I create an empty file and try to read it:
Suggested fix Could there be a catch in the
image_read
function similar to thenibable.load
function? When I try the same innibabel
I get an error. They catch the error withos.stat(filename)
.ANTsPy installation