[vtk-developers] Surface

Bill Lorensen bill.lorensen at gmail.com
Tue Feb 22 14:21:16 EST 2011


Try generating normals after you have cleaned the polydata. The
original normals computed by marching cubes will not be correct at the
boundaries. In fact, you may as well
    mcubes.ComputeScalarsOff()
    mcubes.ComputeGradientsOff()
    mcubes.ComputeNormalsOff()

since you don't need any of these quantities. It will reduce your
memory footprint.


On Tue, Feb 22, 2011 at 12:56 PM, Paulo Henrique Junqueira Amorim
<paulojamorim at gmail.com> wrote:
> Hi,
>
> Unfortunately we have problems with that yet (sorry for not enough
> tests). There are some marks in the junctions yet, like, for example,
> in [1]. I created sample code [2], to use that you have to pass a file
> generated by vktXMLImagedataWriter, the min an max scalar to pass to
> vtkMarchingCubes and a outputfile, for example:
>
> $ python test.py /home/tfmoraes/VTI/test1.vti 266 1024 out.vtp
>
> The vtkPolydata will written to out.vtp in above example. The file
> used to generate to vktPolydata used in the screenshot is here [3],
> and I used the same parameters from above.
>
> Thanks!
>
> [1] - http://imgur.com/yiQ19
> [2] - http://ubuntuone.com/p/eVu/
> [3] - http://ubuntuone.com/p/eVt/
>
>
>
>
>
>
>
> On 22 February 2011 09:27, Bill Lorensen <bill.lorensen at gmail.com> wrote:
>>
>> Good to hear it was not a bug.
>>
>>
>> ---------- Forwarded message ----------
>> From: Paulo Henrique Junqueira Amorim <paulojamorim at gmail.com>
>> Date: Tue, Feb 22, 2011 at 6:22 AM
>> Subject: Re: [vtk-developers] Fwd: Surface
>> To: Bill Lorensen <bill.lorensen at gmail.com>
>>
>>
>> Hi Bill,
>>
>> Now it worked, with two options.
>>
>> BoundaryVertexDeletionOff()
>> SplittingOff()
>>
>> Thank you!
>>
>> Regards,
>> Paulo
>>
>>
>>
>> On 21 February 2011 16:41, Bill Lorensen <bill.lorensen at gmail.com> wrote:
>> >
>> > Try applying SplittingOff().
>> >
>> > If nothing changes, can you post the program or script?
>> >
>> > Bill
>> >
>> > On Mon, Feb 21, 2011 at 2:24 PM, Paulo Henrique Junqueira Amorim
>> > <paulojamorim at gmail.com> wrote:
>> > > Bill,
>> > >
>> > > The results was the same.
>> > >
>> > > Regards,
>> > > Paulo
>> > >
>> > >
>> > >
>> > > On 21 February 2011 16:21, Bill Lorensen <bill.lorensen at gmail.com>
>> > > wrote:
>> > >>
>> > >> Did the results change at all?
>> > >>
>> > >> On Mon, Feb 21, 2011 at 12:44 PM, Paulo Henrique Junqueira Amorim
>> > >> <paulojamorim at gmail.com> wrote:
>> > >> > Hi,
>> > >> >
>> > >> > As I said in previous email, try to do what Bill said and continues
>> > >> > with
>> > >> > the
>> > >> > same problem.
>> > >> >
>> > >> > Regards,
>> > >> > Paulo
>> > >> >
>> > >> >
>> > >> >
>> > >> > On 21 February 2011 14:31, Will Schroeder
>> > >> > <will.schroeder at kitware.com>
>> > >> > wrote:
>> > >> >>
>> > >> >> SetBoundaryVertexDeletion(0) or BoundaryVertexDeletionOff() are
>> > >> >> equivalent.
>> > >> >> If you have any problems contact Bill Lorensen since he just
>> > >> >> volunteered
>> > >> >> ;-)
>> > >> >> W
>> > >> >>
>> > >> >> On Mon, Feb 21, 2011 at 12:10 PM, Paulo Henrique Junqueira Amorim
>> > >> >> <paulojamorim at gmail.com> wrote:
>> > >> >>>
>> > >> >>> Hi Will,
>> > >> >>>
>> > >> >>> In Python is only set decimate.BoundaryVertexDeletionOff() ?
>> > >> >>>
>> > >> >>> Regards,
>> > >> >>> Paulo
>> > >> >>>
>> > >> >>>
>> > >> >>> On 21 February 2011 14:03, Will Schroeder
>> > >> >>> <will.schroeder at kitware.com>
>> > >> >>> wrote:
>> > >> >>>>
>> > >> >>>> Mark-
>> > >> >>>> Try disabling vertex deletion:
>> > >> >>>>   // Description:
>> > >> >>>>   // Turn on/off the deletion of vertices on the boundary of a
>> > >> >>>> mesh.
>> > >> >>>> This
>> > >> >>>>   // may limit the maximum reduction that may be achieved.
>> > >> >>>>   vtkSetMacro(BoundaryVertexDeletion,int);
>> > >> >>>>   vtkGetMacro(BoundaryVertexDeletion,int);
>> > >> >>>>   vtkBooleanMacro(BoundaryVertexDeletion,int);
>> > >> >>>> If problems remain let me know please.
>> > >> >>>> Will
>> > >> >>>> On Mon, Feb 21, 2011 at 11:40 AM, Mark Roden <mmroden at gmail.com>
>> > >> >>>> wrote:
>> > >> >>>>>
>> > >> >>>>> Hi VTK developers,
>> > >> >>>>>
>> > >> >>>>> There appears to be some problems running decimation routines
>> > >> >>>>> of
>> > >> >>>>> large
>> > >> >>>>> volumes in parallel.  This is a bug report forwarded by one of
>> > >> >>>>> the
>> > >> >>>>> gdcm contributors for their large project involving both gdcm
>> > >> >>>>> and
>> > >> >>>>> vtk.
>> > >> >>>>>
>> > >> >>>>> Thanks,
>> > >> >>>>> Mark
>> > >> >>>>>
>> > >> >>>>>
>> > >> >>>>> ---------- Forwarded message ----------
>> > >> >>>>> From: totonixsame at gmail.com <totonixsame at gmail.com>
>> > >> >>>>> Date: 21 February 2011 10:21
>> > >> >>>>> Subject: Superficie
>> > >> >>>>> To: Paulo Henrique Junqueira Amorim <paulojamorim at gmail.com>
>> > >> >>>>>
>> > >> >>>>>
>> > >> >>>>> Hi,
>> > >> >>>>>
>> > >> >>>>> In InVesalius we generate a vtkPolydata from a medical
>> > >> >>>>> vtkImageData
>> > >> >>>>> using marching cubes. But the vtkImagedata we are working are
>> > >> >>>>> very
>> > >> >>>>> large, like 512x512x1000, in a 32-bit OS it crashes and is a
>> > >> >>>>> lot
>> > >> >>>>> slow.
>> > >> >>>>> So we thought in parallelize this part of software, then
>> > >> >>>>> InVesalius
>> > >> >>>>> could generate vtkPolydata faster. To do that firstly we split
>> > >> >>>>> the
>> > >> >>>>> vtkImagedata in smaller pieces, to each pieces we do this
>> > >> >>>>> pipeline:
>> > >> >>>>>
>> > >> >>>>> vtkMarchingCubes -> vtkTriangleFilter -> vtkDecimatePro
>> > >> >>>>> (PreserveTopologyOn and SetTargetReduction(0.3)
>> > >> >>>>>
>> > >> >>>>> Each piece can run in parallel.
>> > >> >>>>>
>> > >> >>>>> After all piece are processed we join them, using this
>> > >> >>>>> pipeline:
>> > >> >>>>>
>> > >> >>>>> vtkAppendPolyData -> vtkCleanPolyData -> vtkStripper
>> > >> >>>>>
>> > >> >>>>> Then it shows to the user. But it has a problems: In junctions
>> > >> >>>>> there
>> > >> >>>>> is some marks like showed in [1] and [2]. When I open the STL
>> > >> >>>>> generated from that vtkPolydata in Meshlab, for example, in
>> > >> >>>>> those
>> > >> >>>>> junctions there are some holes [3] and [4].
>> > >> >>>>>
>> > >> >>>>> Do you have some idea why that problem occurs? I have to use
>> > >> >>>>> some
>> > >> >>>>> other filter(s)?
>> > >> >>>>>
>> > >> >>>>> Thanks!
>> > >> >>>>>
>> > >> >>>>> [1] - http://i.imgur.com/MLXPw.png
>> > >> >>>>> [2] - http://i.imgur.com/DRFHy.png
>> > >> >>>>> [3] - http://i.imgur.com/0RB45.png
>> > >> >>>>> [4] - http://i.imgur.com/70fIa.png
>> > >> >>>>> _______________________________________________
>> > >> >>>>> 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
>> > >> >>>>>
>> > >> >>>>
>> > >> >>>>
>> > >> >>>>
>> > >> >>>> --
>> > >> >>>> William J. Schroeder, PhD
>> > >> >>>> Kitware, Inc.
>> > >> >>>> 28 Corporate Drive
>> > >> >>>> Clifton Park, NY 12065
>> > >> >>>> will.schroeder at kitware.com
>> > >> >>>> http://www.kitware.com
>> > >> >>>> (518) 881-4902
>> > >> >>>
>> > >> >>
>> > >> >>
>> > >> >>
>> > >> >> --
>> > >> >> William J. Schroeder, PhD
>> > >> >> Kitware, Inc.
>> > >> >> 28 Corporate Drive
>> > >> >> Clifton Park, NY 12065
>> > >> >> will.schroeder at kitware.com
>> > >> >> http://www.kitware.com
>> > >> >> (518) 881-4902
>> > >> >
>> > >> >
>> > >
>> > >
>
>



More information about the vtk-developers mailing list