elastix icon indicating copy to clipboard operation
elastix copied to clipboard

Double-check limitations of vtk file support

Open N-Dekker opened this issue 3 years ago • 9 comments

According to the manual https://elastix.lumc.nl/download/elastix-5.0.1-manual.pdf

The support for .vtk files is still a bit limited. Currently, only ASCII files are supported, with triangular meshes.

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?

N-Dekker avatar Aug 01 '22 10:08 N-Dekker

Hi Niels, we use this implementation: https://itk.org/Doxygen/html/classitk_1_1VTKPolyDataReader.html . Not sure if it was update recently, but the documentation seems to mention the same limitations, but they also point to an alternative solution, so maybe that is useful? Best, Stefan

From: Niels Dekker @.> Sent: Monday, August 1, 2022 12:34 PM To: SuperElastix/elastix @.> Cc: Stefan Klein @.>; Assign @.> Subject: [SuperElastix/elastix] Double-check limitations of vtk file support (Issue #698)

Waarschuwing: Deze e-mail is afkomstig van buiten de organisatie. Klik niet op links en open geen bijlagen, tenzij u de afzender herkent en weet dat de inhoud veilig is. Caution: This email originated from outside of the organization. Do not click links or open attachments unless you recognize the sender and know the content is safe.

According to the manual https://elastix.lumc.nl/download/elastix-5.0.1-manual.pdfhttps://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Felastix.lumc.nl%2Fdownload%2Felastix-5.0.1-manual.pdf&data=05%7C01%7Cs.klein%40erasmusmc.nl%7C6d44361e21064b44b5c708da73a9647e%7C526638ba6af34b0fa532a1a511f4ac80%7C0%7C0%7C637949469177412049%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=I8GaJl4ag1k%2BDlkubbj267PUTrZPmUZdjMEU6qpLU%2BI%3D&reserved=0

The support for .vtk files is still a bit limited. Currently, only ASCII files are supported, with triangular meshes.

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?

Reply to this email directly, view it on GitHubhttps://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FSuperElastix%2Felastix%2Fissues%2F698&data=05%7C01%7Cs.klein%40erasmusmc.nl%7C6d44361e21064b44b5c708da73a9647e%7C526638ba6af34b0fa532a1a511f4ac80%7C0%7C0%7C637949469177412049%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=CYK7TZUshRvZzRrv0p3Frxhiu%2FC0wOfkpt%2BGbUSc9Ro%3D&reserved=0, or unsubscribehttps://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAAF2LNLDUVKGOK6CTI6LAALVW6R2VANCNFSM55HBV57Q&data=05%7C01%7Cs.klein%40erasmusmc.nl%7C6d44361e21064b44b5c708da73a9647e%7C526638ba6af34b0fa532a1a511f4ac80%7C0%7C0%7C637949469177412049%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=MkesxOhCkr3ttrocvWl7EpzhflYpJ4bHLvc7YkOKtS0%3D&reserved=0. You are receiving this because you were assigned.Message ID: @.@.>>

stefanklein avatar Aug 01 '22 10:08 stefanklein

we use this implementation: https://itk.org/Doxygen/html/classitk_1_1VTKPolyDataReader.html

Thanks @stefanklein, I see now, it says:

Caveat1: itkVTKPolyDataReader can only read triangle meshes. Use vtkTriangleFilter to convert your mesh to a triangle mesh. Caviet2: itkVTKPolyDataReader can only read vtk legacy files. Caveat3: itkVTKPolyDataReader cannot read binary vtk files.

Interestingly, it also says about VTKPolyDataReader:

This class may be deprecated in the future. The MeshFileReader is preferred

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 itk::MeshFileReader. elastix::TransformBase was upgraded from itk::VTKPolyDataReader to itk::MeshFileReader with ebcb511b02b2c555ffa8e7f2e0a89b3b74839ec5 ("ENH: switching elastix to ITK4 !", Marius, 13 Jan 2012.) Hopefully, itk::MeshFileReader has dropped the triangle-only limitation...


Update: I just double-checked: itk::MeshFileReader does not require triangles. So this limitation is indeed out-dated. (Especially when elxStatisticalShapePenalty also stops using VTKPolyDataReader.)

N-Dekker avatar Aug 01 '22 12:08 N-Dekker

Hi Niels, https://itk.org/Doxygen/html/classitk_1_1MeshFileReader.html uses: https://itk.org/Doxygen/html/classitk_1_1MeshIOBase.html and specifically for VTK: https://itk.org/Doxygen/html/classitk_1_1VTKPolyDataMeshIO.html perhaps you can check the code of that class. Any easy way of testing the triangle limitation. Probably would be good to also use this implementation in the statisticalshapepenalty. In any case, this is the recommended way to read/write vtk meshes. Best, Stefan

From: Niels Dekker @.> Sent: Monday, August 1, 2022 2:37 PM To: SuperElastix/elastix @.> Cc: Stefan Klein @.>; Mention @.> Subject: Re: [SuperElastix/elastix] Double-check limitations of vtk file support (Issue #698)

Waarschuwing: Deze e-mail is afkomstig van buiten de organisatie. Klik niet op links en open geen bijlagen, tenzij u de afzender herkent en weet dat de inhoud veilig is. Caution: This email originated from outside of the organization. Do not click links or open attachments unless you recognize the sender and know the content is safe.

we use this implementation: https://itk.org/Doxygen/html/classitk_1_1VTKPolyDataReader.htmlhttps://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fitk.org%2FDoxygen%2Fhtml%2Fclassitk_1_1VTKPolyDataReader.html&data=05%7C01%7Cs.klein%40erasmusmc.nl%7Caf6ec3b95e1749bc037b08da73ba8b25%7C526638ba6af34b0fa532a1a511f4ac80%7C0%7C0%7C637949542292905556%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=hOOG3APC2QUyA5tOo%2BAJEyP9XoqVYcqeh%2FGNYdC0eCM%3D&reserved=0

Thanks @stefankleinhttps://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fstefanklein&data=05%7C01%7Cs.klein%40erasmusmc.nl%7Caf6ec3b95e1749bc037b08da73ba8b25%7C526638ba6af34b0fa532a1a511f4ac80%7C0%7C0%7C637949542292905556%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=u6zVmxDN%2BTZLsum4FwnY6EMhT6ptYdRPJ4mgyyBrBLk%3D&reserved=0, I see now, it says:

Caveat1: itkVTKPolyDataReader can only read triangle meshes. Use vtkTriangleFilter to convert your mesh to a triangle mesh. Caviet2: itkVTKPolyDataReader can only read vtk legacy files. Caveat3: itkVTKPolyDataReader cannot read binary vtk files.

Interestingly, it also says about VTKPolyDataReader:

This class may be deprecated in the future. The MeshFileReaderhttps://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fitk.org%2FDoxygen%2Fhtml%2Fclassitk_1_1MeshFileReader.html&data=05%7C01%7Cs.klein%40erasmusmc.nl%7Caf6ec3b95e1749bc037b08da73ba8b25%7C526638ba6af34b0fa532a1a511f4ac80%7C0%7C0%7C637949542292905556%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=CXHc0f8ep3kiHCtAMvEZVdW2JF9S0eZ2En9thJobZc8%3D&reserved=0 is preferred

Only elxStatisticalShapePenalty still uses VTKPolyDataReader: https://github.com/SuperElastix/elastix/blob/4.9.0/Components/Metrics/StatisticalShapePenalty/elxStatisticalShapePenalty.hxx#L380https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FSuperElastix%2Felastix%2Fblob%2F4.9.0%2FComponents%2FMetrics%2FStatisticalShapePenalty%2FelxStatisticalShapePenalty.hxx%23L380&data=05%7C01%7Cs.klein%40erasmusmc.nl%7Caf6ec3b95e1749bc037b08da73ba8b25%7C526638ba6af34b0fa532a1a511f4ac80%7C0%7C0%7C637949542292905556%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=0GyL151f4yBOaJtMk%2BGUPMXY%2F62UTEjYdK6LxFpBcqA%3D&reserved=0

Other metrics components already use itk::MeshFileReader. elastix::TransformBase was upgraded from itk::VTKPolyDataReader to itk::MeshFileReader with ebcb511https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FSuperElastix%2Felastix%2Fcommit%2Febcb511b02b2c555ffa8e7f2e0a89b3b74839ec5&data=05%7C01%7Cs.klein%40erasmusmc.nl%7Caf6ec3b95e1749bc037b08da73ba8b25%7C526638ba6af34b0fa532a1a511f4ac80%7C0%7C0%7C637949542292905556%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=W0n9GqVHJzG87bKe0t5AGfpVTki%2B0xposlZYXtDAKA8%3D&reserved=0 ("ENH: switching elastix to ITK4 !", Marius, 13 Jan 2012.) Hopefully, itk::MeshFileReader has dropped the triangle-only limitation...

Reply to this email directly, view it on GitHubhttps://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FSuperElastix%2Felastix%2Fissues%2F698%23issuecomment-1201145767&data=05%7C01%7Cs.klein%40erasmusmc.nl%7Caf6ec3b95e1749bc037b08da73ba8b25%7C526638ba6af34b0fa532a1a511f4ac80%7C0%7C0%7C637949542292905556%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=SK29Dq6pY6O6VzTQNstflCEb%2F3svRoSwR%2BwPzHcj1gM%3D&reserved=0, or unsubscribehttps://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAAF2LNLLWB47B2YYTHRCZRDVW7AHDANCNFSM55HBV57Q&data=05%7C01%7Cs.klein%40erasmusmc.nl%7Caf6ec3b95e1749bc037b08da73ba8b25%7C526638ba6af34b0fa532a1a511f4ac80%7C0%7C0%7C637949542292905556%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=juJP0FhPnb5LYoHoKaCsT4zGKQWTbmuCwiYTr0%2BzfjA%3D&reserved=0. You are receiving this because you were mentioned.Message ID: @.@.>>

stefanklein avatar Aug 02 '22 10:08 stefanklein

perhaps you can check the code of that class. Any easy way of testing the triangle limitation. Probably would be good to also use this implementation in the statisticalshapepenalty. In any case, this is the recommended way to read/write vtk meshes.

@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:

None of the keywords VERTICES, LINES, POLYGONS, or TRIANGLE_STRIPS is required.

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 https://github.com/SuperElastix/elastix/pull/699

N-Dekker avatar Aug 02 '22 13:08 N-Dekker

Excellent, thanks!

From: Niels Dekker @.> Sent: Tuesday, August 2, 2022 3:06 PM To: SuperElastix/elastix @.> Cc: Stefan Klein @.>; Mention @.> Subject: Re: [SuperElastix/elastix] Double-check limitations of vtk file support (Issue #698)

Waarschuwing: Deze e-mail is afkomstig van buiten de organisatie. Klik niet op links en open geen bijlagen, tenzij u de afzender herkent en weet dat de inhoud veilig is. Caution: This email originated from outside of the organization. Do not click links or open attachments unless you recognize the sender and know the content is safe.

perhaps you can check the code of that class. Any easy way of testing the triangle limitation. Probably would be good to also use this implementation in the statisticalshapepenalty. In any case, this is the recommended way to read/write vtk meshes.

@stefankleinhttps://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fstefanklein&data=05%7C01%7Cs.klein%40erasmusmc.nl%7C9141375f3c374400d2cd08da7487b1f6%7C526638ba6af34b0fa532a1a511f4ac80%7C0%7C0%7C637950424436554860%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=hy50L%2BFIZfSexi8u1uxN8bjNZqIhByPlp%2Fvvt%2FN7V78%3D&reserved=0 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#L177https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FInsightSoftwareConsortium%2FITK%2Fblob%2Fv5.3rc04%2FModules%2FCore%2FMesh%2Finclude%2FitkVTKPolyDataReader.hxx%23L177&data=05%7C01%7Cs.klein%40erasmusmc.nl%7C9141375f3c374400d2cd08da7487b1f6%7C526638ba6af34b0fa532a1a511f4ac80%7C0%7C0%7C637950424436554860%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=fJv6BeCbPMYl%2Bw5aQRRCq%2B0YLHExd6UTkxTb4Gd%2Fl0E%3D&reserved=0

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.pdfhttps://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fvtk.org%2Fwp-content%2Fuploads%2F2015%2F04%2Ffile-formats.pdf&data=05%7C01%7Cs.klein%40erasmusmc.nl%7C9141375f3c374400d2cd08da7487b1f6%7C526638ba6af34b0fa532a1a511f4ac80%7C0%7C0%7C637950424436554860%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=J%2BCLOjxCZCR6aAxaLRFtVX4bfOqp%2FYzOSDLaJiG36EE%3D&reserved=0 says:

None of the keywords VERTICES, LINES, POLYGONS, or TRIANGLE_STRIPS is required.

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 #699https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FSuperElastix%2Felastix%2Fpull%2F699&data=05%7C01%7Cs.klein%40erasmusmc.nl%7C9141375f3c374400d2cd08da7487b1f6%7C526638ba6af34b0fa532a1a511f4ac80%7C0%7C0%7C637950424436554860%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=HKbhYAz09HKtEmpOtYCKnHlIB0x8FDPAOVcjh2g7WcY%3D&reserved=0

Reply to this email directly, view it on GitHubhttps://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FSuperElastix%2Felastix%2Fissues%2F698%23issuecomment-1202507217&data=05%7C01%7Cs.klein%40erasmusmc.nl%7C9141375f3c374400d2cd08da7487b1f6%7C526638ba6af34b0fa532a1a511f4ac80%7C0%7C0%7C637950424436554860%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=Qguwirg%2Fp6OySqhWzLNTABRwX3WIVbqjCWAA4C3g2T4%3D&reserved=0, or unsubscribehttps://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAAF2LNLZW73KSZPUCHY2SNDVXEMKDANCNFSM55HBV57Q&data=05%7C01%7Cs.klein%40erasmusmc.nl%7C9141375f3c374400d2cd08da7487b1f6%7C526638ba6af34b0fa532a1a511f4ac80%7C0%7C0%7C637950424436711092%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=AVi1GMEzlqcVthnfELl9tJOjohmIlYu4jOLUR7RCqks%3D&reserved=0. You are receiving this because you were mentioned.Message ID: @.@.>>

stefanklein avatar Aug 02 '22 17:08 stefanklein

Excellent, thanks!

You're welcome. BTW, it appears to me now that itk::MeshFileReader<MeshType> and itk::MeshFileWriter<MeshType> do support both 2D and 3D points. I mean, I tested with either a 2D or a 3D MeshType, and they both just appear to work fine. It's just the ITK/Python itk.meshread that assumes 3D (producing seemingly arbitrary values for the 3rd coordinate of each read point).

https://github.com/InsightSoftwareConsortium/ITK/blob/585b8f991d7c8fb2d84b51571c3c91f7ae79706e/Modules/IO/MeshVTK/src/itkVTKPolyDataMeshIO.cxx#L287 says:

  this->m_PointDimension = 3; // vtk only support 3 dimensional points

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.

N-Dekker avatar Aug 03 '22 14:08 N-Dekker

OK great, maybe bring that to the attention of the ITK-guys

From: Niels Dekker @.> Sent: Wednesday, August 3, 2022 4:13 PM To: SuperElastix/elastix @.> Cc: Stefan Klein @.>; Mention @.> Subject: Re: [SuperElastix/elastix] Double-check limitations of vtk file support (Issue #698)

Waarschuwing: Deze e-mail is afkomstig van buiten de organisatie. Klik niet op links en open geen bijlagen, tenzij u de afzender herkent en weet dat de inhoud veilig is. Caution: This email originated from outside of the organization. Do not click links or open attachments unless you recognize the sender and know the content is safe.

Excellent, thanks!

You're welcome. BTW, it appears to me now that itk::MeshFileReader<MeshType> and itk::MeshFileWriter<MeshType> do support both 2D and 3D points. I mean, I tested with either a 2D or a 3D MeshType, and they both just appear to work fine. It's just the ITK/Python itk.meshread that assumes 3D (producing seemingly arbitrary values for the 3rd coordinate of each read point).

https://github.com/InsightSoftwareConsortium/ITK/blob/585b8f991d7c8fb2d84b51571c3c91f7ae79706e/Modules/IO/MeshVTK/src/itkVTKPolyDataMeshIO.cxx#L287https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FInsightSoftwareConsortium%2FITK%2Fblob%2F585b8f991d7c8fb2d84b51571c3c91f7ae79706e%2FModules%2FIO%2FMeshVTK%2Fsrc%2FitkVTKPolyDataMeshIO.cxx%23L287&data=05%7C01%7Cs.klein%40erasmusmc.nl%7Cddec579d98284e9c4bb608da755a3e22%7C526638ba6af34b0fa532a1a511f4ac80%7C0%7C0%7C637951327697653384%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=5rISe0PY1zBzSEdTUJ8pBUF6XcUAqvUPchS7VeRQOWc%3D&reserved=0 says:

this->m_PointDimension = 3; // vtk only support 3 dimensional points

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.

— Reply to this email directly, view it on GitHubhttps://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FSuperElastix%2Felastix%2Fissues%2F698%23issuecomment-1204005558&data=05%7C01%7Cs.klein%40erasmusmc.nl%7Cddec579d98284e9c4bb608da755a3e22%7C526638ba6af34b0fa532a1a511f4ac80%7C0%7C0%7C637951327697653384%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=KVkiWxkxiFphI%2BZJhOuZZd7HKG4E0eUkCYVOmSPthAY%3D&reserved=0, or unsubscribehttps://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAAF2LNINWATWZK6RONNUYLLVXJ455ANCNFSM55HBV57Q&data=05%7C01%7Cs.klein%40erasmusmc.nl%7Cddec579d98284e9c4bb608da755a3e22%7C526638ba6af34b0fa532a1a511f4ac80%7C0%7C0%7C637951327697653384%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=TC%2Bb1wsnWku5kENeQE%2B4zoLHSRUujiFe%2FpMCe0FfcKs%3D&reserved=0. You are receiving this because you were mentioned.Message ID: @.@.>>

stefanklein avatar Aug 03 '22 15:08 stefanklein

OK great, maybe bring that to the attention of the ITK-guys

Good idea @stefanklein, it appears that there was an issue already, "Add 2D mesh support", I just added my comment: https://github.com/slicersalt/ITKShape/issues/8#issuecomment-1204999459

N-Dekker avatar Aug 04 '22 09:08 N-Dekker

Ok, great, thanks Niels

From: Niels Dekker @.> Sent: Thursday, August 4, 2022 11:31 AM To: SuperElastix/elastix @.> Cc: Stefan Klein @.>; Mention @.> Subject: Re: [SuperElastix/elastix] Double-check limitations of vtk file support (Issue #698)

Waarschuwing: Deze e-mail is afkomstig van buiten de organisatie. Klik niet op links en open geen bijlagen, tenzij u de afzender herkent en weet dat de inhoud veilig is. Caution: This email originated from outside of the organization. Do not click links or open attachments unless you recognize the sender and know the content is safe.

OK great, maybe bring that to the attention of the ITK-guys

Good idea @stefankleinhttps://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fstefanklein&data=05%7C01%7Cs.klein%40erasmusmc.nl%7Cca5333683b3b4d2ac78608da75fc135b%7C526638ba6af34b0fa532a1a511f4ac80%7C0%7C0%7C637952022766630580%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=FsbiXA1qW4Sl8X4NqH3sB8joA2RBxO7291ccf%2BAjJbc%3D&reserved=0, it appears that there was an issue already, "Add 2D mesh support", I just added my comment: slicersalt/ITKShape#8 (comment)https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fslicersalt%2FITKShape%2Fissues%2F8%23issuecomment-1204999459&data=05%7C01%7Cs.klein%40erasmusmc.nl%7Cca5333683b3b4d2ac78608da75fc135b%7C526638ba6af34b0fa532a1a511f4ac80%7C0%7C0%7C637952022766630580%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=KjTQb8woE%2BQcnXlBdwZe9jVFRZP7wGMnic5LdLXpGos%3D&reserved=0

Reply to this email directly, view it on GitHubhttps://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FSuperElastix%2Felastix%2Fissues%2F698%23issuecomment-1205003835&data=05%7C01%7Cs.klein%40erasmusmc.nl%7Cca5333683b3b4d2ac78608da75fc135b%7C526638ba6af34b0fa532a1a511f4ac80%7C0%7C0%7C637952022766630580%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=i8RUHqGnNNPFI0odKzT%2B36OmLXIGcw2CVYM7ytq2Nw8%3D&reserved=0, or unsubscribehttps://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAAF2LNIIAHWQKQHZMUHFFZ3VXOEWDANCNFSM55HBV57Q&data=05%7C01%7Cs.klein%40erasmusmc.nl%7Cca5333683b3b4d2ac78608da75fc135b%7C526638ba6af34b0fa532a1a511f4ac80%7C0%7C0%7C637952022766630580%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=Qd8BEwyct4pOtxgOaykfY7oS%2FdHydjtymWXLKg%2FGBZg%3D&reserved=0. You are receiving this because you were mentioned.Message ID: @.@.>>

stefanklein avatar Aug 05 '22 10:08 stefanklein

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:

  • Fixed with ITK 5.3: BUG: VTKPolyDataMeshIO should not hang on inf and NaN in ASCII .vtk file pull request https://github.com/InsightSoftwareConsortium/ITK/pull/3542 commit https://github.com/InsightSoftwareConsortium/ITK/commit/678b97eaebed1a1fddcb77f64cfb5e293700edea
  • Included with ITK 5.3: ENH: Support reading a mesh of non-3D points from a .vtk PolyData file pull request https://github.com/InsightSoftwareConsortium/ITK/pull/3549 https://github.com/InsightSoftwareConsortium/ITK/commit/236f3782581cc68f60ebe9b65fc4983a4abe9df3
  • Opened on ITK Discourse (not entirely "resolved"): Python wrapping for 64-bit double https://discourse.itk.org/t/python-wrapping-for-64-bit-double-itk-mesh-coordinates/5241

Time to close this issue for now!

N-Dekker avatar Aug 23 '22 11:08 N-Dekker