[Insight-users] Re: itkdeformable3DFilter problems

Pieter Vos pieterv@radiology.azn.nl
Mon, 13 May 2002 11:36:49 +0200 (CEST)


Hi Ting,

Sorry, but the updated itkDeformableMesh3DFilter gives the same output
mesh. Do you have the same problems with the mesh when you test the
code?

Maybe I now what is going wrong:
I looked into the code of itkSphereMeshSource.txx since the mesh output
was correct. Look at the following part of code:

------------------------------------
  /* Store all regular cells. */
  for(unsigned int i=0; i+1 < m_ResolutionX ; i++) {
    for (unsigned int j=0; j<m_ResolutionY; j++) {
      jn = (j+1)%m_ResolutionY; 
      tripoints[0] = i*m_ResolutionY+j; 
      tripoints[1] = tripoints[0]-j+jn; 
      tripoints[2] = tripoints[0]+m_ResolutionY; 
      testCell->SetPointIds(tripoints);
      cells->SetElement(p, testCell);
      celldata->SetElement(p, (OPixelType)3.0);
      p++;
      testCell = TriCell::New();
      tripoints[0] = tripoints[1]; 
      tripoints[1] = tripoints[0]+m_ResolutionY; 
      testCell->SetPointIds(tripoints);
      cells->SetElement(p, testCell);
      celldata->SetElement(p, (OPixelType)3.0);
      p++;
      testCell = TriCell::New();
    }
  }

  /* Store cells containing the south pole nodes. */
  for (unsigned int j=0; j<m_ResolutionY; j++) {
    jn = (j+1)%m_ResolutionY; 
    tripoints[0] = numpts-2; 
    tripoints[1] = jn; 
    tripoints[2] = j; 
    testCell->SetPointIds(tripoints);
    cells->SetElement(p, testCell);
    celldata->SetElement(p, (OPixelType)1.0);
    p++;
    testCell = TriCell::New();
  }
------------------------------

You can see that the celldata object has the function SetElement(p,(OPixelType)1.0). 
This function is not called in the itkBinaryMask3DSource. Instead you (and
I) use the function SetCellData(m_NumberOfCells, 0.0). This means that
all the data has pixeltype 0.0. In the itkSphereMeshSource however the
regular cells have pixeltype 3.0, the cells containing the south pole
nodes have pixeltype 1.0 and the north pole cells pixeltype 2.0.
So, maybe this is missing in your code?

In your mail you said to following:

> so in your case to create an input mesh, you just need to assign a cell
> type for each cell. and in case you need to define
> your own stiffness matrix, you use the setstiffnessmatrix method and
> assign the cell with a celltype that point corresponding
> to the stiffness matrix. a for loop can tranlate your mesh with points
> and cells into an input mesh for deformable model.


What celltypes are there? Which cell do I give what type?
How do I know, just having the cell and point, which cell is on the north
pole, which on the south etc... do adjust the data correctly?

Bye,

Pieter


On Fri, 10 May 2002, Ting Chen wrote:

> Hi! pieter, will you try the new binarymaskmeshsource and new
> deformablemesh3Dfilter I checked in last night?
> 
> thanks!
> 
> ting
> 
> ----Original Message-----
> From: Pieter Vos <pieterv@nat-239.azn.nl>
> To: Ting Chen <chenting@graphics.cis.upenn.edu>
> Date: Wednesday, May 08, 2002 10:38 AM
> Subject: Re: [Insight-users] Re: itkdeformable3DFilter problems
> 
> 
> >Hi, it's me again,
> >
> >I made the binary image's internal region a bit smaller, but look at
> >mesh5.jpeg. The deformable mesh is being pulled away form the below edge.
> >I really don't get this because I checked the gradient map and there it is
> >all ok (all vectors are pointing towards the edge). But as you can see in
> >the jpeg file, one part of the mesh in being pulled towards the edge and
> >the other part is being pulled away.
> >
> >Can you explain this behaviour? How can I correct it?
> >
> >Many thanks,
> >
> >--
> >Pieter Vos
> >UMC Radboud Nijmegen
> >The Netherlands
> >mailto:pieterv@radiology.azn.nl
> >
> 
> 

-- 
Pieter Vos
UMC Radboud Nijmegen
The Netherlands
mailto:pieterv@radiology.azn.nl