[Insight-users] Question About DeformableMesh3dFilter

Luis Ibanez luis.ibanez at kitware.com
Fri, 12 Mar 2004 09:07:22 -0500


Hi Zhao,

The BinaryMask3DMeshSource class produces Meshes that
are not well adapted for deformable models because
they have large numbers of triangles that thin-edge
shaped.

You may have to run a cleaning algorithm on the Mesh
before using it as initialization for the deformable
model filter.


For an alternatgive approach, please look at the new
example under:

   Insight/Examples/Registration/
            DeformableRegistration2.cxx



Regards,


   Luis



-----------------------
zhao yong qiang wrote:

> Hi all,
> 
>      I wrote the following code:
> 
>  
> 
>    m_stiff[0] = 0.00001;
> 
>    m_stiff[1] = 0.04;
> 
>    m_scale[0] = 1;
> 
>    m_scale[1] = 1;
> 
>    m_scale[2] = 1;
> 
>  
> 
> m_BinaryMask3DMeshSource->SetBinaryImage(m_CastImageFilter->GetOutput());
> 
> m_BinaryMask3DMeshSource->SetObjectValue(200);
> 
>  
> 
> m_GradientMapFilter->SetInput(gradientMagnitudeFilter->GetOutput());
> 
> m_GradientMapFilter->SetSigma(1.0);
> 
> m_GradientMapFilter->Update();
> 
>  
> 
> m_DeformableMesh3DFilter->SetStiffness(m_stiff);
> 
> m_DeformableMesh3DFilter->SetTimeStep(0.2);
> 
> m_DeformableMesh3DFilter->SetStepThreshold(10);
> 
> m_DeformableMesh3DFilter->SetScale(m_scale);
> 
> m_DeformableMesh3DFilter->SetGradientMagnitude(0.8);
> 
>  
> 
> m_DeformableMesh3DFilter->SetGradient(m_GradientMapFilter->GetOutput());
> 
> m_DeformableMesh3DFilter->SetInput(m_BinaryMask3DMeshSource->GetOutput());
> 
>  
> 
> try
> 
> {
> 
>         m_DeformableMesh3DFilter->Update();//At this point, access 
> violation
> 
> }
> 
> catch(itk::ExceptionObject & excep)
> 
> {
> 
>         std::cerr << "Exception Caught!"<<std::endl;
> 
> }
> 
>  
> 
> I use try/catch, but I can not catch the exception, just access 
> violation when m_DeformableMesh3Dfilter->Update()..
> 
> Can some give me a hand?
> 
> Thanks a lot!!!
> 
> Regards,
>                           Zhao Yongqiang
>                           Dept. of Computer Science & Engineering
>                           Shanghai JiaoTong University
>                           Shanghai, China
>                           zhao-yq at cs.sjtu.edu.cn 
> <mailto:zhao-yq at cs.sjtu.edu.cn>
> 
>  
>