Hi Jan,<div><br></div><div>if you think the bug 10447 should be closed as invalid, I can do it. However, I had a problem with this example (bug 10799), which occurs only on x64 architecture.</div><div><br></div><div>Regards,</div>
<div>Dženan<br><br><div class="gmail_quote">On Tue, Jul 27, 2010 at 17:38, <span dir="ltr"><<a href="mailto:J.Menssen@cukz.umcn.nl">J.Menssen@cukz.umcn.nl</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Dear Dan<br>
<br>
Thank you for your suggestions<br>
<br>
I agree with you to add an example that reproduces the issue. It was my intention to add the modified<br>
DeformableModelApplication.cxx file from the InsightApplications example "DeformableModelSimplexMesh" but I didn't know it was possible to include an attached file<br>
Therefore I described the changes to the original file, because the problem arises in a standard Insight Applications example/program, I hoped this was clear enough.<br>
Now I attached the modified "DeformableModelApplication", replacing the original with this modified on should reproduce the problem. (Lines 528-527 are modified, comments are added)<br>
I also include the CmakeList.txt file, however it is the standard one generated for this standard ÏnsightApplications example "DeformableSimplexMesh. Also all other code in this examples is used unmodified.<br>
<br>
Indeed this described issue is related to bug 10447. However I posted bug 10447 some months ago. Now I'm not sure anymore my suggested solution of that bug is right.<br>
<br>
The "map/set iterator not dereferencable" occurs in iktMapContainer::GetElement. Checking m_SimplexMesh (of simplexMesh2)just before the crash shows that m_Geometry data has no elements. Maybe this is due to the fact it’s dereferences (unregistered) somewhere. Copying the m_Geometry data maybe the solution<br>
<br>
Due to the fact bug 10447 is still unassigned, and maybe the suggestion solution in that posted bug is not the correct one, I reported a new bug (11017) with a more general description.<br>
<br>
I hope the bug will be assigned and solved<br>
<br>
Thank you again for your suggestion, maybe this will help to solve my problem<br>
<br>
Kind regards<br>
<br>
Jan<br>
<div class="im"><br>
<br>
-----Original Message-----<br>
From: Dan Mueller [mailto:<a href="mailto:dan.muel@gmail.com">dan.muel@gmail.com</a>]<br>
Sent: dinsdag 27 juli 2010 16:21<br>
To: Menssen, Jan<br>
Cc: <a href="mailto:insight-users@itk.org">insight-users@itk.org</a><br>
</div><div><div></div><div class="h5">Subject: Re: [Insight-users] bug in DeformableModelSimplexMesh ?<br>
<br>
Hi Jan,<br>
<br>
A suggestion: in general, community which monitors this list is very<br>
helpful, but also very busy. If you want your problem resolved you<br>
have to make it as easy as possible for someone to (1) understand the<br>
problem, (2) reproduce the problem.<br>
<br>
The best way to achieve this is to provide a minimal example which<br>
reproduces the issue: a CMakeLists.txt and single C++ source file.<br>
<br>
In my own experience, the very act of preparing such an example can<br>
sometimes reveal the issue!<br>
<br>
Suggestion aside: do you think the issue you describe could be related<br>
to bug 10447 you previously submitted? It sounds similar...<br>
<a href="http://public.kitware.com/Bug/view.php?id=10447" target="_blank">http://public.kitware.com/Bug/view.php?id=10447</a><br>
<br>
Cheers, Dan<br>
<br>
On 27 July 2010 14:37, <<a href="mailto:J.Menssen@cukz.umcn.nl">J.Menssen@cukz.umcn.nl</a>> wrote:<br>
> Dear Dzenan<br>
><br>
><br>
><br>
> As you proposed in your mail, we created an unnamed block and created a new<br>
> deform filter from scratch<br>
><br>
> We instantiate the filter and set all parameters<br>
><br>
><br>
><br>
> However, this modification results in the same error message as described<br>
> below<br>
><br>
> So our problem is not yet solved<br>
><br>
><br>
><br>
> Thank you for your time, kind regards<br>
><br>
><br>
><br>
> Jan Menssen<br>
><br>
><br>
><br>
> From: Dženan Zukić [mailto:<a href="mailto:dzenanz@gmail.com">dzenanz@gmail.com</a>]<br>
> Sent: donderdag 22 juli 2010 14:56<br>
> To: Menssen, Jan<br>
> Cc: <a href="mailto:insight-users@itk.org">insight-users@itk.org</a>; Nillesen, Maartje<br>
> Subject: Re: [Insight-users] bug in DeformableModelSimplexMesh ?<br>
><br>
><br>
><br>
> I discovered few weeks back, that you cannot just change input mesh for<br>
> deform filter, that is<br>
><br>
> m_DeformFilter->SetInput(m_SimplexMesh);<br>
><br>
> this line is a problem. The workaround I used was to create unnamed block<br>
> and create a new deform filter from scratch (instantiate filter and set a<br>
> bunch of parameters) instead of just setting setting input mesh and calling<br>
> update.<br>
><br>
><br>
><br>
> Regards,<br>
><br>
> Dženan<br>
><br>
><br>
><br>
> On Wed, Jul 21, 2010 at 11:37, <<a href="mailto:J.Menssen@cukz.umcn.nl">J.Menssen@cukz.umcn.nl</a>> wrote:<br>
><br>
> Dear All<br>
><br>
> We are working on a segmentation algorithm using deformable models with a<br>
> refine mesh. The deformation and refinement is done in a for loop. Our<br>
> application is based on the DeformableModel application as given in the<br>
> InsightApplications example DeformableModelSimplexMesh.<br>
><br>
> We modified the for loop in de DeformMesh method<br>
> (DeformableModelApplication.cxx) with a refinement of the mesh, but this<br>
> crashes. Below a part of (pseudo) code is given..<br>
><br>
> for i=1:i<nr_iterations;i++<br>
><br>
> {<br>
><br>
> m_simplexMesh->DisconnectPipeline()<br>
><br>
> m_deformFilter-SetInput(m_simplexMesh);<br>
><br>
> m_deformFilter->Update(0;<br>
><br>
> simplexMesh2 = m_deformFilter->GetOutput();<br>
><br>
><br>
><br>
> m_refineMesh->SetInput(simplexMesh2);<br>
><br>
> m_refineMesh->Update();<br>
><br>
> m_simplexMesh=m_refineMesh->GetOutput();<br>
><br>
> }<br>
><br>
> m_deformFilter is a DeformableSimplexMesh3DGradientConstraintForceFilter,<br>
><br>
> m_RefineMesh is a itkSimplexMeshAdaptTopologyFilter<br>
><br>
><br>
><br>
> To isolate the bug, we started with a little modification of the DeformMesh<br>
> method in DeformableModelApplication.cxx. The modifications are given below<br>
> (line 522 in original file, InsightApplciations 3.16). Running this code<br>
> results also in a crash<br>
><br>
> *----------------------------------------------------------------------------------------------------------------------------------------<br>
><br>
> SimplexMeshType::Pointer simplexMesh2 = m_SimplexMesh;<br>
><br>
> const unsigned int numberOfIterationsToGo =<br>
> atoi(m_IterationsValueInput->value());<br>
><br>
> for( unsigned int i=0; i<numberOfIterationsToGo; i++ )<br>
><br>
> {<br>
><br>
> std::cout << " Iteration " << i << std::endl;<br>
><br>
><br>
><br>
> //* -------------- start modified code<br>
> -------------------------------------------<br>
><br>
> // THIS IS MODIFIED CODE THAT (WE THINK) DOESN'T VIOLATE THE ITK<br>
> RULES BUT THIS<br>
><br>
> // CODE CRASHES<br>
><br>
> m_SimplexMesh->DisconnectPipeline();<br>
><br>
> m_DeformFilter->SetInput(m_SimplexMesh);<br>
><br>
> m_DeformFilter->SetIterations(1);<br>
><br>
> m_DeformFilter->Update();<br>
><br>
> simplexMesh2 = m_DeformFilter->GetOutput();<br>
><br>
> SimplexMesh2->DisconnectPipeline(0<br>
><br>
> m_DeformFilter->SetInput(simplexMesh2);<br>
><br>
> m_DeformFilter->SetIterations(1);<br>
><br>
> m_DeformFilter->Update();<br>
><br>
> m_SimplexMesh = m_DeformFilter->GetOutput();<br>
><br>
> // --------------------- end modified code<br>
> -------------------------------------- */<br>
><br>
> m_SimplexMeshToShow = m_SimplexMesh;<br>
><br>
> this->RefreshMeshVisualization();<br>
><br>
><br>
><br>
> // force a redraw<br>
><br>
> axialView->redraw();<br>
><br>
> coronalView->redraw();<br>
><br>
> sagittalView->redraw();<br>
><br>
> surfaceView->redraw();<br>
><br>
> Fl::check();<br>
><br>
> }<br>
><br>
> *-------------------------------------------------------------------------------------------------------------------------------------------<br>
><br>
> Error message (using Visual Studio 2005 and/or 2008) of the crash<br>
><br>
> Debug Assertion Failed !<br>
><br>
> Expression map/set iterator not dereferencable<br>
><br>
> Do we something wrong? Using a for loop in a pipeline is dangerous but in<br>
> bug 0001080, we read it’s possible to use a for loop. Also at the Old Nabble<br>
> forum I read a message that is must be possible to use a for loop.<br>
> (<a href="http://old.nabble.com/Using-image-iterators-combined-with-filters-in-a-loop-td28684443.html" target="_blank">http://old.nabble.com/Using-image-iterators-combined-with-filters-in-a-loop-td28684443.html</a>)<br>
><br>
> Even if we changed the code in the original example<br>
> DeformableModelApplication according to the above referenced Old Nabble<br>
> article the application crashes (see below)<br>
><br>
><br>
><br>
> m_DeformFilter->SetInput( m_SimplexMesh );<br>
><br>
> m_DeformFilter->SetIterations(1);<br>
><br>
> m_DeformFilter->Update();<br>
><br>
> m_SimplexMesh = m_DeformFilter->GetOutput();<br>
><br>
> m_SimplexMesh->DisconnectPipeline();<br>
><br>
> So is there a bug in the original ITK sources? As far as we now, ITK doesn’t<br>
> allow to change the input of a filter and we think this is what happened in<br>
> the original DeformableSimplexMesh application.<br>
><br>
> Can someone help us with our problem ?<br>
><br>
> We tested with ITK 2.8, ITK 3.16 and 3.18 and all crashes<br>
><br>
> Jan Menssen<br>
> Research assistant<br>
><br>
> Radboud University Nijmegen Medical Centre<br>
> Clinical Physics Lab - Peadiatrics<br>
> Huispost 833, route 833<br>
> P.O box 9101<br>
> 6500 HB Nijmegen<br>
> Telefoon: +31 24 36 19063<br>
> E-mail <a href="mailto:J.Menssen@cukz.umcn.nl">J.Menssen@cukz.umcn.nl</a><br>
><br>
> <a href="http://www.umcn.nl" target="_blank">http://www.umcn.nl</a><br>
><br>
> Het UMC St Radboud staat geregistreerd bij de Kamer van Koophandel in het<br>
> handelsregister onder nummer 41055629.<br>
> The Radboud University Nijmegen Medical Centre is listed in the Commercial<br>
> Register of the Chamber of Commerce under file number 41055629.<br>
><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.html" target="_blank">http://www.kitware.com/products/protraining.html</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>
><br>
> Het UMC St Radboud staat geregistreerd bij de Kamer van Koophandel in het<br>
> handelsregister onder nummer 41055629.<br>
> The Radboud University Nijmegen Medical Centre is listed in the Commercial<br>
> Register of the Chamber of Commerce under file number 41055629.<br>
><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.html" target="_blank">http://www.kitware.com/products/protraining.html</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>
<br>
<br>
<br>
Het UMC St Radboud staat geregistreerd bij de Kamer van Koophandel in het handelsregister onder nummer 41055629.<br>
The Radboud University Nijmegen Medical Centre is listed in the Commercial Register of the Chamber of Commerce under file number 41055629.<br>
</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.html" target="_blank">http://www.kitware.com/products/protraining.html</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></blockquote></div><br></div>