[Insight-users] how to generate 3D mesh

Luis Ibanez luis.ibanez at kitware.com
Tue, 24 Feb 2004 22:45:17 -0500


This is a multi-part message in MIME format.
--------------020606060902000500030300
Content-Type: text/plain; charset=GB2312
Content-Transfer-Encoding: 8bit


Hi Longfei,

I'm not sure I understand your question.

Do you actually have an binary region
already marked in your image ?

If so, the attached code is all what you
need for extracting an itk::Mesh representing
the boundary of such mask.

The same code has been added as an example
to

  Insight/Examples/Filtering/
             IsoSurfaceExtraction.cxx


This program expect to receive as command line
arguments the name of the file containing the
image and the intensity value at which you want
to extract the iso-surface.


Please let us know if you have further questions.


Thanks


   Luis


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

> Hi insight-users£¬
>  			I've use 'itkBinaryMask3DMeshSource' to generate 3D surface mesh, but how to generate mesh of the whole object of 3D bianry image.
>  Thanks!
>  	
> 
> ¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡Longfei Cong
> ¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡lfcong at nlpr.ia.ac.cn
> ¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡2004-02-25
> 
> 
> 
> _______________________________________________
> Insight-users mailing list
> Insight-users at itk.org
> http://www.itk.org/mailman/listinfo/insight-users
> 
======================================================



--------------020606060902000500030300
Content-Type: text/plain;
 name="IsoSurfaceExtraction.cxx"
Content-Transfer-Encoding: base64
Content-Disposition: inline;
 filename="IsoSurfaceExtraction.cxx"

Lyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09DQoNCiAgUHJvZ3JhbTogICBJbnNpZ2h0IFNlZ21lbnRh
dGlvbiAmIFJlZ2lzdHJhdGlvbiBUb29sa2l0DQogIE1vZHVsZTogICAgJFJDU2ZpbGU6IElz
b1N1cmZhY2VFeHRyYWN0aW9uLmN4eCx2ICQNCiAgTGFuZ3VhZ2U6ICBDKysNCiAgRGF0ZTog
ICAgICAkRGF0ZTogMjAw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