# What are the differences between the definitions of mesh traits?

**URL:** <https://discourse.itk.org/t/what-are-the-differences-between-the-definitions-of-mesh-traits/3044>\
**Category:** Beginner Questions\
**Created:** [May 8, 2020, 4:15am UTC](https://discourse.itk.org/t/what-are-the-differences-between-the-definitions-of-mesh-traits/3044 "2020-05-08T04:15:53Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sara\_Caffe](https://discourse.itk.org/user_avatar/discourse.itk.org/sara_caffe/32/974_2.png) [@Sara\_Caffe](https://discourse.itk.org/u/Sara_Caffe)\
**Post date:** [May 8, 2020, 4:15am UTC](https://discourse.itk.org/t/what-are-the-differences-between-the-definitions-of-mesh-traits/3044/1 "2020-05-08T04:15:53Z")

</div>

I am seeing two types of mesh trait definition in ITK example codes. Could you please explain what are the differences?

- What is the mesh trait? what is it exactly showing for a mesh? Based on my understanding, it is the structure of mesh. Is that right?

What is the difference between these two definitions of mesh types?

1. In [this link](https://github.com/InsightSoftwareConsortium/ITKApps/blob/master/DeformableModelSimplexMesh/itkMeshTovtkPolyData.h#L28), the declaration of triangle mesh is:

2. In this [link](https://discourse.itk.org/t/simplex-mesh-deformable-model-doesnt-change/386) , the mesh traits definitions is different:

> typedef float PixelType;  
> typedef itk::DefaultDynamicMeshTraits\<PixelType, dimension\> TriangleMeshTraits;  
> typedef itk::Mesh\<PixelType, dimension, TriangleMeshTraits\> TriangleMeshType;

---

<div class="post-metadata">

**Author:** ![dzenanz](https://discourse.itk.org/user_avatar/discourse.itk.org/dzenanz/32/1093_2.png) [@dzenanz](https://discourse.itk.org/u/dzenanz)\
**Post date:** [May 8, 2020, 11:53am UTC](https://discourse.itk.org/t/what-are-the-differences-between-the-definitions-of-mesh-traits/3044/2 "2020-05-08T11:53:19Z")

</div>

Read docs for [DefaultDynamicMeshTraits](https://itk.org/Doxygen/html/classitk_1_1DefaultDynamicMeshTraits.html) to see explanation of its template parameters. All of them have a default value except the first one.
