<div dir="ltr">Hi all,<div><br></div><div>I am trying to set up a real-time visualization (using VTK) of the deformation of the test file itkDeformableSimplexMesh3DBalloonForceFilter.cxx. </div><div><br></div><div>Most of the test file's code is pretty much unchanged. I added vtkPolyData, vtkActor, vtkRenderer, vtkRenderWindow, vtkRenderWindowInteractor at the beginning of the test and initialized them. Then, at the end of the test file, I added a for-loop, within which is the deformFilter's update() function being called. The changes are as follows: </div>
<div><div><br></div><div><br></div><div> DeformFilterType::Pointer deformFilter = DeformFilterType::New(); </div><div> deformFilter->SetGradient(gradientFilter->GetOutput());</div><div> deformFilter->SetAlpha(0.2);</div>
<div> deformFilter->SetBeta(0.1);</div><div> deformFilter->SetKappa(0.01); </div><div> deformFilter->SetRigidity(0);</div><div> </div><div> SimplexMeshType::Pointer simplexMesh = simplexFilter->GetOutput();</div>
<div> SimplexMeshType::Pointer simplexMesh2 = simplexMesh;</div><div> </div><div> for (int i = 0; i < 100; i++) { </div><div> deformFilter->SetInput(simplexMesh);</div><div> deformFilter->SetIterations(1);</div>
<div> deformFilter->Update();</div><div> </div><div> simplexMesh2 = deformFilter->GetOutput();</div><div><br></div><div> mapper->SetInput(itkMesh2VTKPolyData(simplexMesh2));</div><div>
actor->SetMapper(mapper);</div><div> ren->Render(); </div><div> }</div><div><br></div><div style>The function itkMesh2VTKPolyData() takes an itk mesh and returns a vtkPolyData, and is taken from the ITKApps/DeformableModelSimplexMesh project. </div>
<div style><br></div><div style>The program gives a "Segmentation fault; core dumped" error. </div><div style>When I try debugging the program, the first for-loop iteration works without any problems, but during the second iteration's deformFilter->Update() call, the program breaks. </div>
<div style><br></div><div style>Any suggestions would be appreciated. </div><div style><br></div><div style>PS, </div><div style>My CMakeLists.txt is as follows:</div><div style><div><br></div><div>CMAKE_MINIMUM_REQUIRED(VERSION 2.6)</div>
<div>PROJECT(ITK_DeformableSimplexMeshTests)</div><div>FIND_PACKAGE (ITK)</div><div>IF (ITK_FOUND)</div><div> INCLUDE(${USE_ITK_FILE})</div><div>ENDIF(ITK_FOUND)</div><div><br></div><div>FIND_PACKAGE (VTK)</div><div>
IF (VTK_FOUND)</div><div> INCLUDE(${USE_VTK_FILE})</div><div>ENDIF(VTK_FOUND)</div><div><br></div><div>INCLUDE_DIRECTORIES(${ITK_DeformableSimplexMeshTests_SOURCE_DIR})</div><div>ADD_EXECUTABLE(ITK_DeformableSimplexMeshTests main.cpp)</div>
<div>TARGET_LINK_LIBRARIES (ITK_DeformableSimplexMeshTests ${ITK_LIBRARIES} ${VTK_LIBRARIES})</div><div><br></div></div><div style><br></div><div style><br></div>-- <br>Tanweer Rashid<br>MSVE Dept.<br><div>Old Dominion University</div>
</div></div>