[Insight-users] request fo rexample of itkMesh->SetCellLinks( )

Bitter, Ingmar (NIH/CC/DRD) IBitter at cc.nih.gov
Fri May 28 12:48:16 EDT 2004


Yes there is itk::Mesh::BuildCellLinks()!  Thanks!  
(Did not find it right away because it is not mentioned in the manual)

-Ingmar

Ingmar Bitter, Ph.D.     Diagnostic Radiology Department 
Staff Scientist          Clinical Center
Tel:(301) 435-2155       National Institutes of Health
Fax:(301) 496-9933       9000 Rockville Pike, Bethesda, MD 20892

-----Original Message-----
From: Thomas Boettger [mailto:t.boettger at dkfz-heidelberg.de] 
Sent: Friday, May 28, 2004 12:44 PM
To: Bitter, Ingmar (NIH/CC/DRD)
Subject: Re: [Insight-users] request fo rexample of itkMesh->SetCellLinks()

I think there is a method BuildCellLinks() in the Mesh class?

Thomas

Bitter, Ingmar (NIH/CC/DRD) wrote:
> Hi,
> 
> The following code is a trimmed down version of the
> AutomaticTopologyMeshSource example in the manual. Unfortunately it does
not
> compute the CellLinks. 
> (At least the output contains: Number Of Cell Links: 0)
> 
> Is there a standard way to compute the cell links?
> 
> If not and I have to write one, is itk::AutomaticTopologyMeshSource the
best
> place to do so, as it already contains the hashtables for the cells?  I.e.
> should there be a function
> itk::AutomaticTopologyMeshSource::ComputeCellLinks() that can be called
> after all elements are added and that would traverse all cells ones,
> building the Cell Link container on the way by looking up in the hash
table
> which container entry to add the current cell to.
> 
> -Ingmar
> 
> #include "itkMesh.h"
> #include "itkVertexCell.h"
> #include "itkLineCell.h"
> #include "itkTriangleCell.h"
> #include "itkTetrahedronCell.h"
> #include "itkAutomaticTopologyMeshSource.h"
> 
> int main()
> {
>     typedef float                             PixelType;
>     typedef itk::Mesh< PixelType, 3 >         MeshType;
>     typedef MeshType::PointType               PointType;
>     typedef MeshType::CellType                CellType;
> 
>     typedef itk::AutomaticTopologyMeshSource< MeshType > MeshSourceType;
>     typedef MeshSourceType::IdentifierType               IdentifierType;
>     typedef MeshSourceType::IdentifierArrayType     IdentifierArrayType;
> 
>     MeshSourceType::Pointer meshSource;
>     meshSource = MeshSourceType::New();
> 
>     meshSource->AddTriangle(meshSource->AddPoint( 0, 0, 0),
>                             meshSource->AddPoint( 0, 1, 0),
>                             meshSource->AddPoint( 1, 0, 0)
>                            );
>     meshSource->AddTriangle(meshSource->AddPoint( 1, 1, 0),
>                             meshSource->AddPoint( 0, 1, 0),
>                             meshSource->AddPoint( 1, 0, 0)
>                            );
> 
>     MeshType::Pointer mesh = meshSource->GetOutput();
>     std::cout << mesh << std::endl;
>     return 0;
> }
> 
> _______________________________________________
> Insight-users mailing list
> Insight-users at itk.org
> http://www.itk.org/mailman/listinfo/insight-users
> 


-- 
Dipl.-Inform. Thomas Boettger
Deutsches Krebsforschungszentrum         (German Cancer Research Center)
Div. Medical and Biological Informatics B010    Tel: (+49) 6221-42 2328
Im Neuenheimer Feld 280                          Fax: (+49) 6221-42 2345
D-69120 Heidelberg                            e-mail: t.boettger at dkfz.de
Germany                      http://www.dkfz.de/mbi/people/thomasb.shtml



More information about the Insight-users mailing list