[Insight-users] [ITK Community] Expression: map/set iterator not dereferencable using STLMeshIO
Luis Ibanez
luis.ibanez at kitware.com
Tue Mar 4 12:03:58 EST 2014
Hi Yurrit,
It is great to hear about your interest in the STL reader.
Could you please replace the line:
reader->Update();
with the try / catch block:
try
{
reader->Update();
}
catch( itk::ExceptionObject & excp )
{
std::cerr << excp << std::endl;
return EXIT_FAILURE;
}
I'm suspecting that the real problem is the path to your file:
const char * inputFileName = "inputfile.stl";
that should rather be a full path, such as (for example):
const char * inputFileName =
"C:/MyFiles/ReproducibleScience/STL/inputfile.stl";
and that due to the current lack of the try / catch block,
we are not seeing the error message that points to the
true cause of the problem.
Please give it a try, with the try / catch block,
and with the full path to your STL file, and
let us know what you find,
Thanks
Luis
On Mon, Mar 3, 2014 at 9:10 AM, Yurrit Avonds
<Yurrit.Avonds at materialise.be>wrote:
> 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;
>
> }
>
> _____________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Kitware offers ITK Training Courses, for more information visit:
> http://www.kitware.com/products/protraining.php
>
> Please keep messages on-topic and check the ITK FAQ at:
> http://www.itk.org/Wiki/ITK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.itk.org/mailman/listinfo/insight-users
>
> _______________________________________________
> Community mailing list
> Community at itk.org
> http://public.kitware.com/cgi-bin/mailman/listinfo/community
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20140304/2f3243f5/attachment.html>
More information about the Insight-users
mailing list