[Insight-users] help generate mesh of binary image

Luis Ibanez luis.ibanez at kitware.com
Thu, 19 Feb 2004 04:43:59 -0500


Hi Longfei,

It seems that you forgot to invoke Update()
in the meshSource object before getting its
output with GetOutput().

ITK uses a data pipeline architecture.
No code is actually executed until you invoke
Update() on the filters.

You may want to pass some quality time
reading the software guide

  http://www.itk.org/ItkSoftwareGuide.pdf

and going through the tutorials.

  http://www.itk.org/HTML/Tutorials.htm

That will save you time and unnecessary suffering.


Regards,


  Luis


----------------------
Longfei Cong wrote:

> dear insight-users£¬
>         could someone tell me how to generate a mesh of 3d face, which face is segmented bianary image cardiac. I have just used the 'BinaryMask3DMeshSource'. But there are some thing wrong. I can see the number of points and cells,whie the  points of the cells .   
>      
> 	   the relenvant  code ..
> //+++++++++++++++++++++++++++++++++++++++++
>    meshSource->SetBinaryImage( maskReader->GetOutput() );
>     meshSource->SetObjectValue( 200 );
> 
>  MeshType::Pointer   meww=MeshType::New();; 
>  meww=meshSource->GetOutput();
>   std::cout << "# Points= " << meww->GetNumberOfPoints() << std::endl;
>   std::cout << "# Cell  = " << meww->GetNumberOfCells() << std::endl;  
> //+++++++++++++++
> //the numeber is 2000  and 4000 which can print in the screen 
> //+++++++++++++++ 
> typedef MeshType::PointsContainer::Iterator     PointsIterator;
>   PointsIterator  pointIterator = meww->GetPoints()->Begin();  
> 
>   PointsIterator end = meww->GetPoints()->End();
>   while( pointIterator != end ) 
>     {
>     MeshType::PointType p = pointIterator.Value();  // access the point
>     std::cout << p << std::endl; 
>     ++pointIterator;                                // advance to next point
>     }
>  
> ¡¡¡¡//++++++++++++++++++++++++++++++++++++++++++++++++++++++¡¡¡¡¡¡¡¡¡¡
> 
>  				
> 
> ¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡Longfei Cong
> ¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡lfcong at nlpr.ia.ac.cn
> ¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡2004-02-19
> 
> 
> 
> _______________________________________________
> Insight-users mailing list
> Insight-users at itk.org
> http://www.itk.org/mailman/listinfo/insight-users
>