<div dir="ltr">Hi Yurrit,<div><br></div><div>It is great to hear about your interest in the STL reader.</div><div><br></div><div>Could you please replace the line:</div><div><br></div><div>              reader->Update();</div>
<div><br></div><div>with the try / catch block:</div><div><br></div><div>try</div><div>{</div><div>     reader->Update();</div><div>}</div><div>catch( itk::ExceptionObject & excp ) </div><div>{</div><div>    std::cerr << excp << std::endl;</div>
<div>    return EXIT_FAILURE;</div><div>}</div><div><br></div><div>I'm suspecting that the real problem is the path to your file:</div><div><br></div><div><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas"> </span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:blue">const</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas"> </span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:blue">char</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas"> * inputFileName = </span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:rgb(163,21,21)">"inputfile.stl"</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas">;</span><br>
</div><div><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas"><br></span></div><div><div>that should rather be a full path, such as (for example):</div></div><div><br></div><div><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas"> </span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:blue">const</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas"> </span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:blue">char</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas"> * inputFileName = </span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:rgb(163,21,21)">"C:/MyFiles/ReproducibleScience/STL/inputfile.stl"</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas">;</span><br>
</div><div><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas"><br></span></div><div><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas"><br></span></div><div><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas"><span style="font-family:arial;font-size:small">and that due to the current lack of the try / catch block, </span></span></div>
<div><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas"><span style="font-family:arial;font-size:small">we are </span></span>not seeing the error message that points to the </div><div>true cause of the problem.</div>
<div><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas"><span style="font-family:arial;font-size:small"><br></span></span></div><div><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas"><span style="font-family:arial;font-size:small"><br>
</span></span></div><div><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas"><span style="font-family:arial;font-size:small">Please give it a try, with the try / catch block,</span></span></div><div><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas"><span style="font-family:arial;font-size:small">and with the full path to your STL file, and </span></span></div>
<div><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas"><span style="font-family:arial;font-size:small">let us know what you find,</span></span></div><div><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas"><span style="font-family:arial;font-size:small"><br>
</span></span></div><div><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas"><span style="font-family:arial;font-size:small"><br></span></span></div><div><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas"><span style="font-family:arial;font-size:small">     Thanks</span></span></div>
<div><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas"><span style="font-family:arial;font-size:small"><br></span></span></div><div><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas"><span style="font-family:arial;font-size:small"><br>
</span></span></div><div><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas"><span style="font-family:arial;font-size:small">          Luis</span></span></div><div><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas"><br>
</span></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Mar 3, 2014 at 9:10 AM, Yurrit Avonds <span dir="ltr"><<a href="mailto:Yurrit.Avonds@materialise.be" target="_blank">Yurrit.Avonds@materialise.be</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">





<div lang="NL-BE" link="#0563C1" vlink="#954F72">
<div>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:12.0pt;font-family:"Times New Roman","serif";background:white">Dear all,<u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:12.0pt;font-family:"Times New Roman","serif";background:white"><u></u> <u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:12.0pt;font-family:"Times New Roman","serif";background:white">In an attempt to start using ITK to process STL files, I wrote a small test program, based
 on the “</span><span lang="EN-US" style="font-size:12.0pt;font-family:"Times New Roman","serif"">STL file format MeshIO class for ITK” (<a href="http://hdl.handle.net/10380/3452" target="_blank">http://hdl.handle.net/10380/3452</a>) . The source code below causes an error at the line<u></u><u></u></span></p>

<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:12.0pt;font-family:"Times New Roman","serif""><u></u> <u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:12.0pt;font-family:"Times New Roman","serif"">reader->Update();<u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:12.0pt;font-family:"Times New Roman","serif""><u></u> <u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:12.0pt;font-family:"Times New Roman","serif"">near the end of the source code. The error is as follows:<u></u><u></u></span></p>

<div style="border:none;border-bottom:solid windowtext 1.0pt;padding:0cm 0cm 1.0pt 0cm">
<p class="MsoNormal" style="text-autospace:none;border:none;padding:0cm"><span lang="EN-US" style="font-size:12.0pt;font-family:"Times New Roman","serif""><u></u> <u></u></span></p>
</div>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:12.0pt;font-family:"Times New Roman","serif""><u></u> <u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:12.0pt;font-family:"Times New Roman","serif"">Debug Assertion Failed!<u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:12.0pt;font-family:"Times New Roman","serif""><u></u> <u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:12.0pt;font-family:"Times New Roman","serif"">Program C:\Windows\system32\MSVCP120D.dll<u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:12.0pt;font-family:"Times New Roman","serif"">File C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\xtree<u></u><u></u></span></p>

<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:12.0pt;font-family:"Times New Roman","serif"">Line 237<u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:12.0pt;font-family:"Times New Roman","serif""><u></u> <u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:12.0pt;font-family:"Times New Roman","serif"">Expression: map/set iterator not dereferencable<u></u><u></u></span></p>

<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:12.0pt;font-family:"Times New Roman","serif""><u></u> <u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:12.0pt;font-family:"Times New Roman","serif"">For information on how your program can cause and assertion failure, see the Visual C++ documentation on assets.<u></u><u></u></span></p>

<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:12.0pt;font-family:"Times New Roman","serif""><u></u> <u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:12.0pt;font-family:"Times New Roman","serif"">(Press Retry to debug the application)<u></u><u></u></span></p>
<div style="border:none;border-bottom:solid windowtext 1.0pt;padding:0cm 0cm 1.0pt 0cm">
<p class="MsoNormal" style="text-autospace:none;border:none;padding:0cm"><span lang="EN-US" style="font-size:12.0pt;font-family:"Times New Roman","serif""><u></u> <u></u></span></p>
</div>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:12.0pt;font-family:"Times New Roman","serif""><u></u> <u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:12.0pt;font-family:"Times New Roman","serif"">Has anyone else experienced/solved this issue? I have been trying to fix it for several hours, but cannot seem to find a solution.<u></u><u></u></span></p>

<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:12.0pt;font-family:"Times New Roman","serif""><u></u> <u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:12.0pt;font-family:"Times New Roman","serif"">Kind regards,<u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:12.0pt;font-family:"Times New Roman","serif"">Yurrit<u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:blue;background:white"><u></u> <u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:blue;background:white">#include</span><span lang="EN-US" style="background:white;font-size:9.5pt;font-family:Consolas">
</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:#a31515;background:white">"itkQuadEdgeMesh.h"</span><span lang="EN-US" style="background:white;font-size:9.5pt;font-family:Consolas"><u></u><u></u></span></p>

<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:blue;background:white">#include</span><span lang="EN-US" style="background:white;font-size:9.5pt;font-family:Consolas">
</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:#a31515;background:white">"itkSTLMeshIOFactory.h"</span><span lang="EN-US" style="background:white;font-size:9.5pt;font-family:Consolas"><u></u><u></u></span></p>

<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:blue;background:white">#include</span><span lang="EN-US" style="background:white;font-size:9.5pt;font-family:Consolas">
</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:#a31515;background:white">"itkSTLMeshIO.h"</span><span lang="EN-US" style="background:white;font-size:9.5pt;font-family:Consolas"><u></u><u></u></span></p>

<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:blue;background:white">#include</span><span lang="EN-US" style="background:white;font-size:9.5pt;font-family:Consolas">
</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:#a31515;background:white">"itkMeshFileReader.h"</span><span lang="EN-US" style="background:white;font-size:9.5pt;font-family:Consolas"><u></u><u></u></span></p>

<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:blue;background:white">#include</span><span lang="EN-US" style="background:white;font-size:9.5pt;font-family:Consolas">
</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:#a31515;background:white">"itkMeshFileWriter.h"</span><span lang="EN-US" style="background:white;font-size:9.5pt;font-family:Consolas"><u></u><u></u></span></p>

<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="background:white;font-size:9.5pt;font-family:Consolas"><u></u> <u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:blue;background:white">int</span><span lang="EN-US" style="background:white;font-size:9.5pt;font-family:Consolas">
 main(</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:blue;background:white">int</span><span lang="EN-US" style="background:white;font-size:9.5pt;font-family:Consolas">
</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:gray;background:white">argc</span><span lang="EN-US" style="background:white;font-size:9.5pt;font-family:Consolas">,
</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:blue;background:white">char</span><span lang="EN-US" style="background:white;font-size:9.5pt;font-family:Consolas"> *</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:gray;background:white">argv</span><span lang="EN-US" style="background:white;font-size:9.5pt;font-family:Consolas">[])<u></u><u></u></span></p>

<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="background:white;font-size:9.5pt;font-family:Consolas">{<u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="background:white;font-size:9.5pt;font-family:Consolas"><u></u> <u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="background:white;font-size:9.5pt;font-family:Consolas">      
</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:blue;background:white">const</span><span lang="EN-US" style="background:white;font-size:9.5pt;font-family:Consolas">
</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:blue;background:white">unsigned</span><span lang="EN-US" style="background:white;font-size:9.5pt;font-family:Consolas">
</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:blue;background:white">int</span><span lang="EN-US" style="background:white;font-size:9.5pt;font-family:Consolas"> Dimension = 3;<u></u><u></u></span></p>

<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="background:white;font-size:9.5pt;font-family:Consolas">      
</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:blue;background:white">typedef</span><span lang="EN-US" style="background:white;font-size:9.5pt;font-family:Consolas">
</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:blue;background:white">double</span><span lang="EN-US" style="background:white;font-size:9.5pt;font-family:Consolas">
</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:#2b91af;background:white">EdgeType</span><span lang="EN-US" style="background:white;font-size:9.5pt;font-family:Consolas">;<u></u><u></u></span></p>

<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="background:white;font-size:9.5pt;font-family:Consolas"><u></u> <u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="background:white;font-size:9.5pt;font-family:Consolas">      
</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:blue;background:white">typedef</span><span lang="EN-US" style="background:white;font-size:9.5pt;font-family:Consolas"> itk::</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:#2b91af;background:white">QuadEdgeMesh</span><span lang="EN-US" style="background:white;font-size:9.5pt;font-family:Consolas"><</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:#2b91af;background:white">EdgeType</span><span lang="EN-US" style="background:white;font-size:9.5pt;font-family:Consolas">,
 Dimension> </span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:#2b91af;background:white">QEMeshType</span><span lang="EN-US" style="background:white;font-size:9.5pt;font-family:Consolas">;<u></u><u></u></span></p>

<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="background:white;font-size:9.5pt;font-family:Consolas">      
</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:blue;background:white">typedef</span><span lang="EN-US" style="background:white;font-size:9.5pt;font-family:Consolas"> itk::</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:#2b91af;background:white">STLMeshIOFactory</span><span lang="EN-US" style="background:white;font-size:9.5pt;font-family:Consolas">
</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:#2b91af;background:white">STLMeshIO</span><span lang="EN-US" style="background:white;font-size:9.5pt;font-family:Consolas">;<u></u><u></u></span></p>

<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="background:white;font-size:9.5pt;font-family:Consolas">      
</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:blue;background:white">typedef</span><span lang="EN-US" style="background:white;font-size:9.5pt;font-family:Consolas"> itk::</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:#2b91af;background:white">MeshFileReader</span><span lang="EN-US" style="background:white;font-size:9.5pt;font-family:Consolas"><</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:#2b91af;background:white">QEMeshType</span><span lang="EN-US" style="background:white;font-size:9.5pt;font-family:Consolas">>
</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:#2b91af;background:white">ReaderType</span><span lang="EN-US" style="background:white;font-size:9.5pt;font-family:Consolas">;<u></u><u></u></span></p>

<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="background:white;font-size:9.5pt;font-family:Consolas"><u></u> <u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="background:white;font-size:9.5pt;font-family:Consolas">      
</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:#2b91af;background:white">STLMeshIO</span><span lang="EN-US" style="background:white;font-size:9.5pt;font-family:Consolas">::RegisterOneFactory();<u></u><u></u></span></p>

<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="background:white;font-size:9.5pt;font-family:Consolas">      
</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:#2b91af;background:white">ReaderType</span><span lang="EN-US" style="background:white;font-size:9.5pt;font-family:Consolas">::</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:#2b91af;background:white">Pointer</span><span lang="EN-US" style="background:white;font-size:9.5pt;font-family:Consolas">
 reader = </span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:#2b91af;background:white">ReaderType</span><span lang="EN-US" style="background:white;font-size:9.5pt;font-family:Consolas">::New();<u></u><u></u></span></p>

<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="background:white;font-size:9.5pt;font-family:Consolas"><u></u> <u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="background:white;font-size:9.5pt;font-family:Consolas">      
</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:blue;background:white">const</span><span lang="EN-US" style="background:white;font-size:9.5pt;font-family:Consolas">
</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:blue;background:white">char</span><span lang="EN-US" style="background:white;font-size:9.5pt;font-family:Consolas"> * inputFileName
 = </span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:#a31515;background:white">"inputfile.stl"</span><span lang="EN-US" style="background:white;font-size:9.5pt;font-family:Consolas">;<u></u><u></u></span></p>

<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="background:white;font-size:9.5pt;font-family:Consolas"><u></u> <u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="background:white;font-size:9.5pt;font-family:Consolas">       reader->SetFileName(inputFileName);<u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="background:white;font-size:9.5pt;font-family:Consolas">       reader->Update();<u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="background:white;font-size:9.5pt;font-family:Consolas"><u></u> <u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="background:white;font-size:9.5pt;font-family:Consolas">      
</span><span style="font-size:9.5pt;font-family:Consolas;color:blue;background:white">return</span><span style="background:white;font-size:9.5pt;font-family:Consolas"> 0;<u></u><u></u></span></p>
<p class="MsoNormal"><span style="background:white;font-size:9.5pt;font-family:Consolas">}</span><u></u><u></u></p>
</div>
</div>

<br>_____________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at<br>
<a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Kitware offers ITK Training Courses, for more information visit:<br>
<a href="http://www.kitware.com/products/protraining.php" target="_blank">http://www.kitware.com/products/protraining.php</a><br>
<br>
Please keep messages on-topic and check the ITK FAQ at:<br>
<a href="http://www.itk.org/Wiki/ITK_FAQ" target="_blank">http://www.itk.org/Wiki/ITK_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.itk.org/mailman/listinfo/insight-users" target="_blank">http://www.itk.org/mailman/listinfo/insight-users</a><br>
<br>_______________________________________________<br>
Community mailing list<br>
<a href="mailto:Community@itk.org">Community@itk.org</a><br>
<a href="http://public.kitware.com/cgi-bin/mailman/listinfo/community" target="_blank">http://public.kitware.com/cgi-bin/mailman/listinfo/community</a><br>
<br></blockquote></div><br></div>