[Insight-developers] converting a byu-based vtkPolyData to QuadEdgeMesh: SetCell() not successful...

Michel Audette michel.audette at kitware.com
Wed Jun 23 11:55:09 EDT 2010


Dear Alex,

sorry, I meant to send you a reminder today, but you took care of it.

For ITK developers, I would advise not using the Reserve function with
cells, in the manner that I had,
m_itkMesh->GetCells()->Reserve( numberOfTriangles );
with the QuadEdgeMesh.

Best wishes,

Michel
On Wed, Jun 23, 2010 at 11:49 AM, Alexandre GOUAILLARD <
agouaillard at gmail.com> wrote:

> for archives.
>
> the original problem was solved. At this time, itk::QuadEdgeMesh only
> support cell by cell allocation of the cellarray, whereas itk::mesh
> supports three allocations schemes:
> - cell by cell
> - reserve( number of cells )
> - user-provided pointer to allocated memory.
>
> The reserve function is faster when you know in advance the size as it
> avoids calls to resize(). Rightfully, michek tried to use it.
> unfortunatly, it doe snot work now.
>
> As a work around, michel is now using a cell by cell allocation. On
> the medium term, I will investigate support for reserve. Note: there
> is an additional EdgeCellCOntainer in QE, in addition to the
> CellContainer inherited from Mesh.
>
> alex.
>
> On Wed, Jun 23, 2010 at 11:45 AM, Alexandre GOUAILLARD
> <agouaillard at gmail.com> wrote:
> > dear michel,
> >
> > to be backward compatible with itk::Mesh API, we have an AddFace()
> > which takes the same arguments (list of points). It also checks that
> > everything is alright (points exists, surface is 2-manifold, and there
> > is enough space in the 1-ring of the nodes to insert a triangle).
> >
> > Once everything is checked, it let AddFaceWithSecurePointList do the
> > job at the QE level. Namely, the points' 1-ring are reordered to
> > accomodate the new face and the links between opposite half edges and
> > halfedges and faces are populated nicely. An historical note here: it
> > used to be part of AddFace, but in was doing too many cheks in the
> > case where we were just copying a mesh (think about all the
> > QEmEshtoQEMesh filters that copy the input to the output first to be
> > const correct). This helped make the copy 50% faster.
> >
> > Finally, when everything is set up at the QE level, there is an
> > AddFace method which takes an QEdge as argument that does the final
> > job of putting the face in the face container by calling the
> > superclass (itk::Mesh) function.
> >
> > hope this helps.
> >
> > alex.
> >
> > On Tue, Jun 22, 2010 at 4:59 PM, Michel Audette
> > <michel.audette at kitware.com> wrote:
> >> Hi Alex,
> >>
> >> just wondering, but it seems that QuadEdgeMesh::AddFace can call
> >> AddFaceWithSecurePointList(), which in turn can call AddFace().
> >>
> >> Does that make sense? Is it possible that leads to the wrong number of
> >> faces?
> >>
> >> Best wishes,
> >>
> >> Michel
> >>
> >> On Tue, Jun 22, 2010 at 4:14 PM, Michel Audette <
> michel.audette at kitware.com>
> >> wrote:
> >>>
> >>> Hi again,
> >>>
> >>> There is also code for LaplaceBeltrami in Namic sandbox which must be
> >>> compiled. There is a txx and a .h file, so just including the .h will
> do it.
> >>>
> >>> Best wishes,
> >>>
> >>> Michel
> >>>
> >>> On Tue, Jun 22, 2010 at 4:12 PM, Michel Audette
> >>> <michel.audette at kitware.com> wrote:
> >>>>
> >>>> Hi Alex,
> >>>>
> >>>> svn co https://www.kitware.com/svn/KWPublic/trunk/KWScene KWScene
> >>>>
> >>>> The example is contained in a VTK plugin in
> >>>> Source/Generators/ParaView/vtkITKLaplaceBeltramiFilter.*
> >>>>
> >>>> When this plugin loads into Paraview, if we input one of BYU files
> from
> >>>> the JHU_ATLAS directory (which you can get by building KWScene with
> >>>> USE_JHU_ATLAS_DATA turned ON), and selecting the LaplaceBeltramiFilter
> after
> >>>> one has loaded KWSMenuBar from KWSceneBuild directory (make sure to
> build
> >>>> with Shared_lib On) , the filter will crash as a result of not getting
> valid
> >>>> return from GetCell() from the itk::QuadEdgeMesh.
> >>>>
> >>>> That's where things stand right now. The SetCell views the mesh as
> >>>> non-QE, the third case in
> >>>> void QuadEdgeMesh< TPixel, VDimension, TTraits >
> >>>> ::SetCell( CellIdentifier cId, CellAutoPointer& cell ) .
> >>>>
> >>>> I look forward interacting with you towards a solution.
> >>>>
> >>>> Best wishes,
> >>>>
> >>>> Michel
> >>>>
> >>>>
> >>>>
> >>>>
> >>>>
> >>>>
> >>>> On Tue, Jun 22, 2010 at 4:02 PM, Michel Audette
> >>>> <michel.audette at kitware.com> wrote:
> >>>>>
> >>>>> Hi Alex,
> >>>>>
> >>>>> I'm trying to commit. I've not yet committed anything from this
> laptop,
> >>>>> so I'm working out the username and password. Stay tuned.
> >>>>>
> >>>>> Michel
> >>>>>
> >>>>> On Tue, Jun 22, 2010 at 3:58 PM, Alexandre GOUAILLARD
> >>>>> <agouaillard at gmail.com> wrote:
> >>>>>>
> >>>>>> hi michel,
> >>>>>>
> >>>>>> can you send the vtk file and the code that reproduce the bug.
> >>>>>>
> >>>>>> alex.
> >>>>>>
> >>>>>>
> >>>>>> On Tue, Jun 22, 2010 at 3:51 PM, Michel Audette
> >>>>>> <michel.audette at kitware.com> wrote:
> >>>>>> > Dear fellow developers,
> >>>>>> >
> >>>>>> > here at NAMIC Summer Project Week, my collaborator and I are
> finding
> >>>>>> > that
> >>>>>> > trying to read in a vtkPolyData from a BYU file, and converting it
> to
> >>>>>> > an
> >>>>>> > itk::QuadEdgeMesh based on vtkPolyDataToitkQuadEdgeMesh.cxx taken
> >>>>>> > from
> >>>>>> > InsightApplication, we don't get a pointer from GetCell()
> thereafter.
> >>>>>> >
> >>>>>> > There seems to be logic missing in itk::QuadEdgeMesh::SetCell()
> that
> >>>>>> > would
> >>>>>> > enable us to complete the conversion successfully.
> >>>>>> >
> >>>>>> > Best wishes,
> >>>>>> >
> >>>>>> > Michel
> >>>>>> >
> >>>>>> > --
> >>>>>> > Michel Audette, Ph.D.
> >>>>>> > R & D Engineer,
> >>>>>> > Kitware Inc.,
> >>>>>> > Chapel Hill, N.C.
> >>>>>> >
> >>>>>> >
> >>>>>> > _______________________________________________
> >>>>>> > Powered by www.kitware.com
> >>>>>> >
> >>>>>> > Visit other Kitware open-source projects at
> >>>>>> > http://www.kitware.com/opensource/opensource.html
> >>>>>> >
> >>>>>> > Kitware offers ITK Training Courses, for more information visit:
> >>>>>> > http://kitware.com/products/protraining.html
> >>>>>> >
> >>>>>> > Please keep messages on-topic and check the ITK FAQ at:
> >>>>>> > http://www.itk.org/Wiki/ITK_FAQ
> >>>>>> >
> >>>>>> > Follow this link to subscribe/unsubscribe:
> >>>>>> > http://www.itk.org/mailman/listinfo/insight-developers
> >>>>>> >
> >>>>>> >
> >>>>>
> >>>>>
> >>>>>
> >>>>> --
> >>>>> Michel Audette, Ph.D.
> >>>>> R & D Engineer,
> >>>>> Kitware Inc.,
> >>>>> Chapel Hill, N.C.
> >>>>>
> >>>>
> >>>>
> >>>>
> >>>> --
> >>>> Michel Audette, Ph.D.
> >>>> R & D Engineer,
> >>>> Kitware Inc.,
> >>>> Chapel Hill, N.C.
> >>>>
> >>>
> >>>
> >>>
> >>> --
> >>> Michel Audette, Ph.D.
> >>> R & D Engineer,
> >>> Kitware Inc.,
> >>> Chapel Hill, N.C.
> >>>
> >>
> >>
> >>
> >> --
> >> Michel Audette, Ph.D.
> >> R & D Engineer,
> >> Kitware Inc.,
> >> Chapel Hill, N.C.
> >>
> >>
> >
>



-- 
Michel Audette, Ph.D.
R & D Engineer,
Kitware Inc.,
Chapel Hill, N.C.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/mailman/private/insight-developers/attachments/20100623/340ec03f/attachment-0001.htm>


More information about the Insight-developers mailing list