# [vtkusers] How to transfer

Denis Barbier bouzim at gmail.com
Mon Nov 17 16:20:52 EST 2008

```On 2008/11/16 xx_zx wrote:
>
> Hi, Denis. Thanks a lot! I took your suggestion and it works!:-D
>
> However, I still have some troubles.
> Some structures do not have closed surface. For example, in one of my
> dataset, heart is reconstructed more like a bowl than a closed ellipsoid.
> But the volume calculated by GetVolume() in vtkMassProperties does have
> value and seems right. In this case, is the volume calculated by GetVolume()
> reliable?

I had a closer look at vtkMassProperties and understand now what happens.
Volume is computed by using the following formula, which is one the many
ways to compute volume by using the divergence theorem:
Volume = (1/3) * integral(OM . N, M on volume boundary)
where O is origin, N is unit outward normal at point M, and OM.N is dot product.
This formula is valid only if object is closed, but integral can be computed
with any triangulation.  For instance if you consider an half unit
sphere centered
at origin S={x*x+y*y+z*z=1, z >= 0}, the plane z=0 has no contribution to this
integral and thus the result will be the same whether S is a cap or closed by
z=0 plane.
So this may be what you are seeing, a missing plane has no contribution
to the end result because it contains origin.

In order to test reliability of GetVolume(), you can apply rigid transformations
(translations and rotations) to your object; if volume does not change, result
is most certainly valid.

Another very important point to keep in mind is that normals must be consistent
over the whole boundary.

I did not notice, but reconstructSurface example does not produce a closed
surface, this is more visible after changing back face color.  A solution has
been given at
http://www.vtk.org/pipermail/vtkusers/2007-August/092305.html
(unfortunately this thread is broken, there are other messages in August 2007)
Here is a modified reconstructSurface.tcl example with object being properly
closed, you may apply similar changes in your case.

Denis
-------------- next part --------------
A non-text attachment was scrubbed...
Name: reconstructSurface.tcl
Type: application/x-tcl
Size: 4203 bytes
Desc: not available
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20081117/243532fc/attachment.tcl>
```