[Insight-users] help generate mesh of binary image

Longfei Cong lfcong at nlpr.ia.ac.cn
Thu, 19 Feb 2004 17:41:30 +0800


dear insight-users=A3=AC
        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 .   
     
=09   the relenvant  code ..
//+++++++++++++++++++++++++++++++++++++++++
   meshSource->SetBinaryImage( maskReader->GetOutput() );
    meshSource->SetObjectValue( 200 );

 MeshType::Pointer   meww=3DMeshType::New();; 
 meww=3DmeshSource->GetOutput();
  std::cout << "# Points=3D " << meww->GetNumberOfPoints() <<=
 std::endl;
  std::cout << "# Cell  =3D " << meww->GetNumberOfCells() <<=
 std::endl;  
//+++++++++++++++
//the numeber is 2000  and 4000 which can print in the screen 
//+++++++++++++++ 
typedef MeshType::PointsContainer::Iterator     PointsIterator;
  PointsIterator  pointIterator =3D meww->GetPoints()->Begin();  

  PointsIterator end =3D meww->GetPoints()->End();
  while( pointIterator !=3D end ) 
    {
    MeshType::PointType p =3D pointIterator.Value();  // access the=
 point
    std::cout << p << std::endl; 
    ++pointIterator;                                // advance to=
 next point
    }
 
=A1=A1=A1=A1//++++++++++++++++++++++++++++++++++++++++++++++++++++++=A1=A1=A1=A1=A1=
=A1=A1=A1=A1=A1

 =09=09=09=09

=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1Longfei Cong
=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1lfcong at nlpr.ia.ac.cn
=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A12004-02-19