-
Notifications
You must be signed in to change notification settings - Fork 116
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
Double-check limitations of vtk file support #698
Comments
Thanks @stefanklein, I see now, it says:
Interestingly, it also says about VTKPolyDataReader:
Only elxStatisticalShapePenalty still uses VTKPolyDataReader: https://github.com/SuperElastix/elastix/blob/4.9.0/Components/Metrics/StatisticalShapePenalty/elxStatisticalShapePenalty.hxx#L380 Other metrics components already use Update: I just double-checked: |
The documentation of `itk::VTKPolyDataReader` says: > This class may be deprecated in the future. The MeshFileReader is preferred. https://github.com/InsightSoftwareConsortium/ITK/blob/v5.3rc03/Modules/Core/Mesh/include/itkVTKPolyDataReader.h#L37-L38 Moreover: > itkVTKPolyDataReader can only read triangle meshes While `itk::MeshFileReader` does not have this limitation. Related to issue #698 "Double-check limitations of vtk file support"
The documentation of `itk::VTKPolyDataReader` says: > This class may be deprecated in the future. The MeshFileReader is preferred. https://github.com/InsightSoftwareConsortium/ITK/blob/v5.3rc03/Modules/Core/Mesh/include/itkVTKPolyDataReader.h#L37-L38 Moreover: > itkVTKPolyDataReader can only read triangle meshes While `itk::MeshFileReader` does not have this limitation. Related to issue #698 "Double-check limitations of vtk file support"
@stefanklein I double-checked: it is specifically the itkVTKPolyDataReader that requires POLYGONS in the vtk file. Otherwise it will throw an exception: https://github.com/InsightSoftwareConsortium/ITK/blob/v5.3rc04/Modules/Core/Mesh/include/itkVTKPolyDataReader.hxx#L177 On the other hand, itk::MeshFileReader does accept vtk files without POLYGONS Which should be fine, as https://vtk.org/wp-content/uploads/2015/04/file-formats.pdf says:
So a vtk file may just contain a list of points, without triangles or other connections between them. So yes, I replaced itkVTKPolyDataReader with itk::MeshFileReader in elxStatisticalShapePenalty, pull request #699 |
Related to issue SuperElastix/elastix#698 "Double-check limitations of vtk file support"
You're welcome. BTW, it appears to me now that
But I guess it isn't so strict! 😃 With MeshFileReader and MeshFileWriter, 2D just works, using vtk files. I think it's good to know, because otherwise our own specific elastix/transformix input and output point file formats would have been the only file formats for 2D points, supported by elastix/transformix. |
Good idea @stefanklein, it appears that there was an issue already, "Add 2D mesh support", I just added my comment: slicersalt/ITKShape#8 (comment) |
OK, so the vtk file format may not be perfect, but for now, at least for backward compatibility of elastix and transformix, it's good enough. Significant progress was made to improve vtk file support:
Time to close this issue for now! |
According to the manual https://elastix.lumc.nl/download/elastix-5.0.1-manual.pdf
It seems to me that non-triangular point lists are also supported, right?
I did encounter another limitation though: it appears that VTK only supports 3-D points. Should we adjust the manual accordingly?
The text was updated successfully, but these errors were encountered: