<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">BTW, here is an example on how you could cut a mesh into 2:<div class=""><br class=""></div><div class=""><span class="Apple-tab-span" style="white-space:pre"> </span><a href="http://itk.org/ITKExamples/src/Core/QuadEdgeMesh/CutMesh/Documentation.html" class="">http://itk.org/ITKExamples/src/Core/QuadEdgeMesh/CutMesh/Documentation.html</a></div><div class=""><br class=""></div><div class="">It can be useful to test parameterization…</div><div class=""><br class=""></div><div class=""><br class=""><div><blockquote type="cite" class=""><div class="">On 08 Jun 2015, at 11:43, Arnaud Gelas <<a href="mailto:arnaudgelas@gmail.com" class="">arnaudgelas@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><meta http-equiv="Content-Type" content="text/html charset=utf-8" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Hi Davis,<div class=""><br class=""></div><div class="">The QuadEdgeMeshParameterizationFilter is a fixed boundary parameterization and requires one input mesh with at least one boundary, it could not work with a sphere…</div><div class=""><br class=""></div><div class="">I have updated the documentation in this patch:</div><div class=""><br class=""></div><div class=""><span class="Apple-tab-span" style="white-space:pre"> </span><a href="http://review.source.kitware.com/#/c/19888/" class="">http://review.source.kitware.com/#/c/19888/</a></div><div class=""><br class=""></div><div class="">and added an exception in this one:</div><div class=""><br class=""></div><div class=""><span class="Apple-tab-span" style="white-space:pre"> </span><a href="http://review.source.kitware.com/#/c/19890/" class="">http://review.source.kitware.com/#/c/19890/</a></div><div class=""><br class=""></div><div class="">Thanks for reporting!</div><div class=""><br class=""></div><div class="">Best,</div><div class="">Arnaud</div><div class=""><br class=""><div class=""><blockquote type="cite" class=""><div class="">On 05 Jun 2015, at 17:09, DVigneault <<a href="mailto:davis.vigneault@gmail.com" class="">davis.vigneault@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class="">All--<br class=""><br class="">While running the QuadEdgeMesh Parameterization example from the wiki [1]<br class="">using the provided spherical mesh, I got a segfault on<br class="">itkBorderQuadEdgeMeshFilter.hxx:75:<br class=""><br class="">InputIteratorGeom it = bdryEdge->BeginGeomLnext();<br class=""><br class="">The options I used were ./program sphere.vtk 0 0 output.vtk<br class=""><br class="">After some investigation, I believe it may be that sphere.vtk has no<br class="">internal edges. Therefore, BorderQuadEdgeMeshFilter::Evaluate is returning<br class="">an empty std::list, and list->Begin() is eventually dereferenced on the<br class="">above line. Should an itkWarningMacro() or itkExceptionMacro() be placed<br class="">before the above line, checking whether the list is empty? Or should this<br class="">be on the user?<br class=""><br class="">[1]<br class=""><a href="http://www.itk.org/Wiki/ITK/Examples/Meshes/QuadEdgeMeshParameterizationFilter" class="">http://www.itk.org/Wiki/ITK/Examples/Meshes/QuadEdgeMeshParameterizationFilter</a><br class=""><br class="">One other thing that's a bit confusing--if I pass ./program sphere.vtk 1 0<br class="">output.vtk (using DISK_BORDER_TRANSFORM instead of SQUARE_BORDER_TRANSFORM),<br class="">there is no segfault in the wiki example. In the small program below,<br class="">however, it segfaults in either case.<br class=""><br class="">Here's a program that describes the problem:<br class=""><br class="">#include "itkRegularSphereMeshSource.h"<br class="">#include "itkBorderQuadEdgeMeshFilter.h"<br class=""><br class="">typedef itk::QuadEdgeMesh< double, 3 > TMesh;<br class="">typedef itk::RegularSphereMeshSource< TMesh > TSource;<br class="">typedef itk::QuadEdgeMeshBoundaryEdgesMeshFunction< TMesh > TBorderFunction;<br class="">typedef itk::BorderQuadEdgeMeshFilter< TMesh, TMesh > TBorder;<br class="">int main( int argc, char* argv[] )<br class="">{<br class=""><br class=""> TSource::Pointer source = TSource::New();<br class=""> source->Update();<br class=""> TMesh::Pointer mesh = source->GetOutput();<br class=""><br class=""> TBorderFunction::Pointer fn = TBorderFunction::New();<br class=""> TMesh::EdgeListPointerType list = fn->Evaluate( *(mesh) );<br class=""> std::cout << list->size() << std::endl; // 0<br class=""> // A sphere has no internal edges<br class=""> // Returns a std::list size zero<br class=""><br class=""> TBorder::Pointer border = TBorder::New();<br class=""> border->SetTransformType( TBorder::SQUARE_BORDER_TRANSFORM );<br class=""> // Segfaults even if I change this to DISK_BORDER_TRANSFORM<br class=""> border->SetInput( mesh );<br class=""> border->Update(); // Segfault<br class=""> // itkBorderQuadEdgeMeshFilter.hxx:110<br class=""> // empty std::list is assigned to oborder_it<br class=""> // for loop is bypassed b/c list->begin() == list->end()<br class=""> // InputQEType* output = *oborder_it;<br class=""> // return output; from ComputeLongestBorder<br class=""> // InputQEType *bdryEdge = ComputeLongestBorder();<br class=""><br class=""> // Segfault:<br class=""> // itkBoarderQuadEdgeMeshFilter.hxx:75<br class=""> // InputIteratorGeom it = bdryEdge->BeginGeomLnext();<br class=""><br class=""> return EXIT_SUCCESS;<br class=""><br class="">}<br class=""><br class=""><br class=""><br class=""><br class="">--<br class="">View this message in context: <a href="http://itk-users.7.n7.nabble.com/Segfault-in-Wiki-Example-QuadEdgeMeshParameterizationFilter-tp35771.html" class="">http://itk-users.7.n7.nabble.com/Segfault-in-Wiki-Example-QuadEdgeMeshParameterizationFilter-tp35771.html</a><br class="">Sent from the ITK - Users mailing list archive at <a href="http://Nabble.com" class="">Nabble.com</a>.<br class="">_____________________________________<br class="">Powered by <a href="http://www.kitware.com" class="">www.kitware.com</a><br class=""><br class="">Visit other Kitware open-source projects at<br class=""><a href="http://www.kitware.com/opensource/opensource.html" class="">http://www.kitware.com/opensource/opensource.html</a><br class=""><br class="">Kitware offers ITK Training Courses, for more information visit:<br class="">http://www.kitware.com/products/protraining.php<br class=""><br class="">Please keep messages on-topic and check the ITK FAQ at:<br class="">http://www.itk.org/Wiki/ITK_FAQ<br class=""><br class="">Follow this link to subscribe/unsubscribe:<br class="">http://public.kitware.com/mailman/listinfo/insight-users<br class=""></div></blockquote></div><br class=""></div></div></div></blockquote></div><br class=""></div></body></html>