[Insight-users] Bug in SphereMeshSource

Th. Boettger t.boettger@dkfz-heidelberg.de
Fri, 29 Nov 2002 15:14:35 +0100


Hi everybody,

at first I am asking what the exact difference is between SphereSource 
and SphereMeshSource are and why exist two classes which both - thats at 
least what I'm thinking - do the same. I used SphereSource for creating 
my mesh and reported a bug in SphereSource which already got fixed. I 
found the similar bug in SphereMeshSource. At first please check if the 
class SphereMeshSource is necessary or if it can be removed. 
SphereSource creates a SphereMesh and works...

Here's the bug and my thoughts of how to fix it:

The bug's in SphereMeshSource.h line 77 where Pointer should be replaced 
by CellAutoPointer:

77: typedef typename TriCellType::Pointer           TriCellPointer;
                               ^^^^^^^^^^^^

Otherwise it won't compile. The Problem is now that fixing this produces 
other errors first thing is in SphereMeshSource.txx:

65: OutputMeshPointer outputMesh = this->GetOutput().GetPointer();

I thought this->GetOutpu() would already return the mesh pointer. So why 
the GetPointer() method? This can't work.

the second error occurs during mesh creation. SphereMeshSource.txx lines 
  147,154,168 and 181. Its the same thing four times:

147: cells->SetElement(p, testCell);

This doesn't work with CellAutoPointer anymore (testCell is of type 
TriCellPointer). In my code I add cells to the meshes by calling:

	mesh->SetCell(cellId, newCell );
	mesh->SetCellData(cellId, (OPixelType)3);



Is this the intended way? And isn't it the way of fixing those bugs as well?

Bye
Thomas



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