<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">hi eleni,<div><br></div><div>look at the code of the method. Comments give you all the infos.</div><div><br></div><div><div>/**</div><div> * Number of points</div><div> *</div><div> * There are two methods to get the number of points.</div><div> * 1. itk::QuadEdgeMesh::ComputeNumberOfPoints()</div><div> * 2. itk::Mesh::GetNumberOfPoints()</div><div> *</div><div> * As an itk::QuadEdgeMesh is an itk::Mesh by inheritance, the user</div><div> * can use both. 1. will returned the number of points actually</div><div> * **USED** by at least one edge, while 2. will give you the number</div><div> * of points in the container. Number of unused points can be found</div><div> * by making the difference between the two values.</div><div> */</div><div><br></div><div> // The euler formula states:</div><div> // numFaces - numEdges + numPoints == 2 - 2 * genus - numBounds</div><div> // hence ( 2 - numBounds - numFaces + numEdges - numPoints ) must</div><div>...</div></div><div><br></div><div>to be able to compute the genus via the euler constant, you need the number of components and the number of borders on top of the usual number of vertices edges and faces. The last three are given by the Mesh API, but not the first two.</div><div>There is a BorderInformation class for QEMeshes that does exactly that. It is used in the ValidateEuler method I mentioned earlier.</div><div><br></div><div>Now, this code is not complicated but a little bit tricky (everything about topology is). You can recode it in your structure if you want and compare with the result of the existing code. There are good structures for triangular surfaces meshes, better than QuadEdge structures, and I encourage you to use them if you are sure to deal only with those. If you might use polygonal surface meshes, or if you want to use euler operators, or if you want to work indifferently with primal / dual ( triangular / simplex ), you might want to consider QuadEdgeMesh. </div><div><br></div><div>alex.</div><div><br></div><div><br><div><div>On Jun 21, 2009, at 5:08 PM, Sgouritsa, Eleni wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"> <div> <!-- Converted from text/plain format --><p><font size="2">Thank you,<br> I took a fast look to this class last week.<br> Actually I use a derived class of itkMesh for my mesh, indexedtrianglemesh that somebody had proposed in the list before.<br> For the checker class the ValidateEulerCharacteristic() method returns true or false. How can I get the genus of my mesh?<br> <br> Yes, Kishore solved most of the problems for the Chan & Vese. We are still discussing for the remaining.<br> <br> Regards,<br> Eleni<br> <br> -----Original Message-----<br> From: alex gouaillard [<a href="mailto:alexandre_gouaillard@hms.harvard.edu">mailto:alexandre_gouaillard@hms.harvard.edu</a>]<br> Sent: Sun 6/21/2009 3:36 PM<br> To: Sgouritsa, Eleni<br> Cc: <a href="mailto:insight-users@itk.org">insight-users@itk.org</a><br> Subject: Re: [Insight-users] Genus<br> <br> hi eleni,<br> <br> the genus of a mesh, or of it's dual, is the same.<br> <br> If you use a QuadEdgeMesh, note that you have the primal *and* dual <br> mesh connectivity stored in the surface. You have only one geometry <br> though (up to you to decide if it is the primal or dual, as it's <br> reversible, it's up to the user to decide which one is the primal and <br> which one is the dual.)<br> <br> Again, if you use a QuadEdgeMEsh (which I recommend if you;re going to <br> work with surfaces and want to handle topology nicely), you can take a <br> look at the itkQuadEdgeMeshTopologyChecker class, and specifically the <br> ValidateEulerCharacteristic() method.<br> <a href="http://www.itk.org/Doxygen/html/classitk_1_1QuadEdgeMeshTopologyChecker.html">http://www.itk.org/Doxygen/html/classitk_1_1QuadEdgeMeshTopologyChecker.html</a><br> the doxygen documentation is not great (our bad), but the .txx is <br> documented.<br> <br> BTW is everything alright with Chan & Vesse ? I think kishore solved <br> most of the problems, right?<br> <br> let me know if that helps.<br> <br> alex.<br> <br> <br> On Jun 21, 2009, at 4:14 PM, Sgouritsa, Eleni wrote:<br> <br> > Hello,<br> > is there an itk class to use that gives me the genus of a volume (or <br> > its dual mesh)?<br> ><br> > Regards,<br> > Eleni<br> ><br> > <ATT00001.txt><br> <br> <br> </font> </p> </div> </blockquote></div><br></div></body></html>