Fast Marching Implementation

89 views
Skip to first unread message

bernardoma...@gmail.com

unread,
Sep 29, 2015, 2:52:09 PM9/29/15
to vmtk-users
Hi everyone,

I would like to use the Fast Marching implementation of VMTK in a surface mesh given in a VTK file format.

I've been playing a lot with the applications and scripts that comes with VMTK and I haven't found how to do that.

My questions are:
(1) Is it possible to do that by using one of the scripts?

(2) Or do I need to write my own program for that? 
If so, what would be the C++ classes that I would have to use for that?
Is there an example of usage of VMTK classes?

That's it for now.
Thanks a lot in advance.

Best regards,
Bernardo

Luca Antiga

unread,
Sep 29, 2015, 5:35:58 PM9/29/15
to bernardoma...@gmail.com, vmtk-...@googlegroups.com
Hi Bernardo,

there’s a class that you can use, both from C++ or Python, but there isn’t a script for that.

I suggest you look into vtkVmtk/ComputationalGeometry/vtkvmtkPolyDataCenterlines.cxx, but here’s a sketch:
make sure you define a point array on a surface, which will be your cost function defined over the surface; let’s say this point array is called “Cost”. Then:

- in C++:

#include “vtkIdList.h”
#include “vtkvmtkNonManifoldFastMarching.h"

vtkIdList* seeds = vtkIdList::New();
seeds->SetId(1234); // this is the id of the point you want to start the propagation

vtkvmtkNonManifoldFastMarching* fastMarching = vtkvmtkNonManifoldFastMarching::New();
fastMarching->SetInput(surface);
fastMarching->SetCostFunctionArrayName(“Cost");
fastMarching->SetSolutionArrayName(“Solution");
fastMarching->SeedsBoundaryConditionsOn();
fastMarching->SetSeeds(seeds);
fastMarching->Update();

In python it’s essentially the same thing:

import vtk
from vmtk import vtkvmtk

seeds = vtk.vtkIdList()
seeds.SetId(1234)

fastMarching = vtkvmtk.vtkvmtkNonManifoldFastMarching()
fastMarching.SetInput(surface)
fastMarching.SetCostFunctionArrayName(“Cost")
fastMarching.SetSolutionArrayName(“Solution")
fastMarching.SeedsBoundaryConditionsOn()
fastMarching.SetSeeds(seeds)
fastMarching.Update()

Best,


Luca
--
You received this message because you are subscribed to the Google Groups "vmtk-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vmtk-users+...@googlegroups.com.
To post to this group, send email to vmtk-...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

bernardoma...@gmail.com

unread,
Sep 30, 2015, 9:10:33 AM9/30/15
to vmtk-users
Hi Luca,
thanks a lot for your reply. 
That's what I was looking for.
Is it also possible to run this FMM implementation on a tetrahedral mesh?
Best regards,
Bernardo

Luca Antiga

unread,
Oct 1, 2015, 5:33:25 AM10/1/15
to bernardoma...@gmail.com, vmtk-...@googlegroups.com
Hi Bernardo,
unfortunately the filter only works for vtkPolyData in its current implementation.

Luca
--
Reply all
Reply to author
Forward
0 new messages