-
-
Notifications
You must be signed in to change notification settings - Fork 665
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MeshFileReader/VTKPolyDataMeshIO hangs forever on non-numeric chars in "POINTS" section (including "Infinity" and "NaN") #3539
Comments
Not sure if I'm mixing things (sorry if that is the case), but there seem to be various issues with the mesh-related classes that might all be related to each other (at least, if issues are in the base class; or some pattern was re-used across child-specific implementations), including this one. I did also experience the timeout issue in here: that raised issue #3455. and maybe your comment (?) and maybe Pranjal's #3526, as well as his comment in #3515 (comment) Unfortunately, my investigations at that time did not lead me to any relevant conclusion about the source of the problem. |
Thanks @jhlegarreta but this particular issue is specifically about reading, and specifically about reading the ASCII file type. So I do think the problems you're pointing at are unrelated to this particular one. Even if all of them are Mesh IO related! Thanks anyway Jon! I'm preparing a PR now, for this particular issue. Please wait 😃 |
`MeshFileReader`/`VTKPolyDataMeshIO` did hang forever when trying to read an ASCII .vtk file that contained non-numeric chars in "POINTS" section, for example "Infinity" or "NaN". With this commit, "inf" and "Infinity" will be interpreted as the floating point value infinity, while "nan" and "NaN" will be interpreted as Not-A-Number. Other strings of non-numeric characters in the list of point components (coordinates) will cause the reader to throw an appropriate `itk::ExceptionObject`. Addresses issue InsightSoftwareConsortium#3539 "MeshFileReader/VTKPolyDataMeshIO hangs forever on non-numeric chars in "POINTS" section (including "Infinity" and "NaN")"
`MeshFileReader`/`VTKPolyDataMeshIO` did hang forever when trying to read an ASCII .vtk file that contained non-numeric chars in "POINTS" section, for example "Infinity" or "NaN". With this commit, "inf" and "Infinity" will be interpreted as the floating point value infinity, while "nan" and "NaN" will be interpreted as Not-A-Number. Other strings of non-numeric characters in the list of point components (coordinates) will cause the reader to throw an appropriate `itk::ExceptionObject`. Addresses issue InsightSoftwareConsortium#3539 "MeshFileReader/VTKPolyDataMeshIO hangs forever on non-numeric chars in "POINTS" section (including "Infinity" and "NaN")"
`MeshFileReader`/`VTKPolyDataMeshIO` did hang forever when trying to read an ASCII .vtk file that contained non-numeric chars in "POINTS" section, for example "Infinity" or "NaN". With this commit, "inf" and "Infinity" will be interpreted as the floating point value infinity, while "nan" and "NaN" will be interpreted as Not-A-Number. Other strings of non-numeric characters in the list of point components (coordinates) will cause the reader to throw an appropriate `itk::ExceptionObject`. Addresses issue #3539 "MeshFileReader/VTKPolyDataMeshIO hangs forever on non-numeric chars in "POINTS" section (including "Infinity" and "NaN")"
`MeshFileReader`/`VTKPolyDataMeshIO` did hang forever when trying to read an ASCII .vtk file that contained non-numeric chars in "POINTS" section, for example "Infinity" or "NaN". With this commit, "inf" and "Infinity" will be interpreted as the floating point value infinity, while "nan" and "NaN" will be interpreted as Not-A-Number. Other strings of non-numeric characters in the list of point components (coordinates) will cause the reader to throw an appropriate `itk::ExceptionObject`. Addresses issue InsightSoftwareConsortium#3539 "MeshFileReader/VTKPolyDataMeshIO hangs forever on non-numeric chars in "POINTS" section (including "Infinity" and "NaN")"
`MeshFileReader`/`VTKPolyDataMeshIO` did hang forever when trying to read an ASCII .vtk file that contained non-numeric chars in "POINTS" section, for example "Infinity" or "NaN". With this commit, "inf" and "Infinity" will be interpreted as the floating point value infinity, while "nan" and "NaN" will be interpreted as Not-A-Number. Other strings of non-numeric characters in the list of point components (coordinates) will cause the reader to throw an appropriate `itk::ExceptionObject`. Addresses issue InsightSoftwareConsortium#3539 "MeshFileReader/VTKPolyDataMeshIO hangs forever on non-numeric chars in "POINTS" section (including "Infinity" and "NaN")"
`MeshFileReader`/`VTKPolyDataMeshIO` did hang forever when trying to read an ASCII .vtk file that contained non-numeric chars in "POINTS" section, for example "Infinity" or "NaN". With this commit, "inf" and "Infinity" will be interpreted as the floating point value infinity, while "nan" and "NaN" will be interpreted as Not-A-Number. Other strings of non-numeric characters in the list of point components (coordinates) will cause the reader to throw an appropriate `itk::ExceptionObject`. Addresses issue InsightSoftwareConsortium#3539 "MeshFileReader/VTKPolyDataMeshIO hangs forever on non-numeric chars in "POINTS" section (including "Infinity" and "NaN")"
`MeshFileReader`/`VTKPolyDataMeshIO` did hang forever when trying to read an ASCII .vtk file that contained non-numeric chars in "POINTS" section, for example "Infinity" or "NaN". With this commit, "inf" and "Infinity" will be interpreted as the floating point value infinity, while "nan" and "NaN" will be interpreted as Not-A-Number. Other strings of non-numeric characters in the list of point components (coordinates) will cause the reader to throw an appropriate `itk::ExceptionObject`. Addresses issue InsightSoftwareConsortium#3539 "MeshFileReader/VTKPolyDataMeshIO hangs forever on non-numeric chars in "POINTS" section (including "Infinity" and "NaN")"
`MeshFileReader`/`VTKPolyDataMeshIO` did hang forever when trying to read an ASCII .vtk file that contained non-numeric chars in "POINTS" section, for example "Infinity" or "NaN". With this commit, "inf" and "Infinity" will be interpreted as the floating point value infinity, while "nan" and "NaN" will be interpreted as Not-A-Number. Other strings of non-numeric characters in the list of point components (coordinates) will cause the reader to throw an appropriate `itk::ExceptionObject`. Addresses issue InsightSoftwareConsortium#3539 "MeshFileReader/VTKPolyDataMeshIO hangs forever on non-numeric chars in "POINTS" section (including "Infinity" and "NaN")"
Description
It appears that
MeshFileReader
hangs forever when trying to read an ASCII .vtk file that has non-numeric chars in "POINTS" section (using VTKPolyDataMeshIO). Even when the file was created byMeshFileWriter
, using VTKPolyDataMeshIO as well. This may happen when some of the coordinates of the points has a NaN or an infinite value.Note than
MeshFileReader
does correctly process reading NaN and infinite values from a binary .vtk file. So the issue only occurs with non-binary (ASCII) .vtk files.Steps to Reproduce
VTK file created by itk::WriteMesh(inputMesh, "fileName.vtk"):
Expected behavior
MeshFileWriter
, so it should interpret "Infinity" as the floating point value infinity, and "NaN" as Not-A-Number.Actual behavior
MeshFileReader hangs inside the
while
loop withinitk::VTKPolyDataMeshIO::ReadPointsBufferAsASCII
, atITK/Modules/IO/MeshVTK/include/itkVTKPolyDataMeshIO.h
Line 201 in 9ed9070
Reproducibility
100%
Versions
Latest revision at the master: 9ed9070
Additional Information
I think I'm able to fix it 😃
The text was updated successfully, but these errors were encountered: