# vtkFlyingEdges3D Usage. (Comparison with vtkContourfilter)

**URL:** https://discourse.vtk.org/t/vtkflyingedges3d-usage-comparison-with-vtkcontourfilter/3873
**Category:** Support
**Created:** [July 30, 2020, 1:15am UTC](https://discourse.vtk.org/t/vtkflyingedges3d-usage-comparison-with-vtkcontourfilter/3873 "2020-07-30T01:15:10Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![Seun](https://discourse.vtk.org/user_avatar/discourse.vtk.org/seun/32/767_2.png) [@Seun](https://discourse.vtk.org/u/Seun)
#### Post date: [July 30, 2020, 1:15am UTC](https://discourse.vtk.org/t/vtkflyingedges3d-usage-comparison-with-vtkcontourfilter/3873/1 "2020-07-30T01:15:10Z")

</div>

Hi everyone,  
I was recently testing vtkFlyingEdges3D in replacement of vtkContourFilter and didn’t really notice that much of a difference in terms of performance, just to give an idea of the result of the task I was carrying out. The latter (vtkContourFilter) ran at about 1.08s whereas vtkFlyingEdges3D executed the same task at about 0.94s.  
From what I understand Flying edges is expected to outperform other filters/algorithm in my this vtkContourFilter significantly, is there some necessary steps / setup that needs to be done in other to get the best out of Flying Edge.

note: It may be worth mentioning that the project am working on has always been making use of vtkContourFilter and all I had done was simply changing it to use vtkFlyingEdges (no extra change(s) were made).

---

<div class="post-metadata">

### Author: ![lassoan](https://discourse.vtk.org/user_avatar/discourse.vtk.org/lassoan/32/50_2.png) [@lassoan](https://discourse.vtk.org/u/lassoan)
#### Post date: [July 30, 2020, 1:59am UTC](https://discourse.vtk.org/t/vtkflyingedges3d-usage-comparison-with-vtkcontourfilter/3873/2 "2020-07-30T01:59:29Z")

</div>

See the [filter’s documentation](https://vtk.org/doc/nightly/html/classvtkFlyingEdges3D.html#details) for explanation:

> This class has been threaded with [vtkSMPTools](https://vtk.org/doc/nightly/html/classvtkSMPTools.html). Using TBB or other non-sequential type (set in the CMake variable VTK\_SMP\_IMPLEMENTATION\_TYPE) may improve performance significantly.

---

<div class="post-metadata">

### Author: ![Seun](https://discourse.vtk.org/user_avatar/discourse.vtk.org/seun/32/767_2.png) [@Seun](https://discourse.vtk.org/u/Seun)
#### Post date: [July 30, 2020, 2:17am UTC](https://discourse.vtk.org/t/vtkflyingedges3d-usage-comparison-with-vtkcontourfilter/3873/3 "2020-07-30T02:17:44Z")

</div>

Thanks Andras,  
My apologies, I forgot to mention that I actually testing both classes with TBB (I built VTK with VTK\_SMP\_IMPLEMENTATION\_TYPE in CMake set to TBB, all required paths set and libraries added) I didn’t notice any performance difference. I’ve used TBB recently and seen improvements back then, I was just wondering if there was something specific to vtkFlyingEdges that I’m missing or maybe there’s something else I botched along the way.

---

<div class="post-metadata">

### Author: ![lassoan](https://discourse.vtk.org/user_avatar/discourse.vtk.org/lassoan/32/50_2.png) [@lassoan](https://discourse.vtk.org/u/lassoan)
#### Post date: [July 30, 2020, 2:20am UTC](https://discourse.vtk.org/t/vtkflyingedges3d-usage-comparison-with-vtkcontourfilter/3873/4 "2020-07-30T02:20:56Z")

</div>

What hardware and operating system do you use? What are the dimensions and scalar type of the input image? How many points and cells are in the output polydata?

How does the performance compares to marching cubes?

---

<div class="post-metadata">

### Author: ![Charles\_Gueunet](https://discourse.vtk.org/user_avatar/discourse.vtk.org/charles_gueunet/32/239_2.png) [@Charles\_Gueunet](https://discourse.vtk.org/u/Charles_Gueunet)
#### Post date: [July 30, 2020, 6:20am UTC](https://discourse.vtk.org/t/vtkflyingedges3d-usage-comparison-with-vtkcontourfilter/3873/5 "2020-07-30T06:20:44Z")

</div>

Can you also give us an insight of the size of the contour compared to the size of the data set ?

---

<div class="post-metadata">

### Author: ![Seun](https://discourse.vtk.org/user_avatar/discourse.vtk.org/seun/32/767_2.png) [@Seun](https://discourse.vtk.org/u/Seun)
#### Post date: [July 30, 2020, 4:18pm UTC](https://discourse.vtk.org/t/vtkflyingedges3d-usage-comparison-with-vtkcontourfilter/3873/6 "2020-07-30T16:18:01Z")

</div>

From what I understand, vtkContourFilter uses marching cube.

Hardware: iMac (3.5GHz, 8-Core, Intel Core i9)  
OS: macOS 10.15.6 (Catalina)

# For both cases of (vtkContourFilter & vtkFlyingEdges3D)

* * *

Input image (dimension): 180 x 256 x 256  
Input image (Scalar type): int16\_t

note: I filter the poly data through a stripper as a last step, this might explain why the cells are 0 (as I only work with strips). The result of the final output poly data is as follows

# Output info - vtkContourFilter

* * *

number of cells - 0  
number of strips - 71390  
number of points - 211880

# Output info - vtkFlyingEdges3D

* * *

number of cells - 0  
number of strips - 72966  
number of points - 217790

Can you make any sense of this?

---

<div class="post-metadata">

### Author: ![Seun](https://discourse.vtk.org/user_avatar/discourse.vtk.org/seun/32/767_2.png) [@Seun](https://discourse.vtk.org/u/Seun)
#### Post date: [July 30, 2020, 4:20pm UTC](https://discourse.vtk.org/t/vtkflyingedges3d-usage-comparison-with-vtkcontourfilter/3873/7 "2020-07-30T16:20:05Z")

</div>

I don’t quite understand what you mean by size of contour, does my reply above suffice?
