[vtk-developers] vtkLoopSubdivisionFilter

Bill Lorensen bill.lorensen at gmail.com
Mon Jul 18 19:00:13 EDT 2011


Is there a test that currently exhibits the memory leak?

If not, nclude one with your gerrit patch.

If you do so, use
1) git add yout_test
2) git commit --amend (this will keep the same gerrit topic)
3) git gerrit-push

Bill

On Mon, Jul 18, 2011 at 5:54 PM, Laurent Chauvin
<lchauvin at bwh.harvard.edu> wrote:
> Thank you.
>
> -Laurent
>
> On Mon, Jul 18, 2011 at 5:52 PM, Bill Lorensen <bill.lorensen at gmail.com>
> wrote:
>>
>> Looks great. Welcome to VTK!
>>
>>
>> On Mon, Jul 18, 2011 at 5:50 PM, Laurent Chauvin
>> <lchauvin at bwh.harvard.edu> wrote:
>> > I finally submitted the patch !!
>> >
>> > It was not really easy, but it's done.
>> > I will try to have a better understanding of how git works now.
>> >
>> > Thank you.
>> > -Laurent
>> >
>> > On Mon, Jul 18, 2011 at 4:22 PM, Bill Lorensen <bill.lorensen at gmail.com>
>> > wrote:
>> >>
>> >> So, git is a distributed revision control system. You "committed" to
>> >> your own repository. look here:
>> >> http://itk.org/Wiki/VTK/Git#Gerrit
>> >>
>> >> to see how to create a branch and submit it for review.
>> >>
>> >> "Once you get over the initial learning cure, you will begin to love
>> >> git."
>> >>
>> >> Bill
>> >>
>> >> On Mon, Jul 18, 2011 at 3:49 PM, Laurent Chauvin
>> >> <lchauvin at bwh.harvard.edu> wrote:
>> >> > This is what I did:
>> >> >
>> >> > I cloned VTK.git
>> >> > I created a new branch (git checkout -b LoopSubdivisionFilter)
>> >> > I modified the vtkLoopSubdivisionFilter.cxx
>> >> > I commited
>> >> > I enter a message (description)
>> >> >
>> >> > Is it the procedure ?
>> >> >
>> >> > Thank you.
>> >> > -Laurent
>> >> >
>> >> > On Mon, Jul 18, 2011 at 3:46 PM, Bill Lorensen
>> >> > <bill.lorensen at gmail.com>
>> >> > wrote:
>> >> >>
>> >> >> You committed where? To gerrit?
>> >> >>
>> >> >>
>> >> >> On Mon, Jul 18, 2011 at 3:32 PM, Laurent Chauvin
>> >> >> <lchauvin at bwh.harvard.edu> wrote:
>> >> >> > Ok. I think I did it.
>> >> >> >
>> >> >> > I commited, but I cannot see it with the browser.
>> >> >> > Is there a way to see branches ?
>> >> >> >
>> >> >> > Thank you.
>> >> >> > -Laurent
>> >> >> >
>> >> >> > On Mon, Jul 18, 2011 at 3:26 PM, Bill Lorensen
>> >> >> > <bill.lorensen at gmail.com>
>> >> >> > wrote:
>> >> >> >>
>> >> >> >> I'll try to help. Once you get over the initial learning cure,
>> >> >> >> you
>> >> >> >> will begin to love it.
>> >> >> >>
>> >> >> >> First, did you look here?
>> >> >> >> http://itk.org/Wiki/VTK/Git
>> >> >> >>
>> >> >> >>
>> >> >> >> On Mon, Jul 18, 2011 at 3:00 PM, Laurent Chauvin
>> >> >> >> <lchauvin at bwh.harvard.edu> wrote:
>> >> >> >> > Hello Bill,
>> >> >> >> >
>> >> >> >> > I am trying to use git, but this is complicated.
>> >> >> >> > I'm a bit lost.
>> >> >> >> >
>> >> >> >> > First, I think you should add a step telling to create a
>> >> >> >> > directory
>> >> >> >> > and
>> >> >> >> > type
>> >> >> >> > "git init" inside.
>> >> >> >> >
>> >> >> >> > Thank, I cannot checkout. I have this error:
>> >> >> >> > error: pathspec 'master' did not match any file(s) know to git.
>> >> >> >> >
>> >> >> >> > I don't really understand git yet, so I don't really know what
>> >> >> >> > to
>> >> >> >> > do.
>> >> >> >> >
>> >> >> >> > Could you help me please ?
>> >> >> >> >
>> >> >> >> > Thank you.
>> >> >> >> > -Laurent
>> >> >> >> >
>> >> >> >> >
>> >> >> >> > On Mon, Jul 18, 2011 at 2:27 PM, Bill Lorensen
>> >> >> >> > <bill.lorensen at gmail.com>
>> >> >> >> > wrote:
>> >> >> >> >>
>> >> >> >> >> It would be great if you could provide a gerrit patch
>> >> >> >> >> following
>> >> >> >> >> these
>> >> >> >> >> instructions:
>> >> >> >> >> http://itk.org/Wiki/VTK/Git#Gerrit
>> >> >> >> >>
>> >> >> >> >> and please let us know if the instructions are correct.
>> >> >> >> >>
>> >> >> >> >> Bill
>> >> >> >> >>
>> >> >> >> >> On Mon, Jul 18, 2011 at 2:20 PM, Laurent Chauvin
>> >> >> >> >> <lchauvin at bwh.harvard.edu> wrote:
>> >> >> >> >> > Hello,
>> >> >> >> >> >
>> >> >> >> >> > I was using vtkLoopSubdivisionFilter, but after leaving
>> >> >> >> >> > Slicer
>> >> >> >> >> > I
>> >> >> >> >> > got
>> >> >> >> >> > hundred
>> >> >> >> >> > of thousands of vtkIdList leaks.
>> >> >> >> >> >
>> >> >> >> >> > After debugging, the problem seems to come from this part of
>> >> >> >> >> > code:
>> >> >> >> >> >
>> >> >> >> >> > void vtkLoopSubdivisionFilter::GenerateEvenStencil
>> >> >> >> >> > (vtkIdType
>> >> >> >> >> > p1,
>> >> >> >> >> >
>> >> >> >> >> > vtkPolyData
>> >> >> >> >> > *polys,
>> >> >> >> >> >
>> >> >> >> >> > vtkIdList
>> >> >> >> >> > *stencilIds,
>> >> >> >> >> >                                                     double
>> >> >> >> >> > *weights)
>> >> >> >> >> > {
>> >> >> >> >> >   vtkIdList *cellIds = vtkIdList::New();
>> >> >> >> >> >   vtkIdList *ptIds = vtkIdList::New();
>> >> >> >> >> >   vtkCell *cell;
>> >> >> >> >> >
>> >> >> >> >> >   int i, j;
>> >> >> >> >> >   int numCellsInLoop;
>> >> >> >> >> >   int startCell, nextCell;
>> >> >> >> >> >   vtkIdType p, p2;
>> >> >> >> >> >   vtkIdType bp1, bp2;
>> >> >> >> >> >   int K;
>> >> >> >> >> >   double beta, cosSQ;
>> >> >> >> >> >
>> >> >> >> >> >   // Get the cells that use this point
>> >> >> >> >> >   polys->GetPointCells (p1, cellIds);
>> >> >> >> >> >   numCellsInLoop = cellIds->GetNumberOfIds();
>> >> >> >> >> >   if (numCellsInLoop < 1)
>> >> >> >> >> >       {
>> >> >> >> >> >       vtkWarningMacro("numCellsInLoop < 1: " <<
>> >> >> >> >> > numCellsInLoop);
>> >> >> >> >> >       stencilIds->Reset();
>> >> >> >> >> >
>> >> >> >> >> >       // Test Remove vtkIdList
>> >> >> >> >> >       cellIds->Delete();
>> >> >> >> >> >       ptIds->Delete();
>> >> >> >> >> >       // End Test
>> >> >> >> >> >
>> >> >> >> >> >       return;
>> >> >> >> >> >       }
>> >> >> >> >> >   // Find an edge to start with that contains p1
>> >> >> >> >> >
>> >> >> >> >> > ...
>> >> >> >> >> > cellIds->Delete();
>> >> >> >> >> > ptsIds->Delete();
>> >> >> >> >> > }
>> >> >> >> >> >
>> >> >> >> >> > If we return before the end of the function, the cellIds and
>> >> >> >> >> > ptsId
>> >> >> >> >> > are
>> >> >> >> >> > not
>> >> >> >> >> > deleted (creating leaks).
>> >> >> >> >> > I had the code between comments "Test Remove vtkIdList" and
>> >> >> >> >> > "End
>> >> >> >> >> > Test".
>> >> >> >> >> >
>> >> >> >> >> > Leaks are gone.
>> >> >> >> >> >
>> >> >> >> >> > I just would like to know if it was a mistake or if there is
>> >> >> >> >> > a
>> >> >> >> >> > reason
>> >> >> >> >> > for
>> >> >> >> >> > not deleting before returning ?
>> >> >> >> >> >
>> >> >> >> >> > Thank you.
>> >> >> >> >> > -Laurent
>> >> >> >> >> >
>> >> >> >> >> > --
>> >> >> >> >> > Laurent Chauvin, MS
>> >> >> >> >> > Surgical Planning Laboratory, Radiology
>> >> >> >> >> > Brigham And Women's Hospital, Harvard Medical School
>> >> >> >> >> > http://wiki.ncigt.org/index.php/User:Lchauvin
>> >> >> >> >> >
>> >> >> >> >> > _______________________________________________
>> >> >> >> >> > Powered by www.kitware.com
>> >> >> >> >> >
>> >> >> >> >> > Visit other Kitware open-source projects at
>> >> >> >> >> > http://www.kitware.com/opensource/opensource.html
>> >> >> >> >> >
>> >> >> >> >> > Follow this link to subscribe/unsubscribe:
>> >> >> >> >> > http://www.vtk.org/mailman/listinfo/vtk-developers
>> >> >> >> >> >
>> >> >> >> >> >
>> >> >> >> >> >
>> >> >> >> >
>> >> >> >> >
>> >> >> >> >
>> >> >> >> > --
>> >> >> >> > Laurent Chauvin, MS
>> >> >> >> > Surgical Planning Laboratory, Radiology
>> >> >> >> > Brigham And Women's Hospital, Harvard Medical School
>> >> >> >> > http://wiki.ncigt.org/index.php/User:Lchauvin
>> >> >> >> >
>> >> >> >
>> >> >> >
>> >> >> >
>> >> >> > --
>> >> >> > Laurent Chauvin, MS
>> >> >> > Surgical Planning Laboratory, Radiology
>> >> >> > Brigham And Women's Hospital, Harvard Medical School
>> >> >> > http://wiki.ncigt.org/index.php/User:Lchauvin
>> >> >> >
>> >> >
>> >> >
>> >> >
>> >> > --
>> >> > Laurent Chauvin, MS
>> >> > Surgical Planning Laboratory, Radiology
>> >> > Brigham And Women's Hospital, Harvard Medical School
>> >> > http://wiki.ncigt.org/index.php/User:Lchauvin
>> >> >
>> >
>> >
>> >
>> > --
>> > Laurent Chauvin, MS
>> > Surgical Planning Laboratory, Radiology
>> > Brigham And Women's Hospital, Harvard Medical School
>> > http://wiki.ncigt.org/index.php/User:Lchauvin
>> >
>
>
>
> --
> Laurent Chauvin, MS
> Surgical Planning Laboratory, Radiology
> Brigham And Women's Hospital, Harvard Medical School
> http://wiki.ncigt.org/index.php/User:Lchauvin
>



More information about the vtk-developers mailing list