[vtk-developers] Best fit plane function location

Will Schroeder will.schroeder at kitware.com
Mon Jan 25 08:01:32 EST 2010


David-

I really do not want to start collecting geometric operations in a new
geometric utilities class. Currently (for better or for worse) the VTK
geometric operations are associated with the various cells with which they
are consistent. This utility would be yet another place to look for stuff
and is not consistent with what's in VTK now.

The vtkPlane problem was that one of the best fit plane arguments was a
vtkDataSet* which resulted in linkage problems. Another way to accomplish
something similar is to not use vtkDataSet*, instead use vtkPoints*; note
that vtkPlane is already in VTK/Common. More often than not you are going to
fit a plane to a set of points explicitly represented by vtkPoints
(subclasses of vtkPointSet). I'd expect only in rare circumstances are you
going to traverse points using vtkDataSet::GetPoint(ptId) since this would
correspond to implicit datasets such as images. If necessary you could
always populate a vtkPoints from an implicit dataset (use random sampling or
even the whole population, better yet I would argue that implicit datasets
typically have closed-form solutions to the best fit plane).

Will

On Sat, Jan 23, 2010 at 9:30 PM, David Doria
<daviddoria+vtk at gmail.com<daviddoria%2Bvtk at gmail.com>
> wrote:

> On Fri, Jan 22, 2010 at 4:05 PM, Dean Inglis <dean.inglis at camris.ca>wrote:
>
>> Hi David,
>>
>> could this be added to vtkMath?  Or what about starting
>> a vtkGeometryUtilities or vtkGraphicsUtilities to hold static
>> methods that are not really worthy of creating a filter class around?
>>
>> Dean
>>
>> Subject: [vtk-developers] Best fit plane function location
>>
>>
>>
>>  If you'll recall, a while back we tried to add a BestFitFroMPoints
>>> function
>>> to vtkPlane. This caused some issues with cross-library linkage. Is this
>>> big
>>> enough to make a separate class: vtkBestFitPlane (or maybe
>>> vtkLeastSquaresPlane)?
>>>
>>> I noticed that there is no vtkImplicitFunctionAlgorithm, so is this
>>> usually
>>> not done?
>>>
>>> I'm thinking something like:
>>> vtkPoints* points = vtkPoints::New();
>>> // ... fill points....
>>> vtkBestFitPlane bestFitFilter = vtkBestFitPlane::New();
>>> bestFitFilter->SetInput(points);
>>> bestFitFilter->Update();
>>>
>>> vtkPlane* bestPlane = bestFitFilter->GetOutput();
>>>
>>> Thoughts?
>>>
>>> Thanks,
>>>
>>> David
>>>
>>>
>>>
> For now I could add it to vtkMath, but as you suggest, we wouldn't want to
> clutter vtkMath. I like the idea of a vtkGeometricUtilities class for things
> like this.
>
> Any other thoughts? Anyone agree/disagree?
>
> Thanks,
>
> David
>
> _______________________________________________
> 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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtk-developers/attachments/20100125/8bd063a8/attachment.html>


More information about the vtk-developers mailing list