[Insight-users] Expression: map/set iterator not dereferencable using STLMeshIO

Yurrit Avonds Yurrit.Avonds at materialise.be
Mon Mar 3 09:10:37 EST 2014


Dear all,

In an attempt to start using ITK to process STL files, I wrote a small test program, based on the "STL file format MeshIO class for ITK" (http://hdl.handle.net/10380/3452) . The source code below causes an error at the line

reader->Update();

near the end of the source code. The error is as follows:


Debug Assertion Failed!

Program C:\Windows\system32\MSVCP120D.dll
File C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\xtree
Line 237

Expression: map/set iterator not dereferencable

For information on how your program can cause and assertion failure, see the Visual C++ documentation on assets.

(Press Retry to debug the application)


Has anyone else experienced/solved this issue? I have been trying to fix it for several hours, but cannot seem to find a solution.

Kind regards,
Yurrit

#include "itkQuadEdgeMesh.h"
#include "itkSTLMeshIOFactory.h"
#include "itkSTLMeshIO.h"
#include "itkMeshFileReader.h"
#include "itkMeshFileWriter.h"

int main(int argc, char *argv[])
{

       const unsigned int Dimension = 3;
       typedef double EdgeType;

       typedef itk::QuadEdgeMesh<EdgeType, Dimension> QEMeshType;
       typedef itk::STLMeshIOFactory STLMeshIO;
       typedef itk::MeshFileReader<QEMeshType> ReaderType;

       STLMeshIO::RegisterOneFactory();
       ReaderType::Pointer reader = ReaderType::New();

       const char * inputFileName = "inputfile.stl";

       reader->SetFileName(inputFileName);
       reader->Update();

       return 0;
}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20140303/a2642ac2/attachment.html>


More information about the Insight-users mailing list