Calculating Volume for .vtk File

I am looking into finding the volume of a .vtk mesh from ITK-SNAP after applying a transformation filter. I have tried small snippets of code from the “Programmable Code” filter but the code did not work for me. Are there other steps to try?

Thank you in advance.

What about the “Mesh Quality” filter ? you can compute volume of cells and then integrate it.

Thank you for the response. I looked into this filter and tried ways to use it, but had troubling figuring out my desired volume results. Is there a way you could go through the steps with me? Thank you!

Please share your file.

TAV70_WholePatient.pvsm (1.6 MB)

Here is the file. The chambers are color coded and named. For LA, RV, LV, and RV, that is what I am looking to find the volume of. The models in red are the aorta, valves, and coronary arteries and I don’t need the volumes for those. Would you be able to show me how to use the filter so I can calculate this for the 9 other trials I have? Thank you.

pvsm is not enough, please share your data as well.

Here is a link for the chambers I created in ITK-SNAP and then exported to ParaView. I had to apply a transform filter to get into the correct units, so I also included the .nii.gz file from ITK-SNAP. Do you need any additional files?
Here is the link:
Please let me know if you cannot access this. Thank you for your help!

Your dataset is not volumic but surfacic. You want to compute the volme inside your surface ?

Maybe TTK has something for this @Charles_Gueunet

There is no filters in TTK that could compute the volume of a mesh (or enclosed in a surface) as of today.

I think Tetgen may be the right tool for this, but I am not sure how to get the total volume with it.

Hello, I am trying to compute the volume inside the surface. There is an option to view volume in ITK-SNAP, so I will refer to that for the time being and review their manual. Per Tetgen tutorial, it seems as if the mesh can be viewed in .vtk per a switch to be seen in ParaView. At the moment, I don’t believe the volume option will work for the file from SNAP, but I appreciate both of your help in this matter. If anything is figured out, I will respond to this post with an answer. Stay healthy!