[Insight-users] Problem converting SimplexMesh back into Mesh

Sven Olaf Lüttmann sven.luettmann at fh-dortmund.de
Wed Oct 26 09:26:33 EDT 2011


Dear all,
I'm having some trouble converting an itk::SimplexMesh to itk::Mesh using the 
itkSimplexMeshToTriangleMeshFilter.
I get some errors while compiling the source code and I'm I have no clue about it.

Here is a code snipped with typedefs and declarations. The first thing I do is converting my 
itk::Mesh into a SimplexMesh, after that I use it in an segmentation process and afterwards I would 
like to convert it back.

================================

  typedef itk::Mesh<double> MeshType;
  typedef itk::SimplexMesh< double > SimplexMeshType;

  typedef itk::SimplexMeshToTriangleMeshFilter< SimplexMeshType, MeshType > 
SimplexMeshToTriangleMeshFilterType;

  SimplexMeshToTriangleMeshFilterType::Pointer toMeshFilter = 
SimplexMeshToTriangleMeshFilterType::New();
  toMeshFilter->SetInput( simplexMesh );
  toMeshFilter->Update();


Here are the compiling errors I get.
================================

vtkMySegmentation.cxx: In member function 'void KardioSeg::vtkMySegmentation::startSegmentation2()':

vtkMySegmentation.cxx:353:60: error: no matching function for call to 
'itk::SimplexMeshToTriangleMeshFilter<itk::SimplexMesh<double>, itk::Mesh<double> 
 >::SetInput(itk::MeshSource<itk::Mesh<double> >::OutputMeshType*)'

/usr/local/include/InsightToolkit/Common/itkMeshToMeshFilter.txx:47:1: note: candidate is: void 
itk::MeshToMeshFilter<TInputMesh, TOutputMesh>::SetInput(const TInputMesh*) [with TInputMesh = 
itk::SimplexMesh<double>, TOutputMesh = itk::Mesh<double>]
In file included from 
/usr/local/include/InsightToolkit/BasicFilters/itkSimplexMeshToTriangleMeshFilter.h:190:0,
                  from vtkMySegmentation.h:19,
                  from vtkMySegmentation.cxx:1:

/usr/local/include/InsightToolkit/BasicFilters/itkSimplexMeshToTriangleMeshFilter.txx: In member 
function 'void itk::SimplexMeshToTriangleMeshFilter<TInputMesh, TOutputMesh>::CreateTriangles() 
[with TInputMesh = itk::SimplexMesh<double>, TOutputMesh = itk::Mesh<double>]':

/usr/local/include/InsightToolkit/BasicFilters/itkSimplexMeshToTriangleMeshFilter.txx:42:3:   
instantiated from 'void itk::SimplexMeshToTriangleMeshFilter<TInputMesh, 
TOutputMesh>::GenerateData() [with TInputMesh = itk::SimplexMesh<double>, TOutputMesh = 
itk::Mesh<double>]'

vtkMySegmentation.cxx:536:1:   instantiated from here
/usr/local/include/InsightToolkit/BasicFilters/itkSimplexMeshToTriangleMeshFilter.txx:79:62: error: 
no matching function for call to 'itk::MapContainer<long unsigned int, itk::Point<double, 3u> 
 >::GetElementIfIndexExists(long unsigned int&, itk::AutomaticTopologyMeshSource<itk::Mesh<double> 
 >::PointType*)'

/usr/local/include/InsightToolkit/Common/itkMapContainer.txx:130:1: note: candidate is: bool 
itk::MapContainer<TElementIdentifier, TElement>::GetElementIfIndexExists(ElementIdentifier, 
Element*) const [with TElementIdentifier = long unsigned int, TElement = itk::Point<double, 3u>, 
ElementIdentifier = long unsigned int, Element = itk::Point<double, 3u>]

/usr/local/include/InsightToolkit/BasicFilters/itkSimplexMeshToTriangleMeshFilter.txx:80:62: error: 
no matching function for call to 'itk::MapContainer<long unsigned int, itk::Point<double, 3u> 
 >::GetElementIfIndexExists(long unsigned int&, itk::AutomaticTopologyMeshSource<itk::Mesh<double> 
 >::PointType*)'

/usr/local/include/InsightToolkit/Common/itkMapContainer.txx:130:1: note: candidate is: bool 
itk::MapContainer<TElementIdentifier, TElement>::GetElementIfIndexExists(ElementIdentifier, 
Element*) const [with TElementIdentifier = long unsigned int, TElement = itk::Point<double, 3u>, 
ElementIdentifier = long unsigned int, Element = itk::Point<double, 3u>]

/usr/local/include/InsightToolkit/BasicFilters/itkSimplexMeshToTriangleMeshFilter.txx:81:62: error: 
no matching function for call to 'itk::MapContainer<long unsigned int, itk::Point<double, 3u> 
 >::GetElementIfIndexExists(long unsigned int&, itk::AutomaticTopologyMeshSource<itk::Mesh<double> 
 >::PointType*)'

/usr/local/include/InsightToolkit/Common/itkMapContainer.txx:130:1: note: candidate is: bool 
itk::MapContainer<TElementIdentifier, TElement>::GetElementIfIndexExists(ElementIdentifier, 
Element*) const [with TElementIdentifier = long unsigned int, TElement = itk::Point<double, 3u>, 
ElementIdentifier = long unsigned int, Element = itk::Point<double, 3u>]

===============================

Has anyone an idea where the problem could be.

Thanks very much.

Sven




-- 
*Fachhochschule Dortmund*
*University of Applied Sciences and Arts*

Sven Olaf Lüttmann
B.Sc. Medizinische Informatik

FB Informatik, Medizinische Informatik
Emil-Figge-Str. 42
44227 Dortmund

Raum: EFS 42 B.1.21

Fax: 0231 / 755-6725
E-Mail: sven.luettmann at fh-dortmund.de <mailto:sven.luettmann at fh-dortmund.de>
Web: http://www.fh-dortmund.de
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20111026/a76fd8da/attachment.htm>


More information about the Insight-users mailing list